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
069486231319d544ff874802a60256e1704a897d
JavaScript
catalina10101/gameCartaMayor
/js/classes/comps/cardContainer.js
UTF-8
7,562
2.953125
3
[]
no_license
class CardContainer extends Phaser.GameObjects.Container { constructor(config){ super(config.scene); this.scene = config.scene; if(!config.size) config.size = 6; //number of cards to contain if(!config.backGroundColor) config.backGroundColor = 0xeeeeee; ...
true
2cdab7ab6cf2442333db845a84227c37033df929
JavaScript
Mariya-Skakalina/why-not
/src/js/index.js
UTF-8
474
2.5625
3
[]
no_license
console.log('Hi') import '../style/style.scss' let yes_modalka = document.querySelector('#yes') let no_modalka = document.querySelector('#no') let modalka = document.querySelector('.modal-wrapper') if(getComputedStyle(modalka).display == "flex") { yes_modalka.addEventListener('click', () => { modalka.styl...
true
57fedcf72e95414beb43acb3990f1e18ec3734a4
JavaScript
forcecore235/PracticeA6.8
/js/main.js
UTF-8
429
3.1875
3
[]
no_license
let progressBar = document.querySelector(".progress-bar"); let btn = document.querySelectorAll(".btn"); let progressValue = progressBar.style.width.slice(0, -1); btn.forEach((element) => { element.addEventListener("click", function() { progressValue = Number(progressValue) + Number(element.value); ...
true
5c929a60b3fa5a11d40654c457826d9e080746c7
JavaScript
Petervrancken/PokeDex
/src/components/Pokedex.jsx
UTF-8
6,958
2.640625
3
[]
no_license
import React, {useState, useEffect} from 'react' import loadImage from "../afbeeldingen/pokeball.png" import ReactPaginate from 'react-paginate'; import { Center, Text, Box, Image, Grid, } from "@chakra-ui/react"; function Pokedex() { const [catchInput, setCatchInput] = useState(""); const ...
true
7bf85c3e6a26fc77a4d2a5c6136b2ae93767af84
JavaScript
jeremydmiller/pg-events
/lib/store-base.js
UTF-8
772
2.625
3
[ "Apache-2.0" ]
permissive
function StoreBase(ctor, store){ if (store == null){ store = {}; } var stores = {}; store.initViewStorage = function(type){ if (stores[type] == null){ stores[type] = new ctor(type); } } store.forViewType = function(type){ store.initViewStorage(type); return stores[type]; } store.findView = fun...
true
eb0a6f4d52e6955894ef9c3779f00a3eb4be115c
JavaScript
yangxin1994/simplr-components
/lib/theming/simplr-theme.js
UTF-8
1,389
2.515625
3
[ "MIT" ]
permissive
const defaults = { primary: { main: '#02a9ee', light: '#66daff', dark: '#007abb', }, secondary: { main: '#e0001e', light: '#ff5448', dark: '#a50000', }, }; class SimplrThemeCreator { static init(styles) { let setStyles = styles; if (!setStyles) { setStyles = defaults; ...
true
4f4c82cd02bff7688c29adaa4e5cf6f61dea879c
JavaScript
xpxf/loadingComponent
/src/index.js
UTF-8
6,986
2.625
3
[]
no_license
/** * @author yangwj * * loadingComponent * 加载进度条组件 */ ; (function ($) { 'use strict'; if (!$.fn) { throw new Error("OMG !!! we need jquery!!! help me!!!"); } // 往页面上追加样式 $("<style></style>") .append('\ .loading-component{\ position: abs...
true
852e599e84c995b636d7398733427fb21e026bc6
JavaScript
jjovan/lesson7hw
/scripts/apps.js
UTF-8
1,303
3.671875
4
[]
no_license
// alert('hello world!'); // console.log('hellooooo'); // function changeMe() { // document.getElementById('result') = ('hello world') // } // n // var number1 = 10; // var number2 = -1; // var result = number1 + number2; // console.log(result); // var age = 9; // var number = 100; // if (number <10) { /...
true
587e672862007a4741619f6de8887784e2f99d9c
JavaScript
jyuno426/KCSS
/kcss/static/kcss/js/checkbox.js
UTF-8
2,498
2.84375
3
[ "MIT" ]
permissive
function getAllCheckboxes() { return Array.from(document.getElementsByTagName("input")).filter( (elem) => elem.type === "checkbox" ); } function checkAll(allbox) { /* Mark or unmark all checkboxes */ getAllCheckboxes().forEach((box) => { box.checked = allbox.checked; }); } function checkCSRankings(c...
true
2e026e28c294781040e53a7895c43f3d64f648ee
JavaScript
CSToddDEV/reThinkingNutrition
/rtn.js
UTF-8
22,742
2.546875
3
[]
no_license
// THIS IS A GITHUB TEST //Load Modules var express = require('express'); const mariadb = require('mariadb'); //Load Express and Express Handlebars var app = express(); var handlebars = require('express-handlebars').create({ defaultLayout: 'main' }); //requires var clientMethods = require('./methods/clientMethods...
true
271d8ec5d66b444082b343304ef911776f2e1bda
JavaScript
CATT-CODE/objectively-funcy
/main.js
UTF-8
1,715
3.765625
4
[]
no_license
// Your code here. const person = { } const personTwo = { } const getFirstName = function(person) { return person.firstName; } const getLastName = function(person) { return person.lastName; } const getFullName = function(person) { return person.firstName + " " + person.lastName; } const setFirstName = f...
true
161c131cce58a7f6078448887f80a5d3d128b9fd
JavaScript
laurastolen/bus_mall
/js/app.js
UTF-8
7,708
3
3
[ "MIT" ]
permissive
'use strict'; var localProductData = 'localProductData'; var allProducts = []; var randomProducts = []; var clickCounter = 0; const MAXCLICKCOUNTER = 25; var Product = function (name, picture) { this.name = name; this.picture = picture; this.timesClicked = 0; this.timesDisplayed = 0; this.markAsClicked = f...
true
86b08cb4ff6032529a251e91e2f87bc780e21322
JavaScript
Encoloniel/KingDice
/commands/purge.js
UTF-8
759
2.8125
3
[]
no_license
const ess = require('../ess'); module.exports = { purpose: function(message) { try { if (!Number(message.content.split(" ")[1])) { message.channel.send("Please provide a number for amount of messages to be deleted.") return; } let deleteCount = parseInt(message.content.split(" "...
true
90a8d4505b0273ba8579d947cbe3689bd97064d1
JavaScript
bl4ck4ndbr0wn/facebook-clone
/src/_reducers/index.js
UTF-8
418
2.5625
3
[ "MIT" ]
permissive
import {userConstants} from '../_constants'; const user = JSON.parse(localStorage.getItem('user')); export const initialState = {user}; export function reducer(state = initialState, action) { switch (action.type) { case userConstants.SET_USER: return { ...state, user: action.user, };...
true
0cd4d06b2309de7e6477b1a60bb5120b4f876a7a
JavaScript
TihonkovSergey/omsk-graph
/prepare/2_filterFootprints.js
UTF-8
1,763
2.578125
3
[ "MIT" ]
permissive
const csv = require("csvtojson"); const fse = require("fs-extra"); const readStream = fse.createReadStream("tmp/out.csv"); const hospitals = []; const fireStations = []; const shops = []; const apartments = []; const mapObject = (obj, mapper) => { const mapped = {}; Object.keys(obj).forEach((key) => { mappe...
true
104e32f35705e3832d48c4430bdc77bb461e5341
JavaScript
ThiagoMilhomens/WebDev-Studies
/webDevModerno/Controle/doWhile.js
UTF-8
618
4.1875
4
[ "MIT" ]
permissive
function getInteiroAleatorio(min, max) { const valor = Math.random() * (max - min) + min return Math.floor(valor) } let opcao = -1 do { opcao = getInteiroAleatorio(-1, 10) console.log(`Opção escolhida foi ${opcao}.`) } while (opcao != -1) console.log('Até a próxima!') // Diferente do e...
true
d716734138b6129e741d2eb286181f18b66f4b64
JavaScript
erwanriou/test_UI
/src/components/MenuItem.js
UTF-8
2,240
2.859375
3
[]
no_license
import React from "react" const pack = require("bin-pack") const BinPacking2D = require("binpackingjs").BP2D const { Bin, Box, Packer } = BinPacking2D class MenuItem extends React.Component { constructor(props) { super(props) this.state = { grill: { x: 30, y: 20 } } } handleMenuItems() { co...
true
b8f18a9dddc771da41752bb8fa7e700ae4f076ef
JavaScript
yidea/lab
/app/scripts/models/model.js
UTF-8
3,776
2.84375
3
[]
no_license
define(['underscore', 'backbone'], function (_, Backbone) { /* * @ BB Model * ---------------------------------- * - contain single data model end point connenction and schema, data logic (validation, listen to model changes) */ var ModelTodo = Backbone.Model.extend({ // set default attribute d...
true
3364bc0b15afbebaf6de72a6dbf776da8d3ea3c1
JavaScript
me42th/TECH-LAB
/IGTI/modulo_1/capitulo_2/aula_3/js/script.js
UTF-8
588
3.109375
3
[]
no_license
var input = document.querySelector('#input1'); var textarea = document.querySelector('#textarea'); input.addEventListener('mousemove', (event) => { console.clear(); var ref_red = event.clientX / 188; var ref_blue = event.clientY / 222; console.log(ref_red); var red = Math.ceil(255*r...
true
a2b032c73c764653327873349f9db55934dcf016
JavaScript
xipascu/lighthouse-js-fundamentals
/ageCalculator.js
UTF-8
357
3.625
4
[]
no_license
function ageCalculator(name, yearOfBirth, currentYear) { var age; age = currentYear - yearOfBirth; return age } console.log("Suzie is " + ageCalculator("Suzie", 1984, 2016) + " years old."); console.log("Jack is " + ageCalculator("Jack", 2004, 2016) + " years old."); console.log("Ali is " + ageCalculator...
true
988432d427ae798d6f63b08b8e19b6ddc46c0918
JavaScript
chikeozulumba/getdev-book-api
/routes/book.js
UTF-8
4,459
2.671875
3
[]
no_license
//routes/user.js const express = require("express"); const moment = require("moment"); const Joi = require("joi"); const router = express.Router(); const Book = require("../models/Book"); let schema = Joi.object().keys({ title: Joi.string() .min(3) .max(30) .required(), genre: Joi.string() .min(3) ...
true
2bc005960efc568c9d962a9d3be36ffe187c1a24
JavaScript
Harimohan03/mearn
/javascriptworks/flow controls/looping/r.js
UTF-8
107
3.03125
3
[]
no_license
var num=3,sum=0,total=0; for(let i=1;i<=num;i++){ sum=sum*10+num; total+=sum; } console.log(total);
true
1c0ab9f6e8ee60eeb2748168c05eede7dec720be
JavaScript
AriLFrankel/JS30
/11 - custom html video player/scripts.js
UTF-8
1,877
3.09375
3
[]
no_license
// Elements const player = document.querySelector('.player') const video = player.querySelector('.viewer') const progress = player.querySelector('.progress') const progressBar = player.querySelector('.progress__filled') const toggle = player.querySelector('.toggle') const skipButtons = player.querySelectorAll('[data-s...
true
d21c4e2f306399eb914fa37b6c64d177701374de
JavaScript
MarlonFord/project-cv
/js/main.js
UTF-8
733
3.171875
3
[]
no_license
var coll = document.getElementsByClassName("collapsible"); var i; for (i = 0; i < coll.length; i++) { coll[i].addEventListener("click", function() { this.classList.toggle("active"); var content = this.nextElementSibling; if (content.style.display === "block") { content.style.display = "none"; }...
true
96da9aa09520a23311396e35005bf1076385ea7c
JavaScript
kendfss/pixelwerke
/quanta-js/script.js
UTF-8
3,282
3.046875
3
[]
no_license
// require("./maths.js"); // require("./itertools.js"); // require("./colours.js"); const backgroundColor = 0xfff; const widthInput = document.getElementById('widthInput'); const heightInput = document.getElementById('heightInput'); const extensionInput = document.getElementById('extensionInput'); const colour...
true
6b62cb455bc8ac40f49da064a2bed0bdea3a3668
JavaScript
Brein-369/fancytodo
/server/middlewares/auth.js
UTF-8
1,508
2.5625
3
[]
no_license
const {User, Todo} = require('../models') const {verifyToken} = require('../helpers/jwt.js') const authenticate = (req,res,next)=>{ //fungsi try catch supaya kalo req headers access tokennya salah bisa di catch(error) try { //proses decode menggunakan destructuring //access token selalu didapat...
true
204c5d8d6af9ad0f3a45c8a1e159e27a3d89c1f2
JavaScript
hamburgcodingschool/fullstack-2020-3_nodejs
/code/lesson2/n4-basicRestAPI.js
UTF-8
636
3.140625
3
[]
no_license
const express = require("express"); const app = express(); const port = 3000; const myJSONarray = [ { name: "Helder", city: "Porto", age: 39, }, { name: "Joe", city: "N.Y.", age: 20, }, { name: "Maria", city: "Madrid", age: 55...
true
48b7b52c9236a52fcd82fa6ce1bd711fec84a75a
JavaScript
m-sandesh/JS-Learnings
/JS/1.2Intermediate/ToDoAppV2.js
UTF-8
1,106
3.546875
4
[]
no_license
// This is a to do application for meetings and appointments. let myAppointments = { dayFor: 'Monday', allMeetings: 0, meetingDone: 0, } let AddMeeting = function (objectName, meets = 0) { objectName.allMeetings += meets; }; let MeetingDone = function (objectName, meets = 0) { object...
true
4be7c78de6508f7b48379270d37e49752f7b5820
JavaScript
cwins-lambda/Node-Blog-heat
/posts/postRoutes.js
UTF-8
3,288
2.65625
3
[]
no_license
const express = require('express'); const dbPost = require('../data/helpers/postDb.js'); const dbUser = require('../data/helpers/userDb.js'); const router = express.Router(); // custom middleware function validUserId(req, res, next) { const { userId } = req.body; dbUser.get(userId) .then(user => {...
true
5847984426c9c5767fa411c55ec5808f5a1abc44
JavaScript
corpus-christi/corpus-christi
/ui/mocks/latency.js
UTF-8
295
2.578125
3
[ "MIT" ]
permissive
// Simulate up to 5 seconds of random network latency // Usage: json-server [...] --middlewares latency.js module.exports = (req, res, next) => { let latency = Math.floor(Math.random() * 5000); setTimeout(() => { res.header("X-Simulated-Latency", latency); next(); }, latency); }
true
62f3091393ae2ecea56689c03a26e2f225ef9eab
JavaScript
b-studios/lisp.js
/jsconsole/interpreter_adapter.js
UTF-8
1,407
2.703125
3
[]
no_license
var InterpreterAdapter = function(callback){ var worker_wanted = true, debug = false; // if worker are supported - see worker.js if(!!window.Worker) { var worker = new Worker("jsconsole/worker.js"); worker.onmessage = function(evt) { var msg = evt.data; callback([msg.className, msg...
true
ff2ca46e117a1c30405ef59af837f28925bb6452
JavaScript
zjsxdyw/utility
/Ajax Queue/index.js
UTF-8
2,096
2.953125
3
[]
no_license
function queue(num) { const PENDING = 'pending'; const PREPARATION = 'preparation'; const DONE = 'done'; let queue = [], paused = false, _ajax = $.ajax; num = num || 1; function next() { if (paused) return; let i = 0; while(i < num && i < queue.length...
true
3b191ee198ea964a6eedd64e9a5948115150c99b
JavaScript
rubenrodriguez9/cv-usa-csv-suv-backend
/get-new-cases-by-day.js
UTF-8
396
3.09375
3
[]
no_license
let getNewCasesByDay = function(date, arr){ // console.log(date) // console.log(arr[0][3]) // console.log(arr) for(let i = 0;i < arr.length;i++){ for(let n = 0;n < arr[i].length;n++){ if(arr[i][n] === date){ return arr[i][n+2] } } } } if (typeof getNewCasesByDay === 'undefined...
true
46a5358bf84b3b580fa2c1789ff179de4f1350a7
JavaScript
w4alf/javascript-instruction
/ch04/ch04_favorite_things.js
UTF-8
1,256
4.0625
4
[]
no_license
let readline = require('readline-sync'); console.log("Welcome to the favorite things app, V1"); //initialize an empty array to store favorites let favorites = []; let choice ="y"; while (choice == "y"){ console.log("===Add a favorite thing==="); let id_in =readline.questionInt("Favorite Id: "); ...
true
b629f19aada144433a26c2fa0b26062f6a326e3b
JavaScript
ZES-BJTU/gmh-web
/src/main/webapp/gmh/js/tools.js
UTF-8
3,831
2.609375
3
[ "MIT" ]
permissive
function redirect(url) { window.location.href = url; } // function setCookie(name, value) { // document.cookie = name + "=" + value + "; "; // } //写cookies function setCookie(name, value) { //cookie有效时间,30分钟 var Days = 7; var exp = new Date(); exp.setTime(exp.getTime() + Days * 24...
true
390349b9313bf1cdda2667812f5f3f5e00ec7b3d
JavaScript
CubillasG/tienda-SK
/js/clases.js
UTF-8
735
2.953125
3
[]
no_license
class Producto { constructor(carritoProductos){ let carrito = carritoProductos this.calculoTotalCarrito = () =>{ let total = 0 for(let producto of carrito){ total += parseFloat(producto.precio) } return total } this.calculoDescuentoAplicado = () =>{ ...
true
9cf000699bdca73645ce32e721f644df4e857680
JavaScript
quietdw/react-tutorials
/src/ContextTest.js
UTF-8
1,185
2.671875
3
[]
no_license
import React from "react" import "./contextTest.css" const nContext = React.createContext(100) function Button0(props) { return ( <div> 0<button onClick={props.setN}>{props.n}</button> </div> ) } function Button1() { return ( <div className="bordered"> <div>1</div> <nContext.Consu...
true
7c8f6bdb8e6b13516581f6e18671df5de9bf48aa
JavaScript
Vishal643/mern-todo
/client/src/components/Todo.jsx
UTF-8
2,417
2.546875
3
[]
no_license
import React, { useState, useEffect } from 'react'; import axios from 'axios'; import ShowTodo from './ShowTodo'; import styles from './styles/Todo.module.css'; import ClipLoader from 'react-spinners/ClipLoader'; const Todo = () => { const [todos, setTodos] = useState([]); const [title, setTitle] = useState(''); con...
true
ebc41eb9e11d525cb817e93955fa02e5f6ee8d1c
JavaScript
sakshibansal52/ims
/zenways/Javascipt/number.js
UTF-8
181
3.390625
3
[]
no_license
console.log(Math.random()) function randomnumbers(numberOfRandom){ for( let i=0; i<=numberOfRandom;i++){ console.log(parseInt(Math.random())) } } randomnumbers(10)
true
bb3dde328de783d9217fce22bee6358534f0999f
JavaScript
Jay-Dee-W/-Day-49-Refresh-Token-Backend
/routes/books.js
UTF-8
584
2.734375
3
[]
no_license
const express = require('express') const router = express.Router() router .route("/") .get((_, res) => { res.send('List of books') }) .post((_, res) => { res.send('Adding new book') }) let bookHandler = (req, res, next) => { let id = req.params.bookID if (Number(id) !== N...
true
1c6630ea6796e93a15c1c15ca6816a4fac3a2d8a
JavaScript
day-glow/Leet-Code
/topics/linkedLists/removeLinkedListElements.js
UTF-8
547
4.0625
4
[]
no_license
/* Remove all elements from a linked list of integers that have value val. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3->4->5 */ //TC- O(N) //SC- O(1) const removeElements = (head, val) => { if (!head) return head; let node = head; while (head) { if (head.val === val) { head = head.ne...
true
13d9fc9628de868aceff2b994c674645e3caf237
JavaScript
mhughdo/RGScripts
/FllScr v2.js
UTF-8
1,509
2.59375
3
[]
no_license
var user = "Wesley"; var autocashout = "10000"; var baseBet = 1; var bet=baseBet; engine.on('player_bet', function(data) { if (data.username == user) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 20...
true
929de3165332b5cd37ed92528c2a1167c471947e
JavaScript
biagiola/node-js
/04_http/main.js
UTF-8
623
2.84375
3
[]
no_license
const http = require('http'); //http event tiene todas las capacidades de EventEmitter de por así const server = http.createServer( (req, resp) => { if (req.url === '/') { resp.write('Home page'); resp.end(); } if (req.url === '/about') { resp.write(` <h1>A...
true
958f3f191f88936fbde3a6d897e676cbf2b572b3
JavaScript
bilyananinova/JS-Advanced
/Exercise Classes/autoEngineeringCompany.js
UTF-8
896
2.703125
3
[]
no_license
function autoEngineeringCompany(input) { let cars = {}; input.forEach(element => { let [brand, model, produced] = element.split(' | '); if (!cars[brand]) { cars[brand] = {}; } if (!cars[brand][model]) { cars[brand][model] = 0; } ...
true
e729162a0f0e5662233b26718fbfb7021414a794
JavaScript
Anele078/bootcamp-terminal-tests
/test/regCheck_test.js
UTF-8
510
2.53125
3
[]
no_license
let assert = require("assert"); const regCheck = require('../regCheck'); describe('the regCheck function ' , function(){ it('Should check if indeed a registration number is for a particular province and return true otherwise it should return fslse' , function(){ assert.equal(true, regCheck('DC 55 YU GP', ...
true
e0a09a6715ebd091faf99b1c21f14961dca779b9
JavaScript
NKAJE-FEC-BLD09/k-morelikethis-service
/db/dataSeeder/randomData/ratingGenerator.js
UTF-8
152
2.53125
3
[]
no_license
const ratingGen = () => { const ratings = ['G', 'PG', 'PG-13', 'R']; return ratings[Math.floor(Math.random() * 4)]; }; module.exports = ratingGen;
true
2986b44f0969c36d9e528ac2da444d0f73cca138
JavaScript
div1974/goit-js
/hw-07/js/task-4.js
UTF-8
594
3.625
4
[ "MIT" ]
permissive
let counterValue = 0; const btnDecr = document.querySelector('button[data-action="decrement"]'); // console.log(btnDecr); const btnIncr = document.querySelector('button[data-action="increment"]'); const counter = document.querySelector("#value"); btnDecr.addEventListener("click", decrement); btnIncr.addEventListener(...
true
f5a47d65115b0cf0a4a5df441de633e9f3fba755
JavaScript
bokipantic/restaurant-website
/pretraga.js
UTF-8
15,026
2.703125
3
[]
no_license
let tajmer; function izaberiJelo() { tajmer = setInterval(() => { $.get("https://www.themealdb.com/api/json/v1/1/random.php", function (data) { $("#izabranoJelo tbody").html("<tr><td>" + data.meals[0].idMeal + "</td><td>" + data.meals[0].strMeal + "</td><td>" + data.meals[0].strCategory + "</td...
true
3bbadeef5a2b7028b0dd3763ae87c1b87e10f1f2
JavaScript
NorthernLion/WeatherWatch
/weatherwatchfront/src/reducers/RouterReducer.js
UTF-8
460
2.640625
3
[ "MIT" ]
permissive
const initialState = { selectedLocation: null, showForm: false } const RouterReducer = (state = initialState, action) => { switch (action.type) { case 'SET_LOCATION': return { ...state, selectedLocation: action.location } case 'CLEAR_LOCATION': return { ...state, selectedLocation: null } ...
true
e4e13225409f3e0f734816ec26d0c683f85331b9
JavaScript
Oluchukwu96/Kuzie_Designer
/point.js
UTF-8
10,075
2.515625
3
[]
no_license
function point(x,y,base=null){ var myvec = new vec(); this.origin=base; this.type = "point"; this.x=x; this.y=y; this.last = [x,y]; // the last position this.ratio = [0,0]; this.vel=[0,0]; this.angle=0; this.connections = []; this.children = []; this.r =0; this.end=false; this.constraints ...
true
82f33db76bc8e5a1e1b1587d291c7c81a5fc119e
JavaScript
ycbrian/vintage-tech
/src/utils/helpers.js
UTF-8
901
2.859375
3
[]
no_license
import url from "./URL"; // flatten export function flattenProducts(data) { return data.map(item => { // cloudinary let image = item.image[0].url; // local setup no deployment // let image = `${url}${item.image[0].url}`; return { ...item, image }; }); } // helper functions export function feat...
true
d617e6c2a9eabbc946644bddf6d9f6a7033b6b77
JavaScript
memoryruins/topshell
/core/List.js
UTF-8
6,345
3.03125
3
[ "MIT" ]
permissive
//: (a -> b) -> List a -> List b exports.map = function(f) { return function(r) { var result = []; for(var i = 0; i < r.length; i++) { var a = f(r[i]); result.push(a); } return result; }; }; //: (a -> List b) -> List a -> List b exports.then = function(f)...
true
c85d9287811cc4dd1f8197592adde0f5266eade9
JavaScript
xdigu/Curso-web-moderno-com-js
/fundamentos/boolean.js
UTF-8
737
3.625
4
[]
no_license
let isAtivo = false console.log(isAtivo) isAtivo = true console.log(isAtivo) isAtivo = 0 console.log(!!isAtivo) // Tipos verdadeiros console.log(!!3) console.log(!!-1) console.log(!!' ') console.log(!![]) console.log(!!{}) console.log(!!Infinity) console.log(!!(isAtivo = true)) //Verifica se o valor atribuido a var...
true
7efcee9a636e1722400decdbfad025c79a67cae1
JavaScript
coding-blocks-archives/Webdev_Pitampura_2019_Spring
/Lecture07/todoList/js/index.js
UTF-8
1,524
2.875
3
[]
no_license
$(() => { todos = [] printTodos = function (firstReload = false) { if(firstReload){ todos = JSON.parse(localStorage.getItem("todos")) todos = todos == null ? [] : todos } localStorage.setItem("todos", JSON.stringify(todos)) let list = $('#todolist') list.empty(); console....
true
a9417bbd85efb8e3fdbac7de63db65dc5d1b8fd2
JavaScript
jgautsch/student-judgement
/src/App.js
UTF-8
6,020
2.65625
3
[]
no_license
// @ts-check import React from "react"; import andyKingSrc from "./andy_king.png"; import JudgementForm from "./JudgementForm"; import JudgementViz from "./JudgementViz"; import "./App.css"; import QualitiesList from "./QualitiesList"; import StudentsList from "./StudentsList"; function uid() { return ( "_" + ...
true
e54d2893c1f56396575c9799e78328c1e6367828
JavaScript
PramodSripada/dApp-musicStore
/app/javascripts/app.js
UTF-8
9,628
2.703125
3
[ "MIT" ]
permissive
// Import the page's CSS. Webpack will know what to do with it. import "../stylesheets/app.css"; // Import libraries we need. import { default as Web3 } from 'web3'; import { default as contract } from 'truffle-contract' /* * When you compile and deploy your Store contract, * truffle stores the abi and deployed...
true
ac502ca2e58542c5b41436d790e81b6ec1dcd48e
JavaScript
matthewjhough/parse_lite_prototype
/src/parse-lite/parselite.js
UTF-8
2,557
2.609375
3
[]
no_license
/* eslint-disable */ class ParseLite extends URLSearchParams { constructor(options) { super(); // TODO: add save states to local storage this.options = options; this.params = window.location.search ? this.parseQueryString(window.location.search.substring(1)) : { string: "none" }; thi...
true
57d3b541d9d75437c41eca83eb361a27ea7ba423
JavaScript
hakobera/uglify-me
/app.js
UTF-8
2,170
2.625
3
[ "MIT" ]
permissive
var express = require('express'), fs = require('fs'), jsp = require("uglify-js").parser, pro = require("uglify-js").uglify; /** * Uglify JavaScript source code. * * @param {String} src Original JavaScript source code * @return {String} Uglified code */ function uglify(src) { if (!src || src === '') ...
true
61573cfe03f04806ac0c14d28a157a957fe7f0ac
JavaScript
MohammedBayatena/CodingDojoAxsos
/MERNStack/React/Functional Components/context/src/components/NavBar.js
UTF-8
533
2.59375
3
[]
no_license
import React, {useContext} from 'react'; import "./navstyle.css" // Simple Styling import MyContext from "../context/MyContext"; const NavBar = (props) => { const {name} = useContext(MyContext); // >> Uses Context imported from MyContext [Destructuring is done here as name is got from context] return ( ...
true
a601d52ea0fdd2a3ee8eba9445f6c3bc18aa360d
JavaScript
NeoGlanding/react-lifecycle-method-an
/src/App.js
UTF-8
566
2.765625
3
[]
no_license
import React, {Component} from 'react' import './App.css'; class App extends Component{ constructor() { super(); this.state = { counter: 1 } this.clickHandler = this.clickHandler.bind(this) } clickHandler() { this.setState((prevState, prevProps) => { return {counter: prevState.co...
true
33f74e019b945bd613c6a8edc39bfd9e473ca9da
JavaScript
WifinderWEB/iwifinder
/src/Shop/FrontendBundle/Resources/public/js/app/controller/goods.js
UTF-8
2,984
2.515625
3
[]
no_license
function GoodsCtrl($scope){ $scope.goodsId = 0; $scope.inCart = false; $scope.count = 0; $scope.formId = 'goodsInfo'; $scope.minusGoods = minusGoods; $scope.plusGoods = plusGoods; $scope.removeItem = removeItem; function init(){ if(window.cart) updateDat...
true
02bb5d2d4e5f77d54c06b779157a68d5c550580e
JavaScript
vinayakpatil1994/reactjs-auth
/jwtAuth/app.js
UTF-8
6,384
2.625
3
[]
no_license
/** * To get started install * express bodyparser jsonwebtoken express-jwt * via npm * command :- * npm install express bodyparser jsonwebtoken express-jwt --save */ // Bringing all the dependencies in var mysql = require("mysql"); const express = require("express"); const bodyParser = require("body-p...
true
75c332309e6083d6d8d89e96f5ec25972d78af70
JavaScript
chaoren1641/kissy
/src/editor/coverage/src/editor/range.js
UTF-8
210,250
2.84375
3
[ "MIT" ]
permissive
function BranchData() { this.position = -1; this.nodeLength = -1; this.src = null; this.evalFalse = 0; this.evalTrue = 0; this.init = function(position, nodeLength, src) { this.position = position; this.nodeLength = nodeLength; this.src = src; return this; } ...
true
7d3cb721794b8bb85f323f01365eae95adb3ef4a
JavaScript
Ero6067/profile-scroller
/users.js
UTF-8
253
2.703125
3
[]
no_license
class Users { constructor(count) { this.count = count; } async getUser(count) { const response = await fetch (`https://randomuser.me/api/?results=${count}`); const responseData = await response.json(); return responseData; } }
true
5db840781353fbbcb7a1be2e382d95154ef85dc5
JavaScript
sranga12/lightinthedark
/clark_room/src/components/Book.js
UTF-8
918
2.75
3
[]
no_license
import '../App.css'; class Book extends React.Component { constructor(props) { super(props); this.state = { visible: false, number: -1 }; this.books=[ { text: "Lorem ipsum dolor", title: "The meaning of life" },...
true
a9d7d925afa1c539eb06cea829abd8272cc0693d
JavaScript
D3rise/mmorpg-server
/controllers/Characters.js
UTF-8
2,097
2.796875
3
[]
no_license
const { body } = require("express-validator"); const Character = require("../models/Character"); const User = require("../models/User"); exports.createCharacter = async (req, res) => { const { user } = req; const { name, className } = req.body; let character = await Character.findOne({ name }).exec(); if (ch...
true
26b4c89740174c7f60150a30560c1415194a036e
JavaScript
accountos/squirtle-new
/src/components/helperComponents/Event.js
UTF-8
1,454
2.65625
3
[]
no_license
import OverflowBox from "./OverflowBox"; const Event = ({ month, date, year, name, description }) => { return ( <div style={{ width: '25vw' }}> <div style={{ display: 'flex', alignItems: 'center', marginBottom: '10vh' }}> <OverflowBox content={ <span> <div style={{ color: '#2...
true
5f4f4924588251a5b589bca12b277550a0e3334e
JavaScript
anujthapa/integrify
/reactprojects/formvalidation/src/component/AddUser.js
UTF-8
5,994
2.890625
3
[]
no_license
import React from 'react'; import './adduser.css'; class AddUser extends React.Component{ state = { firstname : '', lastname : '', telephone : '', gender : '', skill : '', message : '', touched : { firstname : false, lastname : false, ...
true
f1f453045e10244d6c0ced88c95dd3b360aa5595
JavaScript
myprysm/advent-of-code
/day23/index.js
UTF-8
3,226
3.671875
4
[]
no_license
const readCups = (cups) => cups.split("").map((v) => parseInt(v)); const generateNumbers = ({ from, to }) => { const array = []; for (let i = from; i <= to; i++) { array.push(i); } return array; }; const findMin = (array) => array.reduce( (min, value) => (min < value ? min : value), Number.MAX_...
true
7bc4926aef9445e4dee9af6041ae18b879124d66
JavaScript
Expert-Hacker/smmNinja
/server/client/src/Admincomponents/Tickets.jsx
UTF-8
3,029
2.546875
3
[]
no_license
import React, { useEffect, useState } from 'react' import {Link} from 'react-router-dom' import TicketList from './TicketList' import {Button,TextField} from '@mui/material' function Tickets() { const[ticket,setticket]=useState("") const[Tickets,setTickets]=useState([]) const[show,setShow]=useState(true) ...
true
425aa9d0128f622e9b31101dda52ac819b3f203c
JavaScript
sakarp/hw6
/public/app.js
UTF-8
1,181
3.203125
3
[]
no_license
window.addEventListener('load', () => { document.getElementById("button-coffee").addEventListener("click", () => { let numCups = document.getElementById("number-coffee").value; let cupsObject = { type: "coffee", number: numCups }; let passJSON = JSON.stringify(cupsObject); console.lo...
true
996aca87b1720ff676e1965dbafc68ab6a4b9fce
JavaScript
atarahk/fullstack-rest
/client/src/helpers/errorMessageHandler.js
UTF-8
289
2.59375
3
[]
no_license
const handleErrorMessage = response => { const errArr = response.error let errorMessage = '' errArr.forEach(errObj => { const fields = Object.keys(errObj) errorMessage = errorMessage + errObj[fields[0]] + '\n' }) return errorMessage } export default handleErrorMessage
true
8de5cd7017fa1caec348f8ea0865135985679dcb
JavaScript
codebyuma/coderbyte
/Medium/PalindromeTwo.js
UTF-8
1,219
4.65625
5
[]
no_license
/*Have the function PalindromeTwo(str) take the str parameter being passed and return the string true if the parameter is a palindrome, (the string is the same forward as it is backward) otherwise return the string false. The parameter entered may have punctuation and symbols but they should not affect whether the st...
true
514fb3e3bc8349be1f70654623d1812921ee7ee5
JavaScript
aamirjamal/IST_project1
/Validator.js
UTF-8
2,053
3.140625
3
[]
no_license
const Validator = { validateName: function() { const name = document.getElementById("name"); if (name.value == "") { this.addError("Name is required!"); return false; } return true; }, validateEmail: function() { const email = document.getElementById("email").value; if (email ...
true
1542bc505cfbc34269824fe8f8e001e852abb65f
JavaScript
ivancoacher/map
/js/common.js
UTF-8
1,586
3.34375
3
[]
no_license
function getRadian(angle){ if(angle==0){ return 0; } return 2*Math.PI/360*angle; } function getAngle(radian){ if(radian==0){ return 0; } return radian/(2*Math.PI/360); } //经纬度转换为墨卡托,单位 米 function latLng2WebMercator(lng, lat) { var mercator={x:0,y:0}; var x = handle_x(lng); // var y = ...
true
bbf0384d255664198fb08fa4ca89166010724f55
JavaScript
Hanna911/JS_DZ_4
/js6.js
UTF-8
1,167
3.90625
4
[]
no_license
// Задача 11. Напишите игру «Угадай число». // При загрузке страницы генерируется случайное число от 0 до 10. // Пользователю дается три попытки угадать число (число вводиться в input). // При каждой проверке выдается подсказка: больше или меньше. // При угадывании, завершении числа попыток выдается оповещение....
true
e22cf2a8bc611634f811ca3e25d3f35dd5f04f8e
JavaScript
timqian/GiG
/src/components/renderMain.js
UTF-8
761
2.84375
3
[ "MIT" ]
permissive
import flattenPosts from "../utils/flattenPosts"; /** * render main page given posts * @param {Object} posts * @return {html} html to fill into container */ export default (posts) => { //posts: {life:[], tech:[], science:[]} let postsList = flattenPosts(posts); const html = postsList .sort((a, b) ...
true
a0ccd5fe82157dfed05cc8161376aba36be3490e
JavaScript
earthtone/clockin
/app/lib/parse-form-data.js
UTF-8
170
2.515625
3
[]
no_license
module.exports = function parseFormData(form, options){ var i = new FormData(form), o = options || {}; for(let [k, v] of i.entries()){ o[k] = v; } return o; };
true
ab34ce0d643f73638700584f77b8a6502213cf41
JavaScript
joanafbrito/frontend-mod-1-prework
/section2/exercises/functions.js
UTF-8
2,923
5.09375
5
[]
no_license
/* In the exercises below, write your own code where indicated to achieve the desired result. One example is already completed. Your task is to complete any remaining prompt. Make sure to run the file with node in your command line. */ //------------------- // PART 1: Function Syntax //------------------- // EXAMPL...
true
e2913844ac38ccc8af8daab1d9a4f6c0de83d2f5
JavaScript
yjjMovie/movieProject
/movie_manager/web/js/user.js
UTF-8
3,136
2.65625
3
[ "MIT" ]
permissive
$(function(){ $.get("user_findUser", function(result){ addTable(result); buttonClick(); }); add(); }); function addTable(result){ $("#tab tr:not(:first)").empty(); $.each(result, function(index, obj){ var sex = ""; if(obj.userSex == 1){ sex = "男"; ...
true
90469d94b462e9148ba4d08034860fba8ee5a380
JavaScript
Evexa/j1
/java.js
UTF-8
20,369
3.796875
4
[]
no_license
'use strict'; /* var leftBorderWidth = 4; let second = 2; const pi = 3.14; console.log(second) // var number = 5; // var string = "Hello!"; // var sym = Symbol(); // var boolean = true; // null; // undefined; // var obj = {}; console.log(4/0); console.log('string'*9); let somthing; console.log(somthing); let pe...
true
89115494b3cf80f7a002f197cb90e2a229c63b76
JavaScript
geforcesong/nodetest
/codewar/accum.js
UTF-8
475
3.53125
4
[]
no_license
/* accum("abcd") -> "A-Bb-Ccc-Dddd" accum("RqaEzty") -> "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" accum("cwAt") -> "C-Ww-Aaa-Tttt" */ function accum(s) { if(!s){ return ''; } const arr = s.split(''); let narr = arr.reduce((prev, cur, index)=>{ const up = cur.toUpperCase(); const lp =...
true
f686f3556566da59dff359d0e7f217e051c61942
JavaScript
beyondme121/connected-react-router-demo
/sanfeng2020react/history/hooks/11.useLayoutEffect.js
UTF-8
2,530
3.25
3
[]
no_license
// 修改number的值, 将number的值赋值给ref.current, 最终使用的也是ref.current import React, { useEffect } from 'react' import ReactDOM from 'react-dom' let hookStates = [] let hookIndex = 0 function useState(initialState) { hookStates[hookIndex] = hookStates[hookIndex] || initialState let currentIndex = hookIndex function setSta...
true
832bf7b137654331ac8d1b4ffdf2bd1a2214963a
JavaScript
RomanJ55/ReactChess
/src/components/Board.js
UTF-8
1,329
2.59375
3
[ "MIT" ]
permissive
import React, { useEffect, useState } from "react"; import Square from "./Square"; const Board = ({ squares, rows, columns, playerName, updateData }) => { const [data, setData] = useState([]); useEffect(() => { setData(squares); }, [squares]); let board = []; for (let i = 0; i < rows; i++) { for (...
true
7a7ed4bffccce4ee530cc922e867138685215e42
JavaScript
sharkman11/sharkman11.github.io
/js/main.js
UTF-8
1,271
2.953125
3
[]
no_license
let theme = localStorage.getItem('theme'); if(theme == null) { setTheme('light'); } else { setTheme(theme); } let themeDots = document.getElementsByClassName('theme_dot'); for (let i = 0; themeDots.length > i; i++){ themeDots[i].addEventListener('click', function() { let mode = this.dataset.mode; console.log(...
true
11b630a67d44bdbf8d7c3321293922ac0c427e40
JavaScript
alisson-lucas/Pomodoro
/index.js
UTF-8
4,301
2.8125
3
[]
no_license
let min = 25; let seg = 00; let pause = 5; let sessions = 3 let time = localStorage.getItem('time'); let pauseTime = localStorage.getItem('pause-time'); let session = localStorage.getItem('sessions'); localStorage.getItem('time'); localStorage.getItem('pause-time'); localStorage.getItem('sessions'); document.getEl...
true
ecc52c44a8bd710c1b092f6ef97c73b80b37c26e
JavaScript
tyllo/ember.test
/app/utils/input-tel.js
UTF-8
417
2.8125
3
[]
no_license
/** * Only number may be press * @param {JQuery} $input */ export default function inputTel($input) { return $input.keypress(isNumberKeyCode); } /** * @param {KeyboardEvent} event */ export function isNumberKeyCode(event) { const {keyCode} = event; const isNumber = keyCode >= 48 && keyCode <= 57; // 0-9 c...
true
85e2e76312e0ac42219f1c54c6c0f216a68bd195
JavaScript
Rick2807/bebidas
/src/components/Formulario.js
UTF-8
2,382
2.515625
3
[]
no_license
import React, { useContext, useState } from 'react' import { Context } from '../context/Categoria' import { recetasContext } from '../context/Recetas' export const Formulario = () => { //utilize context const { category } = useContext(Context) const { buscarRecetas, guardarConsultar } = useContext(recetas...
true
f6f690754669db7b50a0e0df0d3da4dfdd7f868d
JavaScript
mcuchiha09/Hobby-Projects
/src/store/index.js
UTF-8
2,418
2.734375
3
[]
no_license
import { createStore } from "redux"; //Could have also used packages like @reduxjs/toolkit //Not using any mutation check library, doing the checks myself const initialState = { projects: [], currentProject: undefined, notification: undefined }; //Handling all the states in single slice for now const formActionReduce...
true
43a9fa4b3dfff442156c35b7b2c29825fabd1d0f
JavaScript
Khaless/Tech-Map
/public/javascripts/map.js
UTF-8
2,919
2.71875
3
[ "Apache-2.0", "MIT" ]
permissive
var markersArray = []; var zoomLevel = -1; var map; function updateTagMap_callback(data) { var bylatlng = {}; var max_weight = 1; /* * Remove all old info windows & redraw. */ if (markersArray) { for (i in markersArray) { markersArray[i].setMap(null); } markersArray.length = 0; } ...
true
4b5561fedc05ca736ce4a1cb439b8a8499e8b63c
JavaScript
simon1400/slavik.backend
/routes/user.js
UTF-8
2,577
2.546875
3
[]
no_license
const express = require("express"); const userRoutes = express.Router(); let User = require("../models/user.model"); const bcrypt = require('bcrypt'); const saltRounds = 10; userRoutes.route("/all/").get(function(req, res) { User.find(function(err, todos) { if (err) { console.log(err); } else { ...
true
aba27012965aa08efcb4c621ac8280989de8429f
JavaScript
IvanPlisyakov/mesto__job
/src/components/FormValidator.js
UTF-8
2,108
3.046875
3
[]
no_license
export class FormValidator { constructor(tuningValidation, formElement) { this.tuningValidation = tuningValidation; this._formElement = formElement; this.inputList = Array.from(formElement.querySelectorAll(tuningValidation['formInput'])); this.buttonElement = formElement.querySelector(tuningValidatio...
true
18fd35b14e45a02d355b92948d9c0d7cbee0e3fa
JavaScript
Bill-Horst/mentor-simple-js-app
/js/scripts.js
UTF-8
4,537
3.65625
4
[]
no_license
let POKEMON_REPOSITORY = function () { let repository = []; var apiUrl = 'https://pokeapi.co/api/v2/pokemon/?limit=150'; function loadList() { return fetch(apiUrl).then(res => { return res.json(); }).then(json => { json.results.forEach(item => { var...
true
544e88a88659146d8ec16f0e9a5414638b15dc3d
JavaScript
v-tank/Employee-Data-Management
/app.js
UTF-8
1,915
3.03125
3
[]
no_license
// Initialize Firebase var config = { apiKey: "AIzaSyASzgtStABeTugbYGDLmZrAAXM-VREN944", authDomain: "employee-data-management-31ec4.firebaseapp.com", databaseURL: "https://employee-data-management-31ec4.firebaseio.com", projectId: "employee-data-management-31ec4", storageBucket: "employee-data-management-31e...
true
6216e54a67741beb77931a05c4a5c1ed01d6401d
JavaScript
rafaelmbsouza/logica
/revisao_06jun/modules.js
UTF-8
333
3.03125
3
[]
no_license
//npm = node package manager //módulo == bibliotecas let mediana = require('median') //chama a biblioteca let notas = [4,5,8,7,3,2,5,6,8,9,6,4,2,9,8,7,8,9,6] console.log(mediana(notas)) //======================================// let FasamImc = require('fasam-imc-calc') let imc = new FasamImc(72,1.8) console.log(...
true
ec2c8a3f8f96a67f215a61a23bddf7b40a6614be
JavaScript
GratiaSew/webcw_Tourism
/js/comments-get.js
UTF-8
1,308
3.234375
3
[]
no_license
/* Created by Yazeen Thariq on 3rd of July 2017 * This is the get data script for Comments Form. * ... */ function getData(){ var queryString = decodeURIComponent(window.location.search); //console.log(queryString); queryString = queryString.substring(1); var queries = queryString.split("&"); ...
true
caeed946292ce659842f507fe1a37b0da99ed198
JavaScript
terryt925/DiscGolfProTour
/frontend/game.js
UTF-8
421
2.609375
3
[]
no_license
import CourseOne from './courses/courseOne.js'; import Player from "./player.js"; import Basket from './basket.js'; class Game { constructor() { this.attempts = []; this.hole = 1 } course(ctx) { if(this.hole === 1) return new CourseOne(ctx); } player(ctx) { return new Player(this.hole, ct...
true
592d6c63bcdc85ea639ca449c88799ef77897b42
JavaScript
wareesha-nasir/Web_Assignments
/js assignment/stopwatch/app.js
UTF-8
962
3.28125
3
[]
no_license
var min = document.getElementById("min"); var sec=document.getElementById("sec"); var mili=document.getElementById("milli"); var s=0; var m=0; var ml=0; var interval; var start=document.querySelector(".start"); var st=document.querySelector(".stop"); var reset=document.querySelector(".reset"); start.addEventL...
true
2fca118f3be4866a8c6e5dd002e569823c075b4d
JavaScript
thearnica/454797-keksobooking
/js/show-card.js
UTF-8
1,791
2.53125
3
[]
no_license
'use strict'; (function () { var ESC_KEYCODE = 27; var ENTER_KEYCODE = 13; var template = document.querySelector('template'); var offerTemplate = template.content.querySelector('.map__card'); var cartOfAdverts = document.querySelector('.map'); var activePopup = null; var removeNode = function (popup) {...
true
915d7866554678df346b3cf8ae100f15a6471102
JavaScript
JustinBeckwith/next17
/photobooth/public/script.js
UTF-8
2,188
2.875
3
[ "MIT" ]
permissive
var width = 320, height = 0, video, canvas, photo, startbutton, streaming, message, ctx, handle; function onload() { message = document.getElementById('message'); video = document.getElementById('video'); photo = document.getElementById('photo'); startbutton = document.getElementById('startbutton'); canv...
true