blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
132
path
stringlengths
3
236
src_encoding
stringclasses
29 values
length_bytes
int64
8
7.94M
score
float64
2.52
5.72
int_score
int64
3
5
detected_licenses
listlengths
0
142
license_type
stringclasses
2 values
text
stringlengths
8
7.94M
download_success
bool
1 class
91c6411c06334942e71e0ac4b0cca8d0d99f813b
JavaScript
bgoonz/UsefulResourceRepo2.0
/_REPO/GITHUB/include-fragment-element/test/test.js
UTF-8
17,706
2.953125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* eslint-env mocha */ let count const responses = { '/hello': function() { return new Response('<div id="replaced">hello</div>', { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' } }) }, '/slow-hello': function() { return new Promise(resolve => { se...
true
7b6aade2fe293dc63ad73441b0e640b679cfa1ef
JavaScript
PhilipYordanov/JavaScript-Basics
/JSBasics/JSBasics/RadiansToDegrees/app.js
UTF-8
176
3.0625
3
[ "MIT" ]
permissive
function radiansToDegrees([args1]) { let a = parseFloat(args1); let result = (a * 180) / Math.PI; console.log(result.toFixed(2)); } radiansToDegrees(["3.1416"]);
true
8999ed3d540b8703fa25a334ee4ba89f7db65f2c
JavaScript
sanjitrane/algorithms
/src/solutions/Arrays/Monotonic_Array/js/test.js
UTF-8
747
2.625
3
[]
no_license
const {monotonicArray, isMonotonic} = require('./solution') const cases = require('../cases.json') describe('Testing MonotonicArray algo', ()=>{ test(`MonotonicArray exists`, ()=>{ expect(typeof monotonicArray).toEqual('function') }) const {TestResults, JSONTests} = cases JSONTests.forEach((item, index)...
true
147e82f536c65151e25d3a0874af02868f0bf36f
JavaScript
Islam98/Portfolio
/Website1/client/src/components/App/MemberProfile/Edit/Edit.js
UTF-8
17,298
2.546875
3
[]
no_license
import React,{Component} from 'react' import axios from 'axios' const bcrypt = require('bcryptjs'); class Edit extends Component{ constructor(props){ super(props); this.state={ oldPass:"", newPass:"", confPass:"", fname:"", lname:"", ...
true
baea7f9676711cc702e3d3487aeeaa357dc3550c
JavaScript
orzhtml/react-native-blog-examples
/Chapter14-Wechat_Login_Share_Pay/WechatUsageExample/App.js
UTF-8
7,721
2.53125
3
[ "MIT" ]
permissive
/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */ import React, {Component} from 'react'; import {StyleSheet, TouchableOpacity, Text, Alert, View, Dimensions} from 'react-native'; import * as WeChat from 'react-native-wechat'; import ProgressHUD from "./ProgressHUD";...
true
35d588452fb2ea16748ebafdb9fd6bc833c942b9
JavaScript
jeanmichelsl/CedarAirways
/js/main.js
UTF-8
1,626
2.890625
3
[]
no_license
//Get the button: mybutton = document.getElementById("scrollBtn"); // When the user scrolls down 20px from the top of the document, show the button window.onscroll = function() {scrollFunction()}; function scrollFunction() { if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { mybutton...
true
6d8db78ff94b77e1671999d56486c120c348c4ba
JavaScript
Vlad-Konovalchuk/ThreeMatch-Game
/Board.js
UTF-8
6,635
2.90625
3
[]
no_license
var ThreeMatch = ThreeMatch || {}; ThreeMatch.Board = function (state, rows, cols, blockVariations) { this.state = state; this.rows = rows; this.cols = cols; this.blockVariations = blockVariations; this.grid = []; var i, j; // create rows for game table------------ for (i = 0; i < row...
true
0411b1fee5dbb2ec1e7494d65949d3a385637feb
JavaScript
sriharshaperi/Amazon-Shopping
/src/reducer.js
UTF-8
638
3.078125
3
[]
no_license
// initial object state export const initialState = { user: null } export const getBasketTotal = (basket) => //for every item, reduce() will map to the item's price and add to the total amount where initial amount is 0 basket?.reduce((amount, item) => item.price + amount, 0) const reducer = (state, action...
true
ced8eae044c785e477fef4fdf5f98563b5bd08fe
JavaScript
nrs365/html5gamedevpractice
/scripts/game-es6.js
UTF-8
1,123
3.484375
3
[]
no_license
// logic for the Count game class NumberedBox extends createjs.Container { constructor(number=0) { super(); var movieclip = new lib.NumberedBox(); movieclip.numberText.text = number; this.addChild(movieclip); //random position movieclip.x = Math.random() * 200; movieclip.y = Math.random() * 200; } } ...
true
16e0c12a25a3e7de8019d9bda4bced2259ba7353
JavaScript
nsekecharles/formation-js
/correction_tp_1_jour2.js
UTF-8
1,580
3.8125
4
[]
no_license
// Question 1: var karine = { prenom: 'Karine', dateDeNaissance: new Date(1991, 4, 16), moyenne: 12 }; var celia = { prenom: 'Célia', dateDeNaissance: new Date(1995, 5, 9), moyenne: 14 }; var christophe = { prenom: 'Christophe', dateDeNaissance: new Date(1997, 9, 9), mo...
true
6208c71313654f5c111c6ffe1f840a995584def3
JavaScript
mileto94/Frontend-JavaScript-1
/week0/problems/sum-of-digits.js
UTF-8
212
3.09375
3
[]
no_license
"use strict"; var sumOfDigits = function (number) { var n = Math.abs(number), sum = 0; while(n > 0) { sum += n % 10; n = Math.floor(n / 10); } return sum; }; exports.SumOfDigits = sumOfDigits;
true
de027fbd9d96e22b24652816bf793391255861ca
JavaScript
HackYourFutureBelgium/encapsulation
/isolate/08-object-create/examples/03-own-data-delegated-logic.js
UTF-8
2,021
3.9375
4
[ "MIT" ]
permissive
'use strict'; /* Own data, delegated logic so what's all `this` and prototypes good for? reusing code! Using delegation and `this` you can write your logic once and use it on different instances with their own unique data */ { console.log('-- simple counters --'); const counterPrototype = { up:...
true
9bb93b3ac8a4de7c872d0076bf4e2c9b0a407aed
JavaScript
emmxgibbs/fitness-and-wellbeing-app
/src/main/resources/static/js/login_script.js
UTF-8
4,012
2.515625
3
[]
no_license
document.onload = new function () { // URLSearchParams.delete(); try { const accessToken = document.cookie .split('; ') .find(row => row.startsWith('currentUserToken')) .split('=')[1]; window.location.href = "/console" }catch (e) { console...
true
2ee19f8137f609e927f32501449fa42497414fb8
JavaScript
abhishekchaturvedi-07/designPatternInJavascript
/gammaCategorization/creational/prototype.js
UTF-8
1,478
4.40625
4
[]
no_license
// A prototype is a partially or fully initialized object that we can copy and utilize/ make use of it //deep copy the protype // Explicit Copy class Address { constructor(streetAddress, city, country) { this.streetAddress = streetAddress; this.city = city; this.country = country; } deepCopy() ...
true
23810e8f7cc21cfb81c47de7e119f9c540dc17ad
JavaScript
joeedh/fairmotion
/tools/babel/test.js
UTF-8
838
2.734375
3
[ "MIT" ]
permissive
/*//* //class Class { // methodA() { function a() { function b() { var a = function d() { if (b == 0) { static c = [0]; c[0] = 1; function d(a, b=1, c, d) { c + 1; } c = 0; ...
true
b25ecf6b1298b88f63d237d3d4d86c2a7f0c0a9b
JavaScript
TeachingForGood/fullstack-workshop-apr2021
/microservices/Reviews/src/auth/auth.middleware.js
UTF-8
897
2.53125
3
[]
no_license
const OAuth2Service = require('../oauth2/oauth2.service'); class AuthMiddleware { constructor() { this.oAuth2Service = new OAuth2Service(); } validateAuthentication = async (req, res, next) => { const errorMessage = 'You are not authorized for this action'; const jwt = req.headers...
true
a52294dc91e41f7b7369fc4e67ecf1f75cd0393c
JavaScript
mimiyin/vital-signs
/public/js/Particle-receive.js
UTF-8
1,359
3.1875
3
[]
no_license
class Particle { constructor(x, y) { this.x = x; this.y = y; this.xStart = x; this.xRange = random(-60, 60); this.size = 0; this.maxSize = 10; // this.startDecay = false; this.lifeSpeed = random(0.2, 1.5); this.pulseSpeed = random(0.01, 0.1); //this.opacity = 100; // this....
true
d7fd7ea71b74be0c96da8463942e98a243117021
JavaScript
NataliaChunikhina/frontend-project-lvl1
/src/games/brain-progression.js
UTF-8
943
3.03125
3
[]
no_license
import { randomize } from '../utils.js'; import startGame from '../index.js'; const gameDescr = 'What number is missing in the progression?'; const progressionLength = 10; const generateProgression = (firstElement, stepProgression, hiddenElementPosition) => { const progression = []; for (let i = 0; i < progressio...
true
df537968aaf8ef1b63f13ec004940943e1d1e728
JavaScript
tirtawr/UASVisdat
/crawler-and-stuff/scrapper/getKecamatan.js
UTF-8
2,792
2.84375
3
[]
no_license
// var request = require('request'); var request = require('sync-request'); var csv = require("fast-csv"); var API_KEY = 'AIzaSyAlgj0oc4s_XssbrHOVRcBLeKM-VlXJqes'; var csvWriter = require('csv-write-stream'); var fs = require('fs'); var getKotaAndKecamatan = function(lat, long, cb){ var retObj = {'kecamatan': false,...
true
32bf57b9b34825c576246beef1e5372c6626f4e7
JavaScript
teethefox/1955
/server.js
UTF-8
1,375
2.765625
3
[]
no_license
// Require the Express Module var express = require('express'); var path = require('path'); // Create an Express App var app = express(); // Require body-parser (to receive post data from clients) var bodyParser = require('body-parser'); app.use(bodyParser.json()); // Require path // Setting our Static Folder Di...
true
defb6f6af836c10b26267479b034d6c588df2800
JavaScript
bhavBains/call-back-functions
/cheatDice.js
UTF-8
673
3.921875
4
[]
no_license
//Program to call an array from parent function using callback function function makeLoadedDie() { var list = [5, 4, 6, 1, 6, 4, 2, 3, 3, 5]; var count = -1; //Cleaner version : var count = 0 return function() { for (var i = 0; i<list.length; i++){ count++; //Cleaner version : var roll = ...
true
a610d0be033572a8bc7840d7d3daba69e0274fb4
JavaScript
psychosocial555666/685113-cinemaddict-11
/src/components/comments.js
UTF-8
8,163
2.625
3
[]
no_license
import AbstractSmartComponent from "./abstract-smart-component.js"; import moment from "moment"; import CommentsModel from "../models/comments"; // import api from "./../api.js"; const SHAKE_ANIMATION_TIMEOUT = 600; const createCommentsTemplate = (film) => { const commentItems = film.commentsAll.map((it) => createC...
true
7d9bf0b15e87460c7c2cf77aadd68197a1c69910
JavaScript
tusharkhatiwada/reach-router-login
/src/login.js
UTF-8
4,706
2.59375
3
[]
no_license
import React, { Component } from "react"; import { navigate } from "@reach/router"; import axios from "axios"; export default class Login extends Component { state = { username: "", password: "", error: false, errorMessage: "", remember: false }; handleInput = event ...
true
ad42c0fa118d4f0489908083ffdfe198f31553fe
JavaScript
ddevaul/cv-application
/src/components/WorkExperience.js
UTF-8
4,110
3.140625
3
[]
no_license
import './styles/WorkExperience.css'; import React from 'react'; import uniqid from "uniqid"; // add in delete button // in non-edit mode it should say from: to: before the dates export default class WorkExperience extends React.Component { constructor(props){ super(props); this.state = { editing: fal...
true
605f5c7568034ac7b166faa8facb861761591e21
JavaScript
eric2523/Aa_classwork
/w9d5/pocket-projects/src/drop_down.js
UTF-8
1,773
3.046875
3
[]
no_license
const dogs = { "Corgi": "https://www.akc.org/dog-breeds/cardigan-welsh-corgi/", "Australian Shepherd": "https://www.akc.org/dog-breeds/australian-shepherd/", "Affenpinscher": "https://www.akc.org/dog-breeds/affenpinscher/", "American Staffordshire Terrier": "https://www.akc.org/dog-breeds/american-staffordshir...
true
3ad466763428f0e6c577ffc4322a32c6b52167fa
JavaScript
lsunsi/markovjs-gridworld
/src/state.js
UTF-8
646
2.609375
3
[ "MIT" ]
permissive
// @flow import type { State } from './types'; const proto = { toString(): string { const { goals, robson: { r, c, dead } } = (this: State); return [goals, r, c, dead].toString(); }, }; const create = (state: State): State => (Object.assign(Object.create(proto), state): any); const init = ( [rows, cols...
true
f7f4424b36533eb37ffe0f238a585eb385319fa7
JavaScript
Sehunwy/vuePractice
/src/views/lib/validate/custom-methods.js
UTF-8
954
2.734375
3
[]
no_license
export function validCore(validateStr, value) { validateStr = strToJson(validateStr) var errors = []; var errorVal = '' for (let key in validateStr) { if (typeof methods[key] != 'undefined') { errorVal = methods[key](validateStr[key], value); if (errorVal != '') { ...
true
5c9ab4e55ac282417d0d5e2e9feb333749acd4cc
JavaScript
wesleyyliao/Paird
/client/app/util.js
UTF-8
2,130
3.359375
3
[]
no_license
/** Converts unix time to a string in the local time zone **/ export function unixTimeToString(time) { //var myDate = new Date(time*1000).toGMTString(); //return (myDate.toLocaleString()); var date = new Date(time*1000); //May need to change to support millisecond input only var days = ["Sun","Mon","Tue","Wed",...
true
59866a5fe4f39b68f4c91cc96cd9662edc7a9f0e
JavaScript
loctv/seedfund
/react-app/src/components/auth/SignUpForm.js
UTF-8
4,244
2.65625
3
[]
no_license
import React, { useState } from "react"; import { Redirect, NavLink } from "react-router-dom"; import { signUp } from "../../services/auth"; const SignUpForm = ({ authenticated, setAuthenticated, setCurrentUser }) => { const [errors, setErrors] = useState([]); const [firstname, setFirstname] = useState(""); cons...
true
ae99f7f1db03bf708247e8445523d2987c4e057b
JavaScript
sashameison/student_api
/demo/js/src/components/Profile/Posts/StudentPost/StudentPost.jsx
UTF-8
767
2.515625
3
[]
no_license
import axios from "axios"; import Post from "../Post/Post"; import {useEffect, useState} from "react"; const StudentPost = () => { const [studentPost, setStudentPost] = useState([]) const URL = 'http://localhost:8080/api/student' const fetchStudent = () => { axios.get(URL).then(res => { ...
true
976b3933c28f69407669694b5855840c62f15612
JavaScript
XPlatform-Consulting/ubiquity-cantemo-theme
/portal_media/mdl/js/libs/jquery-growl/jquery.growl.js
UTF-8
4,282
2.546875
3
[]
no_license
/** * Modified jquery.growl.js from Cantemo Core theme * * The original code had a possible XSS vulnerability that could be exploited * * Original Author: Unknown * Modified by: Jared Smith <jared@highwaythreesolutions.com> */ ! function ($) { function create(rebuild) { var instance = document.ge...
true
9b5bc11ef52631f2f5c25b1a99179a1b76ee7c58
JavaScript
ybbbby/HTML_JS
/JavaScript/powerpoint-like/move.js
UTF-8
1,012
2.875
3
[]
no_license
function startMove(obj,json,fnEnd) { clearInterval(obj.timer); var bStop=true; obj.timer=setInterval(function(){ for(var attr in json) { var cur=getStyle(obj,attr) var speed=(json[attr]-cur)/6; speed=speed>0?Math.ceil(speed):Math.floor(speed); if(cur!=json[attr]) { bStop=false; } if...
true
0ea3e5499ac4e5e8152aae963b252977e6a7646d
JavaScript
codenautas/backend-plus
/ejemplos/client/index.js
UTF-8
2,931
2.5625
3
[ "MIT" ]
permissive
"use strict"; var html=jsToHtml.html; function presentarPlaca(estado) { agregaLogoAlElemento(pantalla); var textoComienzaEncuesta=estado.estructura.textos.placas['bienvenido-'+estado.estado]; var encabezado=textoComienzaEncuesta.encabezado; var parrafos=textoComienzaEncuesta.parrafos; var mensaje...
true
fcc67ee9353c9e996bcfb860f92888d251ca22a0
JavaScript
jmsdevx/shelfie
/server/controller.js
UTF-8
2,307
2.6875
3
[]
no_license
module.exports = { //create a table first getAllData: (req, res, next) => { const dbInstance = req.app.get('db'); dbInstance.get_all_data() .then(response => res.status(200).send(response)) .catch(error => { res.status(500).send(error) console.log(error...
true
cc264deb82f19d6df627ea0c669f780cede0ec3f
JavaScript
mcascardi/wp-content-dialog
/javascript/wordpress-content-dialog.js
UTF-8
755
2.625
3
[ "Unlicense" ]
permissive
/** * Wrapper function to safely use $ */ function wpcdWrapper( $ ) { var wpcd = { /** * Main entry point */ init: function () { wpcd.prefix = 'wpcd_'; wpcd.templateURL = $( '#template-url' ).val(); wpcd.ajaxPostURL = $( '#ajax-post-url' ).val(); wpcd.registerEventHandlers(); }, /**...
true
fd0ee0f9333cedd828ee23138777bb0565cec15e
JavaScript
Corenb/Hangry
/commands/ban.js
UTF-8
825
2.875
3
[]
no_license
module.exports = { name: 'ban', description: 'Ban a user from the server.', guildOnly: true, args: true, permissions: 'KICK_MEMBERS', usage: '<user> <reason>', execute(message, args) { /*if (args.length < 2) { return message.reply('Veuillez mentionner l\'utilisateur à bannir et indiquer une raison.'); } ...
true
c3e4e0f5c00075715088231906d8c012a3fd4917
JavaScript
muhsalfarizi/Sprint3Latihan1Soal5
/1.3/Biasa/export.js
UTF-8
100
3.03125
3
[]
no_license
export let biodata = (name, age) => { console.log(`Nama saya ${name} dan umur saya ${age}`); }
true
80f37e24a6c76363e4e8496db6b37feef8e30754
JavaScript
theRickix/feup-laig
/Tests/Test1/reader/MySphere.js
UTF-8
1,744
2.921875
3
[]
no_license
/** * MySphere * @constructor */ function MySphere (scene, radius, slices, stacks) { CGFobject.call(this,scene); this.radius = radius; this.slices = slices; this.stacks = stacks; this.initBuffers(); }; MySphere.prototype = Object.create(CGFobject.prototype); MySphere.prototype.constructo...
true
481fbf3eacf8a020dfbc1d2b5d6a21269f2ab55e
JavaScript
JomoPipi/Art-Function
/Tool.js
UTF-8
522
3.109375
3
[]
no_license
const addBrush = name => document.getElementById(name).onclick = () => brush.mode = name const brush = { size: 5, color: '#007700', x: 1e5, y: 1e5, mode: 'fill' } for (m of ['oval', 'line', 'pencil', 'fill', 'getColor','soval','rect','srect']) addBrush(m) const colorPick...
true
521fa0a4a2581943ef353fc7989b2c749fec8402
JavaScript
davsav16/team-profile-generator
/lib/Engineer.js
UTF-8
1,697
2.90625
3
[]
no_license
const Employee = require('./Employee'); class Engineer extends Employee { constructor(name, id, email, github) { super(name, id, email) this.github = github; } getGithub() { return this.github } getRole() { return Engineer; } } module.exports = Engineer; ...
true
23f2ad908b896cf2043dc27ee51bddeb0a440839
JavaScript
Oppevara/h5p-music-composition-exercises-library
/scripts/komp/build_scale.js
UTF-8
12,279
2.609375
3
[ "MIT" ]
permissive
/* Autogenerating Music Exercises for education program "Muusika Kompositsiooniõpetus" https://et.wikibooks.org/wiki/Muusika_kompositsiooni%C3%B5petus/N%C3%84IDISKURSUS._G%C3%9CMNAASIUM Commissioned by Estonian Ministry of Education and Research, Tallinn University, in the frame of Digital Learning Resources project ...
true
ef41bac23db33e33b1a020b79f10ae354ef4859a
JavaScript
sashafdtv/GLOAcademy-FreelanceExchange
/script/temp.js
UTF-8
735
3.203125
3
[]
no_license
const deadline = "2020-02-16"; const delOfNum = function declOfNum(number, titles) { cases = [2, 0, 1, 1, 1, 2]; return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; }; const calcDeadline = (deadline) => { const now = Date.now(); const milDeadline = Date.parse(...
true
5ec6cf43076f85c19c3753f6117eca64eec87873
JavaScript
zymrytekabashi/algorithms
/SLL/length.js
UTF-8
774
3.34375
3
[]
no_license
function length() { var current = this.head var count = 0; while (current) { count++ current = current.next } return this } // Given a headNode, a lowVal and a highVal, remove from the list any nodes that have values less than lowVal or // higher than highVal. Return the new list...
true
40dd57fb612d5c7116b7c75c956dfca76efe3e2b
JavaScript
Shorojit1997/ReactJs
/src/HookComponents/UseCallback/ParentComp.js
UTF-8
651
2.671875
3
[]
no_license
import React, { useState,useCallback,useEffect } from 'react'; import Button from './Button'; const ParentComp = () => { const [id,setId]=useState(0); const [counter,setCounter]=useState(0) const incrementId=useCallback(()=>{ setId(id+1); },[id]) const incrementCounter=useCallback(()=>{ ...
true
cd0a690f885444bf4c4dc5989069e00b0cdaa26d
JavaScript
FortanPireva/castReceiver
/src/js/models/receiver-controls.js
UTF-8
1,571
2.6875
3
[]
no_license
import SeekBar from "./seekbar"; import Timer from "./timer"; class ReceiverControls { constructor(id) { this.seekbar = new SeekBar(".seekbar-progress"); this.timer = new Timer(".timer"); this.castDebugger = null; this.element = document.querySelector(id); this.show = true; this.loader = docum...
true
a027be80599adbdd12c27d182bee89adcc8c9e9d
JavaScript
nmcandoit/js_samples
/jquery_new-password-form.js
UTF-8
2,540
2.9375
3
[]
no_license
/************************************************************************* Sample of new password form validation Features: - Check the criteria that the password must contain - Change color of criteria when this is completed - enable1/disable submit button of the modal *********...
true
4c44692db7f8ef7c65e1762a23ca73f8c40482a1
JavaScript
NASOKILA/SoftUni
/5.Front-End/02.JavaScript for Front-End/08.Introduction to JQuery & DOM Exce/04.DOM Dynamic Form/dom-dynamic-form.js
UTF-8
2,034
3.0625
3
[]
no_license
/** * Created by user on 16/11/2017. */ function domDynamicForm(selector) { let conteiner = $(selector); let mainDiv = $('#content'); mainDiv.addClass('items-control'); let div = $('<div></div>'); div.addClass('add-Controls'); //label za diva let label = $('<label></label>'); labe...
true
cbc42dacdf19384816c48343e6babb35e814c938
JavaScript
renatadomingues/trybe-exercicios-
/MOD1-Fundamentos/4 - Introdução à JavaScript e Lógica de Programação/2-JavaScript - Array e loop For/Exercício7.js
UTF-8
647
4.25
4
[]
no_license
let numbers = [5, 9, 3, 19, 70, 8, 100, 2, 35, 27]; let menorNumero = numbers[0]; // o valor da variável smallestNumber poderia ser qualquer um, desde que fosse maior que o maior número do array numbers. Caso atribuíssemos o valor 1 para a variável, nosso algoritmo estaria errado, pois ele nunca acharia um número menor...
true
3b8a41e138999ba3ab46f868c43cc4de6352132b
JavaScript
kowall1013/Vanilla-JS-TS-Projects
/08-TODO-LIST/dist/main.js
UTF-8
13,562
3
3
[]
no_license
"use strict"; /* globals DOMPurify zlFetch */ updateConnectionStatus(); function assert(condition, msg) { if (!condition) { throw new Error(msg); } } // ======================== // Variables // ======================== const rootendpoint = 'https://api.learnjavascript.today'; const auth = { // REPLA...
true
cb22ba881799c459969652b07e1126ecef797b27
JavaScript
mikun10/Rest-API-with-Node.js-Express
/app.js
UTF-8
1,161
2.8125
3
[]
no_license
//Bassic Rouoting.. const express =require('express'); const bodyParser = require('body-parser'); const placesRoutes = require('./routes/places-routes'); // importing places-routes.js //Now we can use it as a middleware const usersRoute =require('./routes/users-routes') const HttpError = require('./models/http-erro...
true
10ce4840d27486ae08c89dcf89c13864a1947559
JavaScript
LukaszSarzynski/CodeCombat-solutions
/mountain/cloudrip-commander.js
UTF-8
528
3.203125
3
[ "MIT" ]
permissive
// Summon some soldiers, then direct them to your base. // Each soldier costs 20 gold. while (hero.gold > hero.costOf("soldier")) { hero.summon("soldier"); } var soldiers = hero.findFriends(); var soldierIndex = 0; // Add a while loop to command all the soldiers. while (soldierIndex < soldiers.length) { var sol...
true
dff44fe1ffab2cd6c71c46f396142f39543e9e4e
JavaScript
julessplvd/for-loops
/for-loops.js
UTF-8
753
3.609375
4
[]
no_license
// Increment by 10 for (var i = 5; i <= 120; i += 10) { console.log("Current value is " + i) } // Decrement by Division for (var i = 4096; i >= 1; i /= 2) { console.log("Current value is " + i) } // Arryay iteration var presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Quincy Adams", "Jackso...
true
cacfec49787958b1edad36ac0f634a02eeb8ae82
JavaScript
profeweb/WEBDEV
/DATASTRUCTS/EXAMPLES/BINARY TREE/bst visual/sketch.js
UTF-8
3,393
3.703125
4
[]
no_license
var canvas; var bsTree; var baseX = 150, baseY = 250; function setup() { canvas = createCanvas(windowWidth, windowHeight); canvas.position(0,0); canvas.style('z-index', '-1'); canvas.style('display', 'block'); background(255); bsTree = new BSTree(); // add some members to the set A for(var i=...
true
22e5fd1e7f58d030f65f5355756d038aecad17f4
JavaScript
SunboX/fxos-washing-machine_interface
/apps/system/js/app.js
UTF-8
3,718
2.59375
3
[ "MIT" ]
permissive
//screen.mozLockOrientation(['landscape']); window.addEventListener('ready', () => { 'use strict'; Promise.all([ navigator.gpio.setPinMode(2, 'output'), navigator.gpio.setPinMode(3, 'output') ]).then(pins => { let [pin2, pin3] = pins; pin2.writeDigit...
true
30ff03f873e33f581351350824435f00a3a5cedb
JavaScript
harrisse/AdventureTime
/UnityProjectSpriteManager/Assets/Scripts/BusinessMen.js
UTF-8
1,909
2.71875
3
[]
no_license
#pragma strict private var player : GameObject; private var graphics : UnityEngine.GameObject; private var motor : CharacterMotor; var hp : int = 3; var invulnTime : int = 30; private var invulnCounter : int = 0; // max and min locations can move to in x direction var maxX : float; var minX : float; var framesBetween...
true
109f2a1c0dfe7ff8bec1505f921c5a3cde05b205
JavaScript
i-tengfei/coo
/src/math/quaternion.js
UTF-8
1,197
3.078125
3
[ "MIT" ]
permissive
define( function ( ) { function Quaternion( x, y, z, w ){ this.x = x || 0; this.y = y || 0; this.z = z || 0; this.w = ( w !== undefined ) ? w : 1; } Quaternion.prototype = { setFromRotation: function( v ){ var c1 = Math.cos( v.__x / 2 ); ...
true
d7af2a5cbb87a79e9f67c39f1f4ab945b56c91a7
JavaScript
dryan/django-filters-js
/src/pluralize.js
UTF-8
590
2.734375
3
[ "MIT" ]
permissive
djangoFilters.pluralize = (value, suffixes) => { if (typeof suffixes === "undefined") { suffixes = ",s"; } if (suffixes.indexOf(",") === -1) { suffixes = `,${suffixes}`; } if (suffixes.split(",").length > 2) { return ""; } const [singularSuffix, pluralSuffix] = suffixes.split(","); if (typeo...
true
3cda2a44283504b3d66f7c4c5de1f618d320f48f
JavaScript
Jayaraj8905/redmart
/src/containers/filters.js
UTF-8
2,074
2.625
3
[]
no_license
import React, { Component } from "react"; import { connect } from "react-redux"; import { fetchFilters } from "../actions"; import FilterItem from "./../components/filter_item"; class Filter extends Component { constructor() { super(); this.state = { filters: [] } } onSelect(filterUnit) { ...
true
b9e5be34e883a2f54c20e498b94b209574abfe78
JavaScript
MattMcAlear/Stop-Watch
/stopWatch.js
UTF-8
1,370
3.109375
3
[ "MIT" ]
permissive
"strict" // Purpose: Stop watch // By: Matt McAlear // Date: 12/1/13 function stopWatch(start, miliseconds){ this.currentTime = start * 1000; this.interval = 1000; this._miliseconds = miliseconds; this._intId = null; this._displayId = 'stopWatch'; } stopWatch.prototype.start = function(){ var that = this; ...
true
e1e5c4f2cb1c8c116ae936b57026d6f3d52890ff
JavaScript
diveshkumar/mafia
/routes/groups.js
UTF-8
1,237
2.59375
3
[]
no_license
/* * GET home page. */ var groups = require('../custom_modules/groups'); var users = require('../custom_modules/users'); var redis = require("redis"); var client = redis.createClient(); console.log(exports); exports.groups = function(req, res) { groups.getGroups(req, res, function(data) { res.writeHead(200, {"C...
true
a5d55efac08c619a63e4124627dac1b2d3025a3b
JavaScript
nandokakimoto/cracking-the-code-interview
/linked-lists/2.6/test/solution2_test.js
UTF-8
1,552
3.25
3
[]
no_license
var assert = require('assert'); var Node = require('../../lib/node.js'); var palindrome = require('../solution2.js'); describe('Palindrome', function() { describe('null list', function() { it('should return false', function() { assert(!palindrome(null, 0)); }); }); describe('single caracter list',...
true
abbdf8ed0cf0c16df1bcf67a737b8753a1326d4b
JavaScript
lukestoward/Angular-Node-Dashboard
/Twitter Dashboard/npm/Server.js
UTF-8
2,218
2.609375
3
[]
no_license
console.log("Hello World!"); var Twit = require("twit"); var express = require("express"); var app = express(); var server = app.listen(3000); var io = require("socket.io").listen(server); var TWEETS_BUFFER_SIZE = 3; var T = new Twit({ consumer_key: "key", consumer_secret: "key", access_token: "key", ...
true
372a5ea04229df6aa5b5f5df51fd72b729ed4f88
JavaScript
mflemingsaatva/shoutouts
/src/context/index.js
UTF-8
1,554
2.671875
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; // first make a new context export const MyContext = React.createContext(); // then create a provider component export class MyProvider extends Component { constructor (props) { super(); this.state = { activeUserId: '', userName: '', ...
true
4b9a9e264e1a8eeab1e5cffa5cec1d5c560a32b2
JavaScript
pvpavlov-frontend/zeemo_11ty
/src/assets/js/close-dropdown-main-menu.js
UTF-8
772
2.640625
3
[]
no_license
(function() { if(document.querySelector && window.isMediaQueriesSupported) { // This function is only need if there is support for media queries. var burgerButton = document.querySelector('.burger__button'); var mainMenuContainer = document.querySelector('.header__main-menu-container'); ...
true
2575f6b878f7923c78242f631d59af96f14c9130
JavaScript
mattbarackman/dbc_phase_5_dynamic_elements
/application.js
UTF-8
1,656
3.28125
3
[]
no_license
$(document).ready(function() { function bindEvents() { // Bind functions which add, remove, and complete todos to the appropriate // elements // Add Todo $('.toolbox').on('click', '.add', function(e){ e.preventDefault(); var todo_text = $('.todo').val(); var builtTodo = buildTodo(t...
true
3d7a7746d4e7fcd1fa547bf55544e5ba778ebfd9
JavaScript
jennyjacobsson/project-happy-thoughts-api
/server.js
UTF-8
2,004
2.8125
3
[]
no_license
import express from 'express' import bodyParser from 'body-parser' import cors from 'cors' import mongoose from 'mongoose' const mongoUrl = process.env.MONGO_URL || "mongodb://localhost/happyThoughts" mongoose.connect(mongoUrl, { useNewUrlParser: true, useUnifiedTopology: true }) mongoose.Promise = Promise const Thou...
true
2dfa42afb9d08db2c869417eed7b045ce31ab45f
JavaScript
latha4you11/Book-Selector
/src/containers/book-list.js
UTF-8
1,922
3.078125
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; //when we use curly braces we pull only the required ppropert from the library. import { connect } from 'react-redux'; import { selectBook } from '../actions/index'; import { bindActionCreators } from 'redux';//makes sure the actions generated flow through all the reducers in t...
true
e3508b3f304efc740d239d716922a486e85987c8
JavaScript
cehicm/temperature_graphs
/src/js/scripts.js
UTF-8
1,556
3.015625
3
[]
no_license
window.addEventListener("load", setup); async function setup() { const ctx = document.getElementById("chart").getContext("2d"); const globalTemps = await getData(); const otherTemps = await getDifferentData(); const myChart = new Chart(ctx, { type: "line", data: { labels: globalTemps.years, ...
true
e3bf9961ebb649d9c1618c5640de0410f20106f9
JavaScript
rogerdav/401Whiteboardchallenges
/challenge27/index.js
UTF-8
227
2.796875
3
[ "MIT" ]
permissive
'use strict'; const rotate = require('./lib/solution'); let test = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; let testArray = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; let a = rotate(test); console.log(a); console.log(rotate(testArray));
true
94e5ab488fdab02976e4ba957665cd58d332f378
JavaScript
michellocana/dojo-node
/snippets/gotchas/expressionIf.jsx
UTF-8
282
4.21875
4
[]
no_license
class Person { constructor(name) { this.name = name } greet() { console.log(`Olá, ${this.name}`) } } const isPerson = person => { return person instanceof Person } const michell = new Person('Michell') isPerson(michell) && michell.greet() // -> Olá, Michell
true
5a8256552c328d4c62d0c17d7aeabb32ff07cc3f
JavaScript
cGuille/plaudio
/src/widgets/seeker.js
UTF-8
1,195
2.75
3
[]
no_license
import Widget from './base'; export default class SeekerWidget extends Widget { get selector() { return '.plaudio-seeker'; } initialize() { const changeHandler = this.updateCurrentTime.bind(this); this.elements.forEach(element => { element.addEventListener('input', thi...
true
2212696a5c27e85333cabea8d0d97e3e021b812d
JavaScript
cheng022074/zbee-sdk
/src/database/mongodb/insert.fn.js
UTF-8
2,066
2.65625
3
[]
no_license
/** * * 向集合中插入一条或者多个数据 * * @import mongodb from database.mongo * * @import isObject from is.object.simple * * @import is.array * * @import getCount from database.mongo.count * * @param {object} config 查询配置 * * @param {string} config.collection 查询数据集合 * * @param {string} [config.database='defaul...
true
0e2b767e84c27dca45324462ef355c1d52b279f2
JavaScript
ricardorika/mediaaritimeticajs
/js/index.js
UTF-8
342
3.34375
3
[]
no_license
var nota1 = parseInt(prompt("Digite a nota 1: ")); var nota2 = parseInt(prompt("Digite a nota 2: ")); var nota3 = parseInt(prompt("Digite a nota 3: ")); var media = (nota1 + nota2 + nota3) / 3; if (media <6) { document.write("ALUNO REPROVADO! :( Média: " +media); } if (media >=6) { document.write("ALUNO APROVADO! :D...
true
0efa467d5579131ce289c7e7a7b30ef9d0ba1aad
JavaScript
GitHubJohnExamples/stock_daily_price_test
/index.js
UTF-8
4,268
3.015625
3
[]
no_license
var api = "introduce_api_key_here"; // Put alphavantage api key here var dps = []; var company = null; var symbol = null; var chart = null; var columns = ["Date", "Open", "High", "Low", "Close", "Adjusted Close", "Volume"]; var data1 = [] //Download results into csv function download() { window.location = "https://ww...
true
a2062602e6b8dba724cab027de178431c4666eb5
JavaScript
hrantm/DS-A-JS
/ch3/stackQueue.js
UTF-8
865
3.84375
4
[]
no_license
class Stack { constructor() { this.store = []; } push(val){ this.store.push(val); } pop(){ return this.store.pop(); } isEmpty(){ if (this.store.length === 0) { return true; } } } class StackQueue { constructor(){ this.pushStack = new Stack(); this.popStack = new S...
true
788e75c2f1406ff6e12ce36bd2a03948f7d2b4ba
JavaScript
kirantidke/practice
/JS/dashboard-api.js
UTF-8
2,851
3.046875
3
[]
no_license
const description = document.getElementById('title'); const title = document.getElementById('note'); var error = false; const baseUrl = "http://fundoonotes.incubation.bridgelabz.com/api/"; //function showError(input, message){ //const formControl = input.parentElement; //formControl.className = 'form-outline e...
true
9f7a6a40515e54983ff2267cfaf9b1214c6c1039
JavaScript
brokenalarms/functional-visualiser
/failed_experiments/astParser.js
UTF-8
12,107
2.5625
3
[]
no_license
'use strict'; import {parse} from 'acorn'; import estraverse from 'estraverse'; import escodegen from 'escodegen'; import {includes, pluck, uniq as unique, last} from 'lodash'; import DeclarationTracker from './DeclarationTracker.js' function getVisPaneNodes(parseString) { let d3Nodes = []; let d3CallLinks = []; ...
true
af98aaafe86d89edb147a6aebfabf53732ae5436
JavaScript
simonarnell/hue-halloween
/index.js
UTF-8
1,523
2.984375
3
[]
no_license
var Prob = require('prob.js'); var Hue = require("node-hue-api"), HueApi = Hue.HueApi, lightState = Hue.lightState; const hostname = "INSERT YOUR HUE BRIDGE IP HERE", timeout = 20000, port = 80, username = "INSERT YOUR HUE BRIDGE API KEY HERE"; var hue = new HueApi(hostname, username, ...
true
c460d9da1b42774bb3c7ab32883d98dc11d7fc34
JavaScript
01ago/new-weather-app
/src/FormattedDate.js
UTF-8
624
3.078125
3
[]
no_license
/* import React from "react"; */ export default function FormattedDate(props){ let days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; let day = days[props.date.getDay()]; let hours = props.date.getHours(); let daydate= props.date.getDate(); if(hours <10){ hours=`0${hours}`; } let minutes = props.date.getMin...
true
3f4f7d6eb54f37940b8b30e0f4a95b4c389e821d
JavaScript
garrensmith/Jody
/lib/reporter.js
UTF-8
2,321
2.90625
3
[ "MIT" ]
permissive
var specification_groups = require('./Jody.js').specification_groups; var reporter = exports; // utils var colouriseResult = exports.colouriseResult = function (passed) { if(passed) { return "\033[32mpassed\033[0m"; } else { return "\033[31mfailed!\033[0m"; } }; var drawDots = exports.drawDots = funct...
true
aaf43ae289806d88be110c52d0f2e5538b76dd49
JavaScript
gabrielprns/Projetos_JavaScript
/cond.js
UTF-8
209
3.203125
3
[]
no_license
let hora = 19 if (hora > 6 && hora < 12){ console.log("Bom Dia"); } else if (hora > 12 && hora < 18){ console.log("Boa Tarde"); } else if (hora > 18 && hora < 23){ console.log("Boa Noite"); }
true
6fb773d39255df74a22bd416ecaccef163e32c0d
JavaScript
Anonymous-School/Frontend-Mentor-Shortly-URL-shortening-Api
/index.js
UTF-8
4,503
2.640625
3
[]
no_license
let mobile_menu_login = document.getElementById('mobile_menu_login'); let menuicons = document.getElementById('menuicons'); let form = document.getElementById('url_submit'); let submit = document.getElementById('submit'); let url = document.getElementById('url'); let error = document.getElementById('error'); let output...
true
ff1a639fb8ead4b9bf5c149bc3a1771bfa83e1ae
JavaScript
filiptoma/restauracie
/src/config.js
UTF-8
602
2.625
3
[]
no_license
const args = process.argv.slice(2); const restaurantFlag = args[0]; // flags are { cap, veroni, suzies } let restaurantId; // access to menicka.cz API let restaurantName; switch (restaurantFlag) { case 'cap': restaurantId = 2700; restaurantName = 'Pivnice U Čápa'; break; case 'veroni': restaurantI...
true
a90f2d32387af0ebfe44360faa9111ac3d24a552
JavaScript
lieberscott/helloworld
/codingtrain010oscillation4/sketch.js
UTF-8
1,782
3.5625
4
[]
no_license
// The Nature of Code // Daniel Shiffman // http://natureofcode.com // Additive Wave // Create a more complex wave by adding two waves together. int xspacing = 8; // How far apart should each horizontal position be spaced int w; // Width of entire wave int maxwaves = 5; // total # of waves to add tog...
true
c4a520b650b6d558c9749200db1918764aa6a41b
JavaScript
Astrafhtra/loveMollyrui
/interview/cst/8-13.js
UTF-8
734
3.796875
4
[]
no_license
var list = [ {id: 1, name: '111'}, {id: 2, name: '222'}, {id: 3, name: '333'}, {id: 4, name: '444'}, {id: 5, name: '555'}, {id: 6, name: '666'}, {id: 7, name: '777'}, ] var result = [] function select(selectList){ let arr = [...selectList] let arrVal = arr.map(item => item.id) let res = arrVal.fi...
true
5dffbd1cae529af4e0683c2cc704baf5ae7ab343
JavaScript
Bluemooses/pg-get-post-assigntment
/server/routes/magazines.router.js
UTF-8
1,561
2.84375
3
[]
no_license
const express = require('express'); const router = express.Router(); const pool = require('../modules/pool.js'); let magazines = [ { magtitle: "Pandas", issueNumber: '200', pages: '150' }, { magtitle: "L.A TIMES", issueNumber: '15', pages: '14' }, { ...
true
842dee7af1ade0cbcf4c576ffddbe2e2d0b7a5c4
JavaScript
Dnyanshree/InternshipTrackingSystemProject
/project_code/js/listing.js
UTF-8
747
2.5625
3
[]
no_license
$(document).ready(function(){ $("form#facets").facets({ URLParams : [ { name: "ajax", value: "true" }, ], preAJAX : function () { //validate inputs here! var minPay = $("#minPay").val(); var maxPay = $("#maxPay").val(); if((minPay != "" && minPay != undefined && !/^\d+$/.te...
true
2dee173c44b7e5b72802b3c74de6517582596ea5
JavaScript
mia-casas/LectureNotes
/expressionsAndOperators/comparisonOperators.js
UTF-8
540
3.875
4
[]
no_license
1// Equal to let equalTo = "3" == 3; console.log(equalTo); let strictEqualTo = "3" == 3; console.log(strictEqualTo); //Not equal to let notEqualTo = 3 != "3" //false console.log(notEqualTo); // Strict not equal to let strictNotEqualTo = 3 !== "3"; //true //Greater than let greaterThan = 4>3; console.log(greaterTha...
true
dc4d2371815ab19eaea83843a4e995fc9aa5b2e8
JavaScript
goodluckjjin/foodforme
/src/components/Button/index.js
UTF-8
1,107
2.59375
3
[]
no_license
import React, { Component } from 'react'; class Button extends Component { handleButtonClick = (e) => { console.log(this.props.email_value); if (e.target.name === "login") { return ( alert( `EMAIL: ${this.props.email_value}<br/> ...
true
f2323b8a6c36c247ac7f0d4ac7212190230f9665
JavaScript
dengrui20/web_note
/js高级/手写PromiseAplus/PromiseAplus.js
UTF-8
8,529
3.453125
3
[]
no_license
// https://promisesaplus.com/ var Promise = (function(window) { // 重写Promise var PENDING = 'pending' var FULFILLED = 'fulfilled' var REJECTED = 'rejected' /** * @param promise // then返回的promise实例 * @param invokResult // then内函数的执行结果 * @param resolve // new Promise(executor) executor方法的回调 * @par...
true
3c1082919f3d8269bfba56ba50e29d7c79fb4b2b
JavaScript
eugene-mobile/dht-11
/backup/2015-01-17/server.js
UTF-8
1,031
2.984375
3
[]
no_license
const dht11 = require('node-dht-sensor'); const gpio = require('rpi-gpio'); var outPinValue = true; const outputPins = [40, 38, 36, 32, 26, 24, 22, 18]; outputPins.forEach(function(pinNum) { gpio.setup(pinNum, gpio.DIR_OUT); }) function toggleLed() { outPinValue = !outPinValue; outputPins.forEach(function(...
true
27a7517be888f96b0df666d5dd1caea87c78bd83
JavaScript
jimmyhmiller/PlayGround
/one-hundred/recordings/redux2.js
UTF-8
1,851
3.03125
3
[]
no_license
const compose = (f, g) => (...args) => (f(g(...args))) const applyMiddleware = (...middlewares) => (createStore) => (...args) => { const store = createStore(...args); const dispatch = middlewares .map(m => m(store)) .reduce(compose)(store.dispatch); return { ...store, dispa...
true
700d3613cc896cb7175985d4bb46ca5948e156fe
JavaScript
WilliamChittester/PSUCampusNightMap
/js/buildings.js
UTF-8
4,828
3.40625
3
[]
no_license
// The first line here loads the data in the building-centroids GeoJSON file $.getJSON("https://rawgit.com/pennstategeog467/campus-map/gh-pages/data/building-centroids.json", function(centroids) { // Because everything we do after this depends on the JSON file being loaded, the above line waits for the JSON file ...
true
3d99210d0af268715161286075f0d4fe771ad51d
JavaScript
PortneufCoder/Pollz4Teamz
/backend/server.js
UTF-8
3,511
2.78125
3
[]
no_license
const express = require('express'); const app = express(); const PORT = 8083; app.use((req, res, next) => { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); // app.use(express.static('public')); app.us...
true
ed286c132bc2975a296903770b1034c904412b5f
JavaScript
ChuckFoo/ddb-importer
/src/parser/character/senses.js
UTF-8
2,556
2.578125
3
[ "MIT" ]
permissive
import DICTIONARY from "../../dictionary.js"; import utils from "../../utils.js"; import logger from "../../logger.js"; export function getSensesMap(data) { let senses = { darkvision: 0, blindsight: 0, tremorsense: 0, truesight: 0, units: "ft", special: "" }; // custom senses if (data....
true
4aaf3cb5e4a20b2fd7383c7c5602f1416dc02359
JavaScript
alan-mak/lighthouse-daily-work
/w1/d3-objects/social_network/social.js
UTF-8
2,607
3.59375
4
[]
no_license
const data = { f01: { name: "Alice", age: 15, follows: ["f02", "f03", "f04"] }, f02: { name: "Bob", age: 20, follows: ["f05", "f06"] }, f03: { name: "Charlie", age: 35, follows: ["f01", "f04", "f06"] }, f04: { name: "Debbie", age: 40, follows: ["f01", "f02",...
true
e386cfca25dbc6085caf47208b0be2a6220b4a98
JavaScript
aoandrade1/guess-the-word
/js/script.js
UTF-8
5,934
3.984375
4
[]
no_license
const guessedLettersElement = document.querySelector(".guessed-letters"); const guessButton = document.querySelector(".guess"); const textInput = document.querySelector(".letter"); const wordInProgress = document.querySelector(".word-in-progress"); const remaining = document.querySelector(".remaining"); const remaining...
true
ddcdd48bed305be4f73f9ce02037ab6c89219dd3
JavaScript
hoanganh25991/flow-check-type
/index.js
UTF-8
219
3.375
3
[]
no_license
// @flow const sum = (arr: Array<number>) => (arr.reduce((sum, item) => sum + item, 0): number); let myStr: string; let myNumber: number; myStr = sum([1,2,3]); myNumber = sum([2,3,4]); console.log(myStr, myNumber);
true
e5b4b25dc920b7fecb05d2afa221bc675e5eedb0
JavaScript
brentsowers1/coordinatecommons-frontend
/src/classes/Map.js
UTF-8
5,305
2.703125
3
[]
no_license
import loadJs from '../util/loadJs'; import config from '../config'; export default class Map { constructor(mapContainerId, geoJsonUrlBase, placeType, callbacks) { // This is necessary so that we can have any number of map instances if (window.googleMapInstanceCounter) { window.googleMapInstanceCounter...
true
5595c619119121ac780d562072c0bf5cf0edb495
JavaScript
LOVEwitch/leetcode
/3_Longest Substring Without Repeating Characters.js
UTF-8
374
3.125
3
[]
no_license
var lengthOfLongestSubstring = function(s) { if (s.length == 0) {return 0;} var longest = 0, p1 = 0, p2 = 0, hashmap = {}; while(p2 < s.length) { if (hashmap[s[p2]] != undefined) { p1 = Math.max(hashmap[s[p2]]+1,p1) } longest = Math.max(longest,p2-p1+1); hashmap[s...
true