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
7c9e1f53c022790828449ee21bddbbcffc5ce655
JavaScript
seanox/aspect-js
/sources/expression.js
UTF-8
12,402
2.84375
3
[ "Apache-2.0" ]
permissive
/** * LIZENZBEDINGUNGEN - Seanox Software Solutions ist ein Open-Source-Projekt, * im Folgenden Seanox Software Solutions oder kurz Seanox genannt. * Diese Software unterliegt der Version 2 der Apache License. * * Seanox aspect-js, fullstack for single page applications * Copyright (C) 2023 Seanox Software Soluti...
true
d6cc89dac69157d1ce8c5909d0a523a2fff6cc17
JavaScript
fantasy-08/Builder
/src/App.js
UTF-8
1,182
2.5625
3
[]
no_license
import React, { useState } from "react"; import './App.css'; import Navbar from './Components/Navbar'; import ShowProduct from './Components/ShowProduct'; import CreteNew from './Components/CreteNew'; var initial_product = { productName: "Washing machine", material: [{ name: "smoke" }, { name: "plastic" }, { name: ...
true
d349f1a3759913269eac25b8ebcf53172864c60f
JavaScript
andreaweb/star-wars
/src/PlanetsAPI.js
UTF-8
200
2.75
3
[]
no_license
const api = "https://swapi.co/api/planets/" export const getPlanet = (randomPlanet) => fetch(api + randomPlanet) .then(res => res.json()) .then(data =>{ let planet = data; return planet})
true
f7f42bc8feb3e5cfced40558b799a8ae6b078b92
JavaScript
MoodyBones/vue-play
/scrimba/index.js
UTF-8
1,756
3.546875
4
[]
no_license
// Lesson 1 - Hello Vue! // var app = new Vue({ // // create new instance // // then pass in the options object // el: '#app', // tell it where we want it to live. we target dom node with id #app // data: { // message: 'Hello Vue!' // } // }) // app.message = `I have changed the data` // //////////////...
true
842081a5b396ba44b1d8d5e94901191d3705c28d
JavaScript
cermati/satpam
/test/validators/numeric.spec.js
UTF-8
1,422
2.53125
3
[ "MIT" ]
permissive
import { expect } from 'chai'; import validator from '../../lib'; describe('Numeric validator', () => { const rules = { income: ['numeric'] }; context('with integer digits', () => { it('should success', () => { const result = validator.validate(rules, {income: '123'}); const err = result.mes...
true
3adfa7d05dcf691c679b0c0f310dc109b6ffec3b
JavaScript
EKI-INDRADI/eki-latihan-typescript
/9_app.js
UTF-8
190
2.640625
3
[]
no_license
// interfaces describing indexables //let s: States<boolean> = {enabled : true, maximized : false}; var s = { enabled: true, maximized: false }; console.log(s); console.log(s['maximized']);
true
565712e08f107e21b1ba4045856b67c917e2a319
JavaScript
deltall1/IntelliartsSummerCamp2019
/test/console-report.js
UTF-8
911
2.578125
3
[]
no_license
const commands = require("../services/commandsWrapper"); const expect = require("chai").expect; describe("console report", () => { it("User gets a report for the specified year", async () => { const data = { year: "2019", currencyInto: "UAH" }; const yearsReport = await commands.report(data);...
true
ec0aba12e682ae8fc3568fe8ee497225c3227c62
JavaScript
mjtabaya/fta-3
/client/src/App.js
UTF-8
2,162
2.578125
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios' import 'semantic-ui-css/semantic.css' import Login from './components/auth/Login' class App extends Component { constructor() { super(); this.state = { loggedInStatus: 'NOT_LOGGED_IN', user: null, error: '' }; this...
true
dfce3c1874660dcc1a1b60c3930b7b10bcd23145
JavaScript
GuldLuca/rabotnik-insight
/controllers/employee.js
UTF-8
2,342
2.75
3
[]
no_license
const Employee = require("../models/employee"); const Task = require("../models/task"); const Project = require("../models/project"); const Client = require("../models/client"); //Root path const rPath = require("../variables/root-path.json").path; //Get profile.html exports.getEmployeePage = (req, res) =>{ retur...
true
959ef6105caa85e078623cb8cc39043d81c8edb5
JavaScript
EdwardYam/HumanEvaluation
/js/main.js
UTF-8
13,450
2.625
3
[]
no_license
document.write("<script type='text/javascript' src='js/FileSaver.js-master/src/FileSaver.js'></script>"); function upload(){ document.getElementById("previous-btn").disabled=false; document.getElementById("next-btn").disabled=false; let reads = new FileReader(); file = document.getElementById('uploa...
true
82ca11315a935af878f5324db3278b80e9c5b126
JavaScript
apriliandi246/simple-redux
/store.js
UTF-8
1,208
2.828125
3
[]
no_license
import reducer from "./reducer.js"; import isPlainObject from "./utils/isPlainObj.js"; function createStore(reducer) { let state; let currentListeners = []; if (typeof reducer !== "function") { throw new Error("Expected the reducer to be a function"); } return { getState() { retur...
true
74bea1d05e4be8bc4caebfd1d6c8f618855a040f
JavaScript
ljwrer/leetcode-in-js
/problems/findMedianSortedArrays.js
UTF-8
986
3.71875
4
[]
no_license
/** * @param {number[]} nums1 * @param {number[]} nums2 * @return {number} */ var findMedianSortedArrays = function (nums1, nums2) { const totalLength = nums1.length + nums2.length; const medianIndex = Math.floor((totalLength) / 2); let i = 0; let j = 0; let value1, value2; while (i + j <= m...
true
85508f2925260351e57aa184cca8c5bb7441821a
JavaScript
bljessica/nowcoder-algorithms
/剑指offer/JZ11.二进制中1的个数.js
UTF-8
148
3.328125
3
[]
no_license
function NumberOf1(n) { // write code here let res = 0; while(n !== 0) { res++; n = n & (n - 1); } return res; }
true
049f47e60f59cbf6441dc4216e3df5c0c2467be0
JavaScript
kassio/my-watch
/common/settingsFile.js
UTF-8
1,132
2.578125
3
[ "Apache-2.0" ]
permissive
import * as fs from 'fs'; import { settingsKeys } from '../common/utils.js'; const SETTINGS_FILE = 'QuickStatsSettings.txt'; export const writeSetting = ({ key, value }) => { const settings = readSettings(); writeSettings({ ...settings, [key]: value }); }; export const writeSettings = settings => { console.inf...
true
a67f482fbdc11e41515289f2dc0f7a761bd8c919
JavaScript
vehicle-history/npm-vehicle-history-model
/lib/model/response/vehicle/location.js
UTF-8
512
3
3
[ "MIT" ]
permissive
class Location { constructor(country, state) { this.country = country; this.state = state; } } class LocationBuilder { constructor() { this.country = null; this.state = null; } withCountry(country) { this.country = country; return this; } withState(state) { this.state = stat...
true
64d9654eee875b48b34bd71338b1bb6fd3b31a0b
JavaScript
Visqosity/WaveOS-Node-Backend
/modules/string-utilities.js
UTF-8
343
2.578125
3
[]
no_license
// Imports const s2n = require('string2num'); function buffer(input) { return (String('0' + input).slice(-2)); } function encodeString(input) { return (s2n.encode(input)); } function decodeString(input) { return (s2n.decode(input)); } exports.buffer = buffer; exports.encodeString = encodeString; exports.decod...
true
ee519ccb41565d4704dd9974cdaf984b51ff821c
JavaScript
daveroy086/jsAlgorithmsAndDataStructures
/GraphTraversal.js
UTF-8
5,718
3.75
4
[]
no_license
class Graph { // this is an undirected, unweughted graph constructor() { this.adjacencyList = {}; } addVertex(vertex) { if(!this.adjacencyList[vertex]) this.adjacencyList[vertex] = []; } addEdge(vertex1, vertex2) { this.adjacencyList[vertex1].push(vertex2); this....
true
0140d7f3c4f0b0519c2558ef19b3cbcfb95baccc
JavaScript
p2hacks/teamR06
/server/js/hotspot.js
UTF-8
3,680
2.953125
3
[]
no_license
/* b1018194 Ito Hajime HotSpot.js hotspotを求める */ const bignum = require("bignumber.js") exports.gethotspot = (locationX, locationY, distance, locations) => { /*以下のconst値を引数としてとる*/ const mylocate = { x: locationX, y: locationY } // 自分自身の位置 const locateuser = locations /*[{ x: 1, y: 0 }, { x: 1, y: 1.5 ...
true
7f071de16962dd99cdf257dbed0a171a2092e48b
JavaScript
eternalsakura/DIE-corpus
/firefox/jit-test/proxy/testDirectProxySetArray1.js
UTF-8
533
3.171875
3
[]
no_license
// Assigning to a missing array element (a hole) via a proxy with no set handler // calls the defineProperty handler. function test(id) { var arr = [, 1, 2, 3]; var p = new Proxy(arr, { defineProperty(t, id, desc) { hits++; desc.value; "ponies"; desc.enumerable; true; desc.co...
true
6811be3c25b216ef9e74665c2442f85ea035f34b
JavaScript
JinminYANG/programmers
/lv_1/20day/20day.js
UTF-8
1,202
3.46875
3
[]
no_license
// lv.1 - 실패율 - 19day 이어서.. function solution(N, stages) { let answer = []; for (let k = 1; k <= N; k++) { let i = 0; let count = 0; let arr = []; for (i in stages) { if (k === stages[i]) { count++; arr.push(Number(i)); } ...
true
982bbd5597ca8bcf5db2ce7c5d404f24a9942681
JavaScript
bddbzz/nodejs-learning
/example5/server.js
UTF-8
418
2.734375
3
[]
no_license
const net = require("net") const server = net.createServer((socket) => { socket.on("data", function (buffer) { const lessonId = buffer.readInt16BE() console.log("server:",lessonId) buffer.write(Buffer.from(data[lessonId])) }) }) server.listen(4000) const data = { 1001: "课...
true
4259081e00780f2aa734384116f34b12e151bcc6
JavaScript
dhrutidas/bkzq
/admin/assets/js/question_04032017.js
UTF-8
6,495
2.578125
3
[]
no_license
$(document).ready(function () { $(document).on('change', '#QueImg,#QueTxt', function () { var txt = $(this).attr('id') === 'QueImg'; var img = $(this).attr('id') === 'QueTxt'; if (txt) { $('#QueTxt').val(''); $('#results').html(''); ...
true
ebf5f88e7cc4ac19f84ea8a088126108dde62b84
JavaScript
hamdihadj2011/DynamicCrediCard
/src/App.js
UTF-8
1,162
2.640625
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; import Card from './Card.js' import Form from './form.js' class App extends Component { constructor(props){ super(props) this.state={ serial:'************', date:'MMYY', user:'*******', msg:' ' } ...
true
89b95e4f41c36128086dcc37088908a3a116abef
JavaScript
alexxmitchell/no-database-project
/src/components/Locations/Locbox/Locbox.js
UTF-8
2,333
2.53125
3
[]
no_license
import React, { Component } from "react"; import axios from "axios"; import "./Locbox.css"; class Locbox extends Component { constructor(props) { super(props); this.state = { flag: false, userInput: "" }; this.handleAddToPlaces = this.handleAddToPlaces.bind(this); this.editing = thi...
true
9e402d63c238431be28f351751ed58d5a4618207
JavaScript
yinyinghuang/yinyinghuang.github.io
/homePage/production/waterfall/js/jq.js
UTF-8
1,577
2.671875
3
[]
no_license
var hArr=[]; $(function(){ var initBoxs=[]; $("#main").find(".box").each(function(){ initBoxs.push($(this)); }); waterfall(initBoxs); var dataInt={"data":[{"scr":"1.jpg"},{"scr":"4.jpg"},{"scr":"3.jpg"},{"scr":"1.jpg"},{"scr":"4.jpg"},{"scr":"1.jpg"},{"scr":"4.jpg"},{"scr":"1.jpg"},{"scr":"4.jpg"}]}; $(window...
true
5dbcc977a79ab4323978c3edab069794aae38e4f
JavaScript
zackstout/count-sort-vis
/scripts/draw.js
UTF-8
3,650
3.171875
3
[]
no_license
var randomList = []; let w, h; const list_len = 25; const start_len = 30; const end_len = 30; let max; const colors = ["#9b59b6", "#3498db", "#ffa500", "#e74c3c", "#008080", "#2ecc71", '#001f3f', '#85144b', '#AAAAAA', '#F012BE', '#0074D9']; let count_arr = []; let ivl2, ivl, ivl3; // not sure any need to be global -- ...
true
94755f066f1299651aaf630c0394478e7ccbfccb
JavaScript
riturajDas/simpLogin
/index.js
UTF-8
1,993
2.765625
3
[ "MIT" ]
permissive
$(document).ready(function() { $("#name").click(superplaceholder({ //SUPERPLACEHOLDERJS by Kushagra Gour. check it out! el:document.querySelector("#name"), sentences:["Alok Nath", "Tony Stark", "Donald Trump"], options: { letterDelay:100, sentenceDelay:1000, startOnFocus:true, loop:true, ...
true
0ab8d70b6f6088531b74461edf48e282777c7283
JavaScript
kandarpksk/chrome-counter
/background.js
UTF-8
3,981
2.953125
3
[ "Apache-2.0", "MIT" ]
permissive
"use strict"; function Counter(name, listener) { this.count = 0; this.name = name; this.listener = listener; } Counter.prototype.setCount = function(count) { this.count = count; this.listener(this); }; Counter.prototype.increment = function() { this.setCount(this.count+1); }; Counter.prototype....
true
4a9da474dc985dfe3be2be893e7f52d39df63afc
JavaScript
anuptamang/movie-database-app
/src/scripts/ui.js
UTF-8
2,778
2.796875
3
[]
no_license
export default class Movie { constructor() { this.latestHolder = document.querySelector('[data-latest]'); this.byRatingHolder = document.querySelector('[data-by-rating]'); this.detailsHolder = document.querySelector('[data-details]'); } getLatestMovies(movies, moviesHolder) { ...
true
04efc15858e74b7fc965d0446ecf247623aa314e
JavaScript
gregberns/IBE-JS-SDK
/IBE-SDK.js
UTF-8
51,633
2.828125
3
[]
no_license
/** Module P: Generic Promises for TypeScript Project, documentation, and license: https://github.com/pragmatrix/Promise */ var P; (function (P) { /** Returns a new "Deferred" value that may be resolved or rejected. */ function defer() { return new DeferredI(); } P.defer = def...
true
9b53be8fae9a24c9208bff04ac51556199b00ee4
JavaScript
civet-org/core
/src/Meta.js
UTF-8
1,044
2.703125
3
[ "MIT" ]
permissive
class Meta { constructor(base, instance) { this.data = base == null ? {} : base; this.instance = instance; } clear = () => { Object.keys(this.data).forEach((key) => { delete this.data[key]; }); }; delete = (key) => { const value = this.data[key]; delete this.data[key]; retu...
true
946529f4729f488f7ab45a28760dec146481de61
JavaScript
marcos-goes/livro_node
/03/multi.js
UTF-8
158
3.0625
3
[ "Apache-2.0" ]
permissive
setInterval(function(){ console.log("Esse é de 1 segundo..."); }, 1000); setInterval(function(){ console.log("Esse é de 2.5 segundos..."); }, 2500);
true
3c479147610e6fb013ab92afb9c6c4d725ecee46
JavaScript
agomezjuan/JS-Core
/JS Advanced/06 Exercise jQuery/5. DOM Search/dom-search.js
UTF-8
1,844
2.78125
3
[ "MIT" ]
permissive
function domSearch(selector, caseSensitive) { let div = $(selector).addClass('items-control'); let divAddControl = $('<div>') .addClass('add-controls') .append($('<label>').text('Enter text: ') .append($('<input>'))) .appendTo(div); let addButton = $('<a class="button">'...
true
8ecbca3b4b27c4e4b25bea85998292c6534cb6d3
JavaScript
MiYazJE/Discord-music-bot
/src/commands/skip.js
UTF-8
390
2.515625
3
[]
no_license
module.exports = skip; function skip(msg, channel) { if (!msg.member.voice.channel) { return msg.channel.send('⛔ **You have to be in a voice channel to skip the music!**'); } if (!channel.currentSong) { return msg.channel.send('⛔ **There is no songs to skip!**'); } msg.channel.send(`⏭ **Skipping** \`${channel...
true
1a1ea2750f2759c8105ce28cdcbe84221feb5460
JavaScript
yomandrake/diceGame_Heroku
/src/main/resources/static/js/canvasView.js
UTF-8
253
2.546875
3
[]
no_license
function setup() { var canvasMdk = createCanvas(windowWidth, windowHeight * 0.9); canvasMdk.parent('diceCanvas'); background(0); frameRate(60); } function draw() { fill(255); circle(mouseX, mouseY, frameCount % 50 + 1 ); }
true
e55314d626a27dbeaf2fecb5202b8cb28aade435
JavaScript
SBaumann94/Resinemat2
/src/ImageWithText.js
UTF-8
2,101
2.90625
3
[]
no_license
import React from 'react'; import pic1 from './resources/1.jpg' import pic2 from './resources/2.jpg' import pic3 from './resources/3.jpg' const text1 ="Géppark" const text2 ="Célgép tervezés" const text3 ="Prototípus fejlesztés" const timer = 3000 //images appear 3 second after load class ImageWithText extends React...
true
937117578207677e1e2a75e55e9518ddb2411e0b
JavaScript
ParentJA/neopantry-v0
/www/app/src/accounts/services/accounts_service.js
UTF-8
1,334
2.59375
3
[]
no_license
(function (window, angular, undefined) { "use strict"; function accountsService($http, AccountsModel) { var service = { getUser: getUser, hasUser: hasUser, logIn: logIn, logOut: logOut, signUp: signUp }; function getUser() { return AccountsModel.getUser(); } ...
true
4585b6dde9cf9e24d7483ab3b0a351d459b555d2
JavaScript
GoogleCloudPlatform/nodejs-docs-samples
/compute/create-instance-templates/getInstanceTemplate.js
UTF-8
1,844
2.609375
3
[ "Apache-2.0" ]
permissive
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
true
6a5bf8bcedffdb6df71b5a6cf5ed10a72dfff9cf
JavaScript
MukkiBhatt/Javascript-Tutorials
/binarysequence.js
UTF-8
735
3.75
4
[ "MIT" ]
permissive
<!DOCTYPE html> <html> <body> <p>Binary max sequence of 1 :</p> <p id="demo"></p> <script> let n = 16 var maxcount=0; var count = 0; var output='' var output2='' //Convert the number to binary while(n>=1){ let x = n%2; output+=x output2=x+output2 ...
true
fac06c12c85c4eb72467f47782698d1d37d441d9
JavaScript
xabi88/dell_pokemon
/test.js
UTF-8
3,790
3.375
3
[]
no_license
var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); function displayBoard (board) { console.log(` ${board.A1} | ${board.B1} | ${board.C1}\n ___|____|___\n | | \n ${board.A2} | ${board.B2} | ${board.C2}\n ___|_...
true
42bd238af6656fd6d378619d0c00ef00619d3c6c
JavaScript
BoantaCristian/AngularApps
/Students/server/server.js
UTF-8
2,442
2.546875
3
[]
no_license
const express = require('express') const cors = require('cors') const bodyParser = require('body-parser') const mongoose = require('mongoose') const Student = require('./Models/student') const app = express() const router = express.Router() app.use(cors()) app.use('/', router) app.use(bodyParser.json()) mongoose.co...
true
be5635305b766608854f7a33d708ce7dc051684c
JavaScript
agulon1617/animacjeJQ
/js.js
UTF-8
592
2.578125
3
[]
no_license
$(document).ready(function(){ $("button").click(function () { $(".kwadrat").animate({ left: '100px', height:'100px', width:'100px' }, { duration: 3000, complete: function() { $(this).animate({ background...
true
5c9f2f3cdea45a8307d1c89c76b0f08256b0c6ee
JavaScript
doheelab/js-study
/redux-thunk/src/actions/index.js
UTF-8
725
2.78125
3
[]
no_license
import jsonPlaceholder from '../apis/jsonPlaceHolder'; // action creators // Bad approach: breaking the rule of redux // Error: Actions must be plain objects. Use custom middleware for async actions. export const fetchPosts = () => { // 첫번째 문제 // async // const response = await jsonPlaceholder.get('/posts'); /...
true
53c6d21faeda15b1a5f876105c8283a70a00f20f
JavaScript
BeauHibbert/seattle-code-201d80
/class-06/demos/domain-modeling-and-dom/js/app.js
UTF-8
3,196
3.953125
4
[]
no_license
// problem domain: the Seattle Kitten Rescue has tons of kittens who need good homes. One of the best ways to reach prospective adoptive homes is to have profiles for each kitten available on a website. There are hundreds of kittens, though, and only a few volunteers; it's too time-consuming to hand-code each kitten's ...
true
bf85bf43f15a0f987c9bc43db6e2369f82aee183
JavaScript
bmcmillen/okcoders
/week3b/ajax.js
UTF-8
753
2.9375
3
[]
no_license
var express = require('express'); // Don't forget to install the express module var app = express(); // Create our express app app.use('/', express.static('./public')); // Tell express to mount whatever files are in the current directory at / app.get('/time'...
true
77603f98aef3e82e3521fab6c34bb0f994b2f500
JavaScript
cmaddern-stack/COMP30022
/src/components/header/NotificationIcon.js
UTF-8
1,988
2.625
3
[]
no_license
import React from "react"; import { FontAwesome } from "react-icons/fa"; import { FaBell } from "react-icons/fa"; import "../../css/Header.css"; /** * Notification Icon * situated on the header between dark mode toggle icon and profile icon * When clicked a dropdown of users notifications appears */ class Notifica...
true
4084b87d78e46a8b2bcde1571260a148f4c2fc24
JavaScript
ThomasAriano/FBPokeBot
/surveyBot.js
UTF-8
273
3.03125
3
[]
no_license
function clickAll() { var inputs = document.getElementsByTagName("input"); console.log("Length: " + inputs.length); for(var i=0;i<inputs.length;i++) { if(inputs[i].type == "radio" && inputs[i].getAttribute("qsox") == "4") { inputs[i].click(); } } } clickAll();
true
867a4982cfa9cbcb54cb6adab6ae18b276088da9
JavaScript
GuyShefer/JavaScriptExrecises
/1 .0 - more-questions/24.js
UTF-8
688
3.59375
4
[]
no_license
// function cakes(recipe, available) { // let cakes = Infinity; // for (const [key, value] of Object.entries(recipe)) { // if (available[key] == null) { // return 0; // } // cakes = Math.min(cakes, Math.floor(available[key] / value)); // } // return cakes; // } // co...
true
5bee0161a421dd6b3d071568df1b0a6c5e6f8926
JavaScript
aparkova/NodeTutorial
/7-mind-grenade.js
UTF-8
327
3.171875
3
[]
no_license
<<<<<<< HEAD // const num1 = 5; // const num2 = 10; function addValues(num1, num2){ console.log(`the sum is: ${num1 + num2}`) } ======= // const num1 = 5; // const num2 = 10; function addValues(num1, num2){ console.log(`the sum is: ${num1 + num2}`) } >>>>>>> dc24a9d1083b2435d1b852c258555dc67b4a4a3a addValue...
true
e7c276b9e12ee23ac2020d1700083a41f01483ed
JavaScript
ParmeJon/leetcode_problems
/Generate Parentheses/Answer.js
UTF-8
1,006
3.75
4
[]
no_license
var generateParenthesis = function(n) { const leftArr = [], rightArr = [], result = []; for (let count = 0; count < n; count++) { leftArr.push("("); rightArr.push(")"); } function generate(left, right, arr) { //Boundary if (left <= 0) { if (right > 0) { for (let i = 0; i ...
true
faa4e3ccc01daba740a857c83b4f49fd139c90ed
JavaScript
jakep5/DSA-Searching
/search.js
UTF-8
3,322
3.859375
4
[]
no_license
//1) How many searches? //Sorted list - [3, 5, 6, 8, 11, 12, 14, 15, 17, 18] //Target number - 8 //Using recursive binary search algo, identify the sequence of numbers each recursive call will search to try and find 8 //Recursive call 1 - start at 11, 8 is less than 11 (index of 4), so will call again with index of 3...
true
88cdbbaa2bc1d03dc76ef31d2f6943f78779d5c3
JavaScript
RostyslavOstapyak/javaScriptPratice
/lesson6/task10/index.js
UTF-8
128
2.859375
3
[]
no_license
function cloneArr(arr) { if (!Array.isArray(arr)) { return null; } let resultArr = arr.slice(); return resultArr; }
true
1169355baa53992c030e00d1ac9b3c4b90d98f38
JavaScript
irfaanf/JAM
/type-comparisons.js
UTF-8
1,760
4.75
5
[]
no_license
/** * Type Comparisons */ // console.log("Type Comparisons") // Strict equality === // Comparing values only vs comparing values and types // Will return true only if the two operands have same value and type // var num1 = 7; // var num2 = 7; // console.log(num1 == num2); // Ordinary equality: Checks value only // c...
true
16568a33f31cd5a278a9707bd9324b077a61ff2e
JavaScript
IsaSanchezTorron/entregas-hab
/JS/Entrega4/conversorMoneda.js
UTF-8
948
3.515625
4
[ "MIT" ]
permissive
const url = "https://api.exchangerate-api.com/v4/latest/EUR"; const fetchPromise = fetch(url); fetchPromise .then((response) => response.json()) .then((data) => { const valorDelEuro = data.rates.EUR; console.log(`Partimos de que el valor del euro es ${valorDelEuro}`); const valorDelYen = data.rates.JPY...
true
7db505ea548d79a393f33a4d1cd489cc44028fe9
JavaScript
CongoCash/react-tinmage
/src/containers/category/Category.js
UTF-8
3,865
2.578125
3
[]
no_license
import React, { Component } from 'react' import ImagesModel from '../../models/Image.js' import CategoryImage from '../category-image/CategoryImage' import Pagination from "react-js-pagination"; import './Category.css' class Category extends Component { constructor(){ super(); this.state = { images: '...
true
2f7e00fd98e6195bbe1a25a9d2cdbb58423a28a4
JavaScript
rrxrskadosh/am3_sequelize_babel_auth_12
/src/controllers/auth.js
UTF-8
2,371
2.921875
3
[]
no_license
import { Users } from "../models/"; import bcryptjs from "bcryptjs"; import { generateJWT } from "../middlewares/jwt"; //1. Completar la logica para manejar el inicio de sesión // - responder con un codigo de estado 401 cuando las credenciales sean incorrectas // - responder con un mensaje (message) y codigo de estado...
true
f29c6564c25b84289baaba511bd60d5681de24db
JavaScript
BOJ-expedition/Challenges-of-the-week
/2021W09/fienestar/pgr_42747.js
UTF-8
415
3.09375
3
[]
no_license
/* H-Index https://programmers.co.kr/learn/courses/30/lessons/42747 */ function solution(citations) { let map = {} let max = 0 citations.forEach(v=>map[v] = 0) citations.forEach(v=>{ ++map[v] max = Math.max(max,v) }) let sum = 0 for(let i=max;i>=0;--i){ ...
true
8d928776229f0954a8f54f7721293cbcce991e22
JavaScript
VPoshelyuk/js-advanced-scope-closures-lab-nyc-web-091619
/index.js
UTF-8
577
3
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
function produceDrivingRange(rng) { return function(arg1, arg2){ let diff = parseInt(arg2) - parseInt(arg1) if (rng > diff) { return `within range by ${rng - diff}` } else { return `${diff - rng} blocks out of range` } } } function produceTipCalculator(ti...
true
b071a93a179e33c85f9af7c665f21420bf61f79c
JavaScript
websemantics/lolviz.js
/src/support/dom.js
UTF-8
1,648
3.296875
3
[ "MIT" ]
permissive
/** * SVG helper library to create/manipulate SVG DOM elements. * * @version 1.0.0 * @copyright (c) 2016-2018, Web Semantics, Inc. * @author Adnan M.Sagar, PhD. <adnan@websemantics.ca> * @license Distributed under the terms of the MIT License. */ /** * Get or set an SVG DOM node attribute. * * @param {Elemen...
true
9c0b72f064f61c1e604fbcc8ef83f56acc68116e
JavaScript
zhxlhd/admin
/src/utils/DateUtils.js
UTF-8
917
3.3125
3
[]
no_license
/** * 时间格式化 * @param {String} formatter * @param {String} date * dateFormatter('YYYY-MM-DD HH:mm', '1995/02/15 13:55') // 1995-02-15 13:55 */ export function dateFormatter(formatter, date){ date = (date ? new Date(date) : new Date) const Y = date.getFullYear() + '', // 年 M = date.getMonth() + 1, ...
true
c001bf6619dd07731cabdca05134bff40cdf458a
JavaScript
SarahKhachatryan/JS_Backend_PicsArt
/eventEmitter.js
UTF-8
615
3.5625
4
[]
no_license
/**EventEmitter implementation*/ class EventEmitter { listeners = []; emit(eventName, ...data) { this.listeners.filter(({name}) => name === eventName) .forEach(({callback}) => callback.call(this, ...data)); } on(name, callback) { if (typeof callback === 'functio...
true
4faceaca79e381b9669bc6868fbd05c225d4a12a
JavaScript
ntdvl/javascriptworks
/75. Gün/3. Calisma/app.js
UTF-8
151
2.734375
3
[]
no_license
function test () { var x = document.getElementById('email'); if (x.value != '') { alert(x.value); } else { alert('Boş Bırakma'); } }
true
a47e011e0f34d25f4ca19806a6f85587d62a3527
JavaScript
reinarivera16/employee_summary_generator
/app.js
UTF-8
3,864
3.3125
3
[]
no_license
const Manager = require("./lib/Manager"); const Engineer = require("./lib/Engineer"); const Intern = require("./lib/Intern"); const inquirer = require("inquirer"); const path = require("path"); const fs = require("fs"); const OUTPUT_DIR = path.resolve(__dirname, "output"); const outputPath = path.join(OUTPUT_DIR, "tea...
true
4bb0bad24a0cd96f0016e768e6119f3892b4c128
JavaScript
sunilmalviya21/reactlive
/src/About.js
UTF-8
274
2.578125
3
[]
no_license
import React from 'react'; const fname = "Sunil Malviya"; const cdate = new Date().toLocaleDateString(); function Aboutus() { return( <div> <h1>About Component {fname}</h1> <p>Current Date = {cdate}</p> </div> ); } export default Aboutus;
true
cb822f8a8626b962a234af844dddf952dd526b7d
JavaScript
wmira/reactor-ui
/test/util/mergeStylesSpec.js
UTF-8
1,392
2.65625
3
[ "MIT" ]
permissive
import should from 'should'; import { mergeStyles as mstyles , ternStyle as tstyle } from 'reactor-ui/util/mergeStyles'; describe('mergeStyles tests', () => { it('returns all styles as normal', () => { const result = mstyles({background: 'A'}, {color: 'red'}); should( result ).be.ok(); shou...
true
af288bd3c6c0f7fda2294def98e6c0ae30c4cc94
JavaScript
singpath/verifier
/tests/testPromiseFs.js
UTF-8
1,374
2.546875
3
[ "MIT" ]
permissive
'use strict'; const path = require('path'); const expect = require('expect.js'); const promiseFs = require('../src/promiseFs'); const pathExist = promiseFs.pathExist; const readFile = promiseFs.readFile; describe('pathExist', function() { it('should resolve to the file path the the file exist', () => { const e...
true
b7fbe7a335df9239b81cd785b7eb708aa193088b
JavaScript
triciamedina/DSA-Searching
/treeTraversals.js
UTF-8
565
3.09375
3
[]
no_license
const BST = require('./BST'); function main() { let tree = new BST(); tree.insert(25, 25); tree.insert(15, 15); tree.insert(50, 50); tree.insert(10, 10); tree.insert(24, 24); tree.insert(35, 35); tree.insert(70, 70); tree.insert(4, 4); tree.insert(12, 12); tree.insert(18, 1...
true
e18369f393e3448146ff6e712d8bca03ab6e072d
JavaScript
narennadig/Blockchainvoting
/E_pollingprocess/Files/JS/conform.js
UTF-8
246
2.703125
3
[]
no_license
function confirmvote(var vote) { if(vote!=null) { if (confirm('You VOTE for '+vote+' click Ok to CONFIRM')) { return true; } else { return false; } } else { alert(" select voter first "); } }
true
b72d0a616041ae120dc9166c7c0a0aaa49f9852f
JavaScript
theodosiskrt/Sorting-Algorithms
/Sorting Algorithms/insertionSort.js
UTF-8
619
3.90625
4
[]
no_license
const insertionSort = (array) => { for (let i = 1; i < array.length; i++) { for (let j = i; j >= 0; j--) { if (array[j] < array[j - 1]) { [array[j], array[j - 1]] = [array[j - 1], array[j]]; } else break; } } return array; } const testArra...
true
421c62eb38c81fa909711b978cfcf790787706a6
JavaScript
Pablo-rodri/proyecto3
/client/src/components/pages/UsersPage/UsersList.js
UTF-8
1,186
2.5625
3
[]
no_license
import { Component } from "react" import { Row, Col } from "react-bootstrap" import UsersService from '../../../services/user.service' //trae la informacion del servidor a traves del service creado import UserCard from "./UserCard" class UsersList extends Component { // el constructor es lo 1 que se ej...
true
c32a7a4a8db8659d43f3069ff21f7b9cf66a25a8
JavaScript
NilsonRCS/trybe-exercises
/exercises/introducao-a-javascript-e-logica-de-programacao_1/Dia1/Dia1_exercício7.js
UTF-8
262
3.75
4
[]
no_license
let a = 25; let b = 39; let c = 258; if (a > b && a > c) { console.log ('o maior numero é A =' + ' ' + a ) } else if (b > a && b > c) { console.log ('o maior numero é B =' + ' ' + b ) } else { console.log ('o maior numero é C =' + ' ' + c ) };
true
8f73315914b912f59fa35335b5a0a032041ec048
JavaScript
isabellatea/MindFeed
/backend/helpers/bookmarkVideo.js
UTF-8
1,301
2.640625
3
[]
no_license
const User = require('../db').User; const Video = require('../db').Video; const bookmarkVideo = (req, res) => { let email = req.query.email; let videoId = req.query.videoId; let bookmark = req.query.bookmark; User.findOne({email: email}, (err, data) => { if(err) { throw err; ...
true
0f93956abad68f2337a5e88b65c56d8f1503fa98
JavaScript
classicL/2048
/js/Cubes.js
UTF-8
11,214
3.234375
3
[]
no_license
/** * Created by xiaohu on 2015/4/21. */ //对象的克隆 Object.prototype.deepClone=function(){ function cloneObj(){} cloneObj.prototype = this; var obj = new cloneObj(); for(var o in obj){if(typeof(obj[o])=="object")obj[o]=obj[o].deepClone();} return obj; }; //方块组的构造函数 function Cubes(){ for (var i ...
true
d1a4249b3e069c84248c6636dfa3fdc246d81e4e
JavaScript
exORYON/Space-invaders
/scripts/Player-ship.js
UTF-8
3,492
2.90625
3
[]
no_license
export class PlayerShip { constructor() { this.playerShipIcon = new Image(); this.playerShipIcon.onerror = () => { this.playerShipIcon.src = 'https://raw.githubusercontent.com/exORYON/Projects-preview/8f68ad6c52f7a731fb8ca3446e95770b7f4127ed/player-ship.svg'; }; this.play...
true
949cf1f996946dc289ea5eb473c727b3e673ecb3
JavaScript
RasmusJessen/avanceret-webintegration
/js/page_test.js
UTF-8
405
2.71875
3
[]
no_license
let bamse = new spiller(); let profilknap = document.querySelector("#profil"); profilknap.addEventListener("click", function(event){ console.log("du har klikket"); console.log(bamse.profil()); }) let aktivknap = document.querySelector("#skiftaktiv"); aktivknap.addEventListener("click", function(event){ ...
true
5d88e9a1e8f96bc8f607f876c65e1b918a2051a5
JavaScript
ToqYang/holbertonschool-web_front_end
/0x0D-JQuery_advanced/5-dev.js
UTF-8
879
3.296875
3
[]
no_license
// Click attribute and remove function function createFamilyTree() { $( 'body' ).append( '<table>\n<thead style=\"font-weight: bold; font-size: 2rem;\">\n<tr>\n<th>Firstname</th>\n<th>Lastname</th>\n</tr>\n</thead>\ \n<tbody style=\"font-weight: 500; font-size: 1.5rem;\">\n</tbody>\n</table>' ); } function addNewM...
true
51ae794026fb6d62c7ddb6bcaad7d1aa8509745d
JavaScript
auth0/auth0-metrics
/lib/dwh/index.js
UTF-8
4,210
2.578125
3
[ "MIT" ]
permissive
/** * Module dependencies. */ var _ = require('lodash'); var request = require('superagent'); var uuid = require('uuid'); var cookie = require('./cookie')(); var store = require('./store')(); var memory = require('./memory')(); var debug = require('debug')('auth0-metrics:dwh'); /** * Expose dwh */ module.expor...
true
14512830d6e10855a4d452b779be97fdd9fee57a
JavaScript
abopeto1/schoolbac_bulletin
/src2/utils/handleSelectAll.js
UTF-8
265
2.609375
3
[ "JSON", "MIT" ]
permissive
export const handleSelectAll = (event, data, setSelectedDataIds) => { let newSelectedDataIds; if (event.target.checked) { newSelectedDataIds = data.map((d) => d.id); } else { newSelectedDataIds = []; } setSelectedDataIds(newSelectedDataIds); };
true
d287ddc538295b2629987c45b9143db3ff70279c
JavaScript
miszo/typescript-course
/app.js
UTF-8
1,320
3.984375
4
[]
no_license
"use strict"; // string var myName = 'Miszo'; // myName = 30; // type error // number var myAge = 30; // myAge = 'Miszo'; // type error // boolean var hasHobbies = true; // or false // hasHobbies = 1; // type error // assign types var myRealAge; myRealAge = 30; // myRealAge = '30'; // array var hobbies = ['cooking', 'f...
true
46639d24e410fcaf4336c19eb42c069e1cbc5995
JavaScript
sandra9711/Librosopedia
/public/JS/store.js
UTF-8
3,782
2.828125
3
[]
no_license
document.addEventListener("DOMContentLoaded",event=>{ const app=firebase.app(); console.log(app) const createThing = document.getElementById('subtn'); // const thingsList = document.getElementById('thingsList'); //const db = firebase.firestore(); let thingsRef; let unsubscribe; }); var I...
true
a905f4d3bd32f360cf89f411832709453500626b
JavaScript
joaopedrodcf/blog-react
/src/components/Main/PostDetailed/PostDetailed.js
UTF-8
2,681
2.75
3
[]
no_license
import React from 'react'; import PropTypes from 'prop-types'; import { Container, Article, Figure, FigureContainer, Comment, CommentSection } from './style'; import { getPost } from '../../../services/api'; import CommentFormik from '../Forms/CommentFormik'; const formatDate = date => new Date...
true
0ae7a2ec930e72d479f8bf2a9d66d9af00620498
JavaScript
mubreda/checkboxlist
/src/context/tree.js
UTF-8
1,711
2.53125
3
[]
no_license
import React from 'react'; import { nodeHasChildren, allChildrensAreSelected, someChildrensAreSelected } from '../helpers/tree'; const TreeContext = React.createContext(); export const TreeContextProvider = ({ children }) => { const [selectedNodes, setSelectedNodes] = React.useState({}); React.useEffect(() => {...
true
fa23bd65936753b92645e7f174d43c2c14f4d681
JavaScript
KyhleOhlinger/Reporting-A-COS301
/Server Files/importTest.js
UTF-8
2,515
2.78125
3
[]
no_license
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ //-------------------------------------------------------------------IMPORT FILE TO DATABASE---------------------------------------------------...
true
cdb10fe855e1d7140cee6b808b41c6c061e2780f
JavaScript
ya-iris/MovieStash
/public/js/reviewManager.js
UTF-8
1,902
2.859375
3
[]
no_license
(function(){ const modalBtn = document.querySelector('.add-review '); const modalwindow = document.querySelector('.modal-window'); if(modalBtn) modalBtn.addEventListener('click', () => { modalwindow.classList.add('modal-window--active'); }); if(document.querySelector('.modal-window__close')) doc...
true
6fe06616afb4914025bfb9def756be5a1cd9bbcd
JavaScript
commenthol/mongoose-reconnect
/lib/index.js
UTF-8
4,817
2.703125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/** * @license MIT * @copyright 2015- commenthol */ 'use strict' var mongoose = require('mongoose') var debug = require('debug')('mongoose-reconnect') function noop (callback) { callback && callback() } /** * Handle connection reconnects * * @example * var reconnect = require('./mongoose-reconnect'); * //...
true
3a8f9d719a396fae195202d374a65ab1493ab407
JavaScript
triver/demos
/word/util.js
UTF-8
9,056
2.828125
3
[]
no_license
//Vec2 function Vec2(x,y){ this.x = x || 0; this.y = y || 0; } Vec2.prototype = { clone: function(){ return new Vec2( this.x, this.y ); }, copy: function( v){ this.x = v.x; this.y = v.y; return this; }, add: function( v ){ this.x += v.x; this.y += v.y; return this; }, subtract: function( v ...
true
90098f171419e3c8f369ebcaefbedfe3b50284ed
JavaScript
ANDRZEJ1988/js
/part2.js
UTF-8
1,950
3.1875
3
[]
no_license
let users = [ {name: 'vasya', age: 31, status: false}, {name: 'petya', age: 30, status: true}, {name: 'kolya', age: 29, status: true}, {name: 'olya', age: 28, status: false}, {name: 'max', age: 30, status: true}, {name: 'anya', age: 31, status: false}, {name: 'oleg', age: 28, status: ...
true
bce2e1a25a806190594bdcf684b269cab2831c13
JavaScript
shanselman/WebFundamentals
/gulp-tasks/wfUpdatedOn.js
UTF-8
2,133
2.53125
3
[ "Apache-2.0" ]
permissive
/** * @fileoverview Gulp Task for updating wf_updated_on. * * @author Matt Gaunt */ 'use strict'; const gulp = require('gulp'); const chalk = require('chalk'); const fse = require('fs-extra'); const moment = require('moment'); const gutil = require('gulp-util'); const wfRegEx = require('./wfRegEx'); const wfHelpe...
true
20fc17b8dde5acfc9f86ed72a715c1a4eff5d599
JavaScript
dmitryzozulia/basic-js
/src/carbon-dating.js
UTF-8
472
2.953125
3
[ "MIT" ]
permissive
const MODERN_ACTIVITY = 15; const HALF_LIFE_PERIOD = 5730; module.exports = function dateSample(sampleActivity) { if (typeof sampleActivity !== 'string') return false sampleActivity = parseFloat(sampleActivity) if (typeof sampleActivity !== 'number') return false const t = Math.log(MODERN_ACTIVITY / sa...
true
4ba8001d06599fc29449af0b86fc80da356a8dd7
JavaScript
davidlpc1/gerar-pdf-nodejs
/first_src/server.js
UTF-8
1,210
2.59375
3
[]
no_license
const express = require("express"); const ejs = require("ejs"); const path = require("path"); const htmlPdf = require("html-pdf"); const app = express(); const PORT = process.env.PORT || 3000; const passengers = [ { name: "Joyce", flightNumber: 7859, time: "18h00", }, { name: "Brock", flight...
true
332864f8e9fe1bc1682d62214b32c705055c7d06
JavaScript
Adam-SungMin-Park/LeetCode-practice
/twoSum/main.js
UTF-8
357
3.078125
3
[]
no_license
/** * @param {number[]} nums * @param {number} target * @return {number[]} */ var twoSum = function(nums, target) { let test = new Map(); for(var i = 0 ; i < nums.length; i++){ if(test.has(target- nums[i])){ return [test.get(target-nums[i]),i] }else{ test.set(nums[i],...
true
6dc476b6d46c4658b7d53f1c3db5517b7e3fcddf
JavaScript
LAdeveloper99/MERNJan2021
/pokemon-demo/Player.js
UTF-8
411
3.28125
3
[]
no_license
class Player { constructor(){ this.hand = []; } addToHand(target){ this.hand.push(target); } playCard(target){ for(let i = 0; i < this.hand.length; i++){ if (this.hand[i].name == target.name) { var card = this.hand[i]; this.hand.s...
true
d085924243e1581f211be61c363a9a7777da287a
JavaScript
anthonylegrand/CA-Contest-Rennes-Anthony-Legrand
/js/translate.js
UTF-8
613
2.828125
3
[]
no_license
// Récupération du paramétre "lang" dans l'URL let lang = getUrlParam("lang") || "fr" init() function init(){ let json = FR_LANG if(lang === "en") json = EN_LANG setStringText("AboutMe", json) setStringText("Hi", json) setStringText("AboutMe_Text", json) setStringText("MyProjects", j...
true
31df0479664dd0f2ab3908c0fdb9f76004953efd
JavaScript
lmarzy/archive
/js-algorithms/src/browserify/algorithms/is-prime.js
UTF-8
451
3.625
4
[]
no_license
'use strict'; function isPrime(n){ //create the starter dividor number and set to 2 var divisor = 2; //initialise while loop to check n > dividor and then if n % divisor returns 0 if so return false and if not increment divisor and start again while (n > divisor){ if(n % divisor == 0){ return false; ...
true
ed71b0889eff91a1650c53d013b48303a3d0e35f
JavaScript
sararoohan/prep-0221-code-solutions
/prep-javascript-objects/main.js
UTF-8
846
3.53125
4
[]
no_license
var person = { firstName: 'Sara', lastName: 'Roohan', hobby: 'Reading and Learning' }; console.log(person); var fullName = (person.firstName + ' ' + person.lastName); console.log('The person\'s name is:', fullName); person.job = 'Full Time Mom/Student'; console.log('The person\'s current job is:', person.job); ...
true
7b61b6d408d64f942a4f7e972e86b9cbda03b8cf
JavaScript
BeratKARATAS53/Movie-Tracker-Frontend
/src/components/AddDirector.js
UTF-8
2,966
2.5625
3
[]
no_license
import axios from "axios"; import React, { Component } from "react"; import { Redirect } from "react-router-dom"; import DatePicker from "react-datepicker"; import "../assests/css/Button.css"; import "../assests/css/Form.css"; export default class AddDirector extends Component { constructor() { super(); th...
true
09517e5042bd8457f26b455e50bd3bc916384398
JavaScript
annalanigan/mongodb_practice
/client/src/app.js
UTF-8
1,062
3.28125
3
[]
no_license
const CharView = require('./views/charView'); const Request = require('./services/request.js'); const charView = new CharView(); const request = new Request('http://localhost:3000/api/disney') const app = function(){ const createButton = document.querySelector('#submit-button'); createButton.addEventListener('cl...
true
26b757cb74272e225de4d52f866dc6cafcb0e921
JavaScript
maritza723/LeetCodeWork
/easy/1TwoSum.js
UTF-8
1,160
4.28125
4
[]
no_license
/**1. Two Sum * Given an array of integers, return indices of the two numbers such that they add up to a specific target. * * You may assume that each input would have exactly one solution, and you may not use the same element twice. * * Example: * Given nums = [2, 7, 11, 15], target = 9, * * Because nums[0]...
true
b87eeced7d48ee6364aac400487ce3dea74738da
JavaScript
Szczepan1771/star-wars-card-game-react-redux
/src/actions/Tutorial/index.js
UTF-8
1,539
2.53125
3
[]
no_license
import {fetchDataBegin, fetchDataSuccess, fetchDataFailure} from '../index'; export function fetchPlayerTutorial(playerName) { return dispatch => { return fetch('http://localhost:8000/PlayerDeck/' + playerName) .then(dispatch(fetchDataBegin())) .then(response => { if...
true
60a965baab535c8f8033f00fb4cd9962f6d1c0c7
JavaScript
green-fox-academy/JialinWang1JS
/week-01/day-05/Aircraft/Aircraft.js
UTF-8
1,053
3.03125
3
[]
no_license
class Aircraft{ constructor(type){ this.type = type this.ammoStorage = 0 this.maxAmmo = type === 'F16' ? 8 : 12 this.baseDamage = type === 'F35' ? 50 : 30 } fight(){ let damge = this.ammoStorage * this.baseDamage this.ammoStorage = 0 return damge ...
true