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
712af0779493224acb3f34ae64ecd009eb3f5463
JavaScript
Maple0922/vue-axios
/src/js/insertImage.js
UTF-8
143
2.640625
3
[]
no_license
// insert image export default function insertImage(className,url){ const img = document.querySelector('.' + className); img.src = url; }
true
58cdbebb498e123f90b9218b06ddb00dfefc1ca7
JavaScript
EhevuTov/node-test-objectStream
/producerStream.js
UTF-8
567
3.1875
3
[]
no_license
// produces streamable objects of numbers var util = require('util'); var Readable = require('stream').Readable; util.inherits(produceStream, Readable); // our readable stream that pushes out objects function produceStream(options) { if (!options) { options = {}; } options.objectMode = true; Readable.call(this, ...
true
2047e799924f80378f8a9f923b88bf7edfe7016c
JavaScript
opentoken-io/opentoken
/lib/email/log.js
UTF-8
607
2.703125
3
[ "MIT" ]
permissive
"use strict"; /** * @param {opentoken~logger} logger * @param {opentoken~promise} promise * @return {opentoken~email} */ module.exports = (logger, promise) => { /** * Pretends to send an email using a template and additional data. * * @param {string} recipient * @param {string} subject ...
true
624e3268c0f90e8578d8ac8e6f813e3679b0532b
JavaScript
Jadujobs/javascript-basics
/variables.js
UTF-8
1,584
4.375
4
[]
no_license
// Variables console.clear(); // Integers and Floats // 123, 3.14 var number = 90; var pi = 3.14; var numberPi = number + pi; console.log(number); console.log(numberPi); console.log(pi); // Strings var firstName = "Arsalan"; var lastName = "Khattak"; var fullName = firstName + " " + lastName; console.log(firstName...
true
bae4f138ea6c22a982243b6a90e7fad070c7901b
JavaScript
fridahkalimi/frestus
/script.js
UTF-8
2,794
2.59375
3
[]
no_license
window.onload = checkpage(window.location.href); function checkpage(url){ if(url.split('/').pop() == 'home.html'){ document.getElementById('searchBus').addEventListener('click', function(){ var fLctn = document.getElementById('lv-ltn').value; var lLctn = document.getElementById('ar...
true
ec8f715fe69909f2162e5e8175a6f36c817fd4f0
JavaScript
mebble/yaray
/src/effectiveDebt.js
UTF-8
553
2.609375
3
[ "MIT" ]
permissive
const fromentries = require('fromentries'); const { roundTwoPlaces } = require('./utils'); module.exports = debtGraph => { const result = new Map(); for (const { from, to, amount } of debtGraph) { const fromDebt = result.has(from) ? roundTwoPlaces(result.get(from) + amount) : a...
true
6a4daf3f42539dcffa4ce612a13ab9dad93b00e1
JavaScript
LeaX-XIV/LeaX-XIV.github.io
/js/clock-mobile.js
UTF-8
2,304
3.140625
3
[]
no_license
let canvas; let fps = 30; let w = 640; let h = 360; let clockOutline; let seconds; let minutes; let hours; // To limit analogic drift. let prevSc; let framesPerMinute; let startAngleSc; let startAngleMn; let startAngleHr; let speedAngleSc = 360 / 60; // 2 seconds to complete round. let speedAngleMn = 360 / 120; //...
true
51417ed6fd70b970df639723d139c821aa48d741
JavaScript
jackrobinrye/js-advanced-functions-introduction-to-map-and-reduce-lab-online-web-pt-081219
/index.js
UTF-8
1,549
4.0625
4
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Map Methods // Remember, all map methods return a new Array // mapToNegativize(sourceArray) function mapToNegativize(arr) { const newArr = []; let n = 0; arr.forEach(element => { n = element * -1; newArr.push(n); }); return newArr } // mapToNoChange(sourceArray) function mapToNo...
true
0e7f007aa03ece89fd5861ce8eba7c9a64479c9e
JavaScript
Muosvr/WatchAndCode
/V5.js
UTF-8
1,120
3.578125
4
[]
no_license
//.displayTodos should show .todo text //.displayTodos should tell you if todo list is empty //.displayTodos should show .completed var todoList = { todos: [], displayTodos: function() { if (this.todos.length === 0){ console.log("Todo list is empty"); }else { for (i = 0; i<this.todos.leng...
true
d406599f587d4a55a99ea45aa29028bf5cda5ee3
JavaScript
IlliaSushko/hw
/src/project_v.2/components/utils.js
UTF-8
502
3
3
[ "MIT" ]
permissive
export const createNode = ( type = 'div', classNames = [], styles = {}, children ) => { const node = document.createElement(type); classNames.forEach(className => node.classList.add(className)); for (let style in styles) { node.style[style] = style[styles]; } if (!children...
true
50ca109f421ce930e294d78d0e0f43df5831de3a
JavaScript
Sujung-Kim-93/JavaScript_mini_proj
/04_animated-navigation/script.js
UTF-8
1,263
3.046875
3
[]
no_license
const overlay = document.getElementById("overlay"); const menuBars = document.getElementById("menu-bars"); const nav = document.getElementById("nav"); const menuItems = nav.children; //toggle function toggle() { // toggle: 메뉴바 열고닫기 menuBars.classList.toggle('change'); // toggle: menu active overlay.cl...
true
0e6bf2c8ea13ef22f303a38732af1c850b256c04
JavaScript
Nagalakshmi-96/Javascript
/Scripts/Main.js
UTF-8
337
3.03125
3
[]
no_license
function changeDropDownStyle() { var sel=document.getElementsByClassName("customSelect"); for(var j=0;j<sel.length;j++) { console.log(sel[j]); sel[j].onfocus=function() { this.classList.add("selectIconRotated"); } sel[j].onblur=function() { this.classList.remove("selectIconRotated"); } } } chang...
true
c32c65b7f5f3cad8d28d31a68c48dd32d7e4b6f3
JavaScript
MaxKalinin92/LinkStorage
/server/controllers/itemController.js
UTF-8
1,962
2.609375
3
[]
no_license
const { ControllerBase } = require('./controllerBase') class ItemController extends ControllerBase { constructor(itemLogic) { super() this.itemLogic = itemLogic } async addItem(email, url) { try { const items = await this.itemLogic.addItem(email, url) if (items instanceof Array) { ...
true
4b268528a2d832a23f2294f4a6c8296516fd4807
JavaScript
arbyte-br/Arbyte-Atividades
/turma-1/davipanico/Lista_9/E6.js
UTF-8
283
2.78125
3
[]
no_license
/* Escolha um programa que você já fez em atividades passadas e faça o output do terminal ficar colorido com o pacote CHALK: ​https://www.npmjs.com/package/chalk */ // ESSA ATIVIDADE FICA POR SUA CONTA, USE SUA CRIATIVIDADE E FAÇA ALGO MUITO IRADO COM VARIAS CORES.
true
2c981b8aeaeca816e6d3cfc3239b9ab626325f72
JavaScript
Nox911/zeros
/src/index.js
UTF-8
728
3.46875
3
[ "MIT" ]
permissive
module.exports = function getZerosCount(number) { let zeros_of_five=0; let zeros_of_two=0; factorial (number); //calculate whole number of five function five (num) { if (num>=5) { return parseInt(num/5)+five(parseInt(num/5)); } else { return 0; ...
true
2593201b0b6f5f35fd15a4ba27ecf9d0aa3e7c39
JavaScript
AlekhyaPatnam/socialnetworkingbc
/app.js
UTF-8
1,437
2.65625
3
[]
no_license
const express = require('express'); const app = module.exports = express(); const bodyParser = require('body-parser'); const cors = require('cors'); app.use(cors()); // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })); // parse application/json app.use(bodyParser.json()); ...
true
39f1bc8a2e23a47d0107a845024935926a325d65
JavaScript
BrodyJackson/PeeOrFlee
/front_end/src/components/Newwashroom.js
UTF-8
8,237
2.78125
3
[]
no_license
import React, { Component } from 'react'; import '../App.css'; class Newwashroom extends Component { constructor(props){ super(props); this.state = { comment: "", values : { building : "", roomNum : "", stallNum : "0", ...
true
d83118846fd526c503b5898464a6bc15b7cfa26a
JavaScript
gorushkin/18378-mishka
/source/js/index.js
UTF-8
970
2.671875
3
[]
no_license
var popup = document.querySelector(".add-to-basket"); var overlay = document.querySelector(".overlay"); var link = document.querySelector(".product-card__to-order"); link.addEventListener("click", function (evt) { evt.preventDefault(); popup.classList.add("add-to-basket--show"); overlay.classList.add("overlay--s...
true
05725df447bcee2d751bd748d912efaa92bea6b5
JavaScript
11jacob11/JavaScript-Projects
/Basic JavaScript Projects/JS/Basic_JavaScript_3.js
UTF-8
1,264
4.40625
4
[]
no_license
function doThing1() { var num = 7 + 8; document.getElementById("add").innerHTML = "7 + 8 = " + num; } function doThing2() { var num = 7 - 5; document.getElementById("minus").innerHTML = "7 - 5 = " + num; } function doThing3() { var num = 7 * 8; document.getElementById("mult").innerHTML = "7 * ...
true
c1c25f50031daab43ce4fd8f4b8269c49a9e142e
JavaScript
AliceInWonderlandRose/AliceInWonderlandRose.github.io
/Other projects/takeAnOrder/js/takeAnOrder.js
UTF-8
5,793
3.015625
3
[]
no_license
$(document).ready(function(){ //$("#log").append("<br>added some text"); // chnage the background color on focus, yellow $("#mySingleLineText").on("focus", function(){ $("#log").append("<br>Foucus background-color"); $(this).css("background-color", "yellow"); }) .on("blur", function(){ $("#log").append("...
true
dfc0b979a01207776a6edd76e696920d424ea117
JavaScript
TanNingMeng/ceshisina
/blog/math/044/044.js
UTF-8
8,536
2.875
3
[]
no_license
/** * @usage 标记边界点 * @author mw * @date 2016年01月14日 星期四 14:57:23 * @param * @return * */ function signBoundPoint() { //图片 var image = new Image(); image.src = "./1.jpg"; //只处理这100*100个象素 var width = 600; var height = 400; ...
true
087a4c7b8c7e5ac7e792a0c298c0e57b274aab4e
JavaScript
marie-schild/myFridge
/js/apiRezeptErstellen.js
UTF-8
3,184
3.3125
3
[]
no_license
// Funktion, um neues Rezept an die Datenbank zu schicken function sendRezept() { // Deklaration der Variable "url", welche als Base-URL verwendet wird var url = "https://famlist-backend.herokuapp.com/api/"; // Auslesen und erstellen der Variable "zutaten" für die Anzahl der Zutaten var zutaten = localStorag...
true
1750c8be3ab13d7d99946c83d717ad7e9fdecf4a
JavaScript
peterkohler95/classActivities
/Coursework/week-3/day-4/Activities/99-other/object.js
UTF-8
1,114
3.28125
3
[]
no_license
var object = { address: { street: { number: 123, name: "Elm Street", subdivision: { name: "Nightmares Only", board: { members: [ "Freddy", "Jason", "Michael", "Jamie" ] ...
true
97831d511d519c03c81b59054400b070304ed2b5
JavaScript
MunrraMT/javascript-Tutorial-and-Projects-Course
/secao-13/aula-265/comAula/app.js
UTF-8
1,403
3.484375
3
[ "MIT" ]
permissive
const btn = document.querySelector('button.btn'); const content = document.querySelector('p.content'); const chuckImage = document.querySelector('[src="./chuck.png"]'); const url = 'https://api.chucknorris.io/jokes/random'; btn.addEventListener('click', async () => { loading(); getDataAjax(); }); async function get...
true
edd90942a4c208e68f91f56bc2eac2ec3ebf20e0
JavaScript
Frac7/intersect-and-manipulate
/js/holdable.js
UTF-8
11,819
2.671875
3
[]
no_license
let firstHandPosition = null; //posizione della mano nel momento in cui viene chiamato l'evento leap-holdstart let holdStart = false; //indica se l'evento sia stato emesso o meno let target = null; //oggetto da trasformare let hand = null; //mano che innesca l'evento let targetOriginalValue = null; //valore iniziale de...
true
83138d1a9789f7f44c42cf8deea068495e8f5110
JavaScript
ebventurino/JS_OBJECT_CREATE
/object-create.js
UTF-8
2,172
2.984375
3
[]
no_license
const financialAdvisor = Object.create({}, { company: { enumerable: true, writable: true, value: "abc" }, specialty: { enumerable: true, value: "def" }, portfolio: { enumerable: false, value: [{symbol: "cde", quantity: 1000, ...
true
c0d8608b750830dc12d473065081383bdc275219
JavaScript
kjj6198/rent-591-parser
/parser.js
UTF-8
1,541
2.578125
3
[]
no_license
var cheerio = require('cheerio'); const onlyFemale = ($) => { return $('.two em[title="女生"]').length === 1; } const getPrice = ($) => { return $('.price i').text(); } const getPhotos = ($) => { return $('#hid_imgArr').val(); } const getHouseTitle = ($) => { return $('h1 span.houseInfoTitle').text(); } cons...
true
2c680ca4c042a3d82188b18c187392c9711fafb0
JavaScript
jimhantrix/tic-tac-toe-1
/Tic/app.js
UTF-8
5,854
3.75
4
[]
no_license
// Cells variables var a1, a2, a3, b1, b2, b3, c1, c2, c3; // Keeps track of who's turn it is: 0 -> player's turn ## -> 1 comp's turn var turn = 0; // Boolean values to know who won var xWin = false; var oWin = false var gameEnded = false; var getPlayerMove = function(cellID) { // Check if it is the player's turn...
true
dd40ab379070b35970faf0348c5345d4e87fd485
JavaScript
timucini/VocabQuizSpring
/web/src/main/client/src/components/Result.js
UTF-8
943
2.625
3
[]
no_license
import React, { useState } from "react"; import axios from "axios"; function Result(props) { const [match, setMatch] = useState(props.match); const getMatch = () => { axios.get("http://localhost:8080/api/v1/match/match", { params: { match_id: props.match.id }}).then(response => { ...
true
19d5c18d9db682616f2adcbc1a08ac5a17270106
JavaScript
blitzace90/project2
/script.js
UTF-8
4,960
3.234375
3
[]
no_license
$(document).ready(function(){ for (let j=1;j<722;j++){ $('#poke-container').append(`<div id="pokemon${j}" class="pokeCard"></div>`) } //Uncheck region if type selected $('.type').on('click',function(){ $(".region").each(function(){ this.checked = false; }); $('#inputPokemon'...
true
69878cbaf6b05e6978d6a03455ae12b507af18cf
JavaScript
Anna-Dymczyk/currency-converter
/js/script.js
UTF-8
1,417
3.15625
3
[]
no_license
{ const welcome = () => { console.log("Hello🙂"); }; welcome(); const calculateResult = (amount, expectedCurrency) => { const eurRateElement = document.querySelector(".js-eurRate"); const usdRateElement = document.querySelector(".js-usdRate"); switch (amount, expectedCur...
true
7195808e5b629bd7c44a4199d80b921e2644e3be
JavaScript
tommysullivan/ioc4js
/spec/unit/instancing/singleton_instancer_spec.js
UTF-8
4,637
2.65625
3
[]
no_license
describe('SingletonInstancer', function() { var singletonInstancer; var singletonClasses; var singletonInstanceCollection; var onDemandInstancer; var classThatIsNotRegisteredAsSingleton; var classThatIsRegisteredAsSingleton; var namedLiteralConstructorParams; var constructionStack; v...
true
747a2663e56eb97b765679e496a3e62daea26dfe
JavaScript
jonathandorsey1/pantry
/mern-pantry-planner/src/components/pantry-list.component.js
UTF-8
4,356
2.6875
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; import IngredientList from './ingredient-list.component'; export default class PantryList extends Component { constructor(props) { super(props); this.onChangeUsername = this.onChangeUsername.bind(this); this.onSu...
true
12523bcc52579a7b7d11a985395783621a156d09
JavaScript
herbertfj/rpsApp
/rps/src/FakeRoundRepo.js
UTF-8
343
2.59375
3
[]
no_license
function FakeRoundRepo(){ const rounds = [] this.save = function(play){ rounds.push(play) return Promise.resolve() } this.empty = function(){ return Promise.resolve(rounds.length === 0) } this.getAll = function(){ return Promise.resolve(rounds) } } module....
true
a12dc74a456bc9b165e0661602453a0906461dfe
JavaScript
Sidhe-is-me/react-information-flow-v-000
/src/Tier2.js
UTF-8
1,200
2.671875
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
import React, { Component } from 'react' import { getReducedColor, getRandomColor } from './randomColorGenerator.js' import Tier3 from './Tier3' export default class Tier2 extends Component { constructor(props) { super(props) this.state = { childColor: getReducedColor(this.props.color), } } ...
true
3e85db6d370bda8b458f17d774348b045cb60ba9
JavaScript
ryscheng/kingdom
/src/types/Song.js
UTF-8
2,341
2.78125
3
[ "Apache-2.0" ]
permissive
"use strict"; const winston = require("winston"); const needle = require("needle"); const lame = require("lame"); const multipipe = require("multipipe"); /** * Song represents all of the data associated with a song to play, * including the stream **/ class Song { /** * Constructs new Song * @param{string...
true
8375fb38363a5fefdeaaa069e0f529dc044243b5
JavaScript
lazaryan/CyberGarden
/src/js/main.js
UTF-8
1,652
3.03125
3
[]
no_license
class Construct { constructor (block) { this.initblock(block); this.getNotification(); } initblock (el) { this.el = el ? typeof el == 'Object' ? el : document.querySelector(el) : document.querySelector('body'); } getNotification (category=undefined) { let xhr = new...
true
47ec8605bd2bf8e741741935a2912d6fec1297f4
JavaScript
khankuan/ChromeSPP
/js/app.js
UTF-8
3,885
2.71875
3
[]
no_license
$(document).ready(function(){ $("#connectButton").click(deviceSelect); $("#sendButton").click(send); $("#sendButtonDelimiter").click(sendWithDelimiter); $("#sendByteButton").click(sendByte); init(); }); var status = "Connect"; var devices = {}; var deviceInterval; var socket; var profile = {"uuid": "00001101-000...
true
17e1444233b88d562e33d5d4e7a28203d536733f
JavaScript
KristinaChausheva/SoftUniCourses
/JS-Courses/JS-Advanced/09.Regex/03JamesBond/solution.js
UTF-8
1,014
3.03125
3
[]
no_license
let key = 'specialKey'; let line = 'In this text the specialKey HELLOWORLD! is correct, but the following specialKey $HelloWorl#d and spEcIaLKEy HOLLOWORLD1 are not, while SpeCIaLkeY SOM%%ETH$IN and SPECIALKEY ##$$##$$ are!]' function solve() { // let [key, ...line] = JSON.parse(document.getElementById('array').v...
true
1592b9c578a21276065603fdd9af5b8393316a1c
JavaScript
i-fernandez/UNED-pfg
/modules/model/statemanager.js
UTF-8
1,833
3.5625
4
[]
no_license
class StateManager { constructor() { this.currentState = 0; this.states = []; this.timeSeries = []; this.progressData = ''; } /* Devuelve el estado posterior (si existe) */ getNextState() { if (this.currentState+1 < this.states.length) this.currentSt...
true
ad460b86b77602e8844c387acfc59313d9baa110
JavaScript
Andrii-Sharkov/Infinite-Loop-SASS-Project-
/app.js
UTF-8
2,887
3.046875
3
[]
no_license
// ----- Testimonials Slider ----- const testimonialsSlider = document.querySelector('.testimonials-slider'); const testimonialsCard = document.querySelectorAll('.testimonials-card'); const prev = document.querySelector('.prev'); const next = document.querySelector('.next'); let currentIndex = 0; next.addEventListene...
true
38bac9c5fb236ab4b6b5b99c069a4f091b639883
JavaScript
Pulp-Function/practice_vuejs
/index.js
UTF-8
569
2.96875
3
[]
no_license
/* global Vue */ var app = new Vue({ el: "#app", data: function () { return { message: "Hello from JavaScript!", name: "Peter", newFruit: "", fruits: ["apple", "banana", "cantaloupe"], showText: true, disableText: true, }; }, methods: { upperName: function () { ...
true
00f0bd4ace72703d09cce2a379ee637d669c6787
JavaScript
cdcummings10/salmon-cookies
/js/sales.js
UTF-8
4,873
3.28125
3
[]
no_license
'use strict'; function CookieStore( name, minCust, maxCust, averageCookies ){ this.name = name; this.minCust = minCust; this.maxCust = maxCust; this.averageCookies = averageCookies; this.randCookieHourly = []; CookieStore.stores.push(this); } CookieStore.stores = []; CookieStore.prototype.ra...
true
f948c56cf3958d40c4d8e78cd70ef1c4b65c0804
JavaScript
luliya27/homeworks
/GoogleMap/js/googleMapAPI內建方法塞資料.js
UTF-8
7,574
2.5625
3
[]
no_license
let maskData; const cities = document.querySelector('#cities'); const area = document.querySelector('#area'); const storeList = document.querySelector('#store-list'); var markers = [];//放所有的Marker function initMap() { var myLatLng = { lat: 25.0415956, lng: 121.5341098 }, map = new google.maps.Map(document....
true
245de95b034b9ace4b238ef32a029ae81e2070bb
JavaScript
ZakaWieLBS/mattesidan
/js/calc.test.js
UTF-8
927
2.640625
3
[]
no_license
const { sum, pq } = require("./calc"); test("adds 1 + 2 to equal 3", () => { //Texen kan vara den man vill expect(sum(1, 2)).toBe(3); }); test("test pq with 2-3 to be 1,-3", () => { //Texen kan vara den man vill expect(pq(2, -3)).toBe("1,-3"); }); const puppeteer = require("puppeteer"); test("Vad som ska göras...
true
6a6f656ac2ea70456948566858f62ec5aa983f0c
JavaScript
doctor-tlaloc/Send_to_2Do
/options_editor.js
UTF-8
1,194
2.6875
3
[]
no_license
(function() { var exampleParams = { title: "An important page title", selection: "important page fragment", url: "http://page-to-read-later.com" }; function enableEditing(editSelector, exampleSelector, templateName) { var edit = document.querySelector(editSelector); var example = document.que...
true
b21b222e388209014d5c37111e3d8cae6470b877
JavaScript
Harris-Lodi/HTML_CSS_JS_WebSite
/script.js
UTF-8
1,205
3.578125
4
[ "MIT" ]
permissive
const container = document.querySelector('.container') /* code to control the open-navbar button to open navbar */ document.querySelector('.open-navbar-icon').addEventListener('click', () => { container.classList.add('change'); }); /* code to control the close-navbar button to close navbar */ document.querySelect...
true
b825f38a4b157aba0f0d2087719bea11e77365a8
JavaScript
thonker86/freecodeacademy
/Data Structures/remove-elements-from-a-linked-list-by-index.js
UTF-8
1,411
4.21875
4
[]
no_license
function LinkedList() { var length = 0; var head = null; var Node = function(element){ this.element = element; this.next = null; }; this.size = function(){ return length; }; this.head = function(){ return head; }; this.add = function(element){ var node = new Node(element); ...
true
f9abca0819a5c5f2e68111b8fccdd35192c197b1
JavaScript
iPriss/LilianaGiaquinto
/test/carousel.js
UTF-8
4,026
2.90625
3
[]
no_license
(function( $ ){ $.fn.carousel = function(settings) { // Pre-def settings and input settings var settings = $.extend({ // Environment Settings container: this, width: 'auto', height: 'auto', // Images settings imgPath: null, // Images sets can be and object, a list or a path...
true
bf8d72a042c35c5e72c91889bebbd68974ffe9df
JavaScript
StoyanKostov/JavaScript-OOP---Telerik-Academy-2015
/01 Functions and Function Expressions/tasks/task-1.js
UTF-8
1,168
4.15625
4
[]
no_license
/* Task Description */ /* Write a function that sums an array of numbers: numbers must be always of type Number returns `null` if the array is empty throws Error if the parameter is not passed (undefined) throws if any of the elements is not convertible to Number */ function sum(arr) { 'use strict'; var v...
true
75717d0d87e4277c2ef376139a5be6679d74bfd3
JavaScript
nepomnyashchii/TestGit
/old/javascript/042.js
UTF-8
324
3.359375
3
[]
no_license
var fruits, text, fLen; fruits = ["Banana", "Orange", "Apple", "Mango"]; fLen = fruits.length; console.log(fLen) apple = ["dynamo", "spartak", "cska", "dreaming"] lake = apple['0'] console.log(lake) console.log(apple.length) if (10==21) { console.log("I am a champion")} else {console.log("My friend is a champion"...
true
5c33410fc4c47a0facd3401e1fc2dd3af7381e5d
JavaScript
Nakaharen/rocketseat
/guia-javascript/praticas/scripts.js
UTF-8
133
3.046875
3
[]
no_license
// Object const person = { name: 'Karen', age: 27, isAdmin: true } console.log(`${person.name} tem ${person.age} anos`)
true
1bb4b1bb69a90dfdd0c4d5f28d6b9254d7b38eef
JavaScript
thepragmatik/mockatoo
/src/index.js
UTF-8
2,537
3.125
3
[ "MIT" ]
permissive
export class Mockatoo { mock(obj) { this.target = obj; this.rewired = new Map(); let handler = { get: (target, propKey) => { // console.debug(`target: ${target}, propkey: ${propKey}`); if (propKey === '__rewire__') { return (...args) => { // console.debug(`ar...
true
90ebc7732bbe53977a95f9ec60af1a3aef555827
JavaScript
heysaturday/brixx
/assets/app/js/components/directives.js
UTF-8
3,694
2.515625
3
[ "MIT", "BSD-3-Clause" ]
permissive
'use strict'; /* Directives */ angular.module('wpApp.directives', []); angular.module('wpApp.directives') /** * App version */ .directive('appVersion', ['version', function(version) { return function(scope, elm, attrs) { elm.text(version); }; }]) /** * Prevent defau...
true
b1291e659efe83c1be2501b8fcbbed3c69af6a45
JavaScript
cyzhzhd/algorithm
/JS/line/1.js
UTF-8
328
3.453125
3
[]
no_license
const boxes = [ [1, 2], [3, 4], [5, 6], [7, 8], ]; console.log(solution(boxes)); function solution(boxes) { const store = new Array(1000001).fill(0); boxes.forEach((box) => { store[box[0]]++; store[box[1]]++; }); const mismatched = store.filter((n) => n % 2 === 1); return mismatched.length...
true
d73f0dc21aca004f703f0dd1e32fc6ae5a677996
JavaScript
winniexx0918/node.js
/bable/src/app.js
UTF-8
639
3.734375
4
[]
no_license
// let f = (a) =>{ // console.log(a) // } // f (23); //使用Person 原檔案要用import 匯入 // import Person from './person'; // let p = new Person('Peter', 'Lin'); // console.log(p.toString()); // console.log(p.describe()); import Person from './person'; const app = document.querySelector('#app'); let persons = [ new...
true
7bb42e2be5623080ec6ab1931ef70a5f32eeef51
JavaScript
chooomedia/dontbestupid
/js/script.js
UTF-8
3,216
3
3
[]
no_license
$(function () { // The initial variables let dbsHead = $(".dbsHead"); let dbsActivity = $("#dbsCheckbox"); let dbsMode = $("#dbsMode"); let dbsStatus = $(".dbsStatus"); let dbsCounter = $("#dbsAlertCounter"); // Shows the functions if plugin enabled function setEnabled() { dbsActivity.p...
true
42666110fe3968b5636e824d105fed99a4e48d13
JavaScript
dhebarp/financeTracker
/financetrackerbackend/src/routes/Auth.route.js
UTF-8
1,577
2.59375
3
[]
no_license
const express = require('express'); const session = require('express-session'); const AuthRouter = express.Router(); const userModel = require('../models/User.model'); const bcrypt = require('bcryptjs'); //JSON paring Middleware. AuthRouter.use(express.json()); AuthRouter.get('/checkUser', async (req, res) => { i...
true
f698fac22f348833d0cecd0e1cee0bd0eb668270
JavaScript
econavi/hexlet
/front/js-arrays/swap.js
UTF-8
2,020
4.09375
4
[]
no_license
/* Реализуйте и экспортируйте по умолчанию функцию swap, которая меняет местами два элемента относительно переданного индекса. Например, если передан индекс 5, то функция меняет местами элементы, находящиеся по индексам 4 и 6. Параметры функции: * Массив * Индекс Если хотя бы одного из индексов не существует, функция в...
true
91a513004a5710f175466080294b9d8aa4466707
JavaScript
MHG16/instagram-clone
/main.js
UTF-8
3,509
3.625
4
[]
no_license
// Using the tools you've learned in class, create a responsive image board that allows you // to add images and captions via a url. The images that are added to the image board should be // saved to tiny pizza server, so that when you reload the page, they are not lost. The form to // add an image should properly v...
true
aa98be54fbf924b3fb67702f5aaab71295fe32bb
JavaScript
ajaybgupta/webdev-js-hands-on
/dom-project/loan-calculator-app/app.js
UTF-8
2,592
3.28125
3
[]
no_license
// Listen for Submit document.getElementById('loan-form').addEventListener('submit', function(event){ clearError(); // Hide Results const results = document.getElementById('results'); results.style.display = 'none'; // Show Loader const loader = document.getElementById('loading'); lo...
true
8411de448f644156fe3d8b4be0bd4047797c1a51
JavaScript
smartniggs/Calculator-js
/script.js
UTF-8
9,988
2.703125
3
[]
no_license
"use strict"; $(function() { var txtStr = ""; //incase of del var txt_All = ""; var str = "" var symBool = false; var point = false; var sym = ""; var totalClicked = false; var b_left = 0; var b_right = 0; var b_leftBool = false; var totalT = 0; window.addEventList...
true
c7009dfeabcbcf46b5806e92a0c11c6950156c62
JavaScript
abhishekgangwar60/React_Streamy
/src/reducers/streams.reducer.js
UTF-8
934
2.59375
3
[]
no_license
import * as actionTypes from "./../actions/actionTypes"; export const streamsReducer = (state = {}, action) => { switch (action.type) { case actionTypes.CREATE_STREAM: { return { ...state, [action.payload.id]: action.payload }; } case actionTypes.FETCH_SINGLE_STREAM: { r...
true
d689d0f44ca09261a59cbc4691966d453b9e9ac4
JavaScript
shivachaturvedi/cs5200-fall2017-project
/src/DisplayParties/reducer.js
UTF-8
1,378
2.671875
3
[]
no_license
import { DISPLAY_PARTIES_REQUEST_SUCCESS, DISPLAY_PARTIES_REQUEST_ERROR, DISPLAY_PARTIES_REQUEST, } from './constants' const initialState = { partyList: [], // where we'll store party requesting: false, successful: false, messages: [], errors: [], } const reducer = function displayPartiesReducer (...
true
b44d02cf958832d8fb503c8d048ff0cbaeebb240
JavaScript
clickglue/arm
/Arm.js
UTF-8
2,839
2.65625
3
[ "MIT" ]
permissive
//configure Makeblock Auriga with MyFirmata (configurable firmate without Onewire, I2C and Scheduler) var arm = { scale: 44, orderArr: [], currentPos: [], servo: {}, stepper1: {}, stepper2: {}, steppersReady: [true, true], boardReady: false, monitor: function (data) { }, init: fu...
true
58d71be6cff4bd668d101ec61fc3ef815ec49e6f
JavaScript
swanzie/khan-academy
/computing/computer-programming/intro-js/movieReviews.js
UTF-8
452
3.03125
3
[]
no_license
var movies = [ { title: "Puff the Magic Dragon", review: "Best movie ever!!" }, { title: "Godzilla", review: "Scary!!" }, { title: "Harry Potter", review: "Wizards are so cool!" } ]; for (var i = 0; i < movies.length; i++){ fill(84, 140, 209);...
true
bda5083cc2206454d3c869974dcd340aa17c2a0e
JavaScript
julianfcp/Notes_Backend_Express
/src/database.js
UTF-8
904
2.625
3
[]
no_license
// to run mongo --> mongodb in terminal // mongod -- config /usr/local/etc/mongod.conf --fork const mongoose = require('mongoose'); // direccion donde estara mi db // no es necesario crear la db previamente, mongodb la crea automaticamente // la uri se guarda en una variable de entorno .env // se llama mediante el obj...
true
4a108b01153b85fc14947e1025c798be3ea89110
JavaScript
timroosen/assesment
/frontend/gulpfile.js/src/template/nunjucks/filters/assign.js
UTF-8
939
2.90625
3
[]
no_license
// @formatter:off var _ = require( 'lodash' ); var filterName = 'assign'; // @formatter:on /** * Assign filter * * Use this filter to overwrite properties of existing context objects since this is currently not possible natively in Nunjucks yet. * @see: https://github.com/mozilla/nunjucks/issues/313 ...
true
150247e7043d0c99a592d463aa296abab4d501b5
JavaScript
tobiasBora/hackathon_web_ubqc
/app/static/js/perso.js
UTF-8
11,132
3.578125
4
[ "MIT" ]
permissive
/* Important Note: We need to make requests to the server. It is considered bad practice [1] to send synchronous requests in Javascript because it basically locks the browser... So it means that all requests needs to be done asynchonously, with what is so called "promises". If you are interested on how ...
true
0acee4a1f747804f2799dfb0f8cb86b38dde6723
JavaScript
ahodyna/web-experiments
/js-homework/homework_30_data_script.js
UTF-8
477
3.015625
3
[]
no_license
const fs = require('fs'); let file = fs.readFileSync('C:/Users/Alina/Desktop/city.list.json') let openWeatherMapCities = JSON.parse(file) console.log(openWeatherMapCities.length) let uaCities = []; for(let i=0; i < openWeatherMapCities.length; i++){ if(openWeatherMapCities[i].country == "UA"){ uaCities...
true
4d0cd6b598f30b550314d7a70b1d72c865c510bb
JavaScript
wmichaelbischoff/shelfies
/src/component/Form/Form.js
UTF-8
1,865
2.65625
3
[]
no_license
import React, { Component } from 'react' import axios from 'axios'; export default class Form extends Component{ constructor(props){ super(props) this.state = { product_name: '', price: 0, imgurl: '' } } handleImgurl(val){ this.setState({ ...
true
f4bf57472ece6f6e220bf3028bfbcb3902ebb630
JavaScript
throneteki/throneteki
/test/server/cards/01-Core/NavalSuperiority.spec.js
UTF-8
2,168
2.765625
3
[ "MIT" ]
permissive
describe('Naval Superiority', function() { integration(function() { beforeEach(function() { const deck = this.buildDeck('lannister', [ 'Naval Superiority', 'A Noble Cause', 'A Feast for Crows', 'A Clash of Kings', 'The Roseroad', 'Littlefinger (Core)' ...
true
85503a8fc98763dee58f844474d9282606ce232c
JavaScript
zakzakst/object-oriented-practice
/02_member-list-app/code/store/toast.js
UTF-8
1,105
2.71875
3
[]
no_license
export const state = () => ({ isActive: false, message: '' }) export const mutations = { setMessage(state, payload) { state.message = payload; }, clearMessage(state) { state.message = ''; }, setIsActive(state, payload) { state.isActive = payload; } } export const actions =...
true
db7dae357ee3842193380a06bf2b9380a898f2b4
JavaScript
chalkmaster/algorithms
/1000Rainhas/index.js
UTF-8
6,505
3.421875
3
[ "MIT" ]
permissive
function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } const problemSize = 8; const board = {}; function initializeBoard() { for (let col = 0; col < problemSize; col++) { board[col] = {e:[]}; for (let row = 0; row < problemSize; row++) { board[...
true
8505d877e0eb81f00d6f96fe20507f5995cd979e
JavaScript
Bookmonkey/dora
/src/handlers/config.js
UTF-8
2,786
2.734375
3
[]
no_license
const path = require("path"); const promisify = require('util').promisify; const fs = require("fs"); const statPromise = promisify(fs.stat); const inquirer = require("inquirer"); const CONSTANTS = require("../constants"); const ConfigHandler = { REQUIRED_KEYS: ["template", "language", "questions"], async validat...
true
e6253036f4014f8bb50fae42827bb41014c54216
JavaScript
FernandoCaputo/CursoIngresoJS
/8-TPs/03-jsFerretePinturas.js
UTF-8
944
3.921875
4
[]
no_license
/*3. Para el departamento de Pinturas: A. Al ingresar una temperatura en Fahrenheit debemos mostrar la temperatura en Centígrados con un mensaje concatenado (ej.: " 32 Fahrenheit son 0 centígrados"). B. Al ingresar una temperatura en Centígrados debemos mostrar la temperatura en Fahrenheit (ej.: "0 centígrados son 32 ...
true
aff5624cca0afb3ae6ee4f18b3466725bd0aee63
JavaScript
louisscruz/w6d5
/widgets/frontend/weather.jsx
UTF-8
1,302
3.109375
3
[]
no_license
import React from 'react'; class Weather extends React.Component { componentDidMount() { this.getWeather(); } constructor() { super() this.state = { location: navigator.geolocation, city: null, temp: null } } getWeather() { const xml = new XMLHttpRequest(); xml.on...
true
adac046d226c26718a7ea58aea600cc720457eb8
JavaScript
colinmiyata/Sensact
/Config/v3/configSensactApp/triggers.js
UTF-8
13,464
2.703125
3
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
"use strict"; // ---------------------------------------------- // This file defines the main data structures used to hold the data. // Also the functions required to covert this data into a stream (to be sent // to SensAct) and convert from a stream are defined here. // // No user interfact elements are defined here....
true
63613bcb105923bac1d04b1d6d5fe9d358729b79
JavaScript
AJWurts/WeatherVis
/react-app/src/components/SearchBox.jsx
UTF-8
2,202
2.578125
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; import Tooltip from '@material-ui/core/Tooltip'; // Search Box class SearchBox extends Component { constructor(props) { super(props); this.state = { input: "" } } // Handles Input Interaction onChange = (event) => { this.setState({ input: ...
true
784c279f1e8e26d44133cc50e91045299922aafd
JavaScript
timqian/GiG
/src/utils/flattenPosts.js
UTF-8
294
2.90625
3
[ "MIT" ]
permissive
/** * posts object to array * @param {Object} storePosts original posts Object * @return {Array} flattened posts */ export default (storePosts) => { let posts = []; Object.keys(storePosts).forEach(key => { posts = posts.concat(storePosts[key]); }); return posts; }
true
fd876b9e8c986950071409c300cd678524588cd7
JavaScript
oacore/dashboard
/components/application/activities.js
UTF-8
1,853
2.609375
3
[]
no_license
// Resolves child routes and appends parents to the configuration objects const createRoute = (current, parent) => { const result = { ...current, parent } result.test = (str) => (parent?.test?.call(str) || true) && current.test.test(str) if (parent?.path) result.path = [parent.path, current.path].join('/') ...
true
06ad46d296ccae183352e647621db3228ee3546a
JavaScript
nshelton/three-audio-experiments
/src/tQuery.js
UTF-8
2,427
2.609375
3
[ "MIT" ]
permissive
/** * Create an audio source. */ tQuery.World.registerInstance('audio', function (fftSize, element, detectors) { return tQuery.createAudioSource(this, fftSize); }); /** * Create an audio source. */ tQuery.registerStatic('createAudioSource', function (world, fftSize, element, detectors) { // Create source var...
true
62f9d9c3f0095343bd14723bdcadd539a9658b8f
JavaScript
dimitardimitrov93/Programming_Basics_with_JavaScript
/Lecture №7 - Nested Loops/Exercise/04. Train The Trainers.js
UTF-8
913
3.5625
4
[]
no_license
function solve(input) { let juryNum = Number(input.shift()); let command = input.shift(); let finalAssessment = 0; let presentationCounter = 0; while (command != "Finish") { let presentationName = command; let averageGrade = 0; let sum = 0; for (let i = 0; i < juryNum; i++) { let grad...
true
8f6c1cb5c30879d8e7bddc70787fb018f3089b51
JavaScript
Malte311/FinanceList-Desktop
/src/app/scripts/utils/dialogHandler.js
UTF-8
17,923
2.734375
3
[ "MIT" ]
permissive
const InputHandler = require(__dirname + '/inputHandler.js'); const {dateToTimestamp, timestampToFilename} = require(__dirname + '/dateHandler.js'); /** * Class for handling all kinds of dialogs. */ class DialogHandler { /** * @param {View} view View object. */ constructor(view) { this.view = view; this.in...
true
833ebef68ee529dbf2adcb9a3a537e613a152c5c
JavaScript
terrierscript/rework-merge-properties
/index.js
UTF-8
1,206
2.703125
3
[]
no_license
var walk = require("rework-walk") var defaults = require("defaults") var uniq = require("uniq") // put regexp local value for performance. var importantRegexp = new RegExp() importantRegexp.compile(/.*\!important.*/) // delect ordinaly utility // first in last out and remove if duplicate var orderPush = function(arr,...
true
c4838c25609afea0ded694f03de7527fecdd0931
JavaScript
cfech/DataStructuresAndAlgorithms
/05_ProblemSolvingPatterns/unique_values.js
UTF-8
1,069
4.25
4
[]
no_license
// function countUniqueValues(arr){ // if(arr.length === 0) return 0; // var i = 0; // for(var j = 1; j < arr.length; j++){ // if(arr[i] !== arr[j]){ // i++; // arr[i] = arr[j] // } // } // return i + 1; // } //o(N) time because only 1 loop //myImplementat...
true
a3095660239308e85be27416fd126129cb03ba6d
JavaScript
cunnan123/library
/面试/跨域/CORS/S/index.js
UTF-8
1,506
2.75
3
[]
no_license
const express = require('express') const path = require('path') const router = require('./router/routes') const app = express() // 配置静态资源 app.use('/static', express.static(path.join(__dirname, 'public'))) app.use('/static', express.static(path.join(__dirname, 'files'))) //配置全局中间件 app.use(function (req, res, next) { ...
true
2ec7a96790d74df2d26cb073e4e84d854347f029
JavaScript
dillipkumarsahu/JS-FormValidation
/password validation/password 2/script.js
UTF-8
1,046
2.625
3
[]
no_license
function show_message() { var message = document.getElementById("message"); message.style.display = "block"; } function check() { var user = document.getElementById("password").value; var icon = document.getElementById("icon"); var message = document.getElementById("message"); var p_up...
true
43884c16edffd7335e50bda694e9ad0191fe80f1
JavaScript
Liufan666/refactor-homework
/homework/test/employeeTest.js
UTF-8
849
3.140625
3
[]
no_license
const employeeTest = require('ava'); const { Employee } = require('../src/employee'); employeeTest('type is manager', t => { let employee = new Employee('kevin', 'manager'); const result = employee.toString(); t.is(result, 'kevin (manager)'); }) employeeTest('type is engineer', t => { let employee = n...
true
8ac37eba8dd5b974ca972728cbf1d9105d925d69
JavaScript
williamolojede/starwars-api
/src/utils/swapi.js
UTF-8
915
2.703125
3
[]
no_license
import axios from 'axios'; import { DataTransformer } from './dataTransformer'; const SWAPI_FILMS_URL = 'https://swapi.co/api/films'; export const SwapiService = { async getMovies() { const { data: { results } } = await axios.get(SWAPI_FILMS_URL); return results .sort((a, b) => new Date(a.release_dat...
true
8401f85507d4dcc4bda3dd7e7f42251f7cee4917
JavaScript
sunmengyue/fullstack-mastery
/video-exercise/findTheHeighestAltitudes/DanielsSolution.js
UTF-8
239
3.359375
3
[]
no_license
function findHeighestAlt(gain) { let alt = 0; let max = 0; for (let i = 0; i < gain.length; i++) { alt += gain[i]; if (alt > max) { max = alt; } } return max; } console.log(findHeighestAlt([-5, 1, 5, 0, -7]));
true
de39f5f57bded3d72a27c484a50f3758f095e93e
JavaScript
matthewjgolder/tdd-u3-gather-pt4
/gather-phase-4/routes/index.js
UTF-8
1,835
2.625
3
[]
no_license
const router = require('express').Router(); const Item = require('../models/item'); router.get('/', async (req, res, next) => { const items = await Item.find({}); res.render('index', {items}); }); router.get('/items/create', async (req, res, next) => { res.render('create'); }); router.post('/items/create', as...
true
b86e397d34bfd1612a8fac2fde56f7d0c2f5e488
JavaScript
Code-the-Dream-School/web-basics-1-week-2-smykserhi
/index.js
UTF-8
212
2.6875
3
[ "MIT" ]
permissive
alert("Welcome to a new journey and my new site"); /*function newAlert (){ alert("Welcome again to a new journey and my new site"); }; document.querySelector('.alert').addEventListener('click', newAlert); */
true
593372b1082664651ea48e3147387c7e2505d15f
JavaScript
jmthompson2015/financedashboard
/src/api/KeyStatistics.js
UTF-8
4,086
2.578125
3
[ "MIT" ]
permissive
import FetchUtilities from "./FetchUtilities.js"; const KeyStatistics = {}; const createUrl = symbol => `https://finance.yahoo.com/quote/${symbol}/key-statistics?p=${symbol}`; const get52WeekPricePercent = (price, _52WeekLow, _52WeekHigh) => { const myPrice = price ? price.number : undefined; const low = _52Week...
true
72047bb2721031ca33b65f1ed1807239f84dbf25
JavaScript
MichelleCaobianco/JavaScriptES6
/restandspread.js
UTF-8
427
3.9375
4
[]
no_license
// function normal function sum(a,b){ var value = 0; for (var i=0; i<arguments.length; i++){ value += arguments[1]; } return value; } console.log(sum(5,5,5,5,2,3)); //rest operator representado por '...' function sumNew(...args){ console.log(args); } console.log(sumNew(5,5,5,5,2,3));...
true
dab99677c35a41f11b21cc7835ee65abf6a60b68
JavaScript
Dhanush123/alexaskills_promos
/exponentscalculator/index.js
UTF-8
4,204
2.90625
3
[]
no_license
"use strict"; var Alexa = require("alexa-sdk"); var APP_ID = "amzn1.ask.skill.e65f6718-573d-415a-b76e-6d7625f09e7a"; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]"; var SKILL_NAME = "Exponents Calculator"; exports.handler = function(event, context, callback) { var alexa = Alexa.handle...
true
747174d7dbd940945671821967386bb926ac7fa4
JavaScript
teamProjectJS/StreamBasics
/generate.js
UTF-8
1,136
2.640625
3
[]
no_license
const fs = require('fs'); const Source = require('./readable'); const timer = require('./timer'); const { limit, interval } = require('./config'); const books = { fileName: 'books.csv', fileLength: 1e+6, headers: ['id', 'title'], }; const authors = { fileName: 'authors.csv', fileLength: 2e+6, headers: ['...
true
0a25fdd10766b8b4c95237dea89910d1b0f493d9
JavaScript
amanan12/todoList
/todo.js
UTF-8
1,698
3.0625
3
[]
no_license
$(".clearAll").hide(); $(".container").hide(); var list = []; $(".clearAll").click(function(){ list = []; updateList(); $(".clearAll").hide(); }); function setName(){ var getName = $(".red1").val(); $(".name").hide(); $(".setName").html(getName); $(".container").show(); ...
true
4659a96496a51a6a6cb7504c171069a13da3bf6c
JavaScript
brenoassp/TesteProject
/DesafioIclips/JavaScripts/Desafio.js
UTF-8
4,120
2.71875
3
[]
no_license
//lorems = [ // { // "name": "Aliqua aliquip", // "email": "exemplo@square.com.br", // "status": "atrasado", // "tag": "" // }, // { // "name": "Dolore aliqua veniam", // "email": "exemplo@square.com.br", // "status": "andamento", // "tag": "" // }, /...
true
48ae5df9319fc6d43c0ffcd912e647f05be9c2fc
JavaScript
plasticbugs/podcasty
/app/utils/youtubeHelper.js
UTF-8
967
2.546875
3
[]
no_license
const axios = require('axios'); const keys = require('../../config.js') const lookUpVideos = function (channelID, callback) { axios.get('https://www.googleapis.com/youtube/v3/channels', {params: { key: keys.YT_API_KEY, part: 'contentDetails', forUsername: channelID } }) .then(results => { ...
true