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
cdaeffbdce48d4a915737ab1378ecfd21f8cc030
JavaScript
AlexYankoff/SoftUni-Alex
/JS_Applications/16.Test/src/views/dashboard.js
UTF-8
1,653
2.703125
3
[]
no_license
import { html } from '/../../node_modules/lit-html/lit-html.js' import { getItem} from '../api/data.js' // IF Display is different if no data: //${data.length == 0 ? html `<p class="no-memes">No memes in database.</p>`: data.map(itemTemplate)} const dashboardTemplate = (data) => html ` <section id="catalog-p...
true
9dbbf8bfa35c6efdc80b2f0da89835f69ca85a6b
JavaScript
AleksProkofiev/external-courses
/src/ex15_js-oop/js/AccountingCalculator.js
UTF-8
912
3.171875
3
[ "MIT" ]
permissive
function AccountingCalculator() { Calc.call(this); } AccountingCalculator.prototype = Object.create(Calc.prototype); AccountingCalculator.prototype.constructor = AccountingCalculator; AccountingCalculator.prototype.getIncomeTax = function (value) { if (isNumeric(value)) { this.currentValue = value / 100 * 13; ...
true
f3aa0a595cb24dddb33098e8f3f9f5b272c39275
JavaScript
angelachenn/ScholarSearch
/foryou.js
UTF-8
25,715
3.171875
3
[]
no_license
/** * Title: foryou.js * * Javascript for foryou.html, used to store data for displaying and interactions */ //Scholarships JSON const apiURL = "http://localhost:8080/scholarship" //Bookmarks JSON const bookURL = "http://localhost:8080/bookmarks" //User JSON const userURL = "http://localhost:8080/user" //Vue Ins...
true
62d8a3c5fe3c884388d696158b5cf58991a30240
JavaScript
kyawtk/MERN-todo-app
/todo-app/src/components/Main.jsx
UTF-8
1,634
2.8125
3
[]
no_license
import React, { Component, useEffect } from "react"; import Input from "./Input"; import TodoItem from "./Todoitem"; import axios from "axios"; const url = "http://localhost:5000/todos"; class Main extends Component { constructor(props) { super(props); this.state = { todos: [], }; } componentD...
true
3cad2a832f47a132b73b680352b8ca5f1288a5ce
JavaScript
Mi1ms/codeflix
/server/server.js
UTF-8
2,931
2.9375
3
[]
no_license
const http = require('http'); const url = require('url'); const https = require('https'); const fs = require('fs'); let port; const LOCAL_DATABASE = 'data.json'; if (process.argv[2]) { port = process.argv[2]; } else { console.log('Need parameter port (example: 8080)\n'); exit(2); } http.createServer((req,...
true
2eb51537da45fc404385e343bd04c3ec3ebeefbd
JavaScript
vincentyang01/algoQuestions
/reverseInteger.js
UTF-8
143
3.265625
3
[]
no_license
function reverseInteger(x) { let str = x.toString().split('') let rev = str.reverse() console.log(rev) return parseInt(rev); };
true
19e32186cf237fe6c1471eb3fba10aaa72781f91
JavaScript
bellaters/react-course-expensify-app
/src/actions/expenses.js
UTF-8
3,092
2.84375
3
[]
no_license
import uuid from 'uuid'; import database from '../firebase/firebase'; // ADD_EXPENSE export const addExpense = (expense) => ({ type: 'ADD_EXPENSE', expense }); export const startAddExpense = (expenseData = {}) => { return (dispatch, getState) => { const uid = getState().auth.uid const { ...
true
21a153ab86e8138a335ae48a0d0db74753ee3e25
JavaScript
everest2006/front-end-course
/seventhLesson/index.js
UTF-8
451
2.96875
3
[]
no_license
let mul = (value) => { let result = value; return function next(value) { if (value) { result *= value; return next; } return result; } }; let sumStringArgs = (...values) => { let result = { count: 0, errStrings: [] }; values.map( (...
true
9f6b72cfd3f8c57005f2de8b5cd5bb8b76a9c311
JavaScript
poptip/twice
/test/util-test.js
UTF-8
3,142
2.578125
3
[]
no_license
var util = require('../lib/util'); var PublicStream = require('../lib/publicstream'); var sinon = require('sinon'); var spy = sinon.spy; exports['create status code error'] = { 'known error': function(test) { var err = util.createStatusCodeError(401); test.ok(err instanceof Error); ...
true
f77900aebc035c69ffbeb2f52c7a138997613fe4
JavaScript
meistertigran/productivity-timeline
/js/script.js
UTF-8
3,783
2.78125
3
[]
no_license
$(document).ready(function(){ var timeline = new Timeline(new Date()); //Zoom In $(timeline.scaleInSelector).click(function(){ timeline.scaleTimeIn(); }); //Zoom Out $(timeline.scaleOutSelector).click(function(){ timeline.scaleTimeOut(); }); //Show time ...
true
a929f89e746664709e60d56fb1e6666ddf3939ba
JavaScript
dhpatel15/leetcode
/isPowerOfTwo.js
UTF-8
256
3.640625
4
[]
no_license
var isPowerOfTwo = function(n) { if(n === 0){ return false; } if( n === 1 ){ return true; } let x = 1 while(n){ if(x === n){ return true; }else if( x > n){ return false; }else{ x = x * 2; } } };
true
228473c1096a243caa83151f88cb2db4357312c0
JavaScript
praywj/DailyStudy
/reactDemo/demo1/src/04state状态管理.js
UTF-8
1,561
3.21875
3
[]
no_license
import React from 'react' import ReactDOM from 'react-dom' /** * React状态管理 * 1. 在构造函数中设置state中属性的初始值 * 2. 在需要更新state中属性值时通过 this.setState来设置,类似微信小程序 * 3. 可以在组件/标签上绑定事件,并通过dataset进行传参 */ class Tab extends React.Component{ constructor(props){ super(props); this.state = { buttonT...
true
00fdf4359e0a3f30f3a395cc135cd1a0bac16789
JavaScript
pontuslaestadius/portfolio
/archive/dungeon/script/objects.js
UTF-8
5,725
2.84375
3
[]
no_license
var enemy = []; var e = 0; var player = []; var p = 0; var cannon = []; var c = 0; function Player(x, y, w, h, v, transition, transitionSpeed, displayX, displayY, onload){ this.x = x; this.y = y; this.w = w; this.h = h; this.v = v; this.transition = transition; this.transitionSpeed = transitionSpeed; ...
true
bd5c3d1d2f72078993ab51111e8a50882284601f
JavaScript
metallivan/curso-practico-javascript
/taller2/descuentos.js
UTF-8
1,064
3.6875
4
[ "MIT" ]
permissive
// const precioOriginal = 100; // const descuento = 18; const calcularPrecioConDescuento = (precio, descuento) => { const porcentajePrecioConDescuento = 100 - descuento; const precioPorDescuento = (precio * porcentajePrecioConDescuento) / 100; return precioPorDescuento; }; const onClickButtonPr...
true
69bb18a41810a1f336de21f70eede4c4eeb1a33d
JavaScript
travistynes/testa
/js/Game/Enemy/Pip.js
UTF-8
12,172
2.9375
3
[]
no_license
/* The pip is a little guy that can be positioned and if shot and hit by a bullet, will act as a turret and begin firing at the thing that shot it. */ G.Enemy.Pip.Assets = { mesh: undefined // The mesh template }; // Add assets to be loaded by the asset manager. G.Enemy.Pip.Assets.register = function(mana...
true
b71956ba720f3020b35431c05c88b07ac1fc0d8a
JavaScript
HamsterKnight/node-learn
/1 charpter/1-3-fs模块/fs-readfile.js
UTF-8
437
2.84375
3
[]
no_license
const fs = require('fs') fs.readFile('./file.txt', 'utf-8' ,(err, data) => { console.log(data) }) const data = fs.readFileSync('./file.txt', 'utf-8') console.log('data', data) async function readFile() { const data = await fs.promises.readFile('./file.txt', 'utf-8') console.log('promise utf-8 data', da...
true
4bd5a08d4646df914062332e2753ad16a3ec190e
JavaScript
cy6erskunk/visual-map
/src/components/EditableNode/Node.js
UTF-8
2,663
2.8125
3
[]
no_license
import './Node.css'; function buttons(dispatch, parentId, length) { return ( <> <button onClick={() => dispatch({ type: 'add', data: { type: 'array', parentId, length }, }) } > {'[]'} </button> <button onClick={()...
true
b9100f2361025157641b4c5dba436ffb1b864f25
JavaScript
Mariotti7/JavaScript
/MeuRepositorio/node/pg_sequelize/JS/2_create.js
UTF-8
753
2.5625
3
[]
no_license
const db = require('./_database') async function createTables(){ try { await db.connect() await db.query(`CREATE TABLE produto( id serial PRIMARY KEY, nome VARCHAR (250) UNIQUE NOT NULL )`) await db.query(`CREATE TABLE cliente( id serial PRIMARY KEY, NOME VARCHAR (...
true
5f72ca4867982ad1d3a4045ff7774f0ea9dfe62c
JavaScript
yangfeng002/javascriptDemo
/shanpaoDemo/js/user_action/flow.js
UTF-8
7,119
2.734375
3
[ "MIT" ]
permissive
/* User flow */ d3.flow = function() { var flow = {}, nodeWidth = 0, // node宽度 nodePadding = 0, // node下边距 maxStep = 0, // 最大步数 maxValue = 0, // node最大值 firstStepCount = 0, heighScale = 0, // 高度比例 nodes = [], links = [], endScale = d3...
true
43da49398d31d4f3db64eb19b7460426bd3656d4
JavaScript
Aakashdeveloper/eveng_oct_react
/secondapp/src/components/lifecycle.js
UTF-8
851
3.328125
3
[]
no_license
// 1 Get default state // 2 set initila state // 3 before get created // 4 Render jsx // 5 After component mounted import React, { Component } from 'react'; class Lifecycle extends Component{ // 1 Get default state constructor(props){ super(props) // 2 set initila state this.state={ ...
true
8a97b05a43e8503e38a9684a915368fc333ef2e1
JavaScript
Assetbekov-Almar/rn-project3
/HackerNewsRN-master/src/screens/story/List.js
UTF-8
1,203
2.65625
3
[]
no_license
import React from 'react'; import { FlatList, View } from 'react-native'; import _ from 'lodash'; import Comment from './Comment'; const CHUNK_SIZE = 8; export class DummyList extends React.PureComponent { render() { return ( <View style={{ flex: 1 }}> {_.times(Math.min(this.props.items, 4), i => ...
true
ea8e6539d640523f4f9a48820915aa8b01f78841
JavaScript
johancastillo/count-regresive-js
/js/main.js
UTF-8
1,321
3.53125
4
[]
no_license
const main = () => { const getRemainTime = deadline => { let now = new Date(), remainTime = (new Date(deadline) - now + 1000) / 1000, remainSeconds = ("0" + Math.floor(remainTime % 60)).slice(-2), remainMinutes = ("0" + Math.floor(remainTime / 60 % 60)).slice(-2), ...
true
7e73c3945c2016e637f87373b525bed0cd7b2be8
JavaScript
mahmudajhumur/scientific_calculator
/sc.js
UTF-8
1,263
3.6875
4
[]
no_license
var screen = document.querySelector('#screen'); var btn = document.querySelectorAll('.btn'); /*============ For getting the value of btn, Here we use for loop ============*/ for (item of btn) { item.addEventListener('click', (e) => { btntext = e.target.innerText; if (btntext == '×') { ...
true
e936835d36d9213b247d1051e797001d86521e3b
JavaScript
KavithaChandran/cox-prescreen
/scripts/main.js
UTF-8
1,507
3.515625
4
[]
no_license
//-----Function to count the KeyValues----// //----CountValue button function----// function keyValueTotals() { //---Initialization of DOM variables and converting the value to lowercase---// let userInput = document.getElementById("keyValPairs").value.toLowerCase(); userInput = userInput.replace(/ /g, ""); le...
true
0508a38bca2b2a7892bc3e08c89e885e1d9f48f7
JavaScript
mannyxgarcia/sorting
/bubblesort.js
UTF-8
306
3.515625
4
[]
no_license
function bubbleSort(array) { /* your code here */ for (let i = 0; i < array.length; i++) { let currentValue = array[i] let nextValue = array[i+1] if (currentValue > nextValue) { let temp = nextValue array[i+1] = currentValue array[i] = temp } } return array }
true
3bdbe8a6c6728f3ef342321987d06515b1431602
JavaScript
mecsoccer/property-pro-lite
/UI/javascript/property-detail.js
UTF-8
928
2.640625
3
[ "MIT" ]
permissive
/* menu bar */ const menuButton = document.querySelector('.menu'); const menuBar = document.querySelector('.menu-drop-down'); menuButton.addEventListener('click', (event) => { menuBar.classList.toggle('on'); }); /* modal */ const modal = document.getElementById('myModal'); const modalCloseBtn = document.q...
true
23835f5e18f6bb4d40012e3dad3c30012471e065
JavaScript
hanyaning/nodeJS-Lesson
/NodeJS事件/dog.js
UTF-8
800
3.296875
3
[]
no_license
const events = require("events"); const EventEmitter = events.EventEmitter; function Dog(name,energy){ this.name = name; this.energy = energy; var that = this; EventEmitter.call(this); var time = setInterval(() =>{ if(that.energy >=0){ that.emit("bark"); that.energy--...
true
b86ec8340d31cec34e21b02d4f2108ccefecdffc
JavaScript
db-cyber/OcelotBOTv5
/commands/admin/steg.js
UTF-8
1,914
2.5625
3
[]
no_license
const axios = require('axios'); const fs = require('fs'); const child_process = require('child_process'); const Discord = require('discord.js'); module.exports = { name: "Steg Decode", usage: "steg <url>", commands: ["steg"], run: async function (message, args, bot) { let image = await bot.util....
true
7c79f2a1ee1bcefa6b365691d1e2f8775c351b8e
JavaScript
akki-12/gene_js
/js/main.js
UTF-8
3,879
3.375
3
[]
no_license
(function () { /* ---------------------- Variables y Objetos Generales --------------------- */ var app = document.getElementById('app'); var inputCaracteres = document.getElementById('numero-caracter'); var configuracion = { caracteres: parseInt(inputCaracteres.value), symbol: true, ...
true
5a11405c9341702204b08751750f5171738f8879
JavaScript
Edgar256/js-algorithms
/truncateString.js
UTF-8
909
4.0625
4
[]
no_license
/* Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a … ending. Note that inserting the three dots to the end will add to the string length However, if the given maximum string length num is less than or equal to 3, the...
true
c65d1acd3d5d69ef5fd0689590548602ed6a0a25
JavaScript
KalaiselvanSivakumar/Tutorial-Codes
/NodeJS/CodeBurst.io/TheOnlyNodeJSIntroduction/NodeNetwork/fileWatcher.js
UTF-8
680
2.640625
3
[ "MIT" ]
permissive
const net = require('net'), fs = require('fs'), filename = process.argv[2]; const server = net.createServer(function (connection) { console.log('Subscriber connected.'); connection.write(`watching ${filename} for changes`); // File watcher creation let watcher = fs.watch(filename, (err, data) =...
true
4113e5c6f0cedc2da18cb9386e768845a9e6fc16
JavaScript
jackysz/digits-recognition-tfjs
/web/model.js
UTF-8
1,077
2.90625
3
[ "Unlicense" ]
permissive
const width = 28; const height = 28; const MODEL_URL = 'http://localhost:5000/models/mnist/model.json' // const MODEL_URL = 'https://raw.githubusercontent.com/chench53/digits-recognition-tfjs/master/server/models/mnist/model.json' // on-line model var loadModel = (async function() { window.model = await tf.loadLa...
true
6016b17e69e930ed997c1dd34bb618be96bd918a
JavaScript
Jackdaw93/javascript
/balikKata.js
UTF-8
362
3.359375
3
[]
no_license
function balikKata(kata) { var msg = ''; for (var i = kata.length-1; i >= 0; i--) { msg = msg + kata[i] } return msg; /* Balik Kata Dengan Split dll return kata.split('').reverse().join('') */ } console.log(balikKata("Niomic!")); console.log(balikKata("JavaScript")); console.log(balikKata("alohahola"...
true
9fcc744af5ad272de6e97d2471184e636798a378
JavaScript
448022914/BackEndComponent
/autoComponent.js
UTF-8
1,414
2.984375
3
[ "MIT" ]
permissive
const path = require("path"); const fs = require("fs"); const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); fsExistsSync = name => { try{ fs.accessSync(__dirname+"/component/"+name,fs.F_OK); }catch(e){ return false; } return ...
true
fa22eef45e003135fd3bd0a4059b053e11f84353
JavaScript
ZhnZhn/weather-forecast
/src/components/zhn-charts/util/getEveryNthWithCondition.js
UTF-8
858
4.125
4
[ "BSD-3-Clause" ]
permissive
/** * Given an array and a number N, return a new array which contains every nTh * element of the input array. For n below 1, an empty array is returned. * If isValid is provided, all candidates must suffice the condition, else undefined is returned. * @param {T[]} array An input array. * @param {integer} n A numb...
true
e8277e124e769517d7b7cce6e05f47722c175c18
JavaScript
Wilsonruan/Note-Taker
/server.js
UTF-8
2,335
3.03125
3
[ "BSD-3-Clause", "MIT", "ISC" ]
permissive
// Sets up the Express app and Node.js var express = require("express"); var path = require("path"); var app = express(); var PORT = process.env.PORT || 8080; app.use(express.urlencoded({ extended: true })); app.use(express.json()); app.use(express.static(path.join(__dirname, 'public'))); const fs = require("fs") // ...
true
706839f873feacd5141bca195644d5d98b5ce38c
JavaScript
CMTV/youtube
/pug-full-course-2/Моя соцсеть/main.js
UTF-8
1,044
2.65625
3
[]
no_license
const fs = require('fs'); const pug = require('pug'); const age = require('./age'); let users = []; fs.readdirSync('users').forEach((filename) => { let id = filename.replace('.json', ''); let userData = JSON.parse(fs.readFileSync('users/' + filename, 'utf-8')); users.push({...{ id: id}, ...userData}); }...
true
a86a631ca4e44c37cbcf8136161066abcbc4f6c1
JavaScript
iMsubha/load-api-with-hooks
/src/components/User.jsx
UTF-8
1,173
2.890625
3
[]
no_license
import React, { useState, useEffect } from 'react'; import Userdetails from './Userdetails'; function User() { const [count, setCount] = useState(0) const [users, setUsers] = useState([]) useEffect(() => { fetch('https://jsonplaceholder.typicode.com/users') .then(res => res.json()) ...
true
a1537011ea8351043dfd8ec0a531aabc654fce72
JavaScript
opensourceBIM/BIMsurfer
/viewer/cesium/Core/VRTheWorldTerrainProvider.js
UTF-8
13,396
2.515625
3
[ "MIT" ]
permissive
import when from "../ThirdParty/when.js"; import Credit from "./Credit.js"; import defaultValue from "./defaultValue.js"; import defined from "./defined.js"; import DeveloperError from "./DeveloperError.js"; import Ellipsoid from "./Ellipsoid.js"; import Event from "./Event.js"; import GeographicTilingScheme from "./Ge...
true
56729f3f7c50286b6981da1f67ad3d116cb2fba9
JavaScript
HarshitaKhandelwal309/Practice_Javascript_Programs
/palindrome_number/basics.js
UTF-8
594
4.03125
4
[]
no_license
// var data = "tata"; // var splitString = data.split(''); // var rev_data = splitString.reverse(); // var realString = rev_data.join(''); // console.log(realString); // if(data == realString) // { // console.log("yes"); // } // else{ // console.log("no"); // } function palindrome(str) { const splitStri...
true
f575157c62b099ea9e1150742b35a2a0af7b00e5
JavaScript
synesthesiaproject/synesthesiaproject.github.io
/main.js
UTF-8
17,310
2.609375
3
[]
no_license
// JavaScript Document var audio = new Audio(); <!--BUTTONS--> document.querySelector('#yellow').addEventListener( 'click', makeAudioHandler('soundbutton/yellow.mp3') ); document.querySelector('#black').addEventListener( 'click', makeAudioHandler('soundbutton/black.mp3') ); document.querySelector('#grey').ad...
true
acdd1493950c6833dc0adbfb5c37ecd37c8beeda
JavaScript
teddyhoo/LeashTimeGen2
/archive/leashtime-modify-event.js
UTF-8
2,487
3.453125
3
[]
no_license
// Create calendar when document is ready $(document).ready(function() { // We will refer to $calendar in future code var $calendar = $("#calendar").fullCalendar({ // Start of calendar options header: { left: 'prevYear,nextYear', center: 'title', right: 'today,month,agendaDay,agendaWeek prev,next' }, // Make...
true
041260b91f7a6bc0f7a1b1b9b4c8eb6d71128754
JavaScript
dyunasjk/Node.js
/Javascript/Hash.js
UTF-8
545
2.59375
3
[]
no_license
const crypto = require('crypto'); const algorithm = 'aes-256-cbc'; const key = 'abcdefghijklmnopqrstuvwxyz123456'; console.log( 'base64: ', crypto.createHash('sha512') // 사용할 해시 알고리즘을 선택하여 crypto 객체생성 .update('암호화할 문자열') // 암호화 .digest('base64')); // base64로 엔코딩 처리 문자열~~~~ ==에서 ==이 base64마지막 부분...
true
f033c453acdf03ce4c3f96b92f782808c18e2678
JavaScript
jmx164491960/bg-vue-components
/src/utils/localStorage.js
UTF-8
3,013
2.96875
3
[]
no_license
/** *Created by 夜雪暮歌 on 2018/3/12 **/ // 操作localStorage相关api export default { age: 0, // 初始化时存过期时间 maxAge(age) { // 将传入的天数转为时间戳 const time = age * 24 * 60 * 60 * 1000 this.age = time return this }, // 存储 顺便存时间戳 set(name, json, hasExpire) { // localStorage.removeItem(name) // !Array...
true
56c3047bae7188ccb0126fbeb1b95d0e9df4d588
JavaScript
Pillar-song/jsketcher
/modules/workbenches/routingElectrical/features/autoRoute/pathFinderLogic/js/digraphs/digraph.js
UTF-8
1,805
3.265625
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
export class GraphNode { constructor(id) { if (id == null) { throw "Null id"; } this.id = id; this.weights = []; this.neighbourIds = []; this.edgeIds = []; // Note: edgeIds is an optional additional information about edges, not important for processing this.numberOfEdges = 0; }...
true
1e6225b20588811a8fd7565e2f2fbc5119c38da2
JavaScript
marcopetry/alugaCar
/src/Firebase/ApiBanco.js
UTF-8
8,843
2.796875
3
[]
no_license
import firebase from './Firebase' export default class Banco { static criarUsuario(email, senha) { firebase.auth().createUserWithEmailAndPassword(email, senha) .then(() => { Banco.login(email, senha); }) .catch((erro) => { ...
true
e37c6825364bdfbfd44763be534847f7474a8359
JavaScript
nowLetsgo/nice0721
/day02/01.面试题1.js
UTF-8
616
3.828125
4
[]
no_license
//1 2 10 5 6 8 9 3 const p1 = () => (new Promise((resolve, reject) => { console.log(1); let p2 = new Promise((resolve, reject) => { console.log(2); const timeOut1 = setTimeout(() => { console.log(3); resolve(4); }, 0) resolve(5) }) resolve(6); ...
true
00145bde765c88b4ee5966ac923a0cf5d5da21af
JavaScript
diegoandino/Fixr
/public/js/app.js
UTF-8
2,123
2.828125
3
[]
no_license
document.addEventListener("DOMContentLoaded", event => { const app = firebase.app(); console.log(app); }); function googleLogin() { const provider = new firebase.auth.GoogleAuthProvider(); provider.addScope('https://www.googleapis.com/auth/contacts.readonly'); firebase.auth().signInWithPopup(prov...
true
1774b7daabc09ba874ae9b51b9eba97177cc0069
JavaScript
BorislavIvanov/Telerik_Academy
/02. Web Development/05. JavaScript OOP/01. Functions and Function Expressions/01. ModuleForDOM/dom-module.js
UTF-8
1,913
2.84375
3
[]
no_license
var domModule = (function () { var MAX_FRAGMENT_SIZE = 100; var fragmentsBuffer = {}; // only private use function createElement(tagName, innerHTML) { var child = document.createElement(tagName); child.innerHTML = innerHTML; return child; } function addDomElement(tag...
true
14fc56f2fda6755eaa7a6ef922e38859164b54e8
JavaScript
alissonbcc89/modulo1EsQ4
/bundle.js
UTF-8
446
3.109375
3
[]
no_license
"use strict"; var empresa = { nome: 'Rocketseat', endereco: { cidade: 'Rio do sul', estado: 'SC' } }; var nome = empresa.nome, estado = empresa.endereco.estado, cidade = empresa.endereco.cidade; console.log(nome); console.log(estado); console.log(cidade); var usuario = { nome: 'Alisson', idad...
true
2f2f5244b1c2d23a60596ef7eed18f3b10b52e6e
JavaScript
L4ilah/tic-tac-toe
/src/index.js
UTF-8
5,456
2.875
3
[]
no_license
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; function Square(props) { return ( <button id={props.id} className="square" onClick={props.onClick} > {props.value} </button> ); } class Board extends Reac...
true
4140ecba27617fd23a3b8cc4f4a1a38b38451734
JavaScript
Keji-so/signup-app
/backend/routes/router.js
UTF-8
1,123
2.78125
3
[]
no_license
const express = require('express') const router = express.Router() //import router from express const signUpTemplateCopy = require('../tables/SignUpTables') // import table created with mongoose, this is needed to collect the info submitted const bcrypt = require('bcrypt') //used to hide password router.post('/signup...
true
232da4ea12b3c7dcf774b75d34f429cd47ca40cb
JavaScript
belsrc/fjp
/source/monads/IO/index.js
UTF-8
488
2.921875
3
[ "MIT" ]
permissive
import isFunction from './../../util/isFunction'; class IO { constructor(effect) { if(!isFunction(effect)) { throw new Error('effect needs to be a function'); } this._effect = effect; } static of(val) { return new IO(() => val); } static from(fn) { return new IO(fn); } map(f...
true
d50914f3a921ae81ba4ce3eb6e4f8ec8625bb0b2
JavaScript
sillyslux/it-events-croatia
/admin-js/home.js
UTF-8
2,955
2.703125
3
[]
no_license
// modules/About.js import React from 'react' import { Link } from 'react-router' import activeComponent from 'react-router-active-component' const NavLink = activeComponent('li', {activeClassName: 'diabled'}) const data = fetch("../data/09-2016.json") .then( res => res.json() ) .then( data => { // console.lo...
true
761ad7b65ba48538c8289ad71d4034af69cc4d32
JavaScript
yuanyuzhangyyz/observerPattern
/mySrc/TeacherObserver.js
UTF-8
554
2.9375
3
[]
no_license
import {store} from "./Store.js"; export default class TeacherObserver{ constructor(name){ this.name = name; store.addEventListener("observerUpdate",event=>{ const newCourses = event.detail; let element = document.getElementById("teacher") element.inn...
true
d8b539416dd4b09cb4fa150c7c1d53d23bc86d76
JavaScript
kgryte/d3-chart-generators
/client/charts/area/scripts/script.js
UTF-8
1,638
2.6875
3
[ "MIT" ]
permissive
(function ( d3 ) { 'use strict'; var area, simFLG = false, width, height, labels; // Get the chart dimensions: width = parseInt( d3.select( '.chart' ).style( 'width' ), 10 ); height = parseInt( d3.select( '.chart' ).style( 'height' ), 10 ); // Instantiate a new area chart constructor: area = new...
true
0385cc3205d8f7a2df1d0ee8957f9449bc6f5a70
JavaScript
JacobLeonLyerla/HTTP-AJAX
/friends/src/components/Friend.js
UTF-8
2,630
2.828125
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; class Friend extends Component { constructor(){ super() this.state={ name:'', age:'', email:'', } } // showUpdatedFriend =() =>{ // this.setState({showUpdatedFriend: !thi...
true
d83e8478f650a94577793b3e6516429ce76754ec
JavaScript
nbdhirwani/Weather
/src/main/webapp/app/app.js
UTF-8
2,380
2.640625
3
[]
no_license
var app = angular.module('weatherApp', []); app.controller('WeatherController', ['$scope', 'WeatherService', 'CityService', function ($scope, WeatherService, CityService) { CityService.getAllCities( function (data) { $scope.cities = data; $scope.currentCity = $scope.cities[0]; ...
true
1f9318e46d14cbf418921f239797529503ecad94
JavaScript
carlosrojaso/Startupers
/admin/signup.js
UTF-8
503
2.828125
3
[ "MIT" ]
permissive
(function () { function register(email,password){ console.log("info:" + email + " " + password); firebase.auth().createUserWithEmailAndPassword(email, password). catch(function(error) { // Handle Errors here. console.log("Error Code: " + error.code + " Error message: " + error.message); var errorCode = error.cod...
true
386102707b9627575ab82c02d0e69235016ed6ee
JavaScript
ericlobdell/redux-data-service
/dist/Utils/Lodash.test.js
UTF-8
2,162
2.515625
3
[ "MIT" ]
permissive
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Lodash_1 = require("./Lodash"); var faker_1 = require("faker"); var _a = intern.getPlugin("interface.bdd"), describe = _a.describe, it = _a.it, beforeEach = _a.beforeEach; var expect = intern.getPlugin("chai").expect; describe("Lodash FP",...
true
2764b102fa9c7ab53a0655fb5ec65399d272e4f6
JavaScript
brunoguerra/cssjs
/gallleryBitwise/jquery.galleryBitwise.js
UTF-8
2,363
2.5625
3
[]
no_license
var bw_galleries = new Array(); (function($) { $.GalleryBitwonWise = function(g, r, l, thumbs) { var defaults = { animate_time: 500 }, pages, current=1, elements, width, steps; elements = $('ul li', thumbs); width = elements.last().offset().left + elements.last().outerWidth() - elements.f...
true
adbc6e8ff24e42513b7f97d4c437d5fa81799c74
JavaScript
chend99/appmobile-dv
/guia-js/2)metodos-arrays/ejercicio5.js
UTF-8
330
3.546875
4
[]
no_license
/*5- Define la función aprobó, que dada la lista de las notas de un alumno devuelve si el alumno aprobó. Un alumno aprobó si todas sus notas son mayores o iguales a 4*/ function aprobo(notasAlumno){ var notaAprobacion = 4; return notasAlumno.every(elem => elem>=notaAprobacion); } console.log(aprobo([8,6,2,...
true
9c82075b608a84752a0aeeb9683f3a1baaaf1c17
JavaScript
LuisDGracia/social-dashboard
/src/Components/OverViewContainer/OverViewContainer.js
UTF-8
2,110
2.59375
3
[]
no_license
import React, { Fragment } from 'react'; import { OverViewText, OverviewContainer, OverviewInfo, BrandText, H2, OverViewCaret } from './OverViewStyle'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; function OverView({ networks }) { let text = "Views"; let conversion = "0"; const valueHandle...
true
c7963e932c9b616fe684d5f8a79d9b42edfbe0a9
JavaScript
cvevera/FriendFinder
/app/routing/apiRoutes.js
UTF-8
1,322
2.671875
3
[]
no_license
var friendsData = require("../data/friends") module.exports = function(app) { app.get("/api/friends", function(req, res) { res.json(friendsData); }); app.post("/api/friends", function(req, res) { var match = { name: "", photo: "", difference: 50 }; ...
true
222aec906107589ec72beffb053b429dd3974c23
JavaScript
zjh1994/Full-Stack-Notes
/code/ES6/src/05_destructuring/03_mixed_destructuring.js
UTF-8
301
2.78125
3
[]
no_license
let node = { type: "Identifier", name: "foo", loc: { start: { line: 1, column: 1 }, end: { line: 1, column: 4 } }, range: [0, 3] }; let { loc: {start}, range: [startIndex] } = node; console.log(start.line); // 1 console.log(start.column); // 1 console.log(startIndex); // 0
true
6bb7f94fe72c4ff1ab77f417ae17749dd66c63b3
JavaScript
vmolchanov/Auth
/public/js/signup.js
UTF-8
3,845
2.984375
3
[]
no_license
(function () { var form = document.querySelector(".signup-form"); var submit = form.querySelector("input[type=submit]"); var name = form.querySelector(".signup-form__person-name label + input"); var surname = form.querySelector(".signup-form__person-surname label + input"); var email = form.queryS...
true
2fb99708c3674b110a4973cf77e6c24ff83bf23a
JavaScript
captain-noob/Photogram
/upload/static/js/upload.js
UTF-8
1,165
2.640625
3
[]
no_license
submitOK = "true"; function preview_image(event) { var reader = new FileReader(); reader.onload = function(){ var output = document.getElementById('output_image'); var bg = document.getElementById('bg'); var img=document.getElementById('a'); var fileinp=a.value; ...
true
48fc84447f5b20d2521276e125f506cf7d504044
JavaScript
msolters/chroma-google-assistant
/google-function.js
UTF-8
2,225
3.09375
3
[]
no_license
// Imports the Google Cloud client library const {PubSub} = require('@google-cloud/pubsub'); const http = require('https'); // Your Google Cloud Platform project ID const projectId = process.env.GCP_PROJECT_ID; // Instantiates a client const pubsubClient = new PubSub({ projectId: projectId, }); // Publish a pubsub...
true
ca152fa5068695567d19455618f85e922e36a8e5
JavaScript
thejensen/romanNumerals
/benchmarking.js
UTF-8
1,698
3.671875
4
[ "MIT" ]
permissive
//UI Logic... $("form").submit(function(event){ event.preventDefault(); $("#results").text(romanize($("#userNumber").val())); }); //Backend Logic... function romanize(aNumber){ var romanNumber=""; var count=0; if (aNumber <= 3999) { for(var i=1;i<=parseInt(aNumber/1000);i++) { romanNumber+="M"; ...
true
f8413d0aa5a085e8782f194e31721b7e9c5a736c
JavaScript
xslim/iOS-Mappers-Tests
/js/mapper.js
UTF-8
1,330
3.015625
3
[ "MIT" ]
permissive
function mapJSON2Object1(json, object, mapping) { var obj; if (typeof object == 'string') { try { obj = new this[object](); } catch (err) { try { obj = this[object].new(); } catch (err2) { console.log('ERR1: '+err+', ERR2: ...
true
6620ea4da134fc1054dba6b8676de8229c66b040
JavaScript
benk691/hackathon
/static/board.js
UTF-8
3,872
3.046875
3
[]
no_license
paper.install(window); //initialize socket var socket = io.connect('http://localhost:8080'); //======================================================================= //Functions to change the brush variables //======================================================================= var brushColor = 'black';//Default...
true
75e926930aab904f58c0e08a9c098b621ce815d1
JavaScript
CrossNJU/Languist
/src/servers/test/learn.js
UTF-8
227
3.03125
3
[ "MIT" ]
permissive
/** * Created by raychen on 16/7/12. */ let a = 10; //console.log(a); console.log(Math.max(...[9,2,4])); function* hello(){ yield 'hello'; yield 'world'; return 'end'; } var out = hello().next(); console.log(out);
true
ac3c065970c57c94c32e1d4dbdd62d7fdb18660b
JavaScript
SebastianLF/pongo
/public/js/pages/getPaginationSelectedPage.js
UTF-8
334
2.5625
3
[ "MIT" ]
permissive
function getPaginationSelectedPage(url) { var chunks = url.split('?'); var baseUrl = chunks[0]; var querystr = chunks[1].split('&'); var pg = 1; for (i in querystr) { var qs = querystr[i].split('='); if (qs[0] == 'page') { pg = qs[1]; break; } } ...
true
d55c226c91446859c85e5403241986ab5023f598
JavaScript
Rashid-Ali-N/vschool-assignments
/exercises/eventListeners/mouseover.js
UTF-8
251
3.140625
3
[]
no_license
const cordBox = document.getElementsByClassName('red-box') var x = document.clientX; var y = document.clientY; var coor = "X coords: " + x + ", Y coords: " + y; document.addEventListener('mouseover', function(){ cordBox.innerHTML = coor; })
true
d658415b1437ae30e12b7cb63099da5fb7e559cb
JavaScript
thaskoo/spaza-app
/test/productsSold-test.js
UTF-8
4,250
2.71875
3
[]
no_license
var assert = require("assert"); var productList = require("../productList"); var products= require("../productsSold"); it('should return a unique list of product in the file synchronously', function(){ var productLines = productList.linesInFiles("./files/Nelisa Sales History.csv"); asse...
true
b63e8e23c7ac30a96831a21c5dc5cb8abff48766
JavaScript
angelw22/NM2207
/appscripts/main.js
UTF-8
24,352
2.8125
3
[]
no_license
require( // Use this library to "fix" some annoying things about Raphel paper and graphical elements: // a) paper.put(relement) - to put an Element created by paper back on a paper after it has been removed // b) call element.addEventListener(...) instead of element.node.addEventListener(...) ["....
true
d37840b6a5c244a19fdd26f53a3e66b7f49cc133
JavaScript
albertfougy/js-kata-prep
/module1/isPersonOldEnoughToDrive.js
UTF-8
182
3.546875
4
[]
no_license
const isPersonOldEnoughToDrive = person => person.age >= 16 ? true : false; const obj = { age: 16 }; let output = isPersonOldEnoughToDrive(obj); console.log(output); // --> true
true
dac6c33da303023908b6151335fd6b2f96805401
JavaScript
kushagrabansal/CalculatorApp
/script.js
UTF-8
878
3.78125
4
[]
no_license
var flag = 0; var num1 = ''; var num2 = ''; var op = ''; function myFun(a) { if (flag == 0) { num1 = num1 + a; document.getElementById("expression").innerHTML += a; } if (flag == 1) { num1 = Number(num1); num2 = num2 + a; document.getElementById("expression").innerH...
true
86b9e33e9955e087c80006aae3637c4f5fa7d415
JavaScript
raiprograming/t-shirt-selling-with-MERN-stack
/projfrontend/src/admin/helper/adminapicall.js
UTF-8
3,039
2.609375
3
[]
no_license
import API from "../../backend" //category calls export const createCategory=(userId,token,category)=>{ return fetch(`${API}/category/create/${userId}`,{ method:"POST", headers:{ Accept:"application/json", "Content-Type":"application/json", Authorization:`Bearer $...
true
f986e8d98d951b1ed844e127a1eaea5963016e2f
JavaScript
fablee/main
/jquery-active.js
UTF-8
280
2.546875
3
[]
no_license
//Active menu jQuery.setnav = function setNavigation() { var path = window.location.pathname; $('.box.box-mnu a').each(function() { var href = $(this).attr('href'); if(path.substring(0, href.length) === href){ $(this).addClass('active'); } }); }; $.setnav();
true
2ecbda636d3568db01a64dd8068fe25991b7fcb7
JavaScript
Jaymin610/Quote-JN
/src/index.js
UTF-8
1,718
3.0625
3
[]
no_license
import "./styles.css"; const quoteContainer = document.getElementById("quote-container"); const quoteContent = document.getElementById("quote-content"); const quoteText = document.getElementById("quote-text"); const quoteAuthor = document.getElementById("quote-author"); const twButton = document.getElementById("tw-btn...
true
cbc23fbf253f1dbb77121002aa900adaba606069
JavaScript
weishaoqiang/threeJS_develop
/src/utils/commenWebGL.js
UTF-8
877
2.59375
3
[]
no_license
import * as THREE from 'three' const CommentWebGL = function() { this.scene = null this.camera = null this.controls = null } CommentWebGL.prototype.initCanvas = function (dom) { try { if (!_isDOM(dom)) { throw new Error('dom is not a HTMLElement') } const width = dom.offsetWidth, height = do...
true
43fdcdbbf7f81370b3e5bf41a787e3b159abdbf7
JavaScript
bcbcb/web-historian
/web/http-helpers.js
UTF-8
1,776
2.5625
3
[]
no_license
var path = require('path'); var fs = require('fs'); var archive = require('../helpers/archive-helpers'); var self = this; exports.sendResponse = function(res, data, statusCode, contentType){ if(contentType){ headers['Content-Type'] = contentType; } res.writeHead(statusCode, self.headers); res.end(data.toSt...
true
f603987f53e576729b8256873f004294f730f14f
JavaScript
cocokaleel/Musk-Simulator
/main.js
UTF-8
595
2.71875
3
[]
no_license
//sets up canvas var canvas = document.getElementById('mainCanvas'); var context = canvas.getContext('2d'); //called on load of HTMl function Pause(){ GAME.paused = true; GAME.gravity = 0; ROCKET1.thrusting=false; ROCKET1.rotating=false; GAME.savedXVel = ROCKET1.xvel; GAME.savedYVel = ROCKET1.yvel; ROCKE...
true
af756541add9f5660d33e42bc27562ad20b94564
JavaScript
SilviaJulian/Laravel_5.7
/public/js/generales/salir.js
UTF-8
2,416
2.828125
3
[ "MIT" ]
permissive
/** * Js Salir, para brindar funcionalidades JSON desde / hacia el servidor. * Software Gestion de movilidad© * @author Ing.Luis Alberto Pérez González. * @version 1.0 * @package js * @final */ /** * Variable publica que contiene la respuesta del servidor. * @var {JSON} */ var jsonRespuesta = null; /** * V...
true
adfec3fa560ac909f834c4284a923e209f167853
JavaScript
kevniu/tic-tac-toe
/application.js
UTF-8
6,773
3.203125
3
[ "MIT" ]
permissive
$(document).ready(function() { var win = false; var playerTurn = 1; var board = [ ["0", "0", "0"], ["0", "0", "0"], ["0", "0", "0"], ] function isOdd(num) { if (num % 2 == 1) { return true; } else { return false; } } ...
true
c1edead6ba38e6d8216f50741a71f05eb36c102f
JavaScript
bvmCoder/Data-Visualization
/clientSide/graphOperations/resetVisualization.js
UTF-8
962
2.625
3
[]
no_license
const networkGenerator = require('../graphOperations/generateGraph'); const errorNotifier = require('../viewHelpers/errorNotifier'); /** * Calls generate graph with all the cell and link info stored on the client side. * On a failure displays alert to the user. * @param container - The container object used as ...
true
1da2f679f6df15af0a2b730eabf8a2307b6df50a
JavaScript
itshui3/team-builder
/src/App.js
UTF-8
1,486
2.53125
3
[]
no_license
import React, {useState} from 'react'; import {Route} from 'react-router-dom'; import {TeamList} from './data/TeamList'; import Form from './components/Form'; import RenderTeam from './components/RenderTeam'; import './App.css'; function App() { const [teamList, setTeamList] = useState(TeamList); const [memberT...
true
c980a934e9a35df263d573dc659af663616c9eec
JavaScript
sojinleej/weather-app
/geocode/geocode.js
UTF-8
1,177
3.28125
3
[]
no_license
const request = require('request'); var geocodeAddress = (address, callback) => { var encodedAddress = encodeURIComponent(address); // console.log(argv); // debug // check the connectivity and handle the errors request({ url: `https://maps.googleapis.com/maps/api/geocode/json?address=${encodedAddress}`, json: tr...
true
a5afa51aec5b7d78aa77db24f1af7db3acbe402c
JavaScript
Tejaswini-Ekkaldevi/JSExercises
/Map-1/mapAB4.js
UTF-8
647
4.1875
4
[]
no_license
// 9> Map-1 -- mapAB4 // Modify and return the given map as follows: if the keys "a" and "b" have values that have different lengths, then set "c" to have the longer value. If the values exist and have the same length, change them both to the empty string in the map. function mapAB4(someMap){ if (someMap.has("a") ...
true
26f7c419733bc2d09eff559306099341f858d7ab
JavaScript
visakhvijayasree/node-web-express
/src/utils/forecast.js
UTF-8
671
2.640625
3
[]
no_license
const request = require('request') const forecast = (latitude, longitude, callback) => { const url = `http://api.weatherstack.com/current?access_key=c0e7ac185a8b2fb66675d5abc6e373d8&query=${latitude},${longitude}`; // http: //api.weatherstack.com/current?access_key=c0e7ac185a8b2fb66675d5abc6e373d8&query =-71....
true
a69bfc6af6924e08af8926af5014e739b44314ac
JavaScript
emilyusa/React-Apps
/AddressProxy/src/ElfDebugEnzyme.js
UTF-8
1,342
2.671875
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; export default class ElfDebugEnzyme { constructor(showData=false, callerName = '') { this.showData = showData; this.callerName = callerName + ':\n'; } display(value) { console.log(this.callerName + value); } getAll(wrapper, showM...
true
3106f41a16a21c90e9d900e8f89af74fe9648779
JavaScript
EllaGoncharenko/test
/src/js/constant.js
UTF-8
439
2.90625
3
[]
no_license
const $ = require('jquery'); const a = 'Hello, Ella'; const b = 'Hello, Baby'; function hello() { return (`${a} ${b}`); } hello(); function ShowMeTheHello() { const second = hello(); $('#second').html(second).css({ color: 'black', cursor: 'pointer', 'font-size': '14px' }); } ShowMeTheHello(); function Colo...
true
bcadcbdd5462a751cc821b8561199874a917d000
JavaScript
LLNL/llnl.github.io
/js/visualize/largeRepos/sunburst_licenses.js
UTF-8
13,305
2.5625
3
[ "MIT" ]
permissive
/* Creates a zoomable sunburst visualization for webpage */ function draw_sunburst_licenses(areaID) { // Load data file, process data, and draw visualization var url = ghDataDir + '/intReposInfo.json'; var files = [url]; Promise.all(files.map(url => d3.json(url))).then(values => drawSunburst(values[0], ...
true
6b221ae4a11cf32c6ef76e7df5ce49ec68218fd9
JavaScript
oliwynn/hybridintegration
/public/main.js
UTF-8
2,805
2.65625
3
[]
no_license
var app = new Vue({ el: '#app', data: { products: [{ name: "" }, { name: "" }, { name: "" }, { name: "" }, { name: "" }, { name: "" }, { name: "" }, { n...
true
1eb4afed666c7029fc07be461e68b6410af677d7
JavaScript
folukeOpenuni/js-exercises
/week-3/E-array-map/exercise.js
UTF-8
721
4.875
5
[]
no_license
// Using the .map() method, create a new array with `numbers` multiplied by 100 // Write multiple solutions using different syntax (as shown in the README) var numbers = [0.1, 0.2, 0.3, 0.4, 0.5]; function multiplyByhundred(num) { return num * 100; } var newNumber = numbers.map(multiplyByhundred); var numMultiply...
true
ae60be636bc05b17f8ebcaf8e02588f9be349e90
JavaScript
war97man/Angular-Sidebar
/scripts/components/todo.component.js
UTF-8
716
2.546875
3
[]
no_license
angular.module('Sidebar') .component('todoComponent', { templateUrl: 'templates/todo.template.html', controller: todoCtrl, }) function todoCtrl() { var self = this; self.taskList = []; self.editMode = false; self.pushTask = function(task) { if(task && !self.taskList.includes(task)) { ...
true
b03e9a425c0566b449ea08c46bf3e8e347ec3361
JavaScript
Daniel-OC/frontend-mod-1-prework
/section2/exercises/comparisons.js
UTF-8
6,920
4.6875
5
[]
no_license
/* In the exercises below, write your own code where indicated to achieve the desired result. One example is already completed. Your task is to complete any remaining prompt. Make sure to run the file with node in your command line. Look back at the directions from Section 1 if you need a refresher on how to do that....
true
7585c06a431da9e62faac0bf6f15c613491bb88d
JavaScript
ivycheung7/Games101
/resources/js/common.js
UTF-8
187
3.25
3
[]
no_license
var increment = (function(){ var counter = 1; return function(){return counter += 1;} })(); function click(){ document.getElementById("clickCount").innerHTML = increment(); }
true
e3244fa8ea4477b75624ac0762afd4d8b90a7fdd
JavaScript
pdsan97/Workday-Agenda
/script.js
UTF-8
1,248
3.078125
3
[]
no_license
let today = moment().format('MMMM Do YYYY'); let dayOfWeek = moment().format('dddd'); let thisHour = moment().hour(); window.onload = function() { loadPlans(); moment().format(); document.getElementById("current-day").textContent = (dayOfWeek + ' ' + today); setInterval(function() { changeBoxColors(); ...
true