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
fc435c615809429e5eaacdd87e1cfac5151d8509
JavaScript
wickettc/react-book-library
/src/Book.js
UTF-8
706
2.609375
3
[]
no_license
import React from 'react'; function Book(props) { const { title, author, pages, wasRead } = props.book; const displayRead = wasRead ? 'Yes' : 'No'; return ( <div className="book"> <h3 className="book-title">{title}</h3> <h5 className="book-author">Author: {author}</h5> <h5 className="book-...
true
806b6cf4c4014cb2fc8c39147126ec640d2b9f57
JavaScript
ohjungsoo92/background-generator
/hellojs/for_in.js
UTF-8
141
2.890625
3
[]
no_license
var foo = { name: 'foo', age: 30, major: 'computer science' }; var prop; for (prop in foo) { console.log(prop, foo[prop]); }
true
8034a26b6952e5c02937b1eced9ad3b625deadd9
JavaScript
JaceN22/debug
/app.js
UTF-8
130
2.53125
3
[]
no_license
funtion ranson(){ var finnish = me; } console.log(finnish); var dog = woof; funtion(){ console.log(dog); } console.log(dog);
true
731e9e9965df9a80d2b7a500fcad9a1ec2829130
JavaScript
PacktPublishing/Building-Cross-Platform-Desktop-Applications-with-Electron
/Chapter05/Example02/main.js
UTF-8
1,926
2.6875
3
[ "MIT" ]
permissive
const { app, BrowserWindow } = require('electron'); let win = null; // index.html flle path let appUrl = `file://${__dirname}/build/index.html`; // Configure Webpack Dev Server if (process.env.NODE_ENV == 'development') { console.log('Bundling webpack...'); const webpack = require('webpack'); const webpackDev...
true
05cf0222ff987b20c1a0682981a92df140c3dd12
JavaScript
wittycodes/craflo-storefront
/packages/paperbits-styles/src/styleUitls.js
UTF-8
423
2.515625
3
[ "MIT" ]
permissive
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatUnicode = void 0; function formatUnicode(unicode) { var unicodeString = unicode.toString(16); if (unicodeString.length > 4) { return ("000000" + unicodeString.toLowerCase()).substr(-6); } else { re...
true
9b8fc65539477e498cd5d44c5d2a7e7cb53b5b42
JavaScript
hbouvier/redisctl
/lib/redisctl.js
UTF-8
4,182
2.515625
3
[]
no_license
module.exports = function () { function RedisCtl(config) { var $this = this; this.config = config; this.meta = config.meta; this.version = config.version; this.logger = config.logger; } RedisCtl.prototype.exec = function (options) { var $this = this, ...
true
53a347286aa4e8b9377fc8b5539c213e3a0b7034
JavaScript
sapegin/enzyme-article-2019
/src/components/Login.js
UTF-8
1,030
2.546875
3
[]
no_license
import React from 'react'; import PropTypes from 'prop-types'; export default function Login({ onSubmit }) { const [username, setUsername] = React.useState(''); const [password, setPassword] = React.useState(''); const handleSubmit = event => { event.preventDefault(); onSubmit({ username, password }); ...
true
58c530238d8b007957720ec2e8593c8218a496d9
JavaScript
joshuaaguilar20/TypescriptPlay
/classes.js
UTF-8
2,248
3.3125
3
[]
no_license
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] =...
true
34d09b6ca4a25eb132604280018e82294a1a266a
JavaScript
maxifuchs/i18n-postal-address
/tests/testFile.js
UTF-8
577
2.65625
3
[ "MIT" ]
permissive
const PostalAdress = require('..').default; function formatAdress() { let myAddressPersonal = new PostalAdress(); myAddressPersonal.setAddress1('Kennedy Road'); myAddressPersonal.setAddressNumber('150'); myAddressPersonal.setState('Kowloon'); myAddressPersonal.setCity('Wan Chai'); // myAddress...
true
64ae34b02ef57259797350eb7a2ccfcb5b0c8ea0
JavaScript
lleman/Calculator-Javascript-
/calc.js
UTF-8
663
2.890625
3
[]
no_license
let button = [...document.getElementsByTagName('button')]; let input = document.getElementById('input'); let zero = document.getElementById('zero'); let result = document.getElementById('result'); let del = document.getElementById('delete'); button.forEach(function (a) {a.addEventListener('click', function () { if...
true
307462689d77c322e4463ed1471fa1c8913d636f
JavaScript
Felipeballarino/Food-App
/api/src/routes/index.js
UTF-8
2,054
2.890625
3
[]
no_license
const { Router } = require('express'); const {searchName, searchId, searchType,searchAll, createRecipe, createDiet, searchForDiet} = require('./utils') // Importar todos los routers; // Ejemplo: const authRouter = require('./auth.js'); const router = Router(); // Configurar los routers router.get('/recipes', a...
true
1695ec62170804863105b3b0081bbe0ec28e3faa
JavaScript
MarlomSouza/CQS
/Exemplo_2/src/UI/atividadeapp/src/features/Atividade/store/mutations.js
UTF-8
1,116
2.515625
3
[]
no_license
import Vue from 'vue' const SET_ATIVIDADES = (state, obj) => { state.atividades = obj.atividades } const INCREMENTAR_ATIVIDADES = (state, atividade) => { state.atividades.push(atividade) } const REMOVER_ATIVIDADE = (state, index) => { state.atividades.splice(index, 1) } const SET_ATIVIDADE = (state, atividade...
true
c98ed353e8cfad4e85a3c7dc41e831f151de1872
JavaScript
itsSkyCraft/covid.js
/cli.js
UTF-8
2,420
2.890625
3
[]
no_license
#!/usr/bin/env node const chalk = require('chalk'); const enquirer = require('enquirer'); const fetch = require('node-fetch'); const covid = require('./index.js'); const figlet = require('figlet'); async function res(){ const response = new enquirer.Select({ name: 'Select', message: chalk.green('W...
true
4384cd604a86f6decf009cf896d25a49bfad7a92
JavaScript
CSolari96/p2-solari-courtney
/lib/main.js
UTF-8
1,646
3.359375
3
[]
no_license
"use strict"; // Mobile Hamburger Menu var menuClose = document.getElementById("close-menu"); // Store mobile menu close button var menuOpen = document.getElementById("open-menu"); // Store mobile menu open button var mobileMenu = document.getElementsByClassName("mobile-menu")[0]; // Store mobile menu // When the use...
true
773331da355b7a2d6b19e69f24aeaa5f1dca96b6
JavaScript
LEtudiantFork/sir-trevor-js
/src/helpers/table/lib.js
UTF-8
711
2.515625
3
[ "MIT" ]
permissive
var _ = require('../../lodash.js'); function dataKeyIsUnique(newKey, tableData) { return Object.keys(tableData[0]).every(function(tableDataItemKey) { return tableDataItemKey !== newKey; }); } function getHeaderNames(tableData, headerKey) { return _.uniq( tableData.map(function(tableDat...
true
2d087473e8e4261086e534b140ff49e4454848b2
JavaScript
molomby/brisk-docs
/packages/website/bin/page-generator/templates/changelog/index.js
UTF-8
726
2.578125
3
[ "MIT" ]
permissive
const outdent = require('outdent'); /** * changelogTemplate - template for generating a changelog page * * @param {string} changelogPath relative path to the changelog file * @param {string} wrapperPath relative path to the page template component * @param {object} [data={}] extra data needed by the page *...
true
790a47c6560c40762b6435a4b73c639f61093dc7
JavaScript
tublitzed/hi-lo
/assets/js/main.js
UTF-8
846
2.71875
3
[]
no_license
import Game from './classes/game'; import store from './modules/store'; import Preach from 'preach'; import './modules/nav'; /** * Create a single global event object that we'll share throughout the app. */ let vent = new Preach(); /** * Builds game options: loads game if one is set from storage * and creates a s...
true
6b2982f049702b404a5186e1a7fc3491a5b19ca8
JavaScript
tuantt98/upload-image
/index.js
UTF-8
2,544
2.59375
3
[]
no_license
const express = require("express"); const bodyParser = require("body-parser"); const multer = require("multer"); const path = require("path"); const app = express(); const storage = multer.diskStorage({ destination: "public/uploads", filename: (req, file, cb) => { cb(null, file.originalname); } }); const up...
true
17397256bcd4d97ef92b089b4078a0e21ec19cd9
JavaScript
karanjariwala/Excel
/src/utils/pureFunctions.js
UTF-8
1,100
2.84375
3
[ "MIT" ]
permissive
const createCells=(num)=>{ let cells=[]; for(let i=0;i<num;i++){ cells[i]=[]; for(let j=0;j<num;j++){ cells[i].push({ x:i, y:j, val:'', sign:'+', }) } } return cells; } const createCellVie...
true
35087e19db96c64a3f5133b1b44600554aed338d
JavaScript
vlowe85/Flexget
/app/services/local-storage.js
UTF-8
542
2.671875
3
[ "Apache-2.0" ]
permissive
require( "nativescript-localstorage" ); export default class LocalStorage { constructor() { console.log("Keys stored", localStorage.length); } save(key, value) { localStorage.setItem(key, value); return value; } saveObject(key, value) { localStorage.setItemObject(...
true
45fe364d5eb4d037ccedcd66b778fa17f41897ed
JavaScript
rynkevic7/webdriverio-test
/test/specs/register1.js
UTF-8
3,134
2.5625
3
[]
no_license
const assert = require('assert'); const {expect} = require('chai'); const email = '0.24984543258656222one@one.com'; const firstName = "John"; const lastName = "Smith"; const password = "123456"; describe('register page', () => { it('should have the right title', () => { browser.url('https://stage.pasv.us...
true
e316fe7366a25b4126d7c6410b4c7660de525c66
JavaScript
tomijuarez/javascript
/tricky-questions/exercise1.js
UTF-8
370
3.921875
4
[]
no_license
/** * Result of this: */ [[123],[123]].map((value)=>{ return value *2 }); /** * The result will be [246, 246] because `map` goes to the deepest element of the array and in this case they're numbers. * If the array would be like [[1,2,3],[[[12]]]].map(value => value * 2); it would output [NaN, 24] because the dee...
true
1c9bec9f9ff3c499dd968e79a684745e86b28ac4
JavaScript
zain610/gittocli
/src/util/Prompt.js
UTF-8
920
2.78125
3
[ "MIT" ]
permissive
const inquirer = require("inquirer"); const chalk = require("chalk"); let getRepoName = () => { return inquirer.prompt([ { type: "input", name: "repoName", //key to access data message: "Enter the name of the repository" } ]); }; let getTagName = () => { return inquirer.prompt([ { ...
true
9a18f2da432547d650735552fe392b7ff9255c4a
JavaScript
housecricket/Awesome-tips-for-improving-web-development-in-JavaScript
/Ways-to-Swap-Variables-in-JavaScript/solution1.js
UTF-8
139
3.140625
3
[]
no_license
var a, b; a = 3 b = 5 console.log(`before: a = ${a} and b = ${b}`) temp = a a = b b = temp console.log(`after: a = ${a} and b = ${b}`)
true
7135436bbf97e2d81df1c06dbaed8c3e6afcb5ed
JavaScript
NotMyself/Thinger
/app/scripts/user-search.js
UTF-8
1,393
2.765625
3
[ "MIT" ]
permissive
(function($, exports){ 'use strict'; function startsWith(item, term){ return item.toLowerCase().indexOf(term.toLowerCase()) === 0; } function UserSearch(options) { this.users = options.users || []; this.template = $(options.template).html(); this.getTerm = function() { ...
true
6ef7c8c98a02ed2a0ff6f43aa58edb6076651fef
JavaScript
vdeturckheim/tworme
/test/index.js
UTF-8
1,492
2.515625
3
[ "MIT" ]
permissive
'use strict'; // Dummy use case test, to be removed and replaced by real ones const Fs = require('fs'); const Lab = require('lab'); const lab = exports.lab = Lab.script(); const describe = lab.describe; const after = lab.after; const before = lab.before; const it = lab.it; const expect = Lab.expect; const Model = req...
true
86fb1360aebd137927fc967ce01e503faae02fe8
JavaScript
ElliotWhiley/VisualGit
/app/misc/gitCommands.js
UTF-8
284
2.890625
3
[ "MIT" ]
permissive
function addCommand(command) { var gitCommand = document.createElement("p"); gitCommand.className = "git-command"; gitCommand.id = "git-command"; gitCommand.innerHTML = command; var footer = document.getElementById("footer"); footer.appendChild(gitCommand); }
true
1be2c82e6d44a4e0c09883b5ebce16195757a11d
JavaScript
philiptyler/TheBoozeReaction
/src/js/store.js
UTF-8
2,182
2.765625
3
[]
no_license
var EstablishmentCol = require('./establishmentCol'); var LibationCol = require('./libationCol'); var Menu = require('./menu'); var store = {}; var loadCounter = 0; /* builds establishment Backbone collection from json from API */ window.bus.on('ESTABLISHMENTS_READY', function (jsonPayload) { store.establishmentJSO...
true
84b602ec572d4b565ddd0c8620045c230f048e21
JavaScript
osmanthustonx/PureJS_Hotel_practice
/js/calendar.js
UTF-8
4,169
3.453125
3
[]
no_license
var calendar = { dayTable: null, //初始化TABLE year: null, //初始化年 month: null, //初始化月份 selectDay: null, getFirstDay: (year, month) => { //獲取每個月第一天在星期幾 var firstDay = new Date(year, month, 1); // console.log(firstDay.getDay(), firstDay); return firstDay.getDay(); //getDa...
true
e0b7035820bb0ebf409ce8ec30fe97ce4c5dbc5a
JavaScript
w01fgang/react-styled-date-time-picker
/example/src/App.js
UTF-8
1,414
2.578125
3
[]
no_license
import React from 'react'; import { DateTime } from 'luxon'; import DateTimePicker from 'react-styled-date-time-picker'; class App extends React.Component { constructor(props) { super(props); this.state = { fromDate: DateTime.local().set({ hours: 10, minutes: 0 }), toDate: DateTime.local().plus...
true
776c40bd577968d1fa042322f9a11b833c8f9b16
JavaScript
Vali0/BattleShips-Game
/server/controllers/gameLogic.js
UTF-8
2,785
3.4375
3
[]
no_license
function checkRowForShips(board, row, startCol, endCol) { for (var currentCol = startCol; currentCol <= endCol; currentCol++) { if (board[row][currentCol] === '*') { return false; } } return true; } function checkColForShips(board, col, startRow, endRow) { for (var currentR...
true
e442f622f9804496aaaeebc6e895432f47636e3c
JavaScript
artyom-deryavka/YaHoPicaso
/public/javascripts/icore/icore_canvas.js
UTF-8
544
2.59375
3
[]
no_license
var ICore_Canvas = function() { var canvas = document.getElementById(Config.CANVAS); var context = canvas.getContext('2d'); ICore.getCanvas = function() { return canvas; } ICore.getContext = function() { return context; } ICore.resizeCanvas = function(width, height) { ICore.getCanvas().width = wid...
true
7290a0a7dc73dba7f182559f785b94daa570e4f8
JavaScript
Owais749/Assignm
/app.js
UTF-8
10,042
3.515625
4
[]
no_license
// *****Question 1***** // var date=new Date(); // document.write(date) // *****Question 2***** // var my_month=new Date() // var month_name=new Array(12); // month_name[0]="January" // month_name[1]="February" // month_name[2]="March" // month_name[3]="April" // month_name[4]="May" // month_name[5]="June" // month_nam...
true
e1a13ab24d581a80fdc53c32726fffdf08218d9f
JavaScript
faqihakih/javascript-playground
/practice 1/8.js
UTF-8
1,647
4
4
[]
no_license
/** Virus Percentage =============== Implementasikan function virusPercentage untuk menghitung persentase virus yang ada. Hanya akan ada 4 tipe virus, yaitu: - * - # - @ - $ # Contoh: - `input` -> **##@ output -> 40% *, 40% #, 20% @ - `input` -> **#*## output -> 50% *, 50% # Contoh lain ada di test case # Asum...
true
058a20c8bcbc60511287b45bc8be2d93fdb439f5
JavaScript
wcursino/codecomp
/src/services/UserService/index.js
UTF-8
2,199
2.640625
3
[]
no_license
import { API_URL } from "./../../config"; var request = require("request"); class UserService { register(username, password) { console.log("we made it here"); var postData = { username: username, password: password }; console.log("postData", postData); var url = API_URL + "/api/v1/r...
true
6b60a20b6fcab70b83a39f489395d50c5d5997bb
JavaScript
edfrias/skylab-bootcamp-201904
/staff/pablo-rey/array-functions/includes.js
UTF-8
474
3.828125
4
[]
no_license
'use strict'; /** * Returns true if the array includes the value * * @param {Array} array * @param {*} value * * @returns {boolean} True if the array includes the value */ function includes (array, value) { if (!(array instanceof Array)) throw new TypeError("array param is not an array"); if (a...
true
e101550c520d452c13d3de4fa03b86035a5ed1a6
JavaScript
ProfessorMarcolan/crash-bash-io
/assets/client-jogo.js
UTF-8
2,598
2.90625
3
[]
no_license
var socket = io(); socket.emit("connect"); //estou plorando coisas queu nao deveria estar explorando //HUADSHUASDHUASDHUAHUSDhuASD //mas isso nao é uma live didatica SHAUDHUASDHUADSHUAHUDShuads //refatore essa gambiarra XD $.getJSON('/pega_salas', function (data, textStatus, jqXHR){ this.data = data data.f...
true
dc0f30791941af6f66d788ff228c0b5d475e027e
JavaScript
Stulnikitina/html_work
/js/tasks from js.ru/sort-object.js
UTF-8
498
4.28125
4
[]
no_license
//https://learn.javascript.ru/task/sort-objects "use strict"; let vasya = { name: "Вася", age: 25 }; let petya = { name: "Петя", age: 30 }; let masha = { name: "Маша", age: 28 }; let names = [ vasya, petya, masha ].sort( (a, b) => { if (a.age > b.age) { return 1; } if (a.age < b.age) { ret...
true
5d5afbdfd3931e8906e9f1d559f92dcc091078a6
JavaScript
cshing/moduleExercise
/moduleList.js
UTF-8
456
3.203125
3
[]
no_license
var list = [] //private, not accessabl to outside function storeNumber (number) { list.push(number); } // storeNumber((5)) // console.log(list); function returnList() { return sortList(list); } //console.log(list) function sortList(array) { array.sort(function (a, b) { return a - b; }); ...
true
b7400b6d9e337c2972be27d9a99ff9c7cb0711c9
JavaScript
dnunez-cloud/Basic--Unit-Tests
/index.test.js
UTF-8
5,663
2.921875
3
[]
no_license
import * as index from "./index.js"; describe('text Tests', () => { test('input Text', () => { expect(index.texto('Qa-automation')).toBe('Qa-automation'); }); test('input Number', () => { expect(index.texto(2)).toBe(2); }); test('input Boolean', () => { expect(index.texto(true)).toBe(true); });...
true
a620dd5fcf12d3aa75d4fda756ef03f9e1e5b0ed
JavaScript
dxcqcv/react-iiSlider
/client/components/ControlButton.js
UTF-8
598
2.546875
3
[ "MIT" ]
permissive
import React from 'react' const ControlButton = ({onClick, dir}) => ( <span onClick = {onClick} > {dir} </span> ) //class ControlButton extends React.Component { //constructor(props) { //super(props); //} //componentWillReceiveProps(NextProps) { //console.log(`componentWillReceiveProps ...
true
66035a9a062d37081766c2f34e8c3c661fbda45f
JavaScript
dconroy91/dayfive-javaScript-exercises
/script.js
UTF-8
2,272
3.984375
4
[]
no_license
// loops // // var i = 0; // while(i < 20){ // console.log(i, "is less that 20") // i++ // } // for(var i = 0; i < 20; i++){ // console.log(i, " its less than 20!") // } // for(var i = 0; i < 100; i++){ // console.log(i, "TWEET TWEET TWEET") // } // var phrase = 1; // while(phrase <= 100){ //...
true
51e4cbc6dc4dcb2824ee511e47dba3189b6ec19a
JavaScript
Francis1024/vue3-json-schema-form
/schema-tests/test01.js
UTF-8
374
2.921875
3
[]
no_license
// Node.js require: const Ajv = require('ajv').default const schema = { type: 'string', minLength: 10 } const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} const validate = ajv.compile(schema) // const valid = validate('咚咚咚咚咚咚咚咚咚咚') //正确的 const valid = validate(12312) // 错误的 if (!valid) console...
true
546c9f8e42e2538315b809f3a8fbd455ae24dba6
JavaScript
MilesOfRoses/deliverable_two
/js/script.js
UTF-8
1,459
3.921875
4
[]
no_license
function suggestClothing() { /*************** Declaring variables ***************/ let tempFahr; //input let EventType; //input let tempClothing; //output let eventTypeClothing; //output let result; //output /*************** INPUT SECTION ***************/ tempFahr = parseFloat(document.getElementById("tempFah...
true
05905e5f6ad35d201f802dc3518af6b274b9b2c1
JavaScript
jodich/kmpng
/models/models.js
UTF-8
753
2.546875
3
[]
no_license
const db = require('../db.js'); const sha256 = require('js-sha256'); const SALT = 'banana' const selectAllLocations = (callback) => { let queryString = 'SELECT * FROM locations'; db.query(queryString, callback); }; const selectAllServices = (callback) => { let queryString = 'SELECT * FROM services'; db....
true
71781d1fbdc4912c4798edd948bb28762c08c258
JavaScript
imranpashaTech/js_snippet
/sampleSearch.js
UTF-8
1,268
2.625
3
[]
no_license
<!DOCTYPE html> <html> <body> <h1>Search Data</h1> <form> <input id="title" type="text" value="National Tactics Developer" required> <input id="city" type="text" value="North Ottis" required> <button onclick="loadDoc()">search</button> </form> <div id="ptable"></div> <script> // var searchCit...
true
b4befe4f68d083559384600b54dfb86256c3d35f
JavaScript
9545891/letao
/public/back/js/second.js
UTF-8
5,107
2.5625
3
[]
no_license
$(function () { // // 请求用户数据 var currentPage = 1; //当前页 var pageSize = 5; //每页 数据条数 render(); function render() { $.ajax({ type: "get", url: "/category/querySecondCategoryPaging", data: { page: currentPage, pageSiz...
true
faf3fa6c45334d746928a9ef45579bafa4da33f9
JavaScript
cuongpv219/test_enci
/public/js/groups/saler/controller_common.js
UTF-8
261
2.546875
3
[]
no_license
$(document).ready(function() { $('.confirm-delete').click(function(event) { event.preventDefault(); var href = $(this).attr('href'); var result = confirm('Are you sure?'); if (result) { window.location = href; } }); });
true
1fdaac7881560eab6cb7a38fd09d4a1e45917788
JavaScript
guptajyoti845/UI-layouts
/src/infinite-scroll/script.js
UTF-8
2,464
3.40625
3
[]
no_license
const postContainer = document.getElementById('post-container'), loading = document.querySelector('.loader'), filter = document.getElementById('filter'); let limit =5; let page = 1; //Fetch POST from API async function getPosts(){ const result = await fetch(`https://jsonplaceholder.typicode.com/posts?_lim...
true
6e2860aed5381ab6c41257adaf1cdef1bdb1808e
JavaScript
NATHALIEBENARROCH/project-m2-nyan-cat
/js/main.js
UTF-8
1,314
3.96875
4
[]
no_license
// We create an instance of the Engine class. Looking at our index.html, // we see that it has a div with an id of `"app"` const gameEngine = new Engine(document.getElementById("app")); // keydownHandler is a variable that refers to a function. The function has one parameter // (does the parameter name matter?) which ...
true
c15103e4aa1f4253f0d4d78a4cc82198633ec4b4
JavaScript
oephrosinin/rss-reader
/client/src/js/app.js
UTF-8
6,229
2.734375
3
[]
no_license
"use strict"; import Rss from "./lib/modules/rssReader"; // Module for reading rss import Chart from "chart.js"; // Module for drawing diagrams import Functions from "./lib/Functions"; // Helpful functions $( document ).ready(() => { // variable for store the diagram let diag...
true
311aba0ada3df87a8bc23b18f09709e3f30e3c62
JavaScript
pqrsooo/emg-studio
/app/components/ScatterPlot/index.js
UTF-8
3,778
2.5625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import React from 'react'; import * as d3 from 'd3' import DataCircles from 'components/DataCircles'; // console.log(d3); Returns the largest X coordinate from the data set const xMax = (data) => d3.max(data, (d) => d[0]); // Returns the higest Y coordinate from the data set const yMax = (data) => d3.max(data, (d) =>...
true
e92693bd7b8b1f7c5d5ce647660234f4d9905ccc
JavaScript
Blaios/Curso
/js/cards.js
UTF-8
2,492
2.625
3
[]
no_license
var url = 'https://web-jedi.herokuapp.com/animales'; const load = (response) => { for (let i = 0; i < response.length; i = i+2) { $("#cardsHome").append( ` <div class="row justify-content-center align-items-center"> <div class="col-md-6 col-sm-12 mb-5 mt-5"> <div class="card card...
true
8fa7fe25fe7a0be45b09b6e40626c1537cb29f5b
JavaScript
leapradel/react-mmi
/app/components/Machine.js
UTF-8
564
2.875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/** * * App.js * */ //rajouter un bouton qui permet de changer l'état de notre machine : active ou non active //stocker les infos (nom et statut des machines) dans le state import React from 'react'; class Machine extends React.Component { render() { // Dans tous les cas, afficher return <...
true
41820721b331780a8860fcda33fc11251e2eb5e2
JavaScript
DubbleA/SynchRewrote
/Window1/html/l2.js
UTF-8
1,883
3.625
4
[]
no_license
// Get number of jigged l2s function l2 () { const randomstring = require('randomstring'); var l2s = []; // Log the results. const num = (document.getElementById('userInput2').value); for (let i = 0; i < num; i++) { // picks number between numbers 1-5 var temp = (Math.random() *100) + 1; ...
true
d2e7af914fd5e9c09908b0c927c5d1f9c61164c8
JavaScript
mapbox/glyph-inspect
/glyphs.js
UTF-8
2,511
2.875
3
[ "ISC" ]
permissive
'use strict'; // glyph ======================================== exports.glyph = {read: readGlyph, write: writeGlyph}; function readGlyph(pbf, end) { return pbf.readFields(readGlyphField, {}, end); } function readGlyphField(tag, glyph, pbf) { if (tag === 1) glyph.id = pbf.readVarint(); else if (tag === 2...
true
c608859c625ebcd2ea033827c25e52f17d7c4a29
JavaScript
trastopchin/AIT-CG-2D-Shapes-And-Patterns
/2D_shapes_and_patterns/js/ShapesAndPatternsScene.js
UTF-8
8,083
2.8125
3
[]
no_license
/* Tal Rastopchin September 22, 2019 Adapted from Laszlo Szecsi's homework starter code and powerpoint slide instructions. */ "use strict"; /* exported Scene */ class ShapesAndPatternsScene extends Scene { constructor (gl) { super(gl); this.avatarPosition = {x:0, y:0}; this.avatarSpeed = 1; } // create my ...
true
cc330599ea8567c17f39d106033926e1d75bbde4
JavaScript
Pedginald/react-to-do-list
/src/components/MainContent.js
UTF-8
856
2.65625
3
[]
no_license
import React, { Component } from 'react'; import ToDoItem from './ToDoItem'; import toDosData from '../toDosData'; class MainContent extends Component { constructor() { super() this.state = { todos: toDosData } this.handleChange = this.handleChange.bind(this) } handleChange(id) { this.setState(prevSta...
true
b32d7c9c67d39122ab4af609719cee40b4732faa
JavaScript
GHypesZ/WorkFinder
/src/pages/LogIn.js
UTF-8
3,379
2.515625
3
[]
no_license
import React, {Component} from 'react'; import { View, Alert, StatusBar, Image, KeyboardAvoidingView, Platform, } from 'react-native'; import SafeAreaView from 'react-native-safe-area-view'; import Estilo from "../Styles"; import auth from "@react-native-firebase/auth"; import {Input, Button} from "react-...
true
8debc40d922c902131425f8708c957cd16db06b0
JavaScript
lathajb/Github-Javascript-Refactor-Assignment
/public/src/js/update-issue/update-issue.service.js
UTF-8
1,725
2.53125
3
[]
no_license
'use strict'; import {renderConfirmMsg} from '../create-repo/message-render.js'; const rootUrl = "https://api.github.com/"; const token = "Bearer 529bc0d5e46ad8501d290d4388110b38998b7808"; const user = 'lathajb'; function updateIssueService(issueObj) { let header = new Headers({ "Content...
true
bee8b3d5aef89ce09e18057d0230748b654a3fa7
JavaScript
departement-loire-atlantique/design-system-web
/framework/js/misc/request.js
UTF-8
1,484
2.984375
3
[ "MIT" ]
permissive
class MiscRequest { static send (url, successCallback, errorCallback, parameters = null, method = 'GET') { if (!url) { return null; } if (parameters && method.toLowerCase() === 'get') { url += (url.includes('?') ? '&' : '?') + MiscUrl.jsonToUrl(parameters).toString()...
true
3aa90086a1d7cfa24c76d4c2e4f3fb1e5511656f
JavaScript
CarlMungazi/react-experimental-renderer
/src/renderer/index.js
UTF-8
8,481
2.828125
3
[ "MIT" ]
permissive
/** This renderer does the bare minimum to update the example application. See: https://blog.atulr.com/react-custom-renderer-1/ */ const Reconciler = require('react-reconciler'); const HostConfig = { now: Date.now, // this will be used by the reconciler to calculate the current time /** * This function allow...
true
b03d83f2f999f603aed3752788384b3a0cae829a
JavaScript
terryyyyyy/nutbox-contract
/scripts/utils.js
UTF-8
566
2.625
3
[]
no_license
const ethers = require('ethers'); function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } const waitForTx = async (provider, hash) => { console.log(`Waiting for tx: ${hash}...`) while (!await provider.getTransactionReceipt(hash)) { sleep(3000) } } function utf8ToHex(str...
true
d42ee2d14d1a1e667ed3df046e6441b49e81b2be
JavaScript
ojhasubham/node-express-ejs
/server/services/email.js
UTF-8
1,784
2.5625
3
[]
no_license
const sgMail = require('@sendgrid/mail'); var handlebars = require('handlebars'); var fs = require('fs'); const dirname = process.cwd(); const url_link = `${process.env.CLIENT_PROTOCOL}://${process.env.CLIENT_HOST}`; handlebars.registerHelper('getObjectKey', function () { let data = this.toString().split(','); ret...
true
792145e8d71c5db84c12faaea865458ea2917f85
JavaScript
MingYinLv/guide
/Javascript/leetcode/isBalanced.js
UTF-8
1,056
3.671875
4
[]
no_license
/** * Created 2018/08/31 11:52 By lvmingyin */ // Definition for a binary tree node. function TreeNode(val) { this.val = val; this.left = this.right = null; } /** * @param {TreeNode} root * @return {boolean} */ var isBalanced = function (root) { if (!root) return true; function balanced(node) { if ...
true
0e0b9c0da888f51f43057f1839c5cd19f1d28af0
JavaScript
Jequtin/DTEK2040
/Part2/src/App.js
UTF-8
2,792
2.90625
3
[]
no_license
import './App.css'; import React from 'react'; import axios from 'axios' class App extends React.Component { constructor(props) { super(props) this.state = { notes: [ ], newNote: '', newTime: '' } } componentDidMount() { console.log('did mount') axios .get('htt...
true
2120890cecd7e3113b76bb8283c61e63b74dc415
JavaScript
tuthiloi/B-i-tap-Javascript
/day3/script3.js
UTF-8
292
2.890625
3
[]
no_license
var open=document.querySelector('.open'); var close=document.querySelector('.close'); var container=document.querySelector('.container'); open.addEventListener('click', () => container.classList.add('show-nav')); close.addEventListener('click', () => container.classList.remove('show-nav'));
true
929741ac142023ccd61eda271bc64565574ae772
JavaScript
sagar5mati/digiAssist
/src/main/resources/static/pdfjs/web/capture.js
UTF-8
5,016
2.75
3
[ "Apache-2.0" ]
permissive
var dataCapture = { startTime: 0, prevTime: 0, views: [], prevViews: [], addToViews: function(views, time) { this.views.forEach(value => { value.time += time; }); this.views.forEach(value => { var flag = false; this.prevViews.forEach(prevValue => { if(value.pageNumber ===...
true
282388f833ee2bedb5947327079667944422a315
JavaScript
mr-moh/fwd-udacity-landing-page
/js/app.js
UTF-8
2,795
3.84375
4
[]
no_license
/** * * Manipulating the DOM exercise. * Exercise programmatically builds navigation, * scrolls to anchors from navigation, * and highlights section in viewport upon scrolling. * * Dependencies: None * * JS Version: ES2015/ES6 * * JS Standard: ESlint * */ /** * Define Global Variables * */ const na...
true
f7dc3f72783769146dfdf63050a4a83f28ac760d
JavaScript
ruswerner/tweetstack
/client/src/actions/stacks.js
UTF-8
1,956
2.78125
3
[ "MIT" ]
permissive
export const AUTO_ADD_DELAY = 300; export function addStack() { return { type: 'ADD_STACK' }; } export function removeStack(index) { return function(dispatch, getState) { if (getState().stacks.size === 1) { setTimeout(() => dispatch(addStack()), AUTO_ADD_DELAY); } dispatch({ type: 'R...
true
16dd56cbe9ff82d4bc2609147ea177b2993b2cd7
JavaScript
kingofhawks/worksmart
/node/mrtg.js
UTF-8
2,370
2.734375
3
[]
no_license
/** * Created by user on 2015/12/11. */ var jsdom = require("jsdom"); var fs = require("fs"); var jquery = fs.readFileSync("../static/jquery/jquery2.1.4.min.js", "utf-8"); //var traffic = {"http://192.168.153.226:8081/192.168.153.18_37.html":"", // "http://192.168.153.226:8081/192.168.153.18_45.html":"...
true
4599880a265f43d738cea04ee2c16ee682b61ead
JavaScript
aldyerifianzah/tugas-mandiri
/week 3/selasa1.js
UTF-8
352
3.84375
4
[]
no_license
//input "hello world!" // //output // "!dlrow olleh" function reverse(str) { var tampung = [] for (let i = str.length - 1; i >= 0; i--) { tampung.push(str[i]) } let akhir = '' for (let j = 0; j < tampung.length; j++) { akhir += tampung[j] } return akhir } conso...
true
dffb104b97dd4ab8f14b7daba468ea5cd515d3b9
JavaScript
kpuno/survey-app
/src/reducers/results.js
UTF-8
987
2.65625
3
[ "MIT" ]
permissive
import initialState from './initialState'; import axios from 'axios'; const HOST_URL = 'https://survey-app-api.herokuapp.com'; // actions export const GET_SEARCHED_RESULTS = 'GET_SEARCHED_RESULTS'; export const UMOUNT_SEARCHED_RESULTS = 'UMOUNT_SEARCHED_RESULTS'; // reducer export function searchResults(title, email)...
true
4c7e0db5b544db9fd38f6f202d50a102894e326b
JavaScript
mihneacojocaru/AsynchronusL1
/promises.js
UTF-8
360
3.625
4
[]
no_license
let myStatus = true; const example = new Promise ( (resolve,reject) => { setTimeout(()=>{ if(myStatus == true){ resolve("Something"); } else { reject("Something else"); } },3000) }); let rez=""; example. then((data=>{ rez=data; })) .catch(err=>{ ...
true
3d4b1ae18eea62c2a72ee175d29bd66b7180b136
JavaScript
mayanksh99/interndash_frontend
/src/components/Login/Login.js
UTF-8
4,453
2.53125
3
[]
no_license
import React, { Component } from "react"; import logo from "../../assets/logo.png"; import swal from "sweetalert"; import { loginUser } from "../../utils/apiService"; import axios from "axios"; import cookie from "react-cookies"; import register from "../../assets/register.png"; class Login extends Component { state...
true
587eebe6d5c3984c49a73ca79962105f46b32b14
JavaScript
isabelle-soupault/POECD10
/script8.js
UTF-8
1,246
3.375
3
[]
no_license
submit.addEventListener("click", function () { if (age.value >= 18) { alert("Vous êtes majeur"); } else { alert("Vous êtes mineur"); }; }); /* submit.addEventListener("click", function () { if (age >= 18) { result = ("Vous êtes majeur"); } else { let yearsLeft = 18 ...
true
892f4ab5171d4e494ef4c6cedeece4bf7dd0b89c
JavaScript
fcbrule/Covid-Tracker
/src/common/covid-table/Table.jsx
UTF-8
4,231
2.671875
3
[]
no_license
import React from "react"; import { Link } from "react-router-dom"; import PropTypes from "prop-types"; import { insertCommasInNumbers, sortTable } from "../../utils/helpers"; import states from "../../utils/constant/states"; import { TableCell } from "."; import "./Table.css"; class Table extends React.Component...
true
da945ce42c244ad9b62d1d0d5069f2267937eff3
JavaScript
between2spaces/between2spaces.github.io
/docs/morgue/water/water.js
UTF-8
1,426
2.609375
3
[ "MIT" ]
permissive
( function () { 'use strict' WORLDJS.zoom( 2 ) WORLDJS.addEventListener( WORLDJS, 'oncellnew', cell => { let nx = ( cell.x + 50000 ) / 100000 let ny = ( cell.y + 50000 ) / 100000 let n10000 = WORLDJS.noise( nx * 10000, ny * 10000 ) WORLDJS.add( { sprite: { image: n1000...
true
581a8c0bb6389bff8bfaa459713a7da0d6e405c2
JavaScript
kamilAqil/twitterBot2021
/index.js
UTF-8
577
2.65625
3
[]
no_license
require('dotenv').config() const functions = require('./functions') const mainFunc = async()=>{ console.log(`running main func`); let id = '' let usersFollowed = [] try { id = await functions.getUserID(`heubertMungus`) } catch (error) { console.log(`something went ...
true
ee419c1f60a860078e757993838f25b9dfe37599
JavaScript
benschac/online-education-solutions
/project-euler/7-problem.js
UTF-8
412
3.640625
4
[]
no_license
function isPrime(number) { if(number < 1 ) return false; if(number === 1 || number === 2) return true; if(number % 2 === 0) return false; for(var i = 3; i <= Math.sqrt(number); i+=2) if(number % i === 0) return false; return true; } function primeList(upperbound) { var pList = [...Array(upperbound)...
true
b3c301e285b3c702ee8ccfdab6316d155e5d43f0
JavaScript
YuSong-ys/Expressage-manage-system
/src/mock/order.js
UTF-8
3,345
2.578125
3
[]
no_license
import Mock from 'mockjs' // get请求从config.url获取参数,post从config.body中获取参数 function param2Obj(url) { const search = url.split('?')[1] if (!search) { return {} } return JSON.parse( '{"' + decodeURIComponent(search) .replace(/"/g, '\\"') .replace(/&/g, '","') .replace(/=/g, '":...
true
0362a8d6bbeb6f05bd84d42fc68b60d25db69b6a
JavaScript
pk0409/React-repo
/UpdateJobSeekerProfile.js
UTF-8
10,458
2.734375
3
[]
no_license
import React, { Component } from 'react'; //import JobSeekerService from '../services/JobSeekerService'; class UpdateJobSeekerProfile extends Component { constructor(props) { super(props); this.state = { address:'', contact_no:'', email:'', ...
true
e2d802d4e99c39707f6f29b9d0b0615d3df33b46
JavaScript
pfgithub/js-winowman
/api/windowman.js
UTF-8
1,874
2.953125
3
[ "MIT", "Apache-2.0" ]
permissive
function getPanel(x,y,w,h){ //return $('<li>').attr("style","top:"+x+"px;left:"+y+"px;width:"+w+"px;height:"+h+"px;").addClass('contained'); // switch ^ to v var containbox = $('<div>').addClass('windowContainer') var titlebar = $('<div>').addClass('titlebar') var li = $('<li>').css({height:h,width:w,top:y,le...
true
0f03d8383ad43122e8d113393b910540ddb30e71
JavaScript
sanskip/Datastructure
/binarySearchTree.js
UTF-8
351
3.203125
3
[]
no_license
class Node { constructor(root) { this.root = root; this.left = null; this.right = null; } } class BinarySearchTree { constructor() { this.root = null; } insertBST(val) { if (this.root == null) { const node = new Node(val); this.root ...
true
b0b77daed27ae59895fa344bfaaacfc35b00b6e9
JavaScript
knowledge2520/test-20170309
/trunk/themes/admin/js/custom/custom-pet.js
UTF-8
329
2.53125
3
[]
no_license
jQuery(document).ready(function() { $("#topic-category").on("change",function(e){ var type = $('#topic-category').val(); if(type == 'newsfeed_post'){ $("#topic-title").hide(); }else{ $("#topic-title").show(); } }); $("#topic-category").trigger("change"...
true
14b92a37e1a0c4c3c99ce9b8dc1c83d6198fa8fd
JavaScript
chengyuan9826/web
/test-paper/js/test-paper.js
UTF-8
2,979
2.546875
3
[ "MIT" ]
permissive
/** * Created by Administrator on 2016/5/6. */ var timeCon = $('.countdown-time'); $(function () { diffDay('2017/6/7');//倒计时 goNav();//导航 goTop();//返回顶部 //复选框 $('label[for=show-answer]').on('click', function () { var _this=$(this); checkbox(_this); }); $('label[for=select-all]'...
true
3ec1d66b00e5f33a3ae3f3d8d2d63e300a2460e6
JavaScript
PrivetAdel/MonoTeka
/source/js/slider.js
UTF-8
1,188
3.109375
3
[]
no_license
function slider() { let offset = 0; let slideIndex = 1; const prev = document.querySelector('.slider__prev'); const next = document.querySelector('.slider__next'); const wrapper = document.querySelector('.slider'); const wrapperWidth = window.getComputedStyle(wrapper).width.replace(/[a-z]+/g, ''); cons...
true
d4c3bf32a91235f46296912b8ab7061ac6584155
JavaScript
xskdjs1995/todolist
/src/TodoList.js
UTF-8
2,554
3.046875
3
[]
no_license
import React, { Component } from 'react'; // import logo from './logo.svg'; // import './App.css'; import TodoItem from './TodoItem'; class TodoList extends Component { /* 构造函数 初始化就有 state 可以储存数据 */ constructor(props){ super(props); this.state = { list:[ 'render只能返回一个jsx 也就是只有一个div不...
true
2c15b30de6e4c3ff40c7722e7ff74077988fc97c
JavaScript
Ondrik8/WebRelay
/Server/webclient/socketrelay.js
UTF-8
2,785
2.640625
3
[]
no_license
var SocketRelay = { Client: function (host) { this.uploading = false; this.oncode = function (code) { }; this.onstart = function () { }; this.onfinish = function (status) { }; this.ondisconnect = function () { }; this.onprogress = function (eta, bps, progress) { }; var chunkSize = 65536, chunk, lastChun...
true
e68cee72c8d472ba697c8757c5f25ae0720cf7d6
JavaScript
rosenthaleric/p5ballphysics
/app.js
UTF-8
988
2.625
3
[]
no_license
let ball; let boxes = []; let points; const width = 800; const height = 400; const G = 0.011; function setup() { createCanvas(width, height); ball = new Ball(width / 2, height / 5, 25); boxes.push(new Box); frameRate(60) } function draw() { clear(); background(240); textSize(40); textAlign(RIGHT) te...
true
7265fcb04d74a8409b07e51a56614467216f02a5
JavaScript
vargheseakhil/booking-management-system
/src/store/reducer.js
UTF-8
623
2.59375
3
[]
no_license
import * as actionTypes from '../service/util/constants'; const initialState = { bookings:[], isDataFetchDone: false, }; const reducer = ( state = initialState, action ) => { switch ( action.type ) { case actionTypes.FETCH_BOOKINGS_SUCCESS: return { ...state, ...acti...
true
8d94750a4a3079f0c850ef3eb8120ed439d65aa3
JavaScript
johan--/neural-politics
/src/scripts/lib/brain/utils.js
UTF-8
408
2.75
3
[]
no_license
window.utils = { randomColor : function() { return { r: Math.round(Math.random() * 255), g: Math.round(Math.random() * 255), b: Math.round(Math.random() * 255) }; }, toRgb : function(color) { return "rgb(" + color.r + "," + color.g + "," + color.b + ")"; }, normalize : func...
true
d723d5fdfa9b1d135187c2330472f240c16f59a9
JavaScript
liudake/vycf-cli
/src/api/interceptors.js
UTF-8
682
2.578125
3
[]
no_license
import axios from 'axios' /** * [请求时拦截器和响应时拦截器] * request [请求拦截器] * response [响应时拦截器] * checkStatus [http状态码正常,则直接返回数据] * checkCode [http状态码异常,提示告诉用户] */ axios.interceptors.request.use( config => { // 请求时做一些处理 return config }, error => { // 当请求异常时做一些处理 return Promise.reject(err...
true
67e119a1035f4aa1de7c316804ee13e4c66106b7
JavaScript
RysonShalvis/pokemon-react
/src/getPokemon/getPokemon.js
UTF-8
1,213
2.8125
3
[]
no_license
import React from 'react'; import './getPokemon.css'; import axios from 'axios'; let url = 'https://pokeapi.co/api/v2/pokemon/'; class GetPokemon extends React.Component { constructor(props) { super(props); this.state = { pokemon1: {}, search: "" } } ...
true
d6bf0fa44c7c3b498b0784f44b4d97195a953ece
JavaScript
mohitmorarka/Most-Recently-Accessed-File
/last_access.js
UTF-8
1,020
3.1875
3
[]
no_license
/* Comments- 1) Script takes a list of filenames as arguments. 2) An error message is printed if the path to the file is not found. 3) An error message is printed to handle anything that is not a file. 4) It also assumes that spaces for the files have been escaped. */ var fs = require('fs'), fileStats = []; ex...
true
0d6065047053a3458aa0a3c677934e136335bbfd
JavaScript
KevinGuedes/WebDevelopmentCourse
/exercicios-web/exercicios/secao5/05.js
UTF-8
134
2.84375
3
[]
no_license
const displayPrice = (price) => console.log(`R$ ${price.toFixed(2).toString().replace('.', ',')}`) displayPrice(0.30000000000000004)
true
50b92f3221d953a48658f0b2d1ff52a0150ce392
JavaScript
joseph-iussa/tour-planner
/app/map/map.callbacks.js
UTF-8
1,835
2.65625
3
[ "MIT" ]
permissive
'use strict'; // These callbacks are called with their context object set to $scope, i.e. 'this' refers to $scope. angular.module('map'). service('updateCircleOverlay', function (BING_API_MIN_RADIUS_METERS, BING_API_MAX_RADIUS_METERS) { return function (e) { var radius = this.originMarker.getLatLng().dist...
true
2eedd51852cf9e7548e2ae69c7fd54775a8783da
JavaScript
pawankSingh/MERNLoginApplication
/backendroutes/getData.js
UTF-8
711
2.671875
3
[]
no_license
//Used to get all employee const userData = (req, res, next) => { const data = [{ name: "Tiger Ni432424242xon", designation: "System Architect", country: "Edinburgh", age: 61, salary: "$320,800", id:1 }, { name: "Tiger Nixon1213242", ...
true
9ce5709e9ea6d5039f232872cb614cde99a04df0
JavaScript
Oyamasiphula/Nelisas_App
/public/js/search.js
UTF-8
3,191
2.5625
3
[]
no_license
//Jquery AKA AJAX searching patern and custom style for content $(document).ready(function(){ //Products Search $("#productPullReq").keyup(function(){ var productPullReq = $("#productPullReq").val(); $.get("/products/search/" + productPullReq, function(results){ $("#reqProductsOutPut").html(results); ...
true
5be10e9d3efa9369b865347dff702c19445ed0f6
JavaScript
Ryanh899/corona-attempt4
/views/js/index.js
UTF-8
749
2.671875
3
[]
no_license
$(document).ready(function () { $('body').on('click', '#submitGeneral', function (e) { e.preventDefault(); const form = document.querySelector('form#generalPostForm') const formdata = new FormData(form); const post = { fullName: formdata.get('fullName').trim(), ...
true