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
cee56745fe5eafa4dba3363fa54ff62bf1c88864
JavaScript
MasterAye/letao
/public/admin/js/categoryFirst.js
UTF-8
2,751
2.890625
3
[]
no_license
$(function () { getCategoryFirst(); addCategoryFirst(); prevPage(); nextPage(); }); function getCategoryFirst(){ $.ajax({ url:'/category/queryTopCategoryPaging', data:{ 'page':1, 'pageSize':2 }, success:function (data) { data.pag...
true
2bccc8c70acae6d27b885d6bd3e92e369ac3fb2e
JavaScript
antenehs/Commuter
/Reitti/renameCardJS.js
UTF-8
949
2.59375
3
[]
no_license
controlLi = document.getElementById("##NEWCARDNUMBER##"); allInputs = controlLi.getElementsByTagName('input'); var renameButton; for(var i = 0; i < allInputs.length ; i++){ if( allInputs[i].value == 'Name' || allInputs[i].value == 'Nimeä') renameButton = allInputs[i]; } renameButton.click(); controlLi = ...
true
90894930e3496ffa57a7f0b8cf89fd259432ccf5
JavaScript
HalfALifeLeft/Data
/events/channelUpdate.js
UTF-8
6,080
2.515625
3
[]
no_license
/* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ /* eslint-disable no-console */ module.exports = async (client, oldChannel, newChannel) => { if (oldChannel.type == `dm`) return; client.dataConfig.ensure(`${oldChannel.guild.id}`, { prefix: `d!`, mutedRole: ``, messageL...
true
0afe12cdfc9f803ed91fefd6b46d7e398ad9807f
JavaScript
zeroyukiy/react-instagram-clone
/src/features/Auth/reducers.js
UTF-8
917
2.6875
3
[ "MIT" ]
permissive
import { AUTHENTICATE, LOADING, LOGOUT } from "./actionTypes"; let initialState = { loading: false, user: { username: "", fullname: "", avatar: "" } }; const user = JSON.parse(localStorage.getItem("user")); if (user) { const { username, fullname, avatar } = user; initialState = { loading: f...
true
092a8546107c3f465103c3e05530d1c76342fb4b
JavaScript
Thero6th/mmp310
/final presentation/sketch.js
UTF-8
4,034
2.875
3
[]
no_license
/*final project 05/14/20 */ // loading graphics and characters var bubbleImage, dripImage // runs before set up function preload() { couchImage = loadImage('images/couch.png'); radioImage = loadImage('images/radio.png'); boxImage = loadImage('images/donut_box.png'); drbenImage = loadImage('images/drbe...
true
29e375bb5c325fd1ad4327b97a1127452473318e
JavaScript
robertjbass/js_algorithms
/concepts/callApply.js
UTF-8
908
4.21875
4
[]
no_license
/* //* Describe call() and apply() methods ? 1) How do they function? ? 2) How do they what arguments do they take? ? 3) How are they different? */ // call() and apply() are used to change the scope of 'this' within an object const car1 = { brand: 'Porche', getCarDescription: function (cost, year, co...
true
9184473f06733056b72d68d34116635b3b135572
JavaScript
kushagrarora17/take-home
/src/components/footer/CreateRoom.js
UTF-8
731
2.53125
3
[]
no_license
import React, {useRef} from 'react' import PropTypes from 'prop-types' function CreateRoom(props) { const { addRoom } = props; const roomInputRef = useRef(null); const handleRoomSubmit = ev => { ev.preventDefault(); const newRoom = roomInputRef.current.value; addRoom(newRoom); roomInputRef....
true
8ab4c88562eff301fbec686273ad60ffe7cbe62a
JavaScript
getfloret/receipt-scanner
/test/lib/text_parser/date/first_spec.js
UTF-8
660
2.5625
3
[ "MIT" ]
permissive
/* eslint-env mocha */ var chai = require('chai') var assert = chai.assert var dateParser = require('../../../../lib/text_parser/date_parser') var first = require('../../../../lib/text_parser/date/first') describe('First', function () { describe('#extract()', function () { describe('with first', function () { ...
true
faa94cbbd87dcee8d55c8639ff9c8e7668621f6a
JavaScript
vjoshi12/magicmirror
/js/main.js
UTF-8
9,238
2.546875
3
[]
no_license
jQuery.fn.updateWithText = function(text, speed) { var dummy = $("<div/>").html(text); if ($(this).html() != dummy.html()) { $(this).fadeOut(speed / 2, function() { $(this).html(text); $(this).fadeIn(speed / 2, function(){}); }); } } function roundVal(val) { return Math.round(val * 10) / 10; } $.fn...
true
43818f2777856fe1bb8459ee77df17457472af5e
JavaScript
CaoYouXin/resource_management
/src/html/games/src/index.js
UTF-8
2,063
2.71875
3
[]
no_license
import '../../../css/all.css'; import '../../../css/game-list.css'; import Data from './data.html'; import { sendMessage } from '../../../js/sendMsg.js'; var divElem = document.createElement('div'); divElem.innerHTML = Data; document.body.appendChild(divElem); var games = document.getElementById('games'); var gallery...
true
522b782d31d245902028e68942abcae48febd011
JavaScript
LyonsLab/JadeOolong
/demo_pagedynamics.js
UTF-8
1,783
2.671875
3
[]
no_license
/** * Created by senorrift on 7/31/15. */ function getBackgroundColor(slideValue) { var colorCodes = ["#f5f5f5", "#dcdcdc", "#c4c4c4", "#ababab", "#939393", "#7a7a7a", "#626262", "#494949", "#313131", "#181818"]; return colorCodes[slideValue - 1] } function getHeaderText(dataSelected) { switch (...
true
51a9a9f556b7e030d610fd1da80444d9cab976b7
JavaScript
JonathanSawyer/mean_store
/lib/tests/e2e/searchSpec.js
UTF-8
1,968
3.046875
3
[ "MIT" ]
permissive
var Nav = require('./po/nav'), db = require('./testdata'), ProductList = require('./po/productList'), server = require('./server'); describe('Searching', function(){ var nav, productList; beforeEach(server.boot); afterEach(server.shutdown); beforeEach(function(done){ nav = new Nav(); productList = new Pro...
true
2bf9f073ac3d903de9513f3e15fa475843a7c0a1
JavaScript
tunebay/server-depreciated
/controllers/profile.js
UTF-8
1,282
2.546875
3
[]
no_license
const User = require('../models/user'); const Playlist = require('../models/playlist'); exports.loadUserById = (req, res, next) => { return User.findById(req.params.id) .then((data) => { if (!data) { return res.status(404) .json({ error: 'Could not find user' }); } return res....
true
cf5d0773dab33d059c0183c905a4977919c1f4b8
JavaScript
AbhishakeDev/Task-Tracker-React
/src/Components/Header.js
UTF-8
1,161
2.75
3
[]
no_license
import PropTypes from 'prop-types' import { useLocation } from "react-router-dom"; import Button from "./Button"; const Header = ({ showAdd, onAdd, title }) => { const location = useLocation();//this for the button to disappear if it is on the about page // const onClick = () => { // console.log("click...
true
015acec64d7623527fd90684bbd87a98ff1a5865
JavaScript
solimap/js-training
/examples/unit-testing/parser.js
UTF-8
285
2.515625
3
[]
no_license
'use strict'; const _ = require('lodash'); function getAge(data) { const ageField = _.get(data, 'person.age', null); const numericAge = ageField !== null ? _.parseInt(ageField) : null; return !_.isNaN(numericAge) ? numericAge : null; } module.exports = { getAge: getAge };
true
fedb6bdddb99620f5fe4fd15800ab094ffe49a6a
JavaScript
VipulUpadala/React-Two-Value-Calculation-Demo
/src/components/ArithMatic.js
UTF-8
1,805
3.046875
3
[]
no_license
import React, { Component } from "react"; class ArithMatic extends Component { constructor() { super(); this.state = { firstVal: "", secondVal: "", total: "" }; this.handleChange = this.handleChange.bind(this); this.onAddClick = this.onAddClick.bind(this); this.onSubClick = ...
true
68f6e9e0e36483b0c1a5b3bd850071a171cee965
JavaScript
renaissancetroll/javascript-progress-bar
/main.js
UTF-8
1,313
2.890625
3
[]
no_license
const progressBar = document.getElementById('progress-bar') const contentContainer = document.getElementById('content') const progressContainer = document.getElementById('progress-container') const progressCover = document.getElementById('progress-cover') let articleRead = false function progressBarUpdate() { if(...
true
497e3fb756284a3c01139a7d98ecf3e63fc04d12
JavaScript
thechetanvaghela/Reference-Files
/contact form 7 single error msg.js
UTF-8
1,511
2.75
3
[]
no_license
/** * Disable WPCF7 button while it's submitting * Stops duplicate enquiries coming through */ document.addEventListener( 'wpcf7submit', function( event ) { // find only disbaled submit buttons var button = $('.wpcf7-submit[disabled]'); // grab the old value var old_value = bu...
true
5f051661416421e919ae77a91fa7847fcbb9b023
JavaScript
Anagha105/virtualpet
/sketch.js
UTF-8
1,123
3.078125
3
[]
no_license
var dog,sadDog,happyDog; var database; var foodStock, foods; var button1, button2; function preload(){ sadDog=loadImage("Images/Dog.png"); happyDog=loadImage("Images/happy dog.png"); } function setup() { database = firebase.database(); createCanvas(1000,400); dog=createSprite(800,200,150,15...
true
1dbdb344083eeb106ea83a57782a74c70e7c35de
JavaScript
Wahid259/Anisu-lslam
/AnisulslamJavascript/Lesson 28/index.js
UTF-8
266
2.984375
3
[]
no_license
//getElementById // var myHeading = document.getElementById("heading1"); // myHeading.innerHTML = "Hello"; // var myHeading = document.getElementById("heading2"); // myHeading.innerHTML = "Good Bye Good Bye"; // document.getElementById("para1").innerHTML = "Bye";
true
eaafd0261141ceeb014d10f9c3d02fc2973a6071
JavaScript
emevonlou/learning_js
/src/168.js
UTF-8
349
3.15625
3
[ "MIT" ]
permissive
// Proxy let obj = { name: "Shield", age: 2, }; let proxy = new proxy(obj(obj, { get(target, name) { console.log('Someone is asking for the name =}'); return target[name]; }, set(target, name, value) { console.log('Someone is changing the name!'); target[name] = va...
true
2fa7ec9babada615b435c54c549f177a7fab22ba
JavaScript
w4rlock/vue-js-abm
/model/wags.js
UTF-8
1,939
2.609375
3
[]
no_license
'use strict'; let Wags = module.exports , Redis = require('ioredis') ; const redis = new Redis(); //custom commands redis require('./wags.redis.lua')(redis) const K = { entity: 'wag:$id:$name' , next_id: 'next:id:wag' , members: 'wags' } Wags.save = (w) => { return new Promise((res, rej) => { red...
true
d9fb276120e2c6f33ca043f1814a744de9aad41b
JavaScript
saurav389/sunTemple
/suryamandir/static/js/script.js
UTF-8
2,824
3.171875
3
[]
no_license
let count = 0; function addField(){ var br = document.createElement('br'); var container_partyname = document.getElementById("container_partyname"); var container_itemname = document.getElementById("container_itemname"); var container_quantity = document.getElementById("container_quantity"); var contai...
true
7c6df8f3eb655897d751260b3366c66848a40b66
JavaScript
nooraniali17/BusMe
/js_client/js/impl/map.js
UTF-8
2,136
2.65625
3
[]
no_license
import { gmapsGeocode } from '../es6-compat/gmaps/places.js'; import navigator from '../es6-compat/navigator.js'; /** * Initialize map with marker at the current position. * * @returns Map (under `map`) and info popup (under `infoWindow`). */ export async function initMap ( { infoWindow = null, position ...
true
a614ec807c32f01d9deaed691054e1ccf8153556
JavaScript
jinydev/javascript
/docs/basic/es5/function/ex/function_05.js
UTF-8
189
4.09375
4
[]
no_license
// 함수를 선언합니다. function greeting(msg) { return msg + "!!!"; } // 함수를 실행합니다. 인자값을 생략합니다. let message = greeting(); console.log(message);
true
35ea6beece6452ed4dab0197bdcf77f2bae0ed6a
JavaScript
jordanblakey/functional-js
/src/18-imports-in-depth.js
UTF-8
1,847
3.4375
3
[]
no_license
// Import an entire module for side effects only, without importing anything. // This runs the module's global code, but doesn't actually import any values. // import '/index.js'; // import indexDefault from './index' // Aliases the default export // NOTE THIS IS NOT THE SAME AS IMPORT * AS INDEX, WHICH GETS THE NAMED...
true
2471ceb083b2d9bc6a4e36f5e201dab974942521
JavaScript
DraconDev/Tentacles_Extension
/tentacles.js
UTF-8
1,880
3.328125
3
[]
no_license
// LOCAL Storage // Save data to storage locally, in just this browser... // chrome.storage.local.set({ tectaclesToggleStored: true }, function () { // // Data's been saved boys and girls, go on home // }); // chrome.storage.local.get( // /* String or Array */ ["tectaclesToggleStored"], // function...
true
5588b7e604fbcdc2483e71c5085768f0a3f27e48
JavaScript
weichongwin/bookstore
/static/js/detail_price.js
UTF-8
1,674
3.015625
3
[]
no_license
$(function () { update_total_price(); // 计算总价 function update_total_price() { // 获取商品的价格和数量 books_price = $('.show_pirze').children('em').text(); books_count = $('.num_show').val(); // 计算商品的总价 books_price = parseFloat(books_price); books_count = parseInt(books...
true
6020e5f82e61491a206a9ba3ff45206cd5eacc9d
JavaScript
sreekanththadigotla/HungryPIG
/src/reducers/childReducer/childReducerr.js
UTF-8
13,118
2.5625
3
[]
no_license
const initialState = { childElements:[], index:null, selectedChild:null, All:[], saveChildElements:[], orders:[], afterBuy:[], ordersNo:0, sucess:false, deleted:false, pending:false, deleteOrder:false } export const childReducer =(state=initialState,action)=> { ...
true
dee43fb56860e23c21783e95c053f6bbbcaceb20
JavaScript
Marco30/1dv403-laborationer
/2-labbymezzage/js/Message.js
UTF-8
1,067
3.5
4
[]
no_license
"use strict"; function Message(message, date) //Konstruktor som har tvo privata variabler, vi använder get och set för att koma åt dem { this.getText = function()// används för att hämta en text { return message; }; this.setText = function(_text)// används för att lägga till en tex...
true
a92681495bb1ab26545be850ccc38011a8d5a854
JavaScript
yfann/nodjs-react
/server/data/getMessage.js
UTF-8
450
2.65625
3
[]
no_license
//var data = [{"a":"Hello React", "b":"Hello React"}, {"a":"Hello React", "b":"Hello React"}] /* var MessageList = [ { "Message":data}, ]; exports.getMessageList = function (callback) { callback(MessageList); }; */ var MessageList = [ { "Message":"Hello React"}, { "Message":"Hello Webpack"}, { "Message":"He...
true
6abcd4a3fdcb1d7dbc14d427a83f38ff962e13c7
JavaScript
cepradar/Proyectico1Web
/logica.js
UTF-8
5,474
2.90625
3
[]
no_license
$(function () { agregarUsuario(); editarUsuario(); guardarEdicionUsuario(); eliminar(); //add(); }); /* function addNUsuarios(datos) { $.each(datos, function(i, e) { $('#u-tabla').append("<tr>" + "<td>" + e.name + "</td>" + "<td>" + e.apellido + "</td>" + "<td>...
true
b37ffed039571a5289a6c431ccd8ef0efb64f610
JavaScript
AltufjevFrol/JS1-2_3_PhoneBook
/index.js
UTF-8
1,573
3.5
4
[]
no_license
// Телефонная книга var phoneBook = {}; /** * @param {String} command * @returns {*} - результат зависит от команды */ module.exports = function (command) { var commandSplit = command.split(' ');//разбиваем команду на массив из частей switch (commandSplit[0]) { //определяем тип команды case 'ADD': var name = co...
true
24d9da918baa2ac96974c4c5ac60860ec46a0b07
JavaScript
jerryyuan10/final-project
/src/pages/home-page.js
UTF-8
1,425
2.75
3
[]
no_license
import React from "react"; // import { Link } from "react-router-dom"; import HomeConfetti from "../components/home-confetti"; import "./home-page.css"; /** * Home page, add a button to change the SVOA word like a mini game of the create sentence. */ function HomePage(props) { const { word, setWord } = props; /...
true
e01ed10221334cfb73df169275326762b213ba0d
JavaScript
niharpatil/hw2
/index.js
UTF-8
6,850
4.25
4
[]
no_license
var hidden = require('./hidden') var getUser = hidden.getUser /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Ignore code above this line * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Homework...
true
d2be0933131ec9ee48a7a79e88a81d7e9d800a7e
JavaScript
Suyog-Raut/Project-rdbms
/public/lib/popup.js
UTF-8
1,068
2.890625
3
[]
no_license
function openform(){ var x= document.getElementById("1stform"); if (x.style.display==="none"){ x.style.display="block"; }else { x.style.display="none"; } } function openform1(){ var x= document.getElementById("2ndform"); if (x.style.display==="none"){ x.style.display="block"; }else { x.style.display="none"...
true
000b2e35e7760c9fc5ef27e69f78a11a396e763b
JavaScript
ajaymaity/citynet
/cityback/cityback/client_interface/static/scripts/map.js
UTF-8
12,009
2.71875
3
[]
no_license
/* eslint-disable max-len */ /* bunch of global variables */ let previousOccupancy = []; let mapLoaded = false; let firstJson = undefined; let map; let draw; let deltaSlider = 60; let iterators = new Set(); let stationsInChart = new Set(); let polygonLabelMap = {}; let requestInProgress = 0; let lastGeoJson; /** * Sh...
true
b22ac8be3275b67a7fb1316078006cb512ff4fe2
JavaScript
Hidoi-Chan/toxin
/src/firebase-storage.js
UTF-8
1,333
2.546875
3
[]
no_license
import firebase from "firebase/app"; import "firebase/storage"; export const firebaseConfig = { apiKey: "AIzaSyBKAOMhKCHBX0K8ff1TMM9pPIPbubnJd5c", authDomain: "toxin-b35b5.firebaseapp.com", databaseURL: "https://toxin-b35b5-default-rtdb.firebaseio.com", projectId: "toxin-b35b5", storageBucket: "toxin-b35b5.a...
true
41568c84d851aaff3cfc41c91360269ab1281ee8
JavaScript
gaoljie/js-algorithms
/utils/flat.js
UTF-8
261
3.296875
3
[]
no_license
function flat(arr) { return arr.reduce((acc, cur) => { if (Array.isArray(cur)) { return [...acc, ...flat(cur)] } else { return [...acc, cur] } }, []) } console.log(flat([1, 2, [3, 4]])) console.log(flat([1,2,3,[1,2,3,4, [2,3,4]]]))
true
d249f278933997c0726e5f952181d89391b71804
JavaScript
brendanready/Assignment3
/assignment3_part1.js
UTF-8
6,321
3.765625
4
[]
no_license
/* Brendan Ready Assignment 3, Part 1 FEWD 2 */ // Practice with Arrays // STEP 1 /* var favMovies = ["300", "Pulp Fiction", "Dazed and Confused", "Scarface", "No Country For Old Men"]; window.console.log(favMovies[1]); */ // STEP 2 /* var movies = new Array(); movies[0] = "300"; movies[1] =...
true
922d58e3c87d3559435570253119a8caf33c5b22
JavaScript
SMWARREN/Shearwater-Message-Service
/apiController.js
UTF-8
2,529
3
3
[]
no_license
// Importing The MessagesLinked List Class const MessagesLinkedList = require('./MessagesLinkedList.js'); // Creating MessageServices Obj to interact with Linked List const messageServices = new MessagesLinkedList(); // Creates The Message Specification Object const message = messageServices.messageSpecification; // ...
true
f910dfa6fdd2ac2b812311b4ab1787db9e888496
JavaScript
MatthewSamush/iotimList
/src/main/resources/static/js/script.js
UTF-8
173
2.5625
3
[]
no_license
var $ = require('jQuery'); $(document).ready(function() { if($(".statusText").innerHtml() == "Done"){ $(".statusBlock").css("background-color","green"); } });
true
8071b7759ceb40d41199a9caca2427d68cc70eb1
JavaScript
ZhongzhiZhang/book-1
/workers/together/simulate-users.js
UTF-8
7,723
2.84375
3
[ "MIT" ]
permissive
var _ = require('lodash') var random_name = require('node-random-name'); var Firebase = require('firebase'); // Boulder var city_location = { lat: 40.015, lon: -105.27 } var radius = 0.03 // simualate a random person entering, staying for a duration, and leaving function simulate() { // generate a ran...
true
6810a689272c079056b2427ba70a359080c1a060
JavaScript
adebali/adebali.github.io
/workbench/dc.js/web/js/simple-statistics/test/spec/median.test.js
UTF-8
872
3.296875
3
[ "Apache-2.0", "ISC", "MIT" ]
permissive
var assert = require('assert'); var ss = require('../../'); describe('median', function() { it('can get the median of three numbers', function() { assert.equal(ss.median([1, 2, 3]), 2); }); it('can get the median of two numbers', function() { assert.equal(ss.median([1, 2]), 1.5); }); ...
true
a5e16f6e48e959dedbb99a86499772f3678d8158
JavaScript
RamonaN/CloudComputing-UAIC
/bookaholic-final-project/REST/routes/books.js
UTF-8
2,064
2.78125
3
[]
no_license
var express = require('express'); var router = express.Router(); bookController = require('../controllers/bookController'); ratingController = require('../controllers/ratingController'); reviewController = require('../controllers/reviewController'); router.get('/', async (req, res) => { bookController.getBooks((err...
true
7ea3f484e81bb97db05f6a7cfb4e31d76eb362eb
JavaScript
chenqf/technical-summary
/src/leetCode/QA/155.MinStack/index.js
UTF-8
369
3.390625
3
[]
no_license
let MinStack = function() { this.list = []; }; MinStack.prototype.push = function(x) { return this.list.push(x); }; MinStack.prototype.pop = function() { return this.list.pop(); }; MinStack.prototype.top = function() { return this.list[this.list.length - 1] }; MinStack.prototype.getMin = function(...
true
41ffb97a758d4884ac6e789856c87d273cc5f653
JavaScript
JasonLinn/Node.js
/1_basic/5_PersonApp.js
UTF-8
177
2.75
3
[]
no_license
var person = require('./5_Person.js'); var man = new person('James','Bond'); // console.log('full name:',man.fullName('Jason','Lin')); console.log('full name:',man.fullName());
true
3eb7dfd808b062f8ce05f564b3bcd716281acda1
JavaScript
britcorona/Music-History-5
/javascripts/dom-access.js
UTF-8
232
2.515625
3
[]
no_license
define(function() { var $outputEl = $("#box2"); var $moreButton = $('#more'); return { getOutputElement: function() { return $outputEl; }, getMoreButton: function() { return $moreButton; } }; });
true
7b125b355e24ed4e6a6c7b1923805cf9fc02d077
JavaScript
topheman/node-streams-experiments
/experiments/stdout.pipe.number-sequence.js
UTF-8
620
2.765625
3
[]
no_license
var NumberSequence = require('../libs/number-sequence'); var Transform = require('stream').Transform; var parser = new Transform({objectMode:true}); //also works //parser._readableState.objectMode = false; //parser._writableState.objectMode = true; parser._transform = function(buffer, encoding, next){ this.push('c...
true
5f053bf64b285cf8f3a35cef254a8abedc0e70f7
JavaScript
cxchua/hakimchi-v1
/config/controllers/APIController.js
UTF-8
7,221
2.578125
3
[]
no_license
'use strict'; var Gcontact = require('../../models/gcontact'); var Gevent = require('../../models/gevent'); var Gmessage = require('../../models/gmessage'); var currentTime = new Date(); //=============== Get all Contacts Controller Sorted By Contact Date============================= function getContactsAllContactDa...
true
14ad1d0254124f7116eb4f723d4412c47fadf308
JavaScript
NegriHenrique/AP-javascript
/scripts.js
UTF-8
8,636
2.75
3
[]
no_license
let quantidadeEstados = "1"; let estadoInicial = "-1"; let alfabeto = []; let automato = []; let pilha = { valor: 'B', proximo: null }; const SIMBOLO_VAZIO = 'λ'; function atribuiOptions(id, quantidade, label, multiple = false) { let message = `<label for='${id}'>${label}</label>` + `<select id='${id}' ...
true
0cbf5cfb9431d6aecfbfaa6a76d3126d69063742
JavaScript
nhlong20/gitprofile
/script.js
UTF-8
3,022
3.046875
3
[]
no_license
const apiURL = 'https://api.github.com/users/'; const main = document.querySelector('#main'); const form = document.querySelector('#form'); const search = document.getElementById('search'); const getUser = async username => { const res = await fetch(apiURL + username); const resData = await res.json(); if (...
true
a408d1d29eed8387485a7bdcce3c164dea0752e7
JavaScript
Junghyun2006/JSArcher
/src/scripts/slime.js
UTF-8
5,617
2.78125
3
[]
no_license
import {ctx, canvas} from './canvas'; import { drawSprite, animate, char, handleGetHitFrame } from './character'; import {arrows} from './arrow'; import {heart, heartUI} from './heart'; const slime = new Image(); slime.src = "src/sprites/Slime/SlimeA.png"; class Slime { constructor(speed, width, height, frameX, ...
true
d5092948eadf2dbe48247dd8435a3985608f0fcf
JavaScript
sergiubrehuescu/front-end-student-app
/studentapp.js
UTF-8
1,565
2.640625
3
[]
no_license
let controller; let slideScene; let maindescription = document.querySelector('.main-description'); let dashboard = document.querySelector("#dashboard"); let students = document.querySelector("#students"); dashboard.addEventListener("click",() =>{ dashboard.setAttribute("href", `http://127.0.0.1:5500/dashboard.htm...
true
bfd4403342c567bda8c841fb66759e8023456b00
JavaScript
Salim66/Online-Service-Management-System
/assets/js/custom.js
UTF-8
159
3
3
[]
no_license
// Only Number for Input Field function isInputNumber(evt) { let ch = String.fromCharCode(evt.which); if (!(/[0-9]/.test(ch))) { evt.preventDefault(); } }
true
ed903258ac3074eb3e71cd56365a136a8b849ad5
JavaScript
youtube/cobalt
/third_party/v8/test/mjsunit/es6/array-concat-typedarray.js
UTF-8
1,727
2.734375
3
[ "SunPro", "BSD-3-Clause", "Apache-2.0", "GPL-1.0-or-later", "LGPL-2.0-or-later", "MIT" ]
permissive
// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. function testConcatTypedArray(type, elems, modulo) { "use strict"; var items = new Array(elems); var ta_by_len = new type(elems); for (var i = 0...
true
687eeec1d2e42145b5523574b92d4037b85cce7a
JavaScript
andersj234/6-Express-mongoDB
/6.1-ExpressDesdeMongoDB/ej1/public/index.js
UTF-8
283
2.546875
3
[]
no_license
fetch("api/mesas") .then(function (respuesta) { return respuesta.json(); }) .then(function (datos) { let parrafo ="" for (let i = 0; i < datos.contenido.length; i++) { parrafo +=`<p>Tamaño: ${datos.contenido[i].tamanio}</p>` } });
true
f874b7c4dbe2551539974caaca4b70c300970bff
JavaScript
WagnerGabriell/-Segundo-Sementre-Facudade-ADS
/Calculo de média/atividade9.js
UTF-8
1,708
3.0625
3
[]
no_license
media = (n1, n2, ) => { return (n1+n2)/2; } mediaR = (n1, n2, nr) => { return (n1+n2+nr)/3; } $(document).ready (function() { $("#nr").hide() $("#lReculperacao").hide() $("#calcularNovamente").hide() $("#spanResultado1").hide() $("#spanResultado2").hide() $("#calcular").cli...
true
1279838a4a353891a6cae808ff65ce69a4a9fd30
JavaScript
Cylonbasestar88/bead
/UserController.js
UTF-8
3,453
2.859375
3
[]
no_license
/* UserController : Kezeli a felhasználókkal kapcsolatos adatokat, előállítja a bejelentkezés és regosztráció oldalak html tartalmát a megfelelő fájlok és műveletek segítségével. */ var fs = require('fs'); /* Visszaadja a paraméterül kapott url-hez tartozó html tartalmat, amit a böngésző megjel...
true
2680fd61b90c48c92be446b9c25f0a67f4262038
JavaScript
almameow/clickr
/config/routes.js
UTF-8
1,268
2.578125
3
[]
no_license
// This is /config/routes.js var users = require("./../server/controllers/users.js"); var quizzes = require('./../server/controllers/quizzes.js'); module.exports = function(app){ // Receive post request via AJAX to /add // Direct request to the users.add method app.post("/add", function(request, response){ users....
true
b685461432e5beed7a69c8bbcca68ac8d0e2ddc2
JavaScript
rodrigoorocha/lista-de-exercicio-de-js
/q5.js
UTF-8
1,794
3.359375
3
[]
no_license
let div5 = document.querySelector("#q5"); let h1_5 = document.createElement("h1"); h1_5.textContent = "Questão 05"; let div_ladoA = document.createElement("div"); let div_ladoB = document.createElement("div"); let div_ladoC = document.createElement("div"); let div_calcular = document.createElement("div"); ...
true
12faca0b955202c81aa476c4f00b359bc99d6125
JavaScript
OtarinQl/task-manager
/src/models/user.js
UTF-8
2,859
2.546875
3
[]
no_license
const mongoose = require('mongoose') const jwt = require('jsonwebtoken') const bcrypt = require('bcryptjs') const validator = require('validator') const Task = require('./task') mongoose.connect(process.env.MONGODB_URL, { useNewUrlParser:true, useCreateIndex:true, useUnifiedTopology: true, useFindAndMo...
true
af3dfa2a072396bdabc628d0a9c9aca5fb6f627f
JavaScript
carlosscarranza/CharacterCG
/three.js
UTF-8
7,149
2.625
3
[ "MIT" ]
permissive
var camera, scene, renderer; var geometry, material, mesh; var cabezaGeometria, cabezaMaterial, cabezaMesh; var ojoGeometria, ojoMaterial, ojoMesh; var bigoteGeometria, bigoteMaterial, bigoteMesh; var hombrosGeometria, hombrosMaterial, hombrosMesh; var brazoGeometria, brazoMaterial, legsMesh; var stats, controls; let ...
true
6e360d1c87996b71ea45f8608499094957f4b0be
JavaScript
bunkbail/commaspace
/js.js
UTF-8
447
2.8125
3
[]
no_license
function replace() { var txtBox = document.getElementById("txtbox").value; var txtBoxModified = txtBox.replace(/, /g,'\n'); document.getElementById("txtbox").value = txtBoxModified; } var button = document.getElementById("copyToClipboard"), input = document.getElementById("txtbox"); button.addEventListe...
true
8eb6134f5813486063d71f3222f7b80e344b37ff
JavaScript
mvolkmann/nodejs-labs
/async/nextTick.js
UTF-8
500
2.875
3
[]
no_license
'use strict'; var async = require('async'); var Stream = require('stream'); var util = require('util'); function MyStream() { Stream.call(this); var that = this; //process.nextTick(function () { async.nextTick(function () { for (var n = 1; n <= 3; n++) { that.emit('data', n); } that.emit('end...
true
e29c66335b4c5cc1e03f0dca88c3b2e390e92298
JavaScript
ASNikolaev/Telegram-bot-for-notes
/src/module/noteClass.js
UTF-8
293
2.71875
3
[]
no_license
export default class Note { constructor(date, description, id) { let d = date; this.date = [date]; this.description = description; this.UserId = id; this.time = new Date(d.year, d.month, d.day, d.hours, d.minutes, d.seconds).getTime()/1000 } }
true
6ea69adbd117f8a08e1796a1c33a55616c808914
JavaScript
alanv73/Javascript-DSA-Masterclass
/WildWest/mostVowels.js
UTF-8
531
3.59375
4
[]
no_license
function mostVowels(phrase){ if(!phrase) return null; let vowels = ['a','e','i','o','u']; let maxVowels = 0; let maxWord; let words = phrase.split(' '); words.forEach((word) => { let currentVowels = 0; for(var char in word){ if(vowels.includes(word[char.toLowerCa...
true
38b9ecc134cd8e674ccc591c9438374cf43f8fca
JavaScript
jenniferstipe/web_development
/bonfires/seekAndDestroy.js
UTF-8
1,255
3.8125
4
[]
no_license
function destroyer(arr) { var searchArray = []; var matchArray = []; //put arr[0] (the array to filter) in an array variable so it can be called separately using searchArray.filter below for (x=0;x < arguments[0].length; x++) { searchArray.push(arguments[0][x]); } //console.log(searc...
true
eb1d63efe5a363a071e23fdc06e8fd9e942125cb
JavaScript
viveloper/react-todo-server
/routes/auth.js
UTF-8
2,497
2.546875
3
[]
no_license
const router = require('express').Router(); const jwt = require('jsonwebtoken'); var User = require('../models/user.model'); router.get('/', (req, res, next) => { res.send(`hello from auth`); }); // signup router.post('/signup', (req, res, next) => { const { email, username, password } = req.body; const user = ...
true
064dcd032d56677e64098a77b72ef674d7023d34
JavaScript
Pikey79/Direktf-rmedling
/employee/main.js
UTF-8
150
2.625
3
[]
no_license
$(".table-striped tr").each(function(){ if($(this).find(".marked-row").text().indexOf("marked") > -1) { $(this).addClass("work-taken"); } });
true
59d2c50f082241fe0a08142c939e8a3421733ecb
JavaScript
imbudhiraja/react-payslip-generator
/src/App.js
UTF-8
6,155
2.71875
3
[]
no_license
import React, { PureComponent } from 'react'; import Picker from 'react-month-picker-input'; import WelcomeHeader from './WelcomeHeader'; import TextInput from './TextInput'; const nameRegex = /^[a-zA-Z]{2,25}$/; const numberRegex = /^[0-9]+$/; export default class App extends PureComponent { state = { name: ''...
true
0fa8b1d377c731b26dcd53458253cfc9fd4f9a62
JavaScript
turgutkafali/FS-Front-End
/2-JAVASCRİPT/2-Pre-class/16-oop-class/app2.js
UTF-8
140
2.9375
3
[]
no_license
class Person{ static Message(){ return "ecmascript ile nesne yönelimli programlama" } } console.log(Person.Message())
true
e4e8ee7d91818fe378d25b8d59a006ab9a59090d
JavaScript
shakib2021/ES6-Practice
/class.js
UTF-8
282
2.796875
3
[]
no_license
class student{ constructor(sId,sName){ this.id=sId; this.name=sName; this.schoolName="jagadishpur jc high school" } } const student1= new student(12,"shakib"); const student2= new student(001,"bin hamid"); console.log(student1.id,student2.name); console.log(student2);
true
62ea0219eb98f20b939c31176b168ccc217495c6
JavaScript
Tanmay53/cohort_3
/submissions/sm_109_manish-kumar/week_13/day_1/evaluation/src/component/product/Cart.js
UTF-8
3,206
2.546875
3
[]
no_license
import React from "react" import Table from './CartTable' class Cart extends React.Component{ constructor(props){ super(props) this.state = { arr: [], product :{ Name : "", Id :"", Desc:"", Cat:"", Price:"" ...
true
63a651c982171724812249ee3b75f47f5dbbd34c
JavaScript
esemalulu/Erepository-
/MindGym/sweet_emailtpl_import_scheduled.js
UTF-8
3,778
2.53125
3
[]
no_license
/** * Eprompt Template Import script * * Script will import eprompt templates from Neocortex * */ /** * Main */ function main_scheduled() { try { // Prepare mail webservice var baseUrl = 'http://neocortex.themindgym.com/api'; var wsClient = new SWEET.REST.Client(baseUrl); wsClient.enableA...
true
073a1c74d1ba5ba591126225e8a25d6b8476be56
JavaScript
vdiaz1x/CryptoApp
/comment/commentController.js
UTF-8
2,076
2.671875
3
[]
no_license
// this is the file for the controllers for the comment routes // code borrowed from class work // exporting the models in a function module.exports = commentModel => ({ // controller for getting all comments for that user and coun async getAllComments(req, res, next) { try { console.log('get all', req....
true
9846d6d3a18fbf430ded2f6f4ac061c6409a85bb
JavaScript
jhurst16/Team-Generator
/__tests__/Engineer.test.js
UTF-8
409
2.6875
3
[]
no_license
const Engineer = require("../lib/Engineer"); test("getRole() should return \"Engineer\"", () => { const role = "Engineer"; const engineer = new Engineer("name", Number, "string"); expect(engineer.getRole()).toBe(role); }); test('can get github name', () => { const user = 'string' const enginee...
true
ba70179856193f7eea95a9ee81ba910299c914c0
JavaScript
lovejs/lovejs-components
/src/__tests__/emitter/Event.test.js
UTF-8
1,561
3.015625
3
[ "MIT" ]
permissive
const Event = require("components/emitter").Event; const instance = new Event("name", "data"); test("Create instance of an Event with a name and some data", () => { expect(instance).toBeInstanceOf(Event); expect(instance.getName()).toBe("name"); expect(instance.getData()).toBe("data"); instance.setD...
true
c375bd5937ebeb5ce1498a6707496bc67690de0d
JavaScript
lincanbin/bff-parser
/lib/bff-parser.js
UTF-8
1,450
2.53125
3
[ "Apache-2.0" ]
permissive
const BffParserItem = require('./bff-parser-item') const BffParserResult = require('./bff-parser-result') class BffParser { constructor (body = {}, requestProcessor = async (request) => { return (new Promise((resolve, reject) => { })) }, options = {}) { this.options = { maxRequestNumber:...
true
e38ae8dbee3ae86a58ff98305fbc06130f1db5e5
JavaScript
nirali420/tinyapp
/helpers.js
UTF-8
638
3.015625
3
[]
no_license
// FIND USER BY EMAIL ID const getUserByEmail = function(email) { for (let user in users) { if (users[user].email === email) { return users[user].id; } } return ""; }; // GENERATE RANDOM STRING const generateRandomString = function() { return Math.random() .toString(30) .substring(2, 8); ...
true
3b60abd8b215dc01cf4dd1d402ea1f90fec89e15
JavaScript
rai8/ajax
/fetchApi/users.js
UTF-8
628
3.1875
3
[]
no_license
const btn = document.getElementById("btn") btn.addEventListener("click", getUsers) function getUsers() { fetch("users.json") .then((res) => res.json()) .then((data) => { let output = "<h2>Users</h2>" // console.log(data) data.forEach((user) => { //console.log(user.name, user.email...
true
b989910ab927d64a3f4cc28ea8607aeeaeb78364
JavaScript
kaitlynflynn/Whiteboard_Practice
/BalancedBinaryTree/BalancedBinaryTree.js
UTF-8
1,999
4.71875
5
[]
no_license
// Balanced Binary Tree // Given a binary tree class that looks like this: // class BinaryTreeNode { // constructor(value) { // this.value = value; // this.left = null; // this.right = null; // } // insertLeft(value) { // this.left = new BinaryTreeNode(value); // return this.left; // } //...
true
f3a22c2c5cd251fa63804a1991c2c917468611c8
JavaScript
kennja05/redux-delete-lab-nyc-web-120919
/src/components/Band.js
UTF-8
357
2.53125
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import React, { Component } from 'react'; class Band extends Component { handleClick = () => { const {deleteBand, id} = this.props deleteBand(id) } render() { console.log(this.props) return( <li> {this.props.name}<button onClick={this.handleClick}>Delete</button> </li>...
true
1a799128b8469a1164e7138f170f1943b368b7cc
JavaScript
pmsandhu/web-components
/Switch/Switch.js
UTF-8
1,633
2.953125
3
[]
no_license
const switchTemplate = document.createElement('template') switchTemplate.innerHTML = ` <link rel="stylesheet" href="./Switch.css"> <label class="switch"> <input type="checkbox"/> <span class="circle"></span> <span class="label"></span> </label> ` class Switch extends HTMLElement { static get observedAttribut...
true
c5cbd9c139db5910e4d8203379b48adc1223295f
JavaScript
louisheath/javascript-course
/7-ES6/challenge.js
UTF-8
3,587
4.125
4
[]
no_license
/* TASK: In a town with 3 parks and 4 streets, produce an end-of-year report to the mayor covering: 1. Tree density of each park in the town (#trees / park area) 2. Average age of each park 3. The name of the park with over 1000 visitors 4. Total and average length of the town's streets 5. Size classification of a...
true
80d71bb5375fd68a0a7448d46148bcce7e5d22f8
JavaScript
acekhan1999/uae_holidays
/script.js
UTF-8
2,887
3.71875
4
[]
no_license
// Set the date we're counting down to // let Holidays = new function(name, date) { // this.name = name; // this.date = date; // } let counter = 0 let upcomingHolidays = [ { name: "Test Day", date: new Date("May 17, 2021 00:00:00") }, { name: "Test Day 2", date: new Date("May 20, 2021 00:0...
true
53ca8aec86af5ef991e85423468dd69a50b8f4c3
JavaScript
djanta/eslint-config-djantajs
/test/rules/global-require.spec.js
UTF-8
462
2.53125
3
[ "MIT" ]
permissive
'use strict'; // eslint global-require: "error" let fs = require('fs'); const DEBUG = false; // you can use a ternary to determine which module to require let type = DEBUG ? require('fs') : require('path'); /** * Read file function * @param {string} filename file name * @param {Function} callback callback funct...
true
7662fbd4ed5f62970069d5b2bc56f736f9ef6638
JavaScript
G-Fit-Digital/meal-plan-generator
/routes/meal.js
UTF-8
6,696
2.65625
3
[]
no_license
const express = require("express"); const router = express.Router(); const { Item } = require("../models/item"); const randomInteger = require("../utils/utils"); const { Meal } = require("../models/meal"); const calculateMealCalories = require("../utils/calculateCalories"); const calculateMealProtein = require("../util...
true
55ac30b30362a8e7ff9f137ec9d3b302469fa81a
JavaScript
antonyftp/Molly
/commands/ban.js
UTF-8
1,453
2.59375
3
[]
no_license
const Discord = require("discord.js"); const config = require("../json/config"); exports.run = (bot, message, args) => { let bUser = message.guild.member(message.mentions.users.first()); if (!bUser) return message.channel.send("Je n'ai pas trouvé l'utilisateur"); let bReason = args.join(" ").slice(22); ...
true
4655f3b3ee29609d06b8d2f551560d632c89fa29
JavaScript
shacharbuda/coronaTime
/script.js
UTF-8
1,404
3
3
[]
no_license
// Global setup moment.locale('he'); const intlNumFormat = new Intl.NumberFormat().format; $(document).ready(async () => { let data; try { data = await getDataByCountry('il'); } catch(e) { return; } finally { $('.spinner-container').fadeOut(); } $('.data').fadeIn(); const { snapshots } = dat...
true
1d02d3d824d9006f9d69c35d97f27efc209301f4
JavaScript
AnushaMotamarri/javascript-interview-prep
/q2.js
UTF-8
2,235
4.09375
4
[]
no_license
/* what is prototype chain?*/ /* PROTOTYPE: It is an object that is attached to each datatype thats created in JS. this attached object contains some hidden methods which can be accessed directly via a dot '.' operator*/ let arr = ['anusha' , 'Motamarri'] // arr will get attached with Array.prototype object. /*we ca...
true
ef0adb00e91a8d1dc611162527cbc24d1fad618f
JavaScript
HaeSeongPark/TIL
/JavaScript/scope.js
UTF-8
131
3.28125
3
[]
no_license
var func = function(){ var abc = 1; } func() console.log(abc) //abc is not defined if(true){ var edf = 1 } console.log(edf) //1
true
b4755b0ce236a7b79a9d5ad5482faaf73e59bc94
JavaScript
MonikaAnkoliya/schoolapp
/src/reducers/classReducer.js
UTF-8
1,085
2.9375
3
[]
no_license
/* eslint-disable no-case-declarations */ const intialState = [ { id: "1", name: "maths" }, { id: "2", name: "physics" }, { id: "3", name: "chemistry" }, { id: "4", name: "computer" } ]; export default (state = { classData: intialState }, action) => { const { classDat...
true
1ba9ab77de29e8e68d8baa77411f06cada54e588
JavaScript
keisuke6065/react-training
/src/componets/body/form/input/input.js
UTF-8
1,681
2.71875
3
[]
no_license
import React, {Component, PropTypes} from 'react'; class Input extends Component { constructor(props) { super(props); this.state = { dispText: '入力してください' } this.handleInput = this .handleInput .bind(this) } componentWillMount() { c...
true
17f952c7098441c531eae97550b15824ed0a2e73
JavaScript
chromakode/morphdeck
/src/transforms/backgroundSlide.js
UTF-8
356
2.625
3
[ "MIT" ]
permissive
export default function* backgroundSlide(slides) { const bgSlide = slides.find(s => s.svg.getAttribute('data-key') === 'deck-background') if (!bgSlide) { return } for (const slide of slides) { if (slide === bgSlide) { continue } slide.svg.insertBefore(bgSlide.svg.cloneNode(true), slide.sv...
true
f8fa5cf9e1ff9a303e1d82cccdd583c53598802b
JavaScript
tribac/pov
/test/pov-array.test.js
UTF-8
958
2.890625
3
[ "MIT" ]
permissive
import pov, { array } from '../src/pov'; import assert from 'assert'; describe('array basic contract', function() { const ipa = { oof: 1 }; // let's encapsulate the use of pov and its mapping function mapFoo(source) { return pov(source, { foo: 'oof' }); } const mapped = mapFoo(ipa); // m...
true
044c650d24d412cf13a27ea333e535573f367cb3
JavaScript
jagadeeshpalaniappan/jag-learn-react-redux
/src/apps/3-shopping-cart/1-shopping-cart--simple/Products.js
UTF-8
3,091
2.546875
3
[]
no_license
import React, { useRef } from "react"; import { connect } from "react-redux"; import { createSelector } from "reselect"; import { createProductAction, deleteProductAction, addToCartAction } from "./redux"; //------------------ AddProduct ------------- [PERF-ISSUE-FIXED] const AddProduct = ({ createProduct }) =>...
true
328469ec6cc125e538dce5a98124180e30195707
JavaScript
VietAnh1508/chat-app
/public/js/index.js
UTF-8
4,341
2.6875
3
[]
no_license
$(document).ready(function() { $('#join-form').show(); $('#chat-form').hide(); $('#room-list').change(function () { if ($('#room-list').find(':selected').text() !== '-- Pick a room --') { let roomName = $('#room-list').find(':selected').text(); $('[name=room]').val(roomName)...
true
2f8d8aa0eb177b867a741b167d0668a23dd8c26f
JavaScript
mariarykova/fuse8_test
/scripts.js
UTF-8
2,563
2.984375
3
[]
no_license
const requestURL = "https://603e38c548171b0017b2ecf7.mockapi.io/homes"; let items = []; let xhttp = new XMLHttpRequest(); xhttp.open("GET", requestURL); xhttp.responseType = "json"; xhttp.onload = () => { if(xhttp.status >= 400) { console.error(xhttp.response); } else { items = xhttp.response; showH...
true
8f737b55a150713a11c32f0d9ef47308a733f312
JavaScript
gilsonpcf/algoritmos
/fundamentais/javascript/troca_variaveis.js
UTF-8
450
4.46875
4
[]
no_license
// Algoritmo Fundamental Nº 1 // Descrição : Troca dos valores de duas variáveis // Problema : Dadas duas variáveis, trocar os valores atribuídos a elas. // Aplicações: Algoritmos de ordenação. var a = prompt("Valor da variável A:"); var b = prompt("Valor da variável B:"); var aux; aux = a; a = b; b = aux...
true