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
fe1095b6458f97fc1d14117a081130978268d81d
JavaScript
Wahba1414/memories
/src/redux/reducers/memories.js
UTF-8
466
2.5625
3
[]
no_license
import * as Actions from '../actions/constants'; var initalStore = { memories: [] }; //Helper functions. function addMemory (store,action){ var updatedStore = { ...store, memories: [...store.memories , action.memory] } return updatedStore; } export function memories (store = initalS...
true
b6667f87e246e1f20672ab00e6832606378e807c
JavaScript
togakangaroo/nm-demo
/src/food/api.js
UTF-8
1,896
3.03125
3
[]
no_license
const noop = () => {} /* A form of debounce specific to api promises. This is a bit better then the type of debounce you see implemented in eg lodash first because putting milliseconds first just makes more sense, second because its specific to promises meaning it does both a leading and trailing edge debounce...
true
bb97d20002623754c0e48eec9dc50372fe47bb48
JavaScript
dharFr/video-player-playground
/src/mixin/with_format_time.js
UTF-8
712
2.921875
3
[]
no_license
'use strict'; function _splitTime(num) { const secNum = parseInt(num, 10); const hours = Math.floor(secNum / 3600); const minutes = Math.floor((secNum - (hours * 3600)) / 60); const seconds = secNum - (hours * 3600) - (minutes * 60); return [hours, minutes, seconds]; } function _zeroPad(num) { return...
true
20429d2cf7d0cb26a371067a4e82a79dacbcbc1c
JavaScript
Quiincy/Arrays
/main.js
UTF-8
1,830
3.515625
4
[]
no_license
const students = ["Олександр", "Ігор", "Олена", "Іра", "Олексій", "Світлана"]; const themes = ["Диференційне рівняння", "Теорія автоматів", "Алгоритми і структури даних"]; const marks = [4, 5, 5, 3, 4, 5]; function initPairs(students) { const pairs = [ [students[0],students[2]], [students[1],studen...
true
fe98b32e92f3b4d6b410343ede837238bbaac337
JavaScript
ryne2010/toy-problems
/freqency-counters/isAnagram.js
UTF-8
642
4.125
4
[]
no_license
// PROMPT /* * Check if given strings are anagrams of each other * Should be O(n) time complexity */ // SOLUTION const isAnagram = (first, second) => { if (first.length !== second.length) { return false; } const lookup = {}; for (let char in first) { lookup[char] ? lookup[char] += 1 : lookup[char...
true
9a0d39322aa44e49b5aa14fdda4d66151272b0ee
JavaScript
randName/50.017-GnV-Project
/js/lights.js
UTF-8
10,742
3.171875
3
[ "MIT" ]
permissive
// Make a class for lightbulbs so that we can store multiple values of each light property class LightBulb{ constructor(position,size,hue,saturation,value){ this.hue = hue; this.saturation = saturation; this.value = value; this.size = size; let geometry = new THREE.BoxBufferGeometry(size, size, ...
true
83d07b7518fc5de38e79961f408f868874238e73
JavaScript
Philamedia1/pepsi
/script/script.js
UTF-8
215
2.578125
3
[]
no_license
function slider(targetImgSrc){ document.querySelector('.pepsi').src = `./images/${targetImgSrc}`; } function changeBg(color) { const sec = document.querySelector('.sec'); sec.style.background = color; }
true
b1faae5e4650d462d5ae9d6f2e525edb8ffe80ef
JavaScript
knaos/react
/src/services/UsersAPI.js
UTF-8
1,726
2.6875
3
[]
no_license
import TasksAPI from "./TasksAPI"; export default class UsersAPI { static generateId() { return Math.floor(Math.random() * 10001) + 1; } static addUser(user) { return new Promise((resolve, reject) => { let users = UsersAPI.getAllUsers(); if (!users.some(u => u.user...
true
25072c34e7e7eedccb83f6929f828d61e2df76b9
JavaScript
cmertayak/converter-requirejs-jquery
/js/conversion/conversion-bindings.js
UTF-8
2,732
2.875
3
[]
no_license
/** * DOM handling * * @todo How to make this unit better? */ require(['conversion.fn', 'conversion.list', "util.select", "jquery"], function(conversionFn, conversionList, selectWrapper, $){ 'use strict'; var selectors = { concept: $("#converter-selector"), unit1: $("#un...
true
5fe3c9147a417b984388c23d7b5e7a7565c79056
JavaScript
cameron-kirby/web-sprint-challenge-advanced-react
/client/src/components/CheckoutForm.test.js
UTF-8
1,793
2.640625
3
[]
no_license
import React from "react"; import { render, fireEvent } from "@testing-library/react"; import CheckoutForm from "./CheckoutForm"; // Write up the two tests here and make sure they are testing what the title shows // Remember, Arrange, Act, Assert test("form header renders", () => { // Arrange const { getByTe...
true
1661f1ccea33a6de4cfa90745853ee107a54fc81
JavaScript
Yan-Brav/contact-list
/src/fiveQuastions.js
UTF-8
169
2.59375
3
[]
no_license
let dwayne = {}; let daniel = { firstName: 'Daniel' }; let jason = { key: 'Jason' }; dwayne[daniel] = 123; // dwayne[jason] = 456; console.log(dwayne[daniel]);
true
40f6797c49ce7b19edd70d2ca3abac15eca4c6fd
JavaScript
heroku/heroku-cli-util
/lib/util.js
UTF-8
1,127
3.484375
3
[ "ISC" ]
permissive
'use strict' /** * promiseOrCallback will convert a function that returns a promise * into one that will either make a node-style callback or return a promise * based on whether or not a callback is passed in. * * @example * prompt('input? ').then(function (input) { * // deal with input * }) * var prompt2 =...
true
93b751f9d27e8cc239b15375a1ccc3cf646670c9
JavaScript
sz-piotr/eth-card-game
/src/frontend/app/cards/resources.js
UTF-8
869
2.890625
3
[ "Unlicense" ]
permissive
const resources = Object.create(null) export function fetchResourcesFor (card) { return Promise.all([ fetchResource(backgroundUrl(card)), fetchResource(cardImageUrl(card)) ]) } function fetchResource (url) { if (resources[url]) { return Promise.resolve() } else { return new Promise((resolve) =...
true
e3f2bf25529e0904f6de32bf16010deee36ad5ad
JavaScript
Yeshi/uropoke
/public/uropoke/app.js
UTF-8
1,607
2.703125
3
[]
no_license
const app = new Vue({ el: "#result", data: { items: {}, isActive: undefined, }, mounted() { axios.get("drawList.json").then((response) => (this.items = response.data)); }, computed: { // いくつ描き終えた? counter: function () { let count = 0; if (this.items) { for (let i = 0;...
true
a2ea7b9ee772224776a871a2cee4f4007f02c7b7
JavaScript
hautran1999/JapaneseBeginner
/routes/users.js
UTF-8
3,138
2.671875
3
[]
no_license
exports.login = function (req, res) { var sess = req.session; if (req.method == "POST") { var post = req.body; var name = post.username_login; var pass = post.password_login; var sql = "SELECT * FROM `user` WHERE `user_name`='" + name + "' and password = '" + pass + "'"; var query...
true
3ea316d40da92484599332667b9ba9c8bbaabb82
JavaScript
yujin19/leetcode
/leetcode-746.js
UTF-8
744
3.40625
3
[]
no_license
// leetcode 746 // language: js // https://leetcode.com/problems/min-cost-climbing-stairs/ // author: yujin19 /** * @param {number[]} cost * @return {number} */ var minCostClimbingStairs = function(cost) { // null check if (!cost || cost.length === 0) return 0; let dp = new Array(cost.length).fill(0); dp[0] ...
true
304f7a66f2e4ede759710d9aa5a21ee8476ae088
JavaScript
sukiyy/47.9_bst
/dsa-bsts-demo/bst.js
UTF-8
1,031
3.65625
4
[]
no_license
class BinarySearchNode { constructor(val, left=null, right=null) { this.val = val; this.left = left; this.right = right; } /** find: search for val using binary search. */ find(sought) { let current = this; while (current) { if (current.val === sought) return current; ...
true
476f21c9a82ea58e433e84b518bf7410e42a79c8
JavaScript
786391600/japan
/js/resize.js
UTF-8
832
2.609375
3
[]
no_license
function resize(pm,type){ var type=type||'x'; var cW=document.documentElement.clientWidth||document.body.clientWidth; var cH=document.documentElement.clientHeight||document.body.clientHeight; if(type=='x'){ var scale=cW/pm*100+'px'; }else{ var scale=cH/pm*100+'px'; } document...
true
492276ffebd4f3786ffc068913bd1d93c818a8de
JavaScript
eric2523/onepeleton_clone
/frontend/selectors/category_count_selector.js
UTF-8
516
2.8125
3
[]
no_license
export const categoryCountSelector = (workoutClasses, categories) => { let categoryCount = {} let categoriesValues = Object.values(categories) let workoutClassesValues = Object.values(workoutClasses) if (categoriesValues.length){ categoriesValues.forEach((category) => { categoryCount[category.id] = ...
true
91b41bd097d354620cd43aee6ddeb0f002bd35df
JavaScript
DanyonGuthrieLewis/BoardingTime
/public/scripts/avatar.js
UTF-8
1,431
3.09375
3
[]
no_license
function changed(){ var nose = document.getElementById("nose").options[document.getElementById("nose").selectedIndex].value; var eye = document.getElementById("eye").options[document.getElementById("eye").selectedIndex].value; var mouth = document.getElementById("mouth").options[document.getElementById("mo...
true
ef1b9a81c279436fa04126a3947125402851e631
JavaScript
iceycc/bxg_project
/阶段5:架构与运维/05-3 自动化测试/resource/projects/jest-demo1/test/domain.test.js
UTF-8
753
2.828125
3
[ "ISC" ]
permissive
const domains = [ "img10.360buyimg.com", "img11.360buyimg.com", "img12.360buyimg.com", "img13.360buyimg.com", "img14.360buyimg.com" ]; const getImageDomain = skuId => { if (skuId) { return domains[skuId % 5]; } else { return domains[Math.floor(Math.random() * 5)]; } }; describe("getImageDomain...
true
ef03cff69a9527a6e18363c246becf05438b00b3
JavaScript
davidthedev/exploring_algorithms
/maxChar/index.js
UTF-8
414
3.1875
3
[]
no_license
function maxChar(str) { let charMap = {}; str.split('').forEach((char) => { if (!charMap[char]) { charMap[char] = 1; } else { charMap[char] += 1 } }); let maxChar = ''; let maxCharCount = 0; for (let char in charMap) { if (charMap[char] > maxCharCount) { maxChar = char; ...
true
b34376bfc3c87da58dacfb6de1162d012ee832b2
JavaScript
dllarsson/Tetris
/script.js
UTF-8
29,945
3.046875
3
[]
no_license
var x = 4; var y = 0; var atBottom = false; var points = 0; var playerName = ""; var setUsernameAfterGameOver = false; var highScore; var startGame = false; var currentLevel = 1; var nextSymbols = []; var savedSymbol = []; var highScoreAdded = false; var colors = ["blue", "#03f8fc", "green", "orange", "#b503fc", "red",...
true
d23f25f0f31cfc8e19cef161f4b247609ac07e83
JavaScript
JavaPr288/DataStructures
/src/objects.js
UTF-8
550
4.0625
4
[]
no_license
const person={firstName:'Max',age:31, hobbies:['Sports','Cooking']} //cant loop through or access elements by index // person[1], for (el in person) console.log(person['firstName']) console.log(person['fistName']) console.log(person.firstName) //duplicate age const duplicateValues={age:43,age:54} console.log(dupli...
true
0e17d4a75656c3c36e46cee1ae35dbc9ab615716
JavaScript
sunild/exifr
/benchmark/formats-reading.js
UTF-8
2,344
2.921875
3
[ "MIT" ]
permissive
var isNode = typeof require === 'function' var isBrowser = typeof navigator === 'object' if (isBrowser) { var {parse} = window['exifr'] } else if (isNode) { var {parse} = require('../dist/full.umd.js') var fs = require('fs').promises } var imageUrl = '../test/fixtures/IMG_20180725_163423.jpg' var options = { if...
true
1eba861efc77b8492011b0c4abb3611fdb7e6609
JavaScript
Justin-Chen1010/snacks-in-a-van
/routes/authenticate.js
UTF-8
732
2.625
3
[]
no_license
// middleware to ensure user is logged in function isCustomerLoggedIn(req, res, next) { if (req.isAuthenticated() && req.session.role === "customer") { return next(); } // if not logged in, redirect to login form req.session.returnTo = `/customer${req.url}`; res.redirect('/customer/login'); ...
true
2df1be2536a428cfe3f56f483f60815d91f8b5ab
JavaScript
miguelangarano/validacion-cedula-ruc-ecuador
/validadores/javascript/ValidarIdentificacionES6.js
UTF-8
1,930
3.703125
4
[]
no_license
class ValidarIdentificacion{ /** * Error * * Contiene errores globales de la clase * * @var string * @access protected */ error = ''; /** * Validar cédula * * @param string validar Número de cédula * * @return Boolean */ validarCedula=validar=>{ let ced=validar...
true
f1765e4f7884a54a71de64cba224a2c08cd0dd57
JavaScript
SantiagoMarquez/Trabajos-Bictia
/Agosto26/assets/scripts/script.js
UTF-8
1,781
4.4375
4
[]
no_license
//Tipos de variable // //var // var dato = "pepito" // console.log(dato) // var dato = 28 // console.log(dato) // //let // let dato2 = "jose" // console.log(dato2) // dato2 = 22 // console.log(dato2) // //const // const dato3 = ["juan", "juliana"] // console.log(dato3) // dato3.push("carlos") // console.log(dato3)...
true
ddd8720314a5c4c13397e2337fa66e68e7773996
JavaScript
rkurenok/JavaScript
/Homework 3/Task1.js
UTF-8
521
3.859375
4
[]
no_license
function getMaxSubSum(arr) { let maxSum = 0; let sum; for (let i = 0; i < arr.length; i++) { sum = 0; for (let j = i; j < arr.length; j++) { sum += arr[j]; if (sum > maxSum) { maxSum = sum; } } } return maxSum; } getMaxSubSum([-1, 2, 3, ...
true
81ad8b2badf6e4582f0f472a322139d5a9c64d8f
JavaScript
SGExitFailure/EpicChess
/main.js
UTF-8
10,310
3.203125
3
[]
no_license
wKnight = 'K'; wRook = 'R'; wBishop = 'B'; wKing = 'I'; wQueen = 'Q'; wPawn = 'P'; bPawn = 'G'; bRook = 'O'; bKnight = 'S'; bBishop = 'F'; bKing = 'X'; bQueen = 'M'; empty = 'E'; piece = 0; state = 1; idle = 0; selected = 1; available = 2; var GameEngine = { whiteTurn: true, squares: [], available: [], ...
true
c2493dc816bc488a848623a067dff9221e346962
JavaScript
huriel2g/practica4-sa
/spec/test-spec.js
UTF-8
716
2.890625
3
[]
no_license
var app = require("../src/operaciones"); describe("Sumando", function(){ it("La funcion suma 2 numeros", function(){ var value = app.Sumar(52,26); expect(value).toBe(78); }); }); describe("Restando", function(){ it("La funcion resta 2 numeros", function(){ var value = app.Restar(52...
true
0c871a5b69a428ae7a2ba143f516c3109baad864
JavaScript
samandarkuchkarov/Rslang
/src/pages/TextBook/responses.jsx
UTF-8
5,983
2.703125
3
[]
no_license
export const getSetting = async (checked) => { try { let token = localStorage.getItem('token') let userId = localStorage.getItem('userID') const rawResponse = await fetch(`https://sashan.herokuapp.com/users/${userId}/settings`, { method: 'GET', withCredentials: true, headers: { ...
true
43bb136765897a647ae77faa9b8cd2301275f391
JavaScript
paritoshraj11/react_ssr
/src/fetchData.js
UTF-8
387
2.640625
3
[]
no_license
import axios from "axios"; const fetchData = async (path = "all") => { const url = `https://api.github.com/search/repositories?q=stars:>1+language:${language}&sort=stars&order=desc&type=Repositories`; try { let { data } = await axios.get(url); return data; } catch (err) { return new Error("Something ...
true
151831eeaf4ac153c6e5cc795aa18a34b540f15b
JavaScript
EthanPFisher/toWill
/06-ajax/1-Class-Content/6.3/Activities/16-NYTSearch/Instructions/nytProject/nytApp.js
UTF-8
1,177
2.875
3
[]
no_license
// "http://api.nytimes.com/svc/search/v2/articlesearch.json?q=new+york+times&page=2&begin_date=&api-key=ba09bbfdde0e4b779d3df5a8947d752e" $("#search-button").on("click", function () { var searchTerm = $("#search-term").val(); var beginDate = ""; var endDate = ""; var records = 5; if ($("#start...
true
714a931f2c6c63163c7f53891937897bb6a5ff45
JavaScript
samridhi18/Text-To-Speech
/index.js
UTF-8
250
2.734375
3
[]
no_license
function textToAudio(){ let msg=document.getElementById("text-to-speech").value; let speech=new SpeechSynthesisUtterance(); speech.lang="en-US"; speech.text=msg; speech.volume=2; speech.rate=1; speech.pitch=1; window.speechSynthesis.speak(speech); }
true
82052213bdb87d80ac0de430b92846cb863d2cfd
JavaScript
delbury/learning
/algorithm/others/string-char-top-k.js
UTF-8
1,487
3.125
3
[]
no_license
/** * 给定一个字符串数组,再给定整数k,请返回出现次数前k名的字符串和对应的次数。 * 返回的答案应该按字符串出现频率由高到低排序。如果不同的字符串有相同出现频率,按字典序排序。 * 对于两个字符串,大小关系取决于两个字符串从左到右第一个不同字符的 ASCII 值的大小关系。 * 比如"ah1x"小于"ahb","231"<”32“ * 字符仅包含数字和字母 * * return topK string * @param strings string字符串一维数组 strings * @param k int整型 the k * @return string字符串二维数组 */ // 1. functi...
true
20aeeb0726a740b6f865e9d67574a4bddfd7fcd2
JavaScript
vishalbrdr/project-tracking-intro-component-master
/script.js
UTF-8
334
2.546875
3
[]
no_license
document.getElementById("menu-btn-container").addEventListener("click", ()=>{ document.querySelector(".open").classList.toggle("active") document.querySelector(".close").classList.toggle("active") document.querySelector("nav").classList.toggle("active") document.querySelector(".nav-links").classList.tog...
true
a3b2ae673a186a3c056123f2874c6349def9d532
JavaScript
tarunchaitanya/Movies
/app.js
UTF-8
3,624
2.9375
3
[]
no_license
const express = require("express"); const { open } = require("sqlite"); const sqlite3 = require("sqlite3"); const path = require("path"); const databasePath = path.join(__dirname, "moviesData.db"); const app = express(); app.use(express.json()); let database = null; const initializeServerAndDB = async (request, res...
true
bdd045f15463f989351537333cf813189d11af0f
JavaScript
shtuchka666/eum_5
/file.js
UTF-8
1,059
3.21875
3
[]
no_license
let preloader = document.getElementById('preloader'); let name = prompt('Введите имя пользователя:'); let user = `https://api.github.com/users/${name}`; let date = new Date(); setTimeout(function(){ preloader.classList.add('none'); }, 2000); let getDate = new Promise((resolve, reject) => { setTimeout(() => date ? r...
true
b8759062957bd2432517a56d36e12f1db1a30dfa
JavaScript
bbarber/SetGame
/test/unit/engine-tests.js
UTF-8
5,447
2.84375
3
[]
no_license
'use strict'; describe('engine-service', function() { beforeEach(angular.mock.module('setgame')); describe('module', function() { it('should exist', inject(function(engine) { should.exist(engine); })); }); describe('createBoard', function() { var board = []; ...
true
d6dd8eac820395afee2a57f761e59f48d320abcd
JavaScript
MobolanleAdebesin/redux-counter
/src/reducers/CounterReducer.js
UTF-8
603
3.28125
3
[]
no_license
// This reducer takes in two parameters: state, and an action. // Depending on the action received, the reducer will make a change to state. export default (state = 0, action) => { switch (action.type) { case "INCREMENT": return state + 1; case "DECREMENT": return state - 1; case "ZERO": ...
true
c98edb76d681bac4958d7959df55e18636053feb
JavaScript
NunoDSF/1T-projet-seconde-sess
/frontend/js/afficher_collection.js
UTF-8
732
2.96875
3
[]
no_license
"use strict" function affichColle(id) { let xhr =new XMLHttpRequest(); //nouvelle requête xhr.open("get","http://localhost/collec", true); //demande la liste des collections xhr.onload = function(){ let tabl= JSON.parse(xhr.response).slice(); let colle = ""; for(let i in ta...
true
6892631d0eab87ae09270076e7aaf0d7e04bd15d
JavaScript
SciSpike/nodejs-support
/src/test/unit/entities/_.merge.spec.js
UTF-8
4,973
2.609375
3
[ "MIT" ]
permissive
/* global describe, it */ 'use strict' const _ = require('lodash') const { Trait, trait } = require('mutrait') const chai = require('chai') chai.use(require('dirty-chai')) const expect = chai.expect describe('_.merge', () => { it('should invoke inherited property methods correctly', () => { let itSet = 0 l...
true
9e9ba8c3b9abcbd6c237865d8cdb4715d5ce92cf
JavaScript
mr47/holaTestingDeferred
/index.js
UTF-8
1,106
3.140625
3
[]
no_license
'use strict'; // writed this after 20 after interview, and live coding was in google docs. const deferred = function(){ this.listners = []; this.then = (listner) => { this.listners.push(listner); }; this.noop = function(){}; this.resolve = (resp) => { this.listners.push(this.noop)...
true
c6a5246f500f23bf9cd6803ca128eed9238d88fd
JavaScript
vlad988988/WebSite
/WebSite/Content/JS/scrypts.js
UTF-8
1,391
2.78125
3
[ "MIT" ]
permissive
function SetImg(selected_url) { var item = document.getElementById('preview'); item.src = selected_url; } function SubmitForm(name, tel, car) { $.ajax( { method: "POST", url: "/Home/Form", data: { Name: name, Tel: tel, Car: car } }).fail(function () { ...
true
fcb7532c5bbc4198e350d44eb773ced394eca2af
JavaScript
KubanovValentin/lesson_JS.Udemm
/src/js/script_cykle.js
UTF-8
2,263
4.0625
4
[]
no_license
" use strict "; // циклы используються для повторения одних и тех же действий // т.к мы меняем переменную ниже то вместо const пишем let let num = 50; // мы говорим коду пока наше условие не выполненно -выполняй такие то действия // как в реальной жизни - пока заряжен ноутбук мы работаем while (num <= 55) { // п...
true
7332da92b31d95d9c94ef4e850e392a79231918d
JavaScript
Aditya-Thakur/JS_Basics
/Questions/IF-Else-Questions/checkEvenOdd.js
UTF-8
130
3.609375
4
[]
no_license
// check if given no. is even or odd let x = 13; if( x % 2 == 0 ){ console.log("even"); }else{ console.log("odd"); }
true
dbe54a324a7919dd666af49e2989a4d252c13e76
JavaScript
rauliox/DatStore
/1_proyecto/DATStore/web/js/estados.js
UTF-8
919
2.6875
3
[]
no_license
function valorar(val){ document.getElementById('valoracion').value=val; elementos=document.getElementsByName("val"); for(i=0;i<elementos.length;i++) if(i<(5-val)) elementos[i].innerHTML='☆'; else elementos[i].innerHTML='★'; } function cambiarEstado(idOrdenxProducto,e...
true
f5f70932ca957f254c1e8c4e17e798830e8d3ba1
JavaScript
ankitmalikg2/express-tower-api
/routes/handler/authHandler.js
UTF-8
1,475
2.546875
3
[]
no_license
var admin = require('firebase-admin'); var firebase = require("firebase/app"); require("firebase/auth"); var firebaseConfig = require("../../config/firebaseConfig") // Initialize Firebase firebase.initializeApp(firebaseConfig); var app = admin.initializeApp({ credential: admin.credential.applicationDefault(), ...
true
a296546375e163a2dc772805aaa84ad2e3a36821
JavaScript
maksudxx/PI-Countries-FT14a
/client/src/components/order/Order.jsx
UTF-8
1,387
2.578125
3
[]
no_license
import { useState } from "react"; import { useDispatch } from "react-redux"; import { getCountries, orderPopulation} from "../../redux/actions"; import styles from './Order.module.css' export default function Order() { const dispatch = useDispatch(); const [order, setOrder] = useState("asc"); const...
true
4808496e044e0e447aa7a108440ad0f849ef159c
JavaScript
Palomasouza/QuickCash
/Assets/js/products.js
UTF-8
6,013
2.734375
3
[]
no_license
(function() { const cash = document.querySelector("#box-product--Cash").getBoundingClientRect(); const card = document.querySelector("#box-product--Card").getBoundingClientRect(); const account = document.querySelector("#box-product--Account").getBoundingClientRect(); const Inside1 = document.querySelector(...
true
909197fbff2d48e42298a35e759b84357d17b185
JavaScript
luciana-negrini/prog_imperativa
/aula2/aula2ex4.js
UTF-8
1,547
4.3125
4
[]
no_license
// Exercício de IMC // Um nutricionista enviou a seguinte tabela com os dados de seus clientes e, você será responsável por calcular // o Índice de Massa Corporal de cada registro: [tabela no PG] // Quais são as variáveis? Quais são as constantes? De que tipo são? Qual variável poderia armazenar o valor null // seg...
true
c62dfe833768c1febccf3f2d1e583031adc3f26a
JavaScript
bander-saeed94/project3
/db.js
UTF-8
1,837
3.15625
3
[]
no_license
var db = firebase.firestore().collection('locations'); //update if username exist if not crete function updateLocationData(username, latitude, longitude) { getData(username, function (location) { if (!location) { //create writeLocationData(username, latitude, longitude); } e...
true
806c9fc62c310b05eafdc659cc09decc6fb7a6bd
JavaScript
cyrildiagne/ecal_handline_workshop
/code/js/apps/tuna.js
UTF-8
2,466
2.96875
3
[]
no_license
/* this ap shows how to modulate an mp3 according to the length of the lines */ var app = null, users = []; /* called once at initialisation */ function setup() { app = new HL.App(); app.setup({ projectName : 'Tuna - Sound Effects', author1 : 'Prenom Nom', author2 : 'Prenom Nom' });...
true
5fc66a854ca4d0e6707d9501f05568c6fd466ae1
JavaScript
bellmit/CDIO-IL-G3-2018
/nicetohaves/node-minimax/tictactoe/TicTacToeBoard.js
UTF-8
417
2.9375
3
[]
no_license
/** * Requires Board module as the base board logic */ const Board=require('../board/Board'); /** * Represents a Tic-Tac-Toe type board */ class TicTacToeBoard extends Board{ /** * Builds a new classic Tic-Tac-Toe board (3x3) */ constructor(){ super(); for(let i=0;i<9;i++)this._bo...
true
6c1055e7ec4aa9ae31d6096169507935793b439d
JavaScript
tpherndon/real_or_the_onion
/app/app.js
UTF-8
6,206
2.5625
3
[ "MIT" ]
permissive
// Set up a collection to contain article information. On the server, // it is backed by a MongoDB collection named "articles". Players = new Meteor.Collection("articles"); if (Meteor.isClient) { Meteor.startup(function () { Session.setDefault("voted", []); }); voteInSession = function ( votingID ){ var vTem...
true
0582d001085d01f3ec24d0f889ca1bacf2f7de28
JavaScript
angelomellos/FullstackAcademyWorkshops
/express-assessment/routes/index.js
UTF-8
1,341
2.65625
3
[]
no_license
var express = require('express') var bodyParser = require('body-parser'); var router = express.Router() var todos = require('../models/todos') module.exports = router // WRITE SOME ROUTES HERE router.get('/', function(req, res, next) { res.send(Object.keys(todo)); }); router.get('/:person?', function(req, res) { ...
true
bc33999ebd5c5808fcb7906d2614354577d3ee76
JavaScript
ssh24/loopback-sandbox
/apps/mongodb/mongodb-46/server/boot/script.js
UTF-8
1,022
2.515625
3
[]
no_license
'use strict'; var util = require('util'); module.exports = function(app) { var db = app.dataSources.mongoDs; var Employee = app.models.Employee; var Job = app.models.Job; var employees = [{eId: '1', name: 'Sakib', age: 11}, {eId: '2', name: 'Joy', age: 22}, {eId: '3', name: 'Foo', age: 33}]; var jobs =...
true
97aeee04e453d3827ea492c3da27b62ec5dee864
JavaScript
chefest/appcelerator_practica_listview
/app/alloy.js
UTF-8
1,703
3.1875
3
[ "Apache-2.0" ]
permissive
// The contents of this file will be executed before any of // your view controllers are ever executed, including the index. // You have access to all functionality on the `Alloy` namespace. // // This is a great place to do any initialization for your app // or create any global variables/functions that you'd like to ...
true
2d90463446ec1227852a176cc3347854d774a577
JavaScript
D-plus/Football-teams
/src/helpers/preparation-functions.js
UTF-8
939
2.6875
3
[]
no_license
import { formatDate, processGameResult } from './calculations-fucntions'; export const processGames = games => { const preparedGames = games.map(({ date, team_one_goals, team_two_goals, id }) => ({ id, date: formatDate(date), gameResult: processGameResult(team_one_goals, team_two_goals), goalsConcede...
true
bbb305fecd751525daf1a5b733bf4c96410202a0
JavaScript
WilliamFreitag/Chat-App
/Register.js
UTF-8
1,639
3.0625
3
[]
no_license
var socket = io(); usernameChange(); passwordChange(); const urlParams = new URLSearchParams(window.location.search); const resFailed = urlParams.get('RegFailed'); if(resFailed === "true")document.getElementById('status').innerHTML = "That username is taken"; function usernameChange() { checkIfUserExists(); var us...
true
c5b6a99db09476bfae66db4c0746ef69e8ffa42f
JavaScript
ProyectoFinalCAECE/comet-server
/services/validators/projectValidator.js
UTF-8
3,693
2.859375
3
[ "MIT" ]
permissive
"use strict"; /** * Module dependencies */ /* * * Checks if provided parameters for new Project are valid or returns an appropiate response. * @name * @description * @members - optional * */ var validator = require("email-validator"); //Max project name and description text lengths //should be consts but it's us...
true
3b7a91fdeaeeb38e7b8e7e931f5e3408a1b8341a
JavaScript
wesleyshen070/HACKOHIO-HFAGT
/scatter.js
UTF-8
1,957
2.859375
3
[]
no_license
let xlabels = []; const yTRxVals = []; const yNRxVals = []; chartIt(); async function chartIt() { await getData(); const ctx = document.getElementById('chart').getContext('2d'); const myChart = new Chart(ctx, { type: 'scatter', data: { datasets: [{ label: 'Tota...
true
ce89625268f8b6e077f86d5e5d431573ba35d46f
JavaScript
videnacry/cipsaJS
/src/annex/js/1.Fundaments/6.loop/2.js
UTF-8
3,192
2.875
3
[]
no_license
import {memo, useReducer, useCallback, useRef} from 'react' import {Modal, Toast, Form, Alert, Button} from 'react-bootstrap' export const Statement = <p><b>2.</b>{' Crea una aplicación que solicite al usuario un valor numérico. Si el usuario introduce un valor no válido como letras o texto; deberá mostrarse un cuadro...
true
f4642c786aa21df4ec7b9cf4d91f433a9552cf7d
JavaScript
SWDV-665/week-1-typescript-assignment-shelxm
/grocery.js
UTF-8
803
3.53125
4
[]
no_license
var Grocery = /** @class */ (function () { function Grocery(name, quantity, price) { this.name = name; this.quantity = quantity; this.price = price; this.total = quantity * price; } return Grocery; }()); var milk = new Grocery("Milk", 2, 3.10); var bread = new Grocery("Bread"...
true
a5441a08dec6d408d564bddc5dc3818864103b02
JavaScript
aditya-pawar/aditya-pawar.github.io
/en.js
UTF-8
371
2.53125
3
[]
no_license
function f_name() { var num = document.f1.mobile.value; if(isNaN(num)) { alert("enter numeric value only in mobile no"); document.f1.mobile.focus; return false; } else if(num.length < 10 || num.length > 10) { alert("enter valid mobile number"); docu...
true
d2299e55beb436c82f5b6ede9c7f0e80f95149fb
JavaScript
AntonSmir/babel
/packages/babel-plugin-transform-object-super/test/fixtures/get-set/set-semantics-data-non-writable-defined-on-parent-loose/exec.js
UTF-8
299
2.78125
3
[ "MIT" ]
permissive
var Base = { }; Object.defineProperty(Base, 'test', { value: 1, writable: false, configurable: true, }); var obj = { test: 2, set() { return super.test = 3; }, }; Object.setPrototypeOf(obj, Base); assert.equal(obj.set(), 3); assert.equal(Base.test, 1); assert.equal(obj.test, 2);
true
a870a8843235bb5d6935861ea86f2db4d701b090
JavaScript
muhammadyahyo/telegram
/data.js
UTF-8
6,414
2.984375
3
[]
no_license
let data = { users:[ { id: 1, name: "Ali", time: "12:45", photoUrl: "img/1.jpg", phone: 998991112233, messages: [ { text:"Hello my name is Ali", owner: true }, ...
true
af8c23e99b0ca92ddd98e56e52d3800576e28afb
JavaScript
drkwjhnsn/stringinator-base
/test/underbar/map.test.js
UTF-8
236
2.546875
3
[]
no_license
const _ = require('../../underbar'); describe('map()', () => { it('maps every numbers in an array of numbers to their square', () => { const ary = [1, 2, 3]; expect(_.map(ary, ele => ele * ele)).toEqual([1, 4, 9]); }); });
true
2651d3b7719a02d885e3c39a35a835fc9e31e336
JavaScript
MakingBrowserGames/phaser-nano
/tests/src/test001.js
UTF-8
529
2.84375
3
[ "MIT" ]
permissive
var game = new PhaserNano.Game(800, 600, 'canvas', '', { preload: preload, create: create, update: update }); function preload () { game.load.image('atari', 'assets/atari130xe.png'); } var img = null; var w = 0; var h = 0; var y = 0; function create() { img = game.cache.getImage('atari'); w = img.widt...
true
703a1cd52ce58116df1e2b1dfbfea7baaf2d3355
JavaScript
LaraLcq/react-character-manager
/src/components/character.js
UTF-8
1,555
2.703125
3
[]
no_license
import React, { Component } from 'react'; import '../css/App.css'; import 'bootstrap/dist/css/bootstrap.css'; import Axios from 'axios'; export default class character extends Component { constructor(props) { super(props); this.state = { character: [], name:'', image:'', ...
true
87d45f3b7ecb4e62fb9e7c4c24fe7817161d1824
JavaScript
lawgamble/GrubDash
/src/dishes/dishes.controller.js
UTF-8
3,453
3.109375
3
[]
no_license
const path = require("path"); const dishes = require(path.resolve("src/data/dishes-data")); // Use this function to assign ID's when necessary const nextId = require("../utils/nextId"); // TODO: Implement the /dishes handlers needed to make the tests pass //Create, Read, Update, List function list(req, res, next) { ...
true
08dfbcc4d589dd67ed5f8fcdd6b3403aed88636f
JavaScript
AlexeySKiselev/randomjs
/core/methods/beta.js
UTF-8
6,284
3.5625
4
[ "Apache-2.0" ]
permissive
// @flow /** * Beta Distribution * This is continuous distribution * https://en.wikipedia.org/wiki/Beta_distribution * @param alpha: number - alpha > 0, alpha must be integer * @param beta: number - beta > 0, beta must be integer * @returns Beta Distributed value * Created by Alexey S. Kiselev */ import type ...
true
f1528fa7f9288c30011f48b49e154e86e41f2675
JavaScript
OSN64/DynamicMultimediaAss
/js/helper.js
UTF-8
411
2.671875
3
[ "MIT" ]
permissive
// create a help delaying promise Promise.delay = function(time){ return new Promise(function (resolve) { setTimeout(resolve, time); }); } module.exports = { // closure for easy localStorage setting storage: function (key) { return function(val){ if(arguments.length) localS...
true
ce1fee4116a0512053ff5fe6fb588dfe997ac5a5
JavaScript
tiffythinhdang/bentoUp
/src/menu.js
UTF-8
1,282
2.71875
3
[]
no_license
export const MENU_ITEMS = { "onigiri": "../assets/menu_items/onigiri.png", "sashimi": "../assets/menu_items/sashimi.png", "pickles": "../assets/menu_items/pickles.png", "tempura": "../assets/menu_items/tempura.png", "fish": "../assets/menu_items/fish.png", "tamago": "../assets/menu_items/tamago.png", "mea...
true
ba321615985e76e875282089cb5d41a94a9a249d
JavaScript
yoavniran/web-chess
/src/logic/moves/getNextMoves.js
UTF-8
4,363
2.796875
3
[]
no_license
import { BLACK_BISHOP, BLACK_KING, BLACK_KNIGHT, BLACK_PAWN, BLACK_QUEEN, BLACK_ROOK, WHITE_BISHOP, WHITE_KING, WHITE_KNIGHT, WHITE_PAWN, WHITE_QUEEN, WHITE_ROOK, MOVE_TYPES, CHECK_TYPES, } from "consts"; import getColorFromSymbol from "../helpers/getColorFromSymbol"; import { isKing } from "../helpers/i...
true
e7a2bd1e7e35d19f2ff2ee99aefef05e78d4b97f
JavaScript
PicnicSupermarket/localicious
/tests/utils/result.test.js
UTF-8
1,826
2.90625
3
[ "MIT" ]
permissive
const r = require("../../src/utils/result"); test("result.success returns a successful result", () => { let res = r.success(1); expect(res.isSuccess).toBe(true); expect(res.value).toBe(1); expect(res.error).toBeUndefined(); expect(res.isError).toBe(false); }); test("result.error returns an erroneous result"...
true
5a637f9295f18b64f8d7994264a21b8d23ae257d
JavaScript
hy123ops/MY
/src/scripts/router/index.js
UTF-8
2,109
2.546875
3
[]
no_license
import indexController from '../controllers/' import positionController from '../controllers/positions' import searchController from '../controllers/search' import profileController from '../controllers/profile' import detailsController from '../controllers/details' import cinemaSearchController from '../control...
true
bb131adcbd88f0b2def23760a7e769da2f9163d2
JavaScript
bharatagarwal/launch-school
/225_object_oriented_javascript/exercises/01_objects/05_school.js
UTF-8
6,174
3.875
4
[]
no_license
// Create a school object. The school object uses the __student object from the previous exercise__. It has methods that use and update information about the student. Be sure to check out the previous exercise for the other arguments that might be needed by the school object. // addStudent: Adds a student by creating ...
true
6da55cf1fd2537b8aa144a1b225a9e175b804858
JavaScript
barrancocarlos/martial-arts-academy
/controllers/invoiceController.js
UTF-8
3,290
2.53125
3
[]
no_license
var invoiceModel = require('../models/invoiceModel.js'); /** * invoiceController.js * * @description :: Server-side logic for managing invoices. */ module.exports = { /** * invoiceController.list() */ list: function (req, res) { invoiceModel.find(function (err, invoices) { if...
true
dc0685e5123539b8eb2e700916c67120f8077eca
JavaScript
HagueGarcia/PinatuboGroup6
/name.js
UTF-8
946
3.296875
3
[]
no_license
var namePlayer1 = "Player1" var namePlayer2 = "Player2" function getNames(){ namePlayer1 = document.getElementById("mpinput1").value; namePlayer2 = document.getElementById("mpinput2").value; console.log(namePlayer1); console.log(namePlayer2); ...
true
7b6c9ccf6cc47d1afd02e28650d6f0a2d531d417
JavaScript
bpatureau/autonomie-JS
/index.js
UTF-8
3,526
2.640625
3
[]
no_license
import {fabric} from 'fabric'; import { saveAs } from 'file-saver'; let activeColor = "black" let activeTool = "crayon" let stroke = "enable" let gridCellSize = 24 let toolkit = document.querySelector(".toolkit") let buttons = document.querySelector(".buttons") let color = document.querySelector(".color") const pixelCa...
true
6a5fdd938074b172f62fdac6267704fe58d3c503
JavaScript
antonlk/updateURface
/api/queries/studentsQueries.js
UTF-8
2,235
2.515625
3
[]
no_license
var db = require('../db'); var Students = { getAllStudents: function (callback) { return db.query(`SELECT S.studentId, S.name, S.surname, S.className, S.modality, CONVERT(S.photo USING utf8) as photo , A.code, IF(A.code IS NULL,false,true) as gotCode FROM students S L...
true
469914ad0967a7a09a6908fd5cce9f2ab68dc43c
JavaScript
renauy/apple-banana
/src/App.js
UTF-8
4,564
2.546875
3
[]
no_license
import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; //this is test for github commit class Results extends React.Component { render(){ return( <div className={this.props.className + ' resultForm '}> <form> <div className="img-wrapper"> <img clas...
true
271014518cde08c7e81d52c505f43421400755c8
JavaScript
CodeDanCode/CoronavirusTracker
/js/news.js
UTF-8
2,752
3.03125
3
[]
no_license
var doNews = function(){ // empty container and create news elements $('#content').empty(); $('#content').append( '<h2 class="col-md-8 mx-auto">Current News</h2>'+ '<iframe name="newIframe"></iframe>'+ '<ul class = "list news-list" style="list-style-type:none;"></ul>'+ '<...
true
4694f8b849a5b7307bde1f7f929d5cc3fb86bfd1
JavaScript
stappbot/Psychic-Game
/assets/javascript/game.js
UTF-8
2,318
4.28125
4
[]
no_license
let wins = 0; let guesses = 7; let losses = 0; let computerGuess; //$ and camel case is a convention to say you are pointing at something in html const $guessesRemain = document.getElementById("guesses-remain") const $lettersGuessed = document.getElementById("letters-guessed") //insert wins and losses into html const ...
true
2657f124cdfce1fa5160a79c0730de46a47eb2d2
JavaScript
hilderjares/react-typeahead-search
/src/App.js
UTF-8
1,810
2.640625
3
[]
no_license
import React, { useEffect, useState } from 'react'; import { BehaviorSubject, Observable } from "rxjs"; import { getCharacters } from "./services/character-service"; import { Card, CardHeader, CardBody, CardFooter, ImageHeader } from 'react-simple-card'; import './App.css'; const subject$ = new BehaviorSubject(""); ...
true
c1a90623f78763f19875410dedf8c31ad05fe692
JavaScript
ronnoc5991/battleship-react
/src/shipFactory.js
UTF-8
901
3.5
4
[]
no_license
const shipFactory = (length) => { let ship = []; //is it important that the ship knows where it is? let placement = []; let i; for (i=0; i < length; i++) { ship.push('safe'); } const hit = (coordinates) => { for (i=0; i<placement.length; i++) { //search ship placement for...
true
e7e8807e477f3a9c734b00793ee07345eca39109
JavaScript
Muktarul-Islam420/JavaScript
/javascript-elements/slice.js
UTF-8
65
2.609375
3
[]
no_license
var num=10 while(num<=100){ console.log(num); num++; };
true
4039a5b8fa61457bf11ec7f146472c4a2631904a
JavaScript
kraiyan/Chatapp
/public/client.js
UTF-8
1,247
3.359375
3
[]
no_license
const socket =io() let name1; let messageArea= document.querySelector('.chatScreen') do{ name1= prompt("Plz enter your name: ") }while(!name1) let textarea=document.querySelector('#textarea'); textarea.addEventListener('keyup',(e)=>{ if(e.key=='Enter'){ sendMessage(e.target.val...
true
06e730d9fb17d069bf23ca202d530252c2407379
JavaScript
sandermeijer1972/hangman
/src/components/GameOver/GameOver.js
UTF-8
561
2.921875
3
[]
no_license
import React from "react"; import win from "../../assets/win.gif"; import lose from "../../assets/lose.gif"; const GameOver = props => { const winResult = ( <div className="win"> <h2>Jaaaa, je hebt gewonnen!</h2> <img src={win} alt="win" /> </div> ); const loseResult = ( <div className="...
true
9bce041ee327c9fa26472a7acdbcacf20a04a909
JavaScript
carsonplant/fall19-gregslist
/app/models/House.js
UTF-8
806
2.84375
3
[]
no_license
export default class House { constructor(data) { this._id = data._id || Math.floor(Math.random() * 5000) this.year = data.year this.bedrooms = data.bedrooms this.bathrooms = data.bathrooms this.stories = data.stories this.squarefootage = data.squarefootage this.price = data.price this...
true
bf1778fe7bba7eeee91f90abd6201e35ebd9de22
JavaScript
Cha-Hyperion/Article-preview-component-FrontEndMentor-Challenge
/js/app.js
UTF-8
1,454
2.59375
3
[]
no_license
var app = { socialMob: document.querySelector('.sharing-tool--mobile'), socialDes: document.querySelector('.sharing-tool--desktop'), author: document.querySelector('.card__author'), screenSize: window.screen.width, count: 0, init: function() { app.addActionsEventListeners(); ...
true
c092819592167635cd2d7d475c2da42942702338
JavaScript
RdotSilva/React-Native-MERN-TrakAct-Activity-Tracker
/server/controllers/track.js
UTF-8
942
2.84375
3
[]
no_license
const mongoose = require("mongoose"); const Track = mongoose.model("Track"); // @desc Fetch all tracks // @route GET /api/v1/tracks // @access Private exports.getAllTracks = async (req, res) => { // Get tracks from specific user const tracks = await Track.find({ userId: req.user._id }); res.send(tracks); ...
true
de1e0d02bfd80f99356326c2435469a1cf18c62a
JavaScript
JongHyeonSong/toy-RSP
/app.js
UTF-8
2,855
3.4375
3
[]
no_license
function game(){ let pScore = 0; let cScore = 0; const startGame = () => { const playBtn = document.querySelector('.intro button'); const introScreen = document.querySelector('.intro'); const matchScreen = document.querySelector('.match'); const hands = document.q...
true
9f5676a374c5a31043bc53fa9fef511c18f601e1
JavaScript
elliotloftus/AnagramsAPI
/app.js
UTF-8
2,540
2.8125
3
[]
no_license
const mongoose = require('mongoose'); const wordsRoute = require('./routes/words'); const anagramRoute = require('./routes/anagram'); const cors = require('cors'); const express = require('express'); const app = express(); require('dotenv/config') app.use(express.urlencoded({ extended: true })); app.use(express.json()...
true
9da408baa943ef85746160d7b8a865a73c2d7669
JavaScript
svnshing/sorceCombination
/SorceCombine.js
GB18030
3,071
3.125
3
[]
no_license
/** * Created by admin on 2018/2/26. */ /*ѧƳɼ true:ɼ false:ɼ ,ڵijԱĸƳɼĻ򾡿Ϊtrue */ //ԭʼ var studentSorce = [ { index: '170702', chinese: true, math: false, english: false, }, { index: '170708', chinese: false, math: true, english: true, }, { index: '170709', chinese: false,...
true
ee7073757bb58235e8bb38bfd4f5b7facf04173c
JavaScript
adizait/game-and-registration-website
/WebApplication17/JavaScript3.js
UTF-8
4,119
3.3125
3
[]
no_license
var canvas; var canvasPlace; var ballx = 50; var ballVx = 10; var bally = 50; var ballVy = 4; var score1 = 0; var score2 = 0; const winningScore = 3; var winScreen = false; var paddle1y = 250; var paddle2y = 250; const paddleThickness = 10 const paddleHeight = 100; //action when mose click to reset game function mo...
true
3ffd11cbc80f1a867576ebdb1ff81b548787d70d
JavaScript
Aasgard/Website-PDL
/js/functions.js
UTF-8
846
2.65625
3
[]
no_license
function getURLParameter(paramName) { var sPageURL = window.location.search.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == paramName) { return sPa...
true
9c1bc1c59c862e1649ae1e2786eb694203b4a172
JavaScript
Sharp6/theListApi
/user/user.repository.server.js
UTF-8
1,107
2.8125
3
[]
no_license
var userDA = require('./user.da.server'); var User = require('./user.model.server'); var UserRepository = function() { var users = []; var getAllUsers = function() { users = []; return userDA.loadAll() .then(function(userData) { return userData .map(function(data) { var newUser = new User(data...
true