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
68fa93350ddbd6215fbda949edf5983ded805ed4
JavaScript
loynin/fullsuper
/src/actions/tasks.js
UTF-8
6,671
2.578125
3
[]
no_license
import uuid from 'uuid'; import moment from 'moment'; import database from '../firebase/firebase'; import { RRule, RRuleSet, rrulestr } from 'rrule'; import { RRuleInputDate, RRuleFREQ } from '../libs/utils'; export const addTask = ( task ) => ({ type: 'ADD_TASK', task }); export const startAddTask = (taskDat...
true
fbb093af64b79ba1bad6f45ef3577d2b1ac29c21
JavaScript
mizchi-sandbox/rpg-prototype
/src/domain/utils/arrayUtils.js
UTF-8
256
2.828125
3
[ "MIT" ]
permissive
/* @flow */ export function pickRandom<T>(arr: T[]): T { return arr[~~(Math.random() * arr.length)] } export function updateIn<T>( arr: T[], matcher: T => boolean, replacer: T => T ): T[] { return arr.map(i => (matcher(i) ? replacer(i) : i)) }
true
dee17dd29ce150b3eacd8b41a4736b18cc22661b
JavaScript
SimonDemeyere/courses
/Javascript/oefeningen/reeks 1/oef1/script.js
UTF-8
366
3.515625
4
[]
no_license
let age = prompt("Geef leeftijd in:"); function checkLeeftijd(leeftijd) { if(leeftijd < 18) { return "Om deel te nemen aan de spelen van de Nationale Loterij moet je minimum 18 jaar oud zijn."; } else { return `Je bent ${leeftijd} jaar oud. Je mag deelnemen aan de spelen van de Nationale Loteri...
true
dad3b335fc381983c2801e4c0ae3d3a8416298af
JavaScript
t0nin0s/Codewars
/katas/functionalAddition.js
UTF-8
295
3.15625
3
[ "MIT" ]
permissive
function functionalAddition(n) { if (isNaN(n)) throw new Error("first param is not a number"); return function(numero) { if (!isNaN(numero)) { return numero + n; } else { throw new Error("second param is not a number"); } }; } module.exports = functionalAddition;
true
68b6b6bff118b611d7b34c88467be6a56e4c4c98
JavaScript
thiagoskbnsk/masterclass-js
/01.module-js/04.operators/07-true-false.js
UTF-8
252
3.671875
4
[]
no_license
// true = true // false = false // "nomeaqui" = true // "" = false // null = false // undefined = false // 0 = false // 123 = true // -123 = true const nome = undefined; if (nome) { console.log('tem nome') } else { console.log('não tem nome'); }
true
2a31137c973131a6accca71926b03e95cc429695
JavaScript
muraliR/bmi-calculator
/public/js/app.js
UTF-8
4,133
2.71875
3
[]
no_license
App.controller('home', function (page) { $(page).delegate('.submit-button','click',function(){ var weight = $('input[name="weight"]').val(); var height = $('input[name="height"]').val(); var age = $('input[name="age"]').val(); var waist = $('input[name="waist"]').val(); var ...
true
25b6aa6ffdcea105f65e3efb181d1e9ce8074478
JavaScript
Alex-Wolf-7/adoptadog-react
/src/components/authenticate.js
UTF-8
547
2.671875
3
[]
no_license
// Boots to login page if not admin function adminOnly(clearance) { if (clearance !== "admin") { window.location.replace("/"); } } // Boots to login page if not logged in as "user" (admins not allowed either) function userOnly(clearance) { if (clearance !== "user") { window.location.replace("/"); } } ...
true
e99fff0d1d8f818c1d4a3aa9c5c23ce6ed95adcf
JavaScript
electron-utils/electron-profile
/lib/utils/schema.js
UTF-8
1,398
3.15625
3
[ "MIT" ]
permissive
'use strict'; /** * @method getVauleType * @param {*} value */ let getValueType = function (value) { switch (typeof value) { case 'boolean': return 'boolean'; case 'number': return 'number'; case 'string': return 'string'; case 'object': if (!value) { return 'null'; } else if ...
true
142567520e030652e37be7c098a09a7bd1adb18e
JavaScript
8bitDesigner/terroir
/src/reducers/map-generation.js
UTF-8
1,397
2.859375
3
[]
no_license
/* eslint-disable no-return-assign */ import DiamondSquareGenerator from '../models/diamond-square.js' import MidpointDisplacementGenerator from '../models/midpoint-displacement.js' import PerlinNoiseGenerator from '../models/perlin-noise.js' import PerlinOctaveGenerator from '../models/perlin-octaves.js' const initi...
true
f09253ab56c903aa0d45c1a63adb5d36695d040a
JavaScript
daniel100f/formas
/main.js
UTF-8
1,832
3.546875
4
[]
no_license
function operacionesBasicas(){ var a; var b; var suma; var resta; var multi; var divi; var a=parseInt(prompt("por favor ingrese el primer valor")); var b=parseInt(prompt("por favor ingrese el segundo valor")); suma= a+b; resta= a-b; multi= a*b; divi= a/b; alert(" el resultado de la suma es "+ suma + ...
true
2b3fc72ec44dc83c8b69472e1f8ea49e1eb0429a
JavaScript
cninjy/An-old-test-task-webpage
/js/sortings.js
UTF-8
3,862
3.46875
3
[ "MIT" ]
permissive
// Реализация алгоритмов сортировки; // Сортировка "пузырьком"; // Возвращает последовательность перестановок для сортировки, впоследствии используемую для анимации; function bubbleSort(na){ var lc = 0; var swaps = 0; var swapTh = null; do { swaps = 0; for (lc = 0; lc < na.length; lc++){ ...
true
2a0bc52fb3c1ed8e745b752aaecc1cc0f4db5f93
JavaScript
aedimoff/LeetCode
/find-pivot-index/find-pivot-index.js
UTF-8
408
3.09375
3
[]
no_license
/** * @param {number[]} nums * @return {number} */ var pivotIndex = function(nums) { const total = nums.reduce((total, val) => total + val) let currSum = 0 for(let i = 0; i < nums.length; i++) { let rightSum = total - currSum - nums[i] if(rightSum === currSum) { ...
true
30b655f605b5e22e2300e1ffba795b498b72932d
JavaScript
6998/db
/part3/front-end/src/App.js
UTF-8
2,431
2.609375
3
[]
no_license
import React, { Component } from 'react'; import './App.css'; import axios from 'axios'; import Table from './Table'; import Query1 from './Query1'; import Query2 from './Query2'; import Query3 from './Query3'; import Query4 from './Query4'; import baseUrl from "./baseUrl"; console.log(process.env) class App extends C...
true
040690c60026ab614d24850b3c1e0bec0fc47b95
JavaScript
quantumwebgarden/quantumwebgarden.github.io
/client4/verifytest.js
UTF-8
1,576
2.5625
3
[]
no_license
var phno = ""; window.onload=function () { render(); }; function render() { window.recaptchaVerifier=new firebase.auth.RecaptchaVerifier('recaptcha-container'); recaptchaVerifier.render(); } function phoneAuth() { //get the number var number= "+91" + document.getElementById('number').value; ...
true
d3da5c757545eafded3563d976feae8514440e03
JavaScript
jannson/jsmips
/js/node/node_log.js
UTF-8
440
2.65625
3
[]
no_license
LOG_LEVEL = 2 function terminal(m) { //console.log(m); process.stdout.write(m); } function DEBUG (m) { if(LOG_LEVEL >= 3){ console.log("DEBUG: " + m) } } function INFO(m) { if(LOG_LEVEL >= 2){ console.log("INFO: " + m) } } function WARN(m) { if(LOG_LEVEL >= 1){ co...
true
54e0cdde9e3f2c11e3e8456d15ac5a54cd8b21e1
JavaScript
SandroDuarsa/Create-REACT-App
/Create-REACT-App/ClientApp/src/components/Home.js
UTF-8
1,569
2.953125
3
[]
no_license
import React, { Component } from 'react'; import { Row,Col} from 'reactstrap'; export class Home extends Component { static displayName = Home.name; constructor(props) { super(props); this.state = { colors: ['red','blue','green','yellow','purple','brown'], activeColor: "", randomNumber: ...
true
3fd603e9642aff02f8cb09b9afef14b0c0279ebf
JavaScript
leetspeek/leetspeek
/assets/loading.js
UTF-8
1,072
2.984375
3
[]
no_license
$(document).ready(function () { async function getData() { let response = await fetch('https://api.github.com/repos/leetspeek/leetspeek/contributors?page=1'); // let response = await fetch('https://api.github.com/repos/google/ggrc-core/contributors?page=1'); let data = await response.json()...
true
bf0a07ba9287c2e68fd0d77533ffdd333f6655b5
JavaScript
Beking0912/code_with_bilibili
/灵活运用JS开发技巧/function-惰性载入函数.js
UTF-8
355
3.359375
3
[]
no_license
function Func() { if (a === b) { console.log("x"); } else { console.log("y"); } } // 换成 function Func() { if (a === b) { Func = function() { console.log("x"); }; } else { Func = function() { console.log("y"); }; } return Func(); } // 函数内判断分支较多较复杂时可大大节约资源开销
true
0d7b18448f195149a309d196749dfcd97dbbc341
JavaScript
ParuhangAngdembe/Blog-Frontend-REACT
/src/components/Contact.jsx
UTF-8
4,041
2.625
3
[]
no_license
import React, { useState } from "react"; import { Col, Form, Row, Button, FloatingLabel } from "react-bootstrap"; const Contact = () => { // useState as JS Object const [inputs, setInputs] = useState({ fullname: "", email: "", contactnumber: "", address: "", message: "", }); const InputEven...
true
8daac14d7b530ec0bf4af2dd0c4f3110d1231cd0
JavaScript
nqhuy213/ReactStock-API
/controllers/userController.js
UTF-8
2,687
2.5625
3
[]
no_license
const {hashPassword, compare} = require('../utils/hashPassword'); const {generateToken} = require('../utils/token'); const errors = require('../utils/error'); /** * Create new user account * @endpoint - /user/register */ exports.register = (req, res, next) => { const body = req.body; if (!body.email || !body.pas...
true
279940363a3246e3298555d841016fb9cd343950
JavaScript
cjordanball/Async-Await
/02AJAXWAsync.js
UTF-8
300
2.671875
3
[]
no_license
const fetch = require('node-fetch'); async function showGitHubUser(handle) { const url = `https://api.github.com/users/${handle}`; const res = await fetch(url); const user = await res.json(); console.log('user', user.name); console.log('user', user.location); } showGitHubUser('cjordanball');
true
e255c92113cafa9ddb03954f1f860e9f1260994b
JavaScript
lindnerdesign/Exercise_Files
/New to Node/bank.js
UTF-8
1,667
3.296875
3
[]
no_license
var fs = require("fs"); var operation = process.argv[2]; var num1 = process.argv[3]; fs.readFile("bank.txt", "utf8", function(error,data){ switch (operation) { case "total": // add numbers in bank account var bankArray = data.split(",") var balance = 0; for (var i=0; i< ba...
true
305824d52e0081cdf86de06c17214f410b39b520
JavaScript
Aschen/kuzzle-plugin-sequence
/lib/Sequence.js
UTF-8
1,478
2.515625
3
[ "Apache-2.0" ]
permissive
const uuid = require('uuid/v4'); class Sequence { static key (sequenceId) { return `${this.config.redisPrefix}/${sequenceId}`; } static async get (sequenceId) { const sequence = JSON.parse( await this.sdk.ms.get(this.key(sequenceId)) ); return new this(sequence); } constructor (data...
true
439a739628a3b79de9d04d38e75da4323bd51e2c
JavaScript
ustiuzhanin/easy-yellowstone
/src/components/Contacts/ContactForm/ContactForm.js
UTF-8
3,593
2.609375
3
[]
no_license
import React, { Component } from 'react'; import styles from './ContactForm.module.css'; import DayPickerInput from 'react-day-picker/DayPickerInput'; import 'react-day-picker/lib/style.css'; import axios from 'axios'; export class ContactForm extends Component { state = { name: '', email: '', phone: '...
true
0f99e2640bd732f44ad8b9676007192505d8139c
JavaScript
shalom1997-ux/newRepository
/js/main1.js
UTF-8
1,118
2.921875
3
[]
no_license
'use strict' var gBoard ; var gInterval; function init() { gBoard = boardSize() renderBoard(gBoard); } // function boardSize(size) { // var newMat = []; // for (var i = 0; i < size; i++) { // newMat[i] = []; // for (var j = 0; j < size; j++) { // newMat[i][j] = g...
true
b8e3c11bdd744fbd2c859574963699dfac546cca
JavaScript
Shindd/Blog
/handler/addUser.js
UTF-8
1,424
2.75
3
[]
no_license
var addUser = function(params, callback){ console.log('Called JSON-RPC:signup.'); console.dir(params); if( params.length != 3){ callback({ code:400, message: 'Insufficient parameters' }, null); return; } var email = params[0]; ...
true
9e01028488e0dad78156ca54a49fcee25125e6c1
JavaScript
nadineb1160/job-kit
/public/assets/js/jobs.js
UTF-8
2,537
2.59375
3
[]
no_license
$(function () { let globalUserID = sessionStorage.getItem('uuid'); let codingLanguage = sessionStorage.getItem('clid'); $(document).on("submit", "#search-form", function () { event.preventDefault(); var locationCity = $(".job-search-bar").val().trim(); $.ajax(`/api/jobs/${codingLang...
true
0262c036ae99bfc05b243dbf9f361f6062ec01be
JavaScript
samrathkumawat1/NewProject
/src/Home.js
UTF-8
604
2.78125
3
[]
no_license
import { Component } from 'react' import React, { useState, useEffect } from 'react'; function Home(){ const [UserName, setUserName] = useState(''); useEffect(() => { // Update the document title using the browser API const data = sessionStorage.getItem('userData'); let data1=data; ...
true
136e6b0b9b2a18b05fcea20c293315bf3d251802
JavaScript
theshubhamdhage/Photography-site
/app.js
UTF-8
166
2.5625
3
[]
no_license
let guest = function (name = 'UnName', courses = 0) { return `hello ${name} now you can access ${courses} courses for free.`; } console.log(guest('shubham', 5));
true
0787c6b587f2d2b1d55e2bfee923848b479cac69
JavaScript
Salud-Mesoamerica-Initiative/etab-app-server
/static/src/js/dimension/components/LocationList.jsx
UTF-8
1,066
2.546875
3
[ "MIT" ]
permissive
'use strict'; import React from 'react'; import _ from 'lodash'; class LocationList extends React.Component { constructor(props) { super(props); this.state = {}; } render() { let dom; if (this.props.items.length == 0) { dom = <h5 className="text-center">No locations found</h5>; } els...
true
034a550543644c879877dd8e1c76af572c766b02
JavaScript
frontend-er/to-do
/src/components/Phone/MainContent/ToDoItem/ToDoItem.jsx
UTF-8
574
2.5625
3
[]
no_license
import React from 'react'; import style from './ToDoItem.module.css' function ToDoItem(props) { debugger; const completedStyle = { fontStyle: "italic", color: "#cdcdcd", textDecoration: "line-through" } return ( <div className={style.toDoitem}> <input name="isGoing"type=...
true
6446130d721cf11e51c311c8c7589089f7c3df87
JavaScript
jaden5165/FreeCodeCamp
/IntermediateAlgorithmScripting/Roman Numeral Converter.js
UTF-8
2,913
4.25
4
[]
no_license
/* http://www.freecodecamp.com/challenges/roman-numeral-converter Convert the given number into a roman numeral. All roman numerals answers should be provided in upper-case. Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code. Here are some helpful links: Roman Numerals http:/...
true
9b945398f62f5f966a7bfc89122ee78f9a559912
JavaScript
Wmalain/Folie
/assets/js/main.js
UTF-8
274
2.953125
3
[]
no_license
function typeWriter(text, n) { if (n < (text.length)) { $('.pintro2').html(text.substring(0, n+1)); n++; setTimeout(function() { typeWriter(text, n) }, 150); } } var text = $('.pintro2').data('text'); typeWriter(text, 0);
true
f9a1e265c898812441ccf94f1b424941b15e9de9
JavaScript
AlbertoLopez93/myJsProjects
/Exercises/Alberto/OOP Exercises 7/spec/whos_a_good_boy/square-spec.js
UTF-8
5,512
3.015625
3
[]
no_license
"use strict"; let Square = require("../../Square"); let square; let descriptor; let proto; describe("Square Class", () => { describe("Constructor", () => { it("should work when called without arguments", () => { expect(new Square() instanceof Square).toBe(true); }); it("should work when called wit...
true
67a273ea815d3e34dd3c8ad67330da64b026a635
JavaScript
ccoder7/map-cache
/src/index.js
UTF-8
2,669
2.6875
3
[]
no_license
'use strict'; module.exports = { setup, close, get_data, put_data, put_data2, del_data, cleanup, size, }; let cache_timer_interval = 180; const cache_data = new Map(); const cache_type_max_ages = {default: cache_timer_interval}; let cache_max_size = 1024; let cache_timer_id = null; fu...
true
003f8e322baea5a8fcfe8f43aae416f63dacb390
JavaScript
Vaent/bowling-challenge
/spec/BonusCounterSpec.js
UTF-8
1,233
3.125
3
[ "MIT" ]
permissive
"use strict" describe("Bonus Counter", function() { var bonusCounter; it("knows what frame it relates to", function() { bonusCounter = new BonusCounter(6,2); expect(bonusCounter.frame).toEqual(6); }); describe("lifespan", function() { it("can be created with a life of 2 for a strike", function() ...
true
c3a77418d0a72f1164bdd04a80bf0d5c77e7883a
JavaScript
devchas/later-link
/server.js
UTF-8
1,689
2.53125
3
[]
no_license
'use strict'; const Path = require('path'); const Hapi = require('hapi'); const Hoek = require('hoek'); // Create a server with host and port const server = new Hapi.Server(); server.connection({ port: '3000', host: 'localhost' }); server.register(require('vision'), (err) => { Hoek.assert(!err, err); server.v...
true
3a4c8176f5e42f1ec9ba1d9ae7b8190379823984
JavaScript
tataton/tau_code_challenge_3
/public/scripts/cc3.js
UTF-8
1,515
3.421875
3
[]
no_license
$(document).ready(function(){ $.ajax({ type: "GET", url: '/getJokes', success: function(response){ console.log('AJAX GET success.'); var jokeArray = response.jokeArray; updateDisplay(jokeArray); }, error: function(){ console.log('AJAX error in GET method.'); } }); });...
true
f5430a34d993ba6ab88431b515771d1f8aab73a2
JavaScript
dannyhuo/easy-man
/src/main/resources/static/myjs/servicemanager/service-list.js
UTF-8
1,540
2.625
3
[ "Apache-2.0" ]
permissive
function deleteService(serviceId, serviceName) { const swalWithBootstrapButtons = Swal.mixin({ confirmButtonClass: 'btn btn-danger', cancelButtonClass: 'btn btn-success', buttonsStyling: false, }) swalWithBootstrapButtons({ title: 'Are you sure?', text: "You want to...
true
3d144941603a22d17ed15a0d77c2cb468d7aa569
JavaScript
NikolettaMatsur/CG
/js/Painting.js
UTF-8
3,797
2.859375
3
[]
no_license
class Painting extends DecoratedObject { constructor(x, y, z) { super() var geometry = new THREE.CubeGeometry(36.45, 36.45, 0.01); this.material_basic = new THREE.MeshBasicMaterial( { color: 0xc0c0c0, wireframe: false} ); this.material_lambert = new THREE.MeshLambertMaterial({ color: 0xc0c0c0, s...
true
18379ae7ed1f2da45126330332798325238d0de3
JavaScript
heyloh/passwordgen
/src/modules/generatePwdForm.js
UTF-8
790
2.859375
3
[ "MIT" ]
permissive
import generatePwd from './generators'; const generatedPwd = document.querySelector('.generated-pwd'); const charsAmount = document.querySelector('.qtd-caracteres'); const uppercasesChk = document.querySelector('.chk-maiusculas'); const lowercasesChk = document.querySelector('.chk-minusculas'); const numbersChk = docu...
true
b4b60f0d54605e66b0e2d12533ce4f7c80ed1b7f
JavaScript
mars102/oven-auto-present
/lib/configurator_page.js
UTF-8
4,597
2.671875
3
[ "MIT" ]
permissive
function nospace(str) { var VRegExp=new RegExp(' '); var VResult=str.replace(VRegExp,''); return VResult } function nospace2(str) { var newStr = str.replace(/ /g, ''); return newStr; } function number_format(number,decimals,dec_point,thousands_sep) { var i,j,kw,kd,km; if(isNaN(decimals=Math.abs(decimals))){decim...
true
fa45117238f17350bf9c6146687126be7bb6891d
JavaScript
Ryan-D-Miller/Travel-Tracker
/src/domUpdates.js
UTF-8
9,731
2.828125
3
[]
no_license
const cardArea = document.getElementById('tripCards'); let domUpdates = { displayDestinations(destinationData) { const tripSlection = document.getElementById('tripSelection'); destinationData.destinations.forEach(destination => { tripSlection.insertAdjacentHTML('afterbegin', `<option va...
true
e85910f162eeeb3f5683fccef653029ac393e652
JavaScript
havidtech/upTimeMonitor
/lib/helpers.js
UTF-8
3,170
3.125
3
[]
no_license
/* * Helpers for various tasks * */ // Dependencies const crypto = require('crypto'); const config = require('./config') const https = require('https'); const querystring = require('querystring'); // Container for all the helpers var helpers = {}; // Crate a SHA256 hash helpers.hash = (str)=>{ if(typeof(str) == ...
true
c84c1f7ca0f053cc6bd6d2a36f2fbdffcf84602d
JavaScript
Taewii/javascript-core
/JavaScript Advanced/07. Advanced Functions - Exercises/04. Personal BMI.js
UTF-8
681
3.1875
3
[]
no_license
function BMICalc(name, age, weight, height) { const BMI = Math.round(weight / Math.pow(height / 100, 2)); const status = getStatus(BMI); const obj = { name, personalInfo: { age, weight, height, }, BMI, status, }; if (obj.status === 'obese') { obj.recommendation = 'a...
true
f76aa7f4dd3f02e184bfb64cb98034741d7a5cdc
JavaScript
fullbridge/fullbridge.github.io
/_site/js/vendor/chart-dashboard-competencies.js
UTF-8
3,725
2.5625
3
[ "MIT" ]
permissive
$(document).ready(function() { var selfManagementData = { labels: ["Section 1", "Section 2", "Section 3"], datasets: [ { label: "Self Management", fillColor: "#13a8e1", strokeColor: "#E1F5FE", highlightFill: "#13a8e1", ...
true
8aab5a71a78dc920661d41ae3f2dc07c5f5722b7
JavaScript
DimaHvir/ciphers-project
/Project_Decoder_Ring_1/test/caesar.test.js
UTF-8
1,253
2.703125
3
[]
no_license
// Write your tests here! const expect = require("chai").expect const caesarModule = require("../src/caesar") describe("caesar", () => { it("should properly encode", () => { const input = "eyyy this is the input" const shift = 5 const encode = true const expected = "JDDD YMNX NX YMJ NSUZY".toLowerCase() cons...
true
422b7d2300d3dcacdac82ea41a602678153f1d85
JavaScript
Pignataro67/Weather-App
/app.js
UTF-8
1,837
3.65625
4
[]
no_license
// Init Storage const storage = new Storage(); // Get stored location data const weatherLocation = storage.getLocationData(); // Init weather object const weather = new Weather(weaherLocation.city, weatherLocation.state); // Init UI const ui = new UI(); // Get weather on DOM load document.addEventListener('DOMContentL...
true
dd3e46ed194bb8628c79f65ac89a52dce023b78f
JavaScript
NirvanaNimbusa/d3js_chart_app
/public/javascripts/pieChart.js
UTF-8
3,378
2.8125
3
[]
no_license
angApp.service("pieChart",function() { this.buildPie = function(service,data) { var w = 300, h = 300, r = 150, dataConverted = [], d3 = service, total = 0, index=0; //convert data; Object.keys(data).forEach(function(key,index) { dataConv...
true
3a9d292b004b84b610c7dcbb177c90a2a3badace
JavaScript
lolz111/Projects
/unitrans/js/unitransPie.js
UTF-8
6,472
2.75
3
[]
no_license
/* http://stackoverflow.com/questions/1085801/how-to-get-the-selected-value-of-dropdownlist-using-javascript http://stackoverflow.com/questions/5866169/getting-all-selected-values-of-a-multiple-select-box-when-clicking-on-a-button-u http://stackoverflow.com/questions/5330030/javascript-get-values-from-multiple-select-o...
true
9a53e10505471b8af876c9a263d7a03a996911a3
JavaScript
M3dython/reactProjects
/projects/02-tours/setup/src/App.js
UTF-8
2,710
3.65625
4
[]
no_license
import React, { useState, useEffect } from 'react'; import Loading from './Loading'; import Tours from './Tours'; // ATTENTION!!!!!!!!!! // I SWITCHED TO PERMANENT DOMAIN //API that has all the item to be displayed const url = 'https://course-api.com/react-tours-project'; function App() { //setting state values to b...
true
ad32641b96f5dee4e1b1e400403836f515df62df
JavaScript
Shubham076/React-multer
/server/controllers/auth.js
UTF-8
2,085
2.515625
3
[]
no_license
const User = require("../models/user"); const jwt = require("jsonwebtoken") const bcrypt = require("bcrypt"); const user = require("../models/user"); exports.signUp = async(req,res,next)=>{ let email = req.body.email let password = req.body.password let username = req.body.username try{ let...
true
59bdabb261993168bcb5c666f8c740ae7cc898c1
JavaScript
MrBoucher/mrBoucher
/prog/Language/While/js/question-03.js
UTF-8
68
2.859375
3
[]
no_license
var i=2; while(i<=10000){ document.write(i+"<br>"); i+=2; }
true
1fe85f3c16e6d7904d3be728d791b03a4bf1f4d0
JavaScript
Ravikumar-007/learning-center
/bind.js
UTF-8
521
4.0625
4
[]
no_license
// const array = [1, 2, 3]; // function getMaxNumber(...args) { // let result = args.sort((a, b) => a - b); // return result[result.length - 1]; // } // let cbc = getMaxNumber.apply(null, array) // should return 3 // console.log("returned Value ", cbc); const character = { name: 'Simon', getCharacte...
true
1c1092c300a64b1ca7f491132d39ac710451a483
JavaScript
AlexThon/iss_spotter
/loan.js
UTF-8
835
3.734375
4
[]
no_license
const { resolve } = require("path"); let creditLimit = 5000; /*** * * Input: amount which is the money to loan out * Return: promise of the loan which may or may not be fulfilled * */ const loanOut = function(amount) { return new Promise((resolve, reject) => { if (creditLimit > 0) { creditLimit -= am...
true
bcee2ae863f364d218ccaf175c31d1d43015ff40
JavaScript
sourabh12yadav/Java_Assingment12
/main.js
UTF-8
9,805
4.34375
4
[]
no_license
!--------------------------------Sourabh Yadav 19001601056------------------------------! JAVASCRIPT INTRODUCTION------🙏 JAVASCRIPT: - JavaScript is the world's most popular programming language. JavaScript is the programming language of the Web. JavaScript is easy to learn. JavaScript is lightweight, object or...
true
5350fea8fcf92af6ecec91fa3051c00933712a87
JavaScript
renegmed/ml-react-frontend
/src/TextClassifier.js
UTF-8
3,028
2.890625
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; class TextClassifier extends Component { constructor() { super(); this.state = { text: "" , prediction: "" } this.handleChange = this.handleChange.bind(this) this.handleSubmit = th...
true
3288b2e511c35e961dbeaa3d8e530276e51163d3
JavaScript
TwittyManymoon/Almight_TGR_day2
/routes/api.js
UTF-8
1,402
2.546875
3
[]
no_license
const express = require('express'); const router = express(); // Test 1 // router.get('/:data', (req, res) => { // console.log(req.body); // res.send(req.body) // }); // Test 2 router.get('/almight', (req, res) => { console.log("Someone access your motherfucking server"); res.send(`Welcome motherfucker, y...
true
bd8af582e7aeb4c5cc37e0b480ea550c97f64e7f
JavaScript
kamalpandey2012/Javascript-important-topics
/demos/demo004.js
UTF-8
578
4.03125
4
[]
no_license
// Declare an array with no element at index 2,3 and 4 let a = [0, 1, , , , 5, 6]; //show all indexes, not just those that have been assigned value a.find(function(value, index) { console.log("Visited index " + index + " with value " + value); }); a.find(function(value, index) { if (index == 0) { //Delete el...
true
ec7dabb2d531413b23656354308dfa919b5c7d94
JavaScript
bedmonds/serialize-js
/serialize.js
UTF-8
3,092
2.71875
3
[ "MIT" ]
permissive
/** Copyright (c) 2017 Brian Edmonds <brian@bedmonds.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
true
53e6fcdee5a2105161b16f04887cb9abb662f22d
JavaScript
City-of-Helsinki/asomap
/app/state/selectors.spec.js
UTF-8
5,228
2.734375
3
[ "MIT" ]
permissive
import { expect } from 'chai'; import selectors from './selectors'; function getState(extra) { const units = extra.units || {}; const filters = extra.filters || {}; const city = filters.city || ''; const owners = filters.owners || []; const postalCodes = filters.postalCodes || []; return { data: { uni...
true
0a9e9d588f8c232e354b2ed77f4b6c59d00ae06d
JavaScript
superjova/landmark
/app/assets/javascripts/app/map.js
UTF-8
2,680
2.671875
3
[]
no_license
var Map; App.Map = Map = (function() { function Map(overlord) { this.map = new google.maps.Map(document.getElementById('map'), { zoom: 4, disableDefaultUI: true }); this.overlord = overlord; this.markers = []; this.directionsService = new google.maps.DirectionsService; this.direct...
true
358fb756440161c0885e31b6f026a94df671dfea
JavaScript
chinonso25/Cheer-em-up
/functions/index.js
UTF-8
2,316
3.3125
3
[]
no_license
("use strict"); const functions = require("firebase-functions"); const capitalizeSentence = require("capitalize-sentence"); const Filter = require("bad-words"); const badWordsFilter = new Filter(); // Moderates messages by lowering all uppercase messages and removing swearwords. exports.moderator = functions.database...
true
96bc15a751b3ec4bc7556de920482c67b232e349
JavaScript
nabnem/React-work
/React-js/src/new.js
UTF-8
361
2.65625
3
[]
no_license
import { Component } from 'react'; class App extends Component { constructor(){ super(); this.state={skake:true}; } Neymar=()=>{ console.log('hello') } render(){ return( <div> <button onClick={this.Neymar}>click</button> <input type="checkbox"checked={this.state...
true
2d3852a72e5cea6027ba11b7e40f8368486a6f39
JavaScript
Anthony-Mendola/js-templates-advanced-templating-lab-v-000
/index.js
UTF-8
1,577
3.296875
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
function init() { //put any page initialization/handlebars initialization here loadRecipeTemplate() Handlebars.registerPartial('recipeDetailsPartial', document.getElementById("recipe-details-partial").innerHTML) Handlebars.registerPartial('recipeFormPartial', document.getElementById("recipe-form-template").inne...
true
1f37aca1482166fd89673f8bb1b7aa3901004e3a
JavaScript
joaopedrovbs/tapFi
/webapp/controllers/TapFiDevice/prototype.readLongCharacteristic.js
UTF-8
1,213
3.234375
3
[]
no_license
module.exports = function readLongCharacteristic(charac, next) { /* * Flow: * 1. Subscribe to Notification on Characteristic * 2. Each time a Notification arrives, concat buffer * 3. Once an empty buffer (length == 0) is got, finish and callback */ let cb = null let err = null let chunks ...
true
7d825f8c2fbd3481f7448df1b4cf31d5f869abd5
JavaScript
SushrutSaysHi/font_manipulator
/main.js
UTF-8
1,010
3.21875
3
[]
no_license
var noseX = 0; var noseY = 0; var difference = 0; var leftWristX = 0; var rightWristX = 0; function setup() { var video = createCapture(VIDEO); video.size(300, 300); var canvas = createCanvas(300, 300); canvas.position(560, 150); var poseNet = ml5.poseNet(video, ModelLoaded); ...
true
83bdc9f0448e9edbe3095391012728d29c96f72d
JavaScript
webhubUA8/OOP
/unit_4/Rect.js
UTF-8
504
2.765625
3
[]
no_license
class Rect extends DrawField { constructor(h, w, id) { super(h, w, id); } create(elem) { super.create(elem); } fillRect(elem, x, y, w, h) { if (document.querySelector('#one')) { let canvas = document.querySelector('#one'); let ctx = canvas.getContext('2d'); ct...
true
6ec3f0eb9b1ee4b5f9ee179fe1bd4c60807cd9a9
JavaScript
Ercules76/mssql_nodejs_API
/src/controller/users.js
UTF-8
3,550
2.734375
3
[]
no_license
import { Router } from 'express'; export default ({ config, db }) => { let api = Router(); // CRUD - Create Read Update Delete // '/v1/users/add' - Create api.post('/add', (req, res) => { try { let IdUtente = req.body.IdUtente; let NomeUtente = req.body.NomeUtente; ...
true
6eb13bab5a0f5d43d9ba8b1d16254905ec0c1bfa
JavaScript
harshimm/Online-Calculator
/calc_script.js
UTF-8
1,289
3.375
3
[]
no_license
// expr displayed on calc displayed var expr = ""; //screen var var screen = document.getElementById("screen"); //buttons var operators = document.getElementsByClassName('op'); var numbers = document.getElementsByClassName('num'); var scrs = document.getElementsByClassName('scr'); //getting numbers for(numbe...
true
999a96e54b5c1396b5ba1c7aa0fa0b32ff872f51
JavaScript
cessem1/chai-as-promised
/test/assert-eventually.js
UTF-8
5,446
2.96875
3
[ "WTFPL", "MIT" ]
permissive
"use strict"; require("./support/setup.js"); const shouldPass = require("./support/common.js").shouldPass; const shouldFail = require("./support/common.js").shouldFail; const assert = require("chai").assert; const expect = require("chai").expect; describe("Assert interface with eventually extender:", () => { let p...
true
26ed7c3a15fcf51c3c115dfc7e3c563169eb76cb
JavaScript
shahana-banu/VM-Back
/trainerB/trainer.js
UTF-8
619
2.515625
3
[]
no_license
var db = require('../db'); var Trainer = { getAlltrainer: function(callback) { return db.query('SELECT * from trainer', callback); }, getTrainerById:function(id,callback){ return db.query("select * from trainer where user_Id=?",[id],callback); }, createTrainer: function...
true
3dfc547a864bf83c66701be8de95fed1fcaef719
JavaScript
NoName4Me/cross-origin-demo
/client/index.js
UTF-8
2,479
2.71875
3
[]
no_license
const http = require('http'); const url = require('url'); const hostname = '172.18.19.75'; const port = 3010; const serverPort = 3020; const server = http.createServer((req, res) => { const URL = url.parse(req.url); if (URL.pathname === '/') { res.statusCode = 200; res.setHeader('Content-Type'...
true
999ef9ba8b6ac37916bb1a96497d094c82511c61
JavaScript
DannyCaesar/allmighty_app
/src/redux/reducers/dictionary/dictionary-notes-reducers.js
UTF-8
2,359
2.796875
3
[]
no_license
import { DICT_NOTES_TYPES } from '../../actions/dictionary/dictionary-notes-actions'; export default function dictionary_notes(state = [], action) { switch (action.type) { case DICT_NOTES_TYPES.FETCH_NOTES_SUCCESS: return action.payload; case DICT_NOTES_TYPES.FETCH_NOTES_ERROR: console.log('ERROR FETCHING N...
true
44bfa659d0cb69cb6db7f92c174bbd0213d3d909
JavaScript
nmanzano/codewars
/whereIsMyParent/index.js
UTF-8
1,627
3.859375
4
[]
no_license
// Mothers arranged dance party for children in school.On that party there are only mothers and their children.All are having // great fun on dancing floor when suddenly all lights went out.Its dark night and no one can see eachother.But you were flying // nearby and you can see in the dark and have ability to teleport...
true
5fa16326e49dc0d5135116d8fb2a7e0759be470d
JavaScript
dataolandu/letaoshop
/src/storage/index.js
UTF-8
1,021
2.546875
3
[]
no_license
// 存储工具箱 const storage = 'mall'; export default{ setItem(key,value,moudule_name){ if(moudule_name){ let val = this.getItem(moudule_name); val[key] = value; this.setItem(moudule_name,val); }else{ let val = this.getStorage(); val[key] = value;...
true
172a2f1c50bddc162271a8f17ad67ebdfa43b71f
JavaScript
mahikam/Damage-Control
/js/main.js
UTF-8
1,180
2.6875
3
[]
no_license
function saveReport() { let userID = auth.currentUser.uid; alert(userID); // let userID="Mahika"; let name = document.getElementById("nameField").value; let phone = document.getElementById("phoneField").value; let email = document.getElementById("emailField").value; let location = document.g...
true
312a2beaf6e5426d4d0a58a8e9717d88bb29d552
JavaScript
erikkk92/jstarea
/js/todolist.js
UTF-8
14,750
3.15625
3
[]
no_license
/** * * */ (($) => { 'use strict'; const API_URL = 'https://task-backend-fpuna.herokuapp.com/tasks'; const TASK_STATUS = { PENDING: 'PENDIENTE', DONE: 'TERMINADO', CANCEL: 'CANCELADO' }; class Task { constructor(description) { this.id = null; ...
true
1f41ab1c4bc219258120749f3427b1ea7233fcdf
JavaScript
dmheisel/BYKR
/src/redux/reducers/userReducer.js
UTF-8
580
2.53125
3
[]
no_license
const userReducer = (state = {}, action) => { switch (action.type) { case 'SET_USER': return {...state, ...action.payload}; case 'SET_USER_FAVORITES': return { ...state, saved_locations: action.payload } case 'SET_USER_CREATED': return {...state, created_locations: action.payload} ca...
true
2864d8ecc1dfd06f9c59ab1b335272c4627bc39c
JavaScript
williamking/drupal-test-theme
/acg/carousel.js
UTF-8
5,047
2.90625
3
[ "MIT" ]
permissive
$(function() { Carousel = function(width, height, id, speed) { this.dom = $("#" + id); this.width = 800; this.height = 400; this.speed = "slow"; this.moving = false; this.version = "V1.0"; if (width) this.width = width; if (height) this.height = height; if (speed) { this.setSpeed(speed); }...
true
7c975c9be0c8dce672801a098c289fb03d6a5cae
JavaScript
aaltowebapps/team-24
/public/dialog.js
UTF-8
4,801
2.8125
3
[ "MIT" ]
permissive
// Note that displayDialog and isDialogOpen, as declared below, are global variables. It is bad practice to have a global variable in this file we're in a hurry. // By default, the dialog is closed. isDialogOpen = false; // The following function opens a modal dialog using the SimpleDialog2 jQuery plugin. display...
true
0bc14ab6307be05e82d9fd2f5d0217ea575c0f8d
JavaScript
VaninaDzhuteva/frt
/src/scripts/add-service.js
UTF-8
1,669
3.65625
4
[]
no_license
// Declare values const addBtn = document.getElementById('add-btn'); const inputVal = document.getElementById('added-text'); const displayOutput = document.querySelector('.output'); let item = ''; const serviceArr = []; // Add ev listenere on add button if(addBtn) { addBtn.addEventListener('click', createElem); } ...
true
da32be368aab176fc50e394a42cc4c9b495ff599
JavaScript
piero80/corso-javascript
/01/example/js/script.js
UTF-8
187
2.984375
3
[]
no_license
var button = document.getElementById("button"); console.log(button); button.addEventListener("click", function() { var red = "#FF0000"; document.body.style.backgroundColor = red; });
true
ad3e0c1a9a8b70cbff7142c9cced3f732e5459a5
JavaScript
vanceacorina97/sv-homeworks
/js/tema2.js
UTF-8
3,966
3.46875
3
[]
no_license
const EUR = 0.21; const HUF = 75.56; const USD = 0.22; const fraze = [ "Quisque faucibus ipsum id nibh egestas bibendum.", "Phasellus tincidunt sapien nec est tempus lacinia.", "Curabitur ac elit at turpis ultrices hendrerit at et tellus.", "Praesent a magna a ligula gravida sodales eu ut erat.", "U...
true
205b48c89da2beae5b4a90d14864dc5d4f09a535
JavaScript
lambaxx7379/linkerator
/db/index.js
UTF-8
5,735
2.515625
3
[]
no_license
// Connect to DB const { Client } = require("pg"); const DB_NAME = "localhost:5432/linkerator"; const DB_URL = process.env.DATABASE_URL || `postgres://${DB_NAME}`; const client = new Client(DB_URL); async function getTagById(id) { // return the tag try { const { rows: [tag], } = await client.query(` ...
true
e2074981c284546cebf10b21f4449d787e7de5a8
JavaScript
Alok1347/Notrus
/Natours/starter/css/Notes.js
UTF-8
1,324
3.125
3
[]
no_license
/* # We can use !important to mark any style and it will have second highest precendence in style list after user styles # we should always define one root font size and based on that we should give other property values in rem as rem is calculated on root font size. Ex: html { font-size: 10px; // Now 10px will b...
true
55bb8658c58d9c26ce98eb0f7e7c0e8ff3d4fc2b
JavaScript
woalskdl/studyES6
/module/myLogger.js
UTF-8
517
3
3
[]
no_license
/* utility - 보통 별도의 파일로 구분해서 공통으로 사용 */ const _ = { log(data) { if(window.console) console.log(data); } } export default _; export function log(data){ console.log(data); } export const getCurrentHour = () => { return (new Date).getHours(); } // class export class MyLogger { constructor(p...
true
2f4ba16cbb11df88bc3e9ecdd68104bfb02ed76a
JavaScript
Nitin050/client-announce
/components/TagsInput.js
UTF-8
2,359
2.578125
3
[]
no_license
import React from "react"; const TagsInput = props => { const [tags, setTags] = React.useState([]); const [error, setError] = React.useState(''); const addTags = event => { event.preventDefault(); if (event.key === "Enter" && event.target.value !== "") { if (event.target.value.match(/^...
true
970f19d5caac4ec9cde169b4a50b7f56048b97fd
JavaScript
ayush987goyal/typescript-learn
/module-7/app.js
UTF-8
999
3.8125
4
[]
no_license
"use strict"; function greete(person) { console.log("Hello, " + person.firstName); console.log(person); } function changeName(person) { person.firstName = 'Kus'; } var personn = { firstName: 'Ayush', hobbies: ['cooki', 'sports'], greet: function (lastName) { console.log("I am " + this.fi...
true
d529d2959727dc88ad27f477484376bad7b0b404
JavaScript
arman123-creator/etert
/sketch.js
UTF-8
3,020
3.1875
3
[]
no_license
var dog,happyDog,hungryDog,database; var foodS,foodStockRef; var frameCountNow = 0; var fedTime,lastFed,foodObject,currentTime; var milk,input,name; var gameState = "hungry"; var gameStateRef; var bedRoomImg,gardenImg,washroomImg,sleepImg,runImg,livingRoomImg; var feed,addFood; function preload(){ hungryDog = loadImag...
true
dd70d4dc26c95450138e13de558464a04e4b52f9
JavaScript
gitiklar/front-end-course
/tocode/39-domtree-navigation/text/highlight_max.js
UTF-8
243
3.265625
3
[]
no_license
const ul = document.querySelector('.numbers'); let max = ul.firstChild; for ( let element of ul.childNodes ) { if (Number(element.textContent) > Number(max.textContent)) { max = element; } } if (max) { max.classList.add('max'); }
true
ffaa13a4802f10c4c4f9d44c91e07a6ef0ef1bac
JavaScript
borkxs/socketgame
/lib/socket_server.js
UTF-8
2,848
2.5625
3
[]
no_license
/* static server index := send html with client app scripts client app send join to socket server socket server add user to room send joinResult client app create player start emitting socket message for mouse movement other user joining: */ var socketio = require('socket.io'), _ = requir...
true
2e9d3cedd6ded6e3d59d60f06739c64e8e0264fc
JavaScript
Michael-Hanley/code-gov-harvester
/services/indexer/index_cleaner.js
UTF-8
4,825
2.75
3
[ "CC0-1.0" ]
permissive
const _ = require("lodash"); const Logger = require("../../utils/logger"); const getConfig = require('../../config'); const adapter = require('@code.gov/code-gov-adapter'); class ElasticSearchLogger extends Logger { get DEFAULT_LOGGER_NAME() { return "elasticsearch"; } } /** * Class for cleaning ElasticSearc...
true
546dff48390f6f7d21c87b201151e75ba18b5840
JavaScript
db-murphy/MyBlog
/public/js/module_utils/utils.js
UTF-8
5,165
2.75
3
[ "MIT" ]
permissive
define(function (require,exports,module){ /** * 时间戳转换日期. * @param <int> unixTime 待时间戳(秒) */ function UnixToDate(unixTime) { var time = new Date(unixTime); var ymdhis = ""; ymdhis += time.getFullYear() + "-"; ymdhis += DealNum((time.getMonth()+1)) + "-"; ymdhis += DealNum(time.getDate())...
true
993eed3e354cc6476014a697ba2c184aaf9ce8fc
JavaScript
benrossen/Form-Validation
/js/script.js
UTF-8
1,353
3.078125
3
[]
no_license
$(document).ready(function(){ /* your code goes here */ var $slides = $('#slides').find('li'); var slideCount = $slides.length; var nextSlideIndex = 0; var submitted = 0; setInterval(function(){ var $activeSlide = $slides.filter('.active'); if(nextSlideIndex < slideCount - 1) { nextSlideIndex++; } el...
true
89914bb3696320562571e844c05e6cf01f8a3783
JavaScript
vprince001/string_assignment
/codes/palindrome_function.js
UTF-8
418
3.921875
4
[]
no_license
let inputString = process.argv[2]; const checkPalindrome = function(inputString){ let stringReverse = ""; let length = inputString.length-1; let message = "Not a Palindrome"; for(let index = length; index>=0; index--){ stringReverse = stringReverse + inputString[index]; } if(inputString == stringRevers...
true
638901b6163696a65f666553cb540907f039bd34
JavaScript
yamsun/pig-latin-translator
/app.js
UTF-8
994
3.265625
3
[]
no_license
var myInput = document.querySelector("textarea"); // var myInput2 = document.querySelector("#txt-area"); // console.log(myInput2===myInput) // true var myButton = document.querySelector("button"); // console.log(myButton); var myOutput = document.querySelector("#output"); // console.log(myOutput); var myURL = "h...
true
7fcbb21a90a757049c8fe7ca1ae7de0af26530dc
JavaScript
AlexisMerlin/react-amplify
/src/clock.jsx
UTF-8
482
3
3
[]
no_license
import React, { useState, useEffect } from 'react'; const Clock = () => { const [date, setDate] = useState(new Date()); useEffect(() => { console.log("Use state. Montando el componente") setInterval(() => { setDate(new Date()); }, 1000); }, date) return ( <...
true
063147056ac6cfc91e45927d617b4e55f1209546
JavaScript
singhpiyushsingh/learnodejs
/routes/authentication.js
UTF-8
1,288
2.65625
3
[]
no_license
var express = require('express'); var router = express.Router(); var getDB=require('./mongodb').getDB; var db=null; getDB().then(function successHandler(result) { db=result; }, function failureHandler(error) { }); router.post('/',function (req,res) { var adder=req.body; db.collection('user').inser...
true
8519faf30a6298621402ed2945468434ac5efc0a
JavaScript
q50343/canvas-template
/script.js
UTF-8
2,770
3.03125
3
[]
no_license
// 環境變數 let updateFPS = 30 let showMouse = true let time = 0 let bgColor = '#000' // 控制 let controls = { value: 0 } let gui = new dat.GUI() gui.add(controls,'value',-2,2).step(0.01).onChange(value => { }) // ----------- // Vec2 class Vec2{ constructor(x = 0,y = 0) { this.x = x this.y = y ...
true