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
3bb172d363c38e0de058780c16f07d09dd253427
JavaScript
inthra/w1Tue-AlarmClock
/js/alarmClock.js
UTF-8
353
2.765625
3
[]
no_license
exports.Alarm = function(setHour, setMin, setAmPm) { this.hour = setHour; this.min = setMin; this.AmPm = setAmPm; }; exports.Alarm.prototype.checkTime = function() { if ((moment().format("hh") === this.hour) && (moment().format("mm") === this.min) && (moment().format("A") === this.AmPm)) { return true; }...
true
de6bfc6ffb722f4e542767b92fd20f650427a1b2
JavaScript
msgmaxim/ConstraintGraph
/js/build/production.js
UTF-8
53,076
2.59375
3
[]
no_license
Data.Profiling = true; // Data.LogParsing = true; function Data(){ Data._self = this; // not sure if is needed this.global_v_names = {}; // map (var/array)name -> var/array this.all_v = {}; // map varname -> var this.constraints = []; this.constraint_nodes = []; this.var_aliases = {}; } Data.prototype.rea...
true
7500cbd5e7ecdc918e7d4fc8e2bb67e8b40c7c01
JavaScript
MeshalS/NoteHW
/server.js
UTF-8
1,681
2.84375
3
[]
no_license
/// express things const express = require("express"); const path = require("path"); const app = express(); const PORT = process.env.PORT || 3000; app.use(express.urlencoded({ extended: true })); app.use(express.json()); // assets had erro so we need to have the all assest files app.use(express.static('public'));...
true
aa2b0f41d5b465c334dcad4367cb39c760fa894f
JavaScript
drom/website
/src/buildref.js
UTF-8
1,246
2.53125
3
[]
no_license
const {gather} = require("gettypes") const {build} = require("builddocs") const {join, relative} = require("path") function Mod(name) { this.name = name this.shortName = /\w+$/.exec(name)[0] let dir = require.resolve(name) this.base = dir.replace(/[\\\/]dist[\\\/][^\\\/]*$/, "") this.main = join(join(this.ba...
true
9291b3341c364eeaad63c1b5ff3c83846593a02c
JavaScript
sourimd/JSGoodPartsCheatSheet
/SelfInvokingFunction.js
UTF-8
286
3.6875
4
[]
no_license
(function(){ console.log("Self Invoking Function"); })(); var x = (function(){ return 5; })(); console.log( x ); //self executing function returns the function sum var func = (function(){ var sum = function(a, b){ return a+b ; }; return sum; })(); console.log( func(4, 5));
true
a3883fe326703673c5faf6c6f82b46f98d378449
JavaScript
MTUHIDE/CoCoTemp
/src/main/resources/static/js/newsPost.js
UTF-8
532
2.640625
3
[ "MIT" ]
permissive
$(function () { // Show modal to submit form $('#news-post-form').on('submit', function(e){ e.preventDefault(); // Check if form has all required values if ( this.checkValidity() ) { // Check if final submit button was clicked to submit if (this.submitted) { ...
true
5b6d8f005ac4b0b383bbc4a7f15883b2378e404d
JavaScript
Zhiyuan-C/SfwFrame_CourseWorks
/3813ictWeek2myFirstGit/index.js
UTF-8
126
2.609375
3
[]
no_license
console.log("hello world"); let sum = (x, y) => { return x + y; } console.log(sum(5, 10)) console.log("partner updates");
true
a222817b649f2480f81b1dc543ee2656b927ba58
JavaScript
TomGB/advent-of-code-2019
/5.js
UTF-8
2,901
3.203125
3
[]
no_license
var readline = require('readline-sync'); const inputData = require('./5.data.js') const twoParams = ({ param1, param2, paramMode, instructions }) => { const inputA = paramMode[0] ? param1 : instructions[param1] const inputB = paramMode[1] ? param2 : instructions[param2] return { inputA, inputB } } const...
true
aa5d506beb43ec22d8fbff3402be779bf82873cf
JavaScript
Pepsiwiz/checkers
/CheckersGame/checkersgame.js
UTF-8
17,029
2.796875
3
[]
no_license
/** * Гра в шашки * Виконали студенти 3-го курсу * групи ІВ-83 * Куровський А.О. та Бондаренко М.О. * */ var AI_DELAY = 1100; var ID_EMPTY = {"id": 0, "html": ""}; var ID_BLACK = {"id": 1, "html": "<div class=\"c b\"/>"}; var ID_BLACK_KING = {"id": 2, "html": "<div class=\"c bk\"/>"}; var ID_WHITE = {"id"...
true
383ab610f770e8a7112b0fc0b209e5802725a836
JavaScript
lukasszymaniuk6191/wtyczka_do_chrome-
/popup.js
UTF-8
3,338
2.890625
3
[ "MIT" ]
permissive
var nextPage = angular.module('nextPage', []); nextPage.controller('goToProperPage', ['$scope','$http', function($scope,$http) { $scope. goToEasyVocabularyPage = function() { var newURL = "http://localhost:8080/my-vocabulary/easy_words"; chrome.tabs.create({ url: newURL }); ...
true
0af872d42c327dca2d9002614e96280d55635707
JavaScript
edwino-stein/ufrr-20.1-cc-trabalho5-e-6
/src/LL1.js
UTF-8
13,825
3.59375
4
[]
no_license
// Verifica se está rodando pelo Node.js var isNode = typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined'; /** * Classe responsável por representar analisadores LL(1) */ class LL1 { constructor () { this._inicial = null; this._fdc = null; this._gramatica = null; ...
true
ede6f8b1846e12e1e8a2b3b459ef1615d75f8b64
JavaScript
clsavino/react-NYTsearch
/app/components/utils/helpers.js
UTF-8
1,107
2.609375
3
[]
no_license
var axios = require("axios"); var helpers = { runQuery: function(term, start, end){ var term = term.trim(); var start = start.trim() + "0101"; var end = end.trim() + "1231"; console.log("\nin runQuery",term,start,end); return axios.get('/api/search/' + term + '/' + start + '/' + end ) .then...
true
f5e28d70ee5227ca5436ecb9fe47362f32052d4c
JavaScript
agaur/aurora
/src/webapp/lib/aurora/utility.js
UTF-8
2,676
2.609375
3
[]
no_license
AR.Utility = {}; /** * @author Aditya Gaur Finds the maximum value in the data sent for the graph * creation. * @param {object} * [graphDef] An object containing the graph properties and the data */ AR.Utility.scale = { "linear" : "linear", "ordinal" : "ordinal", "log" : "log" }; AR.Utility.f...
true
f4aed87a237acd9c0b34bf12ad2ad241333a3f17
JavaScript
carsonburr/AtomicView
/client/utils/SaveAtomsAndBonds.js
UTF-8
1,339
2.84375
3
[]
no_license
import axios from 'axios'; import qs from 'querystring'; export default function saveAtomsAndBonds(key, atoms, bonds) { var savedAtoms = []; var i = 0; atoms.forEach(atom => { atom.index = i; i++; savedAtoms.push(new cleanAtom(atom)); }); var savedBonds = []; bonds.forEach(bond => { bond.at...
true
5b25d1e8cbb9b3172382865d2c3128ae7c6ece44
JavaScript
whazzabi/whazzup
/whazzup-core/src/main/resources/static/app/services/stateutils.js
UTF-8
2,346
3.234375
3
[ "Apache-2.0" ]
permissive
/** * Utilities that are state-related */ angular.module('dashapp') .factory('StateUtils', function () { var stateUtils = {}; /** * Gives you a score for a state (higher is worse) */ stateUtils.scoreForState = function (state) { if (state == 'GREEN' || sta...
true
2a8a0f2b06d065fb9335349295f6dee74f5c6494
JavaScript
PMelanta/cc
/web/js/base/UserProfile.js
UTF-8
1,544
2.515625
3
[]
no_license
UserProfile = function () { var self = this; this.addToFrequentlyUsedCommands = function (elem, featureRID) { var url = "UUserProfileServlet?command=addToFrequentlyUsedCommands&featureRID=" + featureRID; try { xmlGetResultString(url); } catch (e) { alert("Failed to add to freque...
true
b026ddd9393bb241b1691208b154e1716eab2e88
JavaScript
a424631312/submarine
/assets/assets/scripts/items/background.js
UTF-8
2,729
2.671875
3
[]
no_license
// Learn cc.Class: // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html // Learn Attribute: // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html // - [English] http://www.cocos2d...
true
93117057bcb1a7bc05895530fafc5041e0cadad7
JavaScript
mathieul/jquery.lang
/specs/lib/type_spec.js
UTF-8
3,212
3.21875
3
[]
no_license
/* * JSSpec expectations: * - should_be * - should_not_be * - should_be_empty * - should_be_true * - should_be_false * - should_have(x, "items") // string/array * - should_have_exactly(x, "items") // string/array * - should_have_at_least(x, "items") // string/array ...
true
86876125c9afe3cf367b3d5a2d614f0949b21d5a
JavaScript
roteml8/integration_course
/src/main/resources/static/js/indexMessage.js
UTF-8
2,157
2.546875
3
[]
no_license
var allelements; window.onload=function (){ $.ajax({ url: '/smartspace/elements'+'/'+getQueryVariable('usersmartspace')+'/'+ getQueryVariable('useremail'), type: 'GET', data:'', success: function(data) { //called when successful allelements=data; loadelements(data); }, ...
true
d04f777aa291f32d2ac9c933efc99fe5e448b427
JavaScript
FernandoLucioC/syngenta-test
/test/appTest.js
UTF-8
1,619
3.171875
3
[]
no_license
const assert = require('chai').assert; const chai = require('chai') const expect = chai.expect const app = require('../app'); describe('App',function(){ it('A função handleClient retorna o tipo do cliente, nesse caso Regular',function(){ let result = app.handleClient('Regular: 16Mar2009(mon), 17Mar2009(tues), 18Mar...
true
d706ee40aae7575e2b16ac841ae3eea7072d7246
JavaScript
modernkk/data-structures-algorithms-with-js
/ch8-hashtable/eg3.js
UTF-8
327
2.640625
3
[]
no_license
'use strict'; var pnumbers = new HashTable(); pnumbers.put2('modernkk0', '18500462217'); pnumbers.put2('modernkk1', '18400462257'); pnumbers.put2('modernkk2', '18300461257'); pnumbers.showDistro(); for (var i = 0; i < 3; i++) { var name = 'modernkk' + i; console.log(name + '\'s number is ' + pnumbers.get(name) + '\...
true
1650956f353a4cb8f8634c047d7a75c20e0e720e
JavaScript
caozuowu/algorithm
/leetcode/l_270_e. 最接近的二叉搜索树值.js
UTF-8
602
3.34375
3
[]
no_license
//给定一个不为空的二叉搜索树和一个目标值 target,请在该二叉搜索树中找到最接近目标值 target 的数值。 var tree = require("../module/tree"); var TreeNode = tree.TreeNode var array = [1,2,3,4,5,6,7,8,9] var root = tree.createTree(array, 0, array.length-1); var closestValue = function(root, target) { var temp = root; var closest = root.val while ...
true
ac1e9ab446d8ec3a20a11ff2fdb9882b68c95587
JavaScript
MugilPandian-Eunimart/Product_Management
/app/services/products/product.js
UTF-8
1,671
2.53125
3
[]
no_license
const ProductModel = require('../../models/product'); const ProductFile = require('../../utils/file-handler'); class Product { async handleListProducts(res) { const data = await ProductModel.listProducts(); return res.status(200).send(data); } async handleGetProduct(req,res) { ...
true
ad1a3891438d352d9009182f6309267334cf3859
JavaScript
arknahian/basic-JavaScript-Exam-
/condition.js
UTF-8
377
4.15625
4
[]
no_license
var name = "Jack Ma"; var jobs = true; var salary = 3000; if (jobs == true && salary > 5000) { console.log("Congo You are gonna marry"); } else{ console.log("oops"); } //another condition with or var name2 = "Steve Jobs"; var jobs2 = true; var salary2 = 5000; if (jobs2 == true || salary2 > 9000) { cons...
true
12eaf93773beb38b5a008403c5d3d37c0223a04b
JavaScript
duhnnie/chatIO
/js/audio.js
UTF-8
2,162
2.953125
3
[ "MIT" ]
permissive
var AUDIO, audioCtx; function onError() {}; function loadAudioBuffer(url, callback) { var request = new XMLHttpRequest(); request.open('GET', url, true); request.responseType = 'arraybuffer'; request.onload = function () { audioCtx.decodeAudioData(request.response, function (buffer) { ...
true
af1edcf9473bcc4ea140bba12961c4c40ae17b8a
JavaScript
Kanuty/algorithms
/queue.js
UTF-8
730
4
4
[]
no_license
class Node { constructor(val) { this.value = val; this.next = null; } } class Queue { constructor() { this.first = null; this.last = null; this.size = 0; } enqueue(val) { let newNode = new Node(val); if (!this.first) { this.first = newNode; this.last = newNode; } else { this.last.next = n...
true
5e1496b051aa07ec1fbf1f5bd96fd3c02239ba84
JavaScript
mariusvn/TowerControl
/scripts/main.js
UTF-8
1,723
2.640625
3
[]
no_license
import {draw_gui, draw_sector, draw_runways} from './gui.js'; let app = undefined; //PIXIJS let map_container = undefined; //map content holder (PIXI container) let sector = undefined; //json map content let drag = false; //is draggin' WebFont.load({ google: { families: ['Roboto Mono'] }, active:e=>{ init()...
true
201341eb03b1da635808d00a344254362bbe43df
JavaScript
gabz75/react-boilerplate-starter
/src/hooks/use-fetch.js
UTF-8
636
2.65625
3
[]
no_license
import { useCallback, useState } from 'react'; export const useFetch = (url, fetchConfig = {}) => { const [json, setJSON] = useState(); const [loading, setLoading] = useState(); const [error, setError] = useState(); const makeRequest = useCallback(async () => { try { setLoading(true); const re...
true
5c071e5a7dff37668438c76db111e46c55b1a34f
JavaScript
neekey/iciba-hack
/bookmark.js
UTF-8
860
2.515625
3
[]
no_license
javascript:!(function(){ var host = location.host; var search = location.search; var type = null; if( host == 'word.iciba.com' ){ type = /action\=(\w+)&?/g.exec( search ); if( !type ){ return; } type = type[1]; loadStyle( 'http://neekey.github.com/...
true
369664a830e5a4cf1d1883e56edf9acbe3c94d87
JavaScript
NguyenDuc2596/ES6-JS-
/destructure.js
UTF-8
1,519
3.671875
4
[]
no_license
// Viết code sạch đẹp const buaAn = { anSang: 'Com', anTrua: 'Pho', anToi: 'Chao' } const traiCay = ['cam', 'tao', 'buoi'] // // console.log(`Sang nay toi an ${buaAn.anSang}`); // // console.log(`Trua nay toi an ${buaAn.anTrua}`); // // console.log(`Toi nay toi an ${buaAn.anToi}`); // // // Bữa ăn bị lặp ...
true
b84ff63fe7139ca02d6c9466a3e7c1d19986016d
JavaScript
hayvant/javascriptquiz
/script.js
UTF-8
4,413
3.359375
3
[]
no_license
var timerEl = document.getElementById('countdown'); var mainEl = document.getElementById('main'); // Clock started 100sec given function countdown() { document.getElementById('startBtn').addEventListener('click', function () { var timeLeft = 100; var timeInterval = setInterval(function () { if (timeLeft...
true
bce2cb734d9cb21971d464e36a06fdb2c53217ff
JavaScript
KirilSZyapkov/Practice
/Practice/Elevator/elevator.js
UTF-8
190
3.359375
3
[]
no_license
function elevator(arg1, arg2) { let numPeople = Number(arg1); let capacity = Number(arg2); let result = numPeople/capacity console.log(Math.ceil(result)); } elevator(16, 3)
true
0f52c1556d27e4106926d2ac34a5a3dd81d6472c
JavaScript
DaDanny/simplePU
/client/app/programs/program.service.js
UTF-8
2,807
2.703125
3
[]
no_license
'use strict'; angular.module('simplePuApp') .service('ProgramService', function($http, $q){ return { /* GET Request hits the endpoint /api/programs No arguments required. Expects response to be json object of all programs stored. Once response is recieved, promise is resolved...
true
cd4c79171fa30f034e14d82ee55a9fffd21e19bc
JavaScript
sebmlr/JS_intro
/while/JS_intro_while_incrementation.js
UTF-8
227
3.28125
3
[]
no_license
const MAX=100; var nombre=0; var increment=10; while(nombre<=MAX) { document.write("Le nombre vaut : "+nombre+"<br/>"); document.write("Il reste : "+(MAX-nombre)/increment+" itération <br/>"); nombre+=increment; }
true
ee2bdaebb39f6214c10d75da73ad3befd83ff5b7
JavaScript
juanidiaz/Word-Guess-Game
/assets/javascript/game.js
UTF-8
8,008
3.5625
4
[]
no_license
// VARIABLES -------------------------------------------- // ARRAYS var letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; var wordpool = ["agnes", "barney", "bart", "carl", "edna", "homer", "kent", "krusty", "lenny", "lisa...
true
b71a515e0880b0736b1d17b52ee7a22f94d8e9fe
JavaScript
mariahc/cs290
/project/main.js
UTF-8
1,744
2.875
3
[]
no_license
const express = require('express'); const bodyParser = require('body-parser'); const cors = require('cors'); const axios = require('axios'); const app = express(); let questions = []; let attempts = 0; let score = 0; app.use(cors()); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); a...
true
8118abcfdb6d09eab34aaebc804033330a17a544
JavaScript
CilgaIscan/Codecademy
/section-3/projects/sleep-debt-calculator.js
UTF-8
1,675
3.828125
4
[]
no_license
// Create getSleepHours. const getSleepHours = day => { switch(day){ case 'monday' : return 8; case 'tuesday' : return 8; case 'wednesday' : return 6; case 'thursday' : return 7; case 'friday' : return 6; case 'saturday' : return 8; case 'sunday' : return 9; ...
true
c6dd893998d371c7cf26a6db17bc7207c1cc26c5
JavaScript
FelipeDangond/dart450
/assignments/assignment02/js/x.js
UTF-8
2,187
3.59375
4
[]
no_license
//Unfortunately I could not get this one to work $(document).ready(function() { var video = document.querySelector("#myVideo"); navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; if (navigator...
true
b5fa5a33ac45d6501314a9db6416b5f09ae930da
JavaScript
MicheleVantini-1/SE2_16_170670_L2
/script.js
UTF-8
3,203
3.921875
4
[]
no_license
/** * Function that add a new product with the name and quantity * specified by the user to an html table * @param name - the name of the product to add * @param quantity - the number of units of the new product to add */ function addProduct(name, quantity) { // at first check if the name parameter is a non empty stri...
true
a41ad54df6ee2a2e34bb3c386ec6b10215466542
JavaScript
wemee/tampermonkey_TravianX3
/states/adventures.js
UTF-8
577
2.546875
3
[]
no_license
function adventures(){ localStorage.state = 'adventures'; console.log('adventures'); if(window.location.href == host+'hero.php?t=3'){ console.log('link to Adventure: '+$('.gotoAdventure:eq(0)').attr('href')); window.location.href = host+$('.gotoAdventure:eq(0)').attr('href'); } else if(window.location.p...
true
f20a7f9798f041e65c898b25a57b6d46abfa513e
JavaScript
selevt/svelte-datepicker
/src/components/lib/context.js
UTF-8
4,546
2.59375
3
[ "MIT" ]
permissive
import { writable } from 'svelte/store' import { createFormatter } from './formatter.js' import { dayjs } from './date-utils' const contextKey = {} function moveDateWithinAllowedRange (date, config, isStart) { const isOutsideRange = ( date.getTime() < config.start.getTime() || date.getTime() > config.end.ge...
true
7f4c0a05bf6b8f0069fc8448993532ee3f272495
JavaScript
irdan/euler
/euler48.js
UTF-8
1,028
3.125
3
[]
no_license
console.log("Outside of the base"); console.log("In the base, killing your dudes"); var sum = 0; var max_delta = 15; var max = 10; var num = new Array(max); var sums = new Array(max); var deltas = new Array(max); process.stdout.write("n "); for (var n = 1; n < max; n++){ process.stdout.write(n + " "); } console.lo...
true
b2f8e727478d338eb59d63ac50a6410c6767222d
JavaScript
dmitry-sidorov/wg_forge_frontend
/src/utils/calculateMedian.js
UTF-8
322
3.078125
3
[ "Apache-2.0" ]
permissive
export default function (nums) { const length = nums.length; nums.sort((a, b) => { return parseFloat(a) - parseFloat(b); }); if (length % 2 === 0) { return (parseFloat(nums[length / 2 - 1]) + parseFloat(nums[length / 2]) / 2.0).toFixed(2) } else return parseFloat(nums[(length - 1) / 2]).toFixed(2); ...
true
bc0d69029f7751f3d45f4aa1a5795304e03f7062
JavaScript
Acheyy/Laravel_CRUD
/resources/js/home.js
UTF-8
5,884
2.53125
3
[ "MIT" ]
permissive
const toggleDropdownOptionVisibility = (categoryId) => { $('#main-categories-dropdown').find(`option[value="${categoryId}"]`).addClass('self-hidden'); }; $(document).ready(function() { $(document).on('click', '#btn-add', (e) => { console.log('aadsa'); e.preventDefault(); $('#save-changes').val('add'); $('#...
true
eba28c4175590ce718d4b5c0c20bffd52d125541
JavaScript
CostaUniud/Thetis
/javascript/operations.js
UTF-8
5,329
3.03125
3
[]
no_license
// last data received var lastTimestamp = -1; var lsog = 0, lcog = 0, lmh = 0, lsow = 0 llat = 0.0, llon = 0.0; // last useful data (for the drift calculation) var usefulTimestamp = -1; var usog = 0, ucog = 0, umh = 0, usow = 0 ulat = 0.0, ulon = 0.0; // veer direction var veer = function(u, l, c) { retu...
true
016e209171b8e603925aa8d30ac5471eb7a46bc2
JavaScript
Lidemy/mentor-program-4th-Eleanorecheng
/homeworks/week3/hw2.js
UTF-8
914
4.15625
4
[]
no_license
// 印出水仙花數 function countDigits(input) { let n = input; if (n === 0) return 1; // 如果是零,回傳一位數 let count = 0; while (n !== 0) { n = Math.floor(n / 10); count += 1; } return count; } function isNarcissistic(n) { const digit = countDigits(n); let number = n;// 原始數字 let calculation = 0;// 計算出來的水仙花數...
true
1e324cf372ecf00de2d9efc41e9f7bd407a0756b
JavaScript
antoniocortesjusto/leetcode
/fizzbuzz/test/test.js
UTF-8
1,375
3.140625
3
[]
no_license
var expect = require('chai').expect; var FizzBuzz = require('../src/index').FizzBuzz; describe('FizzBuzz', () => { it('Should return a string', () => { expect(FizzBuzz(0)).to.be.a('string'); expect(FizzBuzz(1)).to.be.a('string'); expect(FizzBuzz(3)).to.be.a('string'); expect(FizzBuzz(5)).to.be.a('string'); ...
true
9a142faf9fe8a96e53fb04342cf99b1a72a19599
JavaScript
hamimistimewa/javascript-es6-progate
/study_03/lesson_01/page_04/script.js
UTF-8
80
3.03125
3
[]
no_license
const greet = (name) => { console.log(`Hello, ${name}`); }; greet('Master White');
true
7923e0615385fd935ec3630a4d4aef3f03780d27
JavaScript
kellofkindles/SOT-Discord-Bot
/website.js
UTF-8
448
2.8125
3
[]
no_license
var colors = require('colors'); // Console colors library const express = require('express'); // Website library const app = express(); // Start express const port = process.env.PORT || 3000; // Start express on specifc port function website2(){ app.use(express.static('public')) // Set public directory as website app...
true
f8d86630e2c47c8b5d15f3e40bf26c22716b43dc
JavaScript
yurimi95/Calculator
/src/index.js
UTF-8
2,742
3.484375
3
[]
no_license
const display = document.querySelector(".display"), equalButton = document.querySelector(".equals"), numBtnArray = document.querySelectorAll("[data-number]"), operationBtn = document.querySelectorAll("[data-operation]"), allClearBtn = document.querySelector(".clear"); let displayVal = ""; let firstVal = ""; le...
true
8c9aa1e34bab91c8acc0773cd7c99186ee9e2e02
JavaScript
hieubx000/message
/components/conversationitem.js
UTF-8
1,285
3.03125
3
[]
no_license
class ConversationItem { id; name; noOfUser; $container; $txtName; $txtNoOfUser onSelectConversation; constructor(id, name, numberOfUser, onSelectConversation) { this.id = id; this.name = name; this.noOfUser = numberOfUser; this.onSelectConversation = on...
true
fef7833d228b8bb5669a7ea4f8e1d035a7ed8680
JavaScript
AnasAzzouzi/ProjectSFE_AnasAzouzi_MrGuezzaz
/ProjectSFE/FrontEnd/career/src/Components/Intern/EditSkills.js
UTF-8
4,794
2.53125
3
[]
no_license
import React,{Component} from 'react' import {Button, Form, FormGroup,Row,Col} from 'react-bootstrap' import axios from 'axios' class EditIntern extends Component{ state={ skillId:0, skills:[], internId:"", intern:{} } async componentWillReceivePr...
true
20c4aa3b993bf165df1835b0a177447002b39a20
JavaScript
ruimarinho/co-authy
/lib/response.js
UTF-8
1,732
2.515625
3
[ "MIT" ]
permissive
/** * Module dependencies. */ var AuthyHttpError = require('../errors/authy-http-error'); var AuthyInvalidApiKeyError = require('../errors/authy-invalid-api-key-error'); var AuthyInvalidRequestError = require('../errors/authy-invalid-request-error'); var AuthyInvalidTokenError = require('../errors/authy-invalid-tok...
true
1e3bb2d2ab87118c536c033843adb62d06a2f27b
JavaScript
cojoigo/WebDevSpring2016
/public/project/client/views/brewery/beer.controller.js
UTF-8
738
2.515625
3
[ "Apache-2.0" ]
permissive
(function() { angular .module("BreweryApp") .controller("BeerController", ['brewDBService', '$location', BeerController]); function BeerController(brewDBService, $location) { var vm = this; vm.selectBeer = selectBeer; vm.searchBeer = searchBeer; function init()...
true
a5a5cf0b6a985fd93b72d934862522a76f56ceeb
JavaScript
tiagoanatar/React-MaterialUI-Base-Theme
/App.js
UTF-8
2,867
3.046875
3
[]
no_license
//import logo from './logo.svg' //import './App.css' import { useState, useEffect } from 'react' // useEffect - will load task on page load - is used to load data from API/Jason //import Header from './components/Header' //import Tasks from './components/Tasks' //import AddTask from './components/AddTask' import Dashbo...
true
7df15e7301147dc997220a1fc72b14e2cf099ce1
JavaScript
danielptm/practice
/javascript/app/test/ProblemSix.test.js
UTF-8
1,521
2.6875
3
[]
no_license
const assert = require('assert'); import ModuleSix from '../src/modules/Module6/ModuleSix'; describe('Robot arm tests:', () => { let commands = []; let blockStateException = []; before(()=> { commands = [ 'move 9 onto 1', 'move 8 over 1', 'move 7 over 1', ...
true
de0f9215f7a4e0ce28932613e60f0a291543a3c2
JavaScript
xiongxiong109/full_screen_mobile
/example/wukong/js/resize.js
UTF-8
1,300
2.703125
3
[]
no_license
$(function(){ var originW=640, originH=1136, baseFontSize=40;/*等比缩放的文字大小1rem就是当前宽度除以设计图宽度*40得到的*/ var baseDom=$(".swiper-wrapper"); centerPage(); var debounceTimer=null; $(window).on('resize',function(){ clearTimeout(debounceTimer); debounceTimer=setTimeout(centerPage,40); }); /*当屏幕宽度大于高度时,保持高度100%, 当屏幕高度...
true
ab216bc0679a933402e49d576de82c12d087ad87
JavaScript
cruiseyideng/js-robot-case
/Core/Pipeline/DelayJob.js
UTF-8
541
2.53125
3
[]
no_license
const {Job} = require("./Job") class DelayJob extends Job{ constructor(){ super(); this.timeout = 0; } initWithData(data){ super.initWithData(data) this.timeout = data["timeout"]; } run(){ if(!this.canRun()){ super.complete(...
true
feff153ec2288c939a926d73519ff1302ab89955
JavaScript
diegobordeu/cmx-test
/cmxreceiver.js
UTF-8
2,786
3.0625
3
[ "Apache-2.0" ]
permissive
/* NodeJS CMX Receiver A basic web service to accept CMX data from a Cisco Meraki network - Accept a GET request from Meraki and respond with a validator - Meraki will POST to server, if validated. - POST will contain a secret, which can be verified by the server. - JSON data will be in the req.body.data. This will be...
true
b0fabe8fc43f2b11a22c92f2517d4125dff3e70d
JavaScript
gomezgleonardob/Algoritmos-Estructura-Datos
/Javascript/seccion-4/app_iterativas_while.js
UTF-8
138
3.484375
3
[]
no_license
// let gasolina = 100; while(gasolina>0) { console.log("Nivel Tanque"+' ' +gasolina); gasolina--; } console.log("Tanque Vacio");
true
80fc13b7e1dceb58d4d9fc3dbe2e5cd63b717fc9
JavaScript
Maxim-front/homewok-16
/task-1/script.js
UTF-8
573
3.453125
3
[]
no_license
const dataTypes = [ true, 's', 0, null, undefined, {}, [], '0n', //Symbol(), () => {}, ] function Infrormation(elem) { this.value = elem; this.type = typeof elem; if (Number.isNaN(elem)) { this.number = '--'; } if (Number.isNaN(elem) == false) { ...
true
c6df40cdad7a6ab7dbc613018b03dde7704de17e
JavaScript
ZxBing0066/ZxBing0066.github.io
/archive/demo/drug/js/app.js
UTF-8
1,231
2.859375
3
[]
no_license
var drugDom = document.getElementsByClassName('drugable'); var ZxDrug = function ZxDrug(dom) { this.dom = dom; this.init(); } var ZxDrugProto = ZxDrug.prototype; ZxDrugProto.init = function() { var self = this; self.top = self.dom.style.top ? +self.dom.style.top.replace('px', '') : 0; self.left = self.dom.style.le...
true
8c152634f10a4612fc011068a6f98b2dab778ab7
JavaScript
cbcybersec/CyberSecCTFs
/Web Apps/CCSP Login/website contents/loginScript.js
UTF-8
993
2.953125
3
[]
no_license
var box = document.getElementsByClassName('loginBox'); var button = document.getElementById('submit'); // console.log(box[0]); // console.log(button); // console.log(button); var corrUser = 'CBHSCyber'; var corrPass = 'Cy83r_S3c_123'; var errorElem = document.getElementById('errorMessage'); button.addEventListen...
true
0a868f40a167c8b50699670038f8930347fa7b61
JavaScript
daofeng123/ClassCodes
/d12/codes/pj03_webpage.js
UTF-8
3,034
2.5625
3
[]
no_license
// 加载模块 var webPage = require('webpage'); // 创建对象 var page = webPage.create(); //打开页面 // page.open( // 'https://www.baidu.com/', // function(status) { // console.log('请求响应状态码',status) // phantom.exit(); // } // ); // // page.open( // 'https://fanyi.baidu.com/sug', // 'POST', // '...
true
67c1d69a122fbbfea28cc9bc4fa3d8ef13d2e545
JavaScript
Vl4d1s/Data-Stracture-And-Algorithems
/hash-tables/first.js
UTF-8
389
3.75
4
[]
no_license
// no order unlike arrays let user = { age: 54, name: 'Vladis', magic: true, scream: function () { console.log('ahhhhhhhhh!'); }, }; user.age; // O(1) user.spell = 'abra kadabra'; // O(1) user.scream(); // O(1) // const a = new Map(); // allows us to set any datatype as the key unlike regular js objects...
true
d854b8341efd8905d2d8081b07589ce6f29ace2a
JavaScript
nicog550/TFM
/public/js/classes/game.js
UTF-8
2,829
2.75
3
[]
no_license
"use strict"; /** * Class responsible for the game logic * @constructor */ var Game = function() { var debugGame = false, gameOver, main, otherPlayersBoard = new OtherPlayersBoard(debugGame), playerBoard = new PlayerBoard(debugGame, setPlayerConfig, otherPlayersBoard.getBoard()), ...
true
19f9bca0f3a5016e268534c3b4180a1a5b94c272
JavaScript
AyahElsayed/React-Course
/src/MySummary/HandlingEvents/AnotherEx-with(this).js
UTF-8
1,034
2.921875
3
[]
no_license
import React, { Component } from 'react' class Video extends Component { constructor(props) { super(props); this.state = { name: '' } // this.handelChange = this.handelChange.bind(this) } handelChange = (event) => { ...
true
ee1589151cb63fad8458abdeba0d149da1e2d405
JavaScript
brunolm/codewars
/3 kyu/hard-time-bomb.js
UTF-8
131
2.703125
3
[]
no_license
// http://www.codewars.com/kata/hard-time-bomb var wireCode = this[Object.keys(this).splice(-2, 2)[0]]; Bomb.CutTheWire(wireCode);
true
959e7cf9c81463a7ff1e969dd4686a6b168fd524
JavaScript
kimjimin1101/syu-likelion-2021-front
/week3/src/babel.example.js
UTF-8
71
2.859375
3
[]
no_license
const calc = (a, b) => a + b; console.log(`calc : ${calc(1, 2)}`);
true
b0f3af1cb1893619bf96d5f367c98f181c863ff3
JavaScript
ardiharyono/tugas_3_js
/tugas3.js
UTF-8
141
3.03125
3
[]
no_license
function nilai(x) { console.log(x); } nilai("kosong"); function kosong() { var angka = "bagus" return angka; } console.log(kosong());
true
d39ebae91fd457bcba986636e3c67b88218f3cb7
JavaScript
Robbie2725/CS418
/mp3/CubeMap.js
UTF-8
5,476
3.140625
3
[]
no_license
/** * @file functios to implement a cube map * @author Robbie Krokos <rkroko2@illinois.edu> */ /** @global the cubemap texture */ var texture; function setupCubeMap(){ // create the texture texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture); // each direction info const l...
true
06c844cfb00c1506c40a43c46d4f78b387d1bccb
JavaScript
AlainRusnov/Algos-ds
/polygonClassConstructor.js
UTF-8
407
4.03125
4
[]
no_license
/* * Implement a Polygon class with the following properties: * 1. A constructor that takes an array of integer side lengths. * 2. A 'perimeter' method that returns the sum of the Polygon's side lengths. */ class Polygon { constructor (sides) { this.sides = sides; } perimeter() { return this.sides.reduc...
true
603aa6002eb7a954f17943f9c9b386dbb14d43a1
JavaScript
Pham-Ha/T2005E-NodeJS
/index.js
UTF-8
1,243
2.578125
3
[]
no_license
const express = require("express"); const app = express(); const PORT = process.env.PORT ||5000; app.listen(PORT,function () { console.log("Server is running..."); }) app.use(express.static("public")); //app.use("view engnine","ejs"); app.set("view engine","ejs"); var counter = 0; app.get("/",function (req,res) {...
true
1af43f86df03089d06608b2aa77ce1ea6c877bca
JavaScript
honaj/Challenge2
/script.js
UTF-8
2,422
3.25
3
[]
no_license
let can = document.querySelector("canvas").getContext("2d"); let storeImage = document.getElementById("storeImage"); let compareImage = document.getElementById("compareImage"); let resultText = document.getElementById("resultText"); let mouseDown = false; let x; let y; can.lineWidth = 10; can.strokeStyle = "red"; can....
true
3336eb84a2bb038c57f329e01cf404c5110d28d0
JavaScript
isaiahaiasi/weather-app
/src/display-data.js
UTF-8
4,573
3.0625
3
[]
no_license
import sampleData from './weather-samples.json'; import makeIconComponent from './weather-icon-loader.js'; import { elm } from './domUtils.js'; const randIndex = Math.floor(Math.random() * sampleData.samples.length); const testQuery = sampleData.samples[randIndex]; function filterWeatherData(obj) { if (obj.cod !== ...
true
fae8a77c2b402cb731e40ba3038e34df7bb44433
JavaScript
ikebastuz/adapt_techs
/src/saga/sagas.js
UTF-8
452
2.546875
3
[]
no_license
import { put, takeEvery, all } from "redux-saga/effects"; import { GET_TODOS, RECIEVED_TODOS } from '../actions' function* GetTodosList(){ const json = yield fetch('https://jsonplaceholder.typicode.com/todos') .then(res => res.json()) yield put({ type: RECIEVED_TODOS, payload: json }); } function* actionWatc...
true
a361d01ee34f1d031de024404ef942b98a332001
JavaScript
nathaliemekahal/Netflix-Proj
/NetflixPage/test.js
UTF-8
338
2.765625
3
[]
no_license
let test=async (params)=> { let j=0 let categories=await getMovies() j++ console.log('categories',categories) for (let i=0;i<categories.length;i++){ let movies=await getCategoryMovies(categories[i]) for(let j=0;j<movies.length;j++){ console.log(movies[j]) } ...
true
cf1e865bc20d01046ae64080277329f8cba82320
JavaScript
jenshandersson/react-workshop
/workshop/reduce.js
UTF-8
120
2.875
3
[]
no_license
const reducer = (state = 0, data) => state + data; const total = [0, 1, 2, 3].reduce(reducer); console.log(total); // 6
true
d26478e9424d1f529249996c618e274bea3aa27c
JavaScript
elegant651/simplestack
/public/main.js
UTF-8
717
2.640625
3
[]
no_license
$(document).ready(function() { init(); $("#btnPush").click(function() { var elem = $("#ipPush").val(); if(elem=="" || elem==null){ alert("insert number before push"); return; } $.ajax({ url: '/api/push/'+elem, type: 'GET', data: {} }).done(function(response) { printState(response); }...
true
de60c958bd09625384994f5a91d5e615254a57ee
JavaScript
ordsec/data-structures-algorithms-js
/05-searching-algorithms/01-binarySearch.js
UTF-8
1,457
3.84375
4
[]
no_license
function test(expected, value) { if (expected !== value) { throw new Error(`Expected ${expected}, but got ${value}`); } console.log('Lookin\' good, chief.'); } function binarySearchIt(arr, val) { if (arr.length === 0) return -1; let left = 0, right = arr.length - 1; while (left <= right) { ...
true
02c9b4ec0a17b9ed50393514a12dcd92297fee7b
JavaScript
gkjohnson/three-transform-dirty-flag
/benchmark/utils.js
UTF-8
928
2.96875
3
[ "MIT" ]
permissive
const { Object3D, Scene } = require('three'); function pad(str, len) { let res = str; while (res.length < len) { res += ' '; } return res; } function runBenchmark(name, func, maxTime, maxIterations = Infinity) { let iterations = 0; const start = Date.now(); while (Date.now() ...
true
4a572fffc9d7338b61e6e0af065e984984263b8b
JavaScript
DoniVoice/TestTaskPokemonAPI
/app/src/components/api/api.js
UTF-8
921
2.546875
3
[]
no_license
import *as axios from 'axios' export const pokemonAPI = { getPokemon() { return ( axios.get('https://pokeapi.co/api/v2/pokemon').then(response => response.data) ) }, getPokemonImage(url) { return ( axios.get(url).then(response => response.data) ) ...
true
f86fbff98e117ac039e6eca647ca9f9365532543
JavaScript
mohitg07/holding-secrets-website
/app.js
UTF-8
8,362
2.640625
3
[]
no_license
//jshint esversion:6 require('dotenv').config(); // we require this module so that we can store our private data in .env file which is hidden file const express = require("express"); const bodyParser = require('body-parser'); const ejs = require('ejs'); const mongoose = require('mongoose'); // require the below 3 mod...
true
d5fe08baef483818b4687d97d4256c30b9dd5454
JavaScript
karnosose/teambuilder
/src/helpers/changeDateFormat.js
UTF-8
297
3
3
[]
no_license
export const changeDateFormat = date => { const month = (date.getMonth() + 1 + '').length < 2 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; const day = date.getDate().length < 2 ? '0' + date.getDate() : date.getDate(); return (date.getFullYear() + "-" + (month) + "-" + day); }
true
71602593a65e51da37c4f8c71a260baf0523b907
JavaScript
srinathava/raspberry-pi-sleep-monitor
/web/js/start.js
UTF-8
637
2.6875
3
[ "MIT" ]
permissive
$(function searchForIp() { function tryIp(ipIdx) { var uri = "http://192.168.1." + ipIdx; $('#searchStatus').innerHTML = 'Pinging ' + uri; $.ajax({ url: uri + "/ping", dataType: "json", timeout: 100 }).success(function(data) { console....
true
ae8aefb169f2e2b6e626ba5df1c56367331184a2
JavaScript
Sheep83/homework_all
/week_6/day_2/shopping/items/items.js
UTF-8
455
2.765625
3
[]
no_license
var apple = { name: "apple", price: 0.79 } var cornflakes = { name: "cornflakes", price: 1.89 } var soup = { name: "soup", price: 1.59 } var truffles = { name: "truffles", price: 10.50 } var bacon = { name: "bacon", price: 3.89 } var eggs = { name: "eggs", price: 2.29 } var store = [] stor...
true
750ece9271080b02a7f21ff23b005a6c0b27cb5c
JavaScript
Adesubomi/NodeJS-tutorial-practise
/018 - listing directory files/list.js
UTF-8
257
2.546875
3
[]
no_license
var fs = require('fs'); // fs module methods have both synchronous // versions and asynchronous versions. fs.readdir('./lib', function(error, files){ if (error) { throw error; } else { console.log(files); } }); console.log("Reading file");
true
fdf35d2c85a99e0c965d5dd5960a75e0f5246dae
JavaScript
sketch-hq/SketchAPI
/Source/dom/__tests__/globalAssets.test.js
UTF-8
2,319
2.6875
3
[ "MIT" ]
permissive
/* globals expect, test */ import { getGlobalColors, getGlobalGradients, globalAssets } from '..' test('should return global colors', () => { const colors = getGlobalColors() expect(colors.length > 0).toBe(true) expect(colors[0].type).toBe('ColorAsset') expect(typeof colors[0].color).toBe('string') }) test('...
true
e679076b81f0e7f449ef932eb861fb0ef0446a8a
JavaScript
Lambdah/tv-show-crawl
/backend/crawler/much/muchParse.js
UTF-8
2,222
2.65625
3
[]
no_license
const puppeteer = require('puppeteer'); async function muchParse(url){ var browser; try{ browser = await puppeteer.launch({headless: true}); var page = await browser.newPage(); page.setDefaultNavigationTimeout(0); await page.goto(url); try{ await page.waitFo...
true
da3cf87f74e8b05e40aee29a728f01f9e6d9634d
JavaScript
hind201/Carte__Youcodeur
/middlewares/userValidator.js
UTF-8
697
2.625
3
[]
no_license
exports.userSignUpValidator = (req,res,next)=>{ req.check('matricule','Matricule is Required').notEmpty(); req.check('firstname','Firstname is required').notEmpty(); req.check('lastname','Lastname is required').notEmpty(); req.check('phone','Phone is required').notEmpty(); req.check('email','Email...
true
779c9b212dfff09d61ea889de37edc1215bf66f2
JavaScript
AK56/west-elm
/src/components/App.test.js
UTF-8
1,626
2.546875
3
[]
no_license
import React from 'react' import App from './App' let goodJSON = { "id":"shop/new/all-new", "name":"All New", "groups": { "0": { "name": "product1", "hero": "image1.jpg", }, "1": { "name": "product2", "hero": "image2.jpg", }, } } let badJSON = '' describe('<App />', () ...
true
ae000dcafe0b8f6dfdd29a89ab6c31de442873f9
JavaScript
lowenkrieg/exerciciofiguras
/index.js
UTF-8
1,474
3.1875
3
[]
no_license
"use strict"; class FigurasG { constructor(aq, ar, br, btri, htri, bp, hp, BTra, btrap, htra, rcir) { this.aq = aq; this.ar = ar; this.br = br; this.btri = btri; this.htri = htri; this.bp = bp; this.hp = hp; this.BTra = BTra; this.btrap = btrap...
true
ae87ac476c69a8064bade4bbc28ecc5655d94526
JavaScript
alinesoarees/PWeb2
/lista 1/questao7.js
UTF-8
555
3.8125
4
[]
no_license
let qtd = parseInt(prompt("Insira a quantidade de números ser digitado:")) if ((qtd < 0) || (qtd == 0)) { alert("O valor a ser digitado positivo e diferente de zero.") } else { let numeros = []; let soma = 0; for (let i = 0; i < qtd; i++) { let numero = parseInt(prompt("Digite o numero...
true
adc0c38522ebf20d2dbbb791a47b1a33de40396a
JavaScript
loociano/deckers
/js/Ground.js
UTF-8
706
3.390625
3
[]
no_license
function Ground(){ this.width = 40; this.height = 20; this.ground = []; this.initGround(); } Ground.prototype = { getWidth: function(){ return this.width; }, getHeight: function(){ return this.height; }, initGround: function(){ for (var y = 0; y < this.height; y++){ var line = []; for (var ...
true
cda3bfa42bfec4107615beda7043b12155df3473
JavaScript
leonardobarone/vue-todolist
/js/script.js
UTF-8
1,537
3.140625
3
[]
no_license
const app = new Vue({ el: "#root", data: { coseDaFare: [ { nome: "Fare i compiti", completato: false, }, { nome: "Fare la spesa", completato: false }, { nome: "Fa...
true
4d9029e89bceb2690552df293952c9858f381e2e
JavaScript
DesertEagleX/NodeJsServer
/source/response/response.js
UTF-8
2,847
2.703125
3
[ "Apache-2.0" ]
permissive
/** * Created by sprint on 16/8/13. */ 'use strict'; /** * ResponseCode prototype. */ var ResponseCode = exports = module.exports = { /** * 成功code */ successCode : 200, /** * 失败 */ failedCode : -200, /** * 参数错误 */ parameterErrorCode : -100, /** * 服...
true
7586513a7852bc7d79983ec3f1d298b32ffb7348
JavaScript
uwilborn/QA-Employee-Tracker
/qaemployeesDBconnections.js
UTF-8
791
2.625
3
[]
no_license
// const mysql = require('mysql'); // const connection = mysql.createConnection({ // host: 'localhost', // // Your port, if not 3306 // port: 3306, // // Your username // user: 'root', // // Be sure to update with your own MySQL password! // password: '', // database: 'qaemployees_db', // }); // co...
true
66950a182017de3e7a41363e8c248a5823d31185
JavaScript
peter-002/sorbon
/nodejs/design_patterns/singleton.js
UTF-8
113
2.90625
3
[]
no_license
/** * 单例: 任何对象都是单例 * */ let obj = { name: "peter", age : 20 }; console.log(obj);
true
1778db792f41963fadf78caf00cd8c5d7887b88c
JavaScript
lee-227/webpack
/webpack-source/source/9.taple/2.SyncBailHook.js
UTF-8
400
2.984375
3
[]
no_license
// 当回调函数返回非 undefined 值的时候会停止调用后续的回调 const { SyncBailHook } = require('tapable'); const hook = new SyncBailHook(['name', 'age']); hook.tap('1', (name, age) => { console.log(1, name, age); return 1; }); hook.tap('2', (name, age) => { console.log(2, name, age); }); hook.tap('3', (name, age) => { console.log(3, na...
true
a22eaddfd5aaf00678af54f4858fd89630d97737
JavaScript
SDBoahen/0719-Phase2-React-Project
/src/App.js
UTF-8
1,982
2.578125
3
[]
no_license
import logo from './logo.svg'; import './App.css'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import { useEffect, useState } from 'react'; import NavBar from './NavBar'; import Home from './components/Home'; import ReActorContainer from './containers/ReActorContainer'; import CatList from '....
true