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
d14af378349368689f353d74e99afc8f0c1b9fb4
JavaScript
VikaAnt/Demo
/pset2/Counter/index.js
UTF-8
418
2.875
3
[]
no_license
var count = 0; function Counter() { this.requests = []; } Counter.prototype.newRequest = function() { const aa = this.requests.push(new Date().getTime()); console.log('this.requests.push(new Date().getTime())' + aa); return ++count; } /*Counter.prototype.getTime = function() { bb = param['time']...
true
6ee9657aa9112d39457aab4d8702d13626a20ce9
JavaScript
ikrs/nodejsCourse
/5-MongoDBMongooseAndRestAPI/playground/mongodb-find.js
UTF-8
1,493
2.8125
3
[]
no_license
/** Fetching Data */ const {MongoClient, ObjectID} = require('mongodb'); MongoClient.connect('mongodb://localhost:27017/TodoApp', { useNewUrlParser: true }, (error, client) => { if (error) { return console.log('Unable to connect to MongoDB Server'); } console.log('Connected to MongoDB Server'); ...
true
52ae114ebdc8a19bffad491b4ee160a500128008
JavaScript
amrmhassan/whochats-backend
/utils/dayRecognizer.js
UTF-8
2,589
3.4375
3
[]
no_license
const main = (date) => { //? when getting days it will start from 0 to 6 //? 7 days in week //? the week start with Sunday=0, Monday=1 ...etc //! //? the custom date //? this is the date that the user will be last seen at //? and its value is an example //? 'year-month-date(day) T hours:minutes:seconds:...
true
e5c96f46998769a9b31db1ed9c3bcf6a32822904
JavaScript
Ruslana/Project-Y
/public/javascripts/application.js
UTF-8
482
2.78125
3
[]
no_license
function recalculate_totals(){ recalculate_total_amount(); recalculate_total_price(); } function recalculate_total_amount(){ $("total_tracks").value = checked_checkboxes().size(); } function recalculate_total_price(){ var sum = checked_checkboxes().inject(0, function(sum, n){ return sum + parseFloat(n.getAttrib...
true
6d391dbde34cbc645e3ba96816dae808bd5c1719
JavaScript
akatsarakis/Eugenia-Dashboard
/public/assets/js/setServers.js
UTF-8
310
2.546875
3
[]
no_license
/** * Set servers chart. **/ function setServers(){ if(window.servers == undefined){return;} document.getElementById("ServersOnline").innerHTML = "Total: " + window.servers.servers + "<br /> Assigned: " + window.servers.assigned; } //updates every 1 second. setInterval( setServers, 1000 );
true
89277db4b16bc121a2dcdf9278b65ba7fe290004
JavaScript
jae24/goaly
/src/Components/Goal/Goals.js
UTF-8
1,367
2.609375
3
[]
no_license
import React from 'react'; import Goal from './Goal'; import { connect } from 'react-redux'; import ButtonToolBelt from './ButtonToolBelt'; import '../../stylesheets/Goals.scss'; // Maps/Binds the state of this class-based component to the // portion of the state that is managed by the goal reducer. // So props contai...
true
5931abb79e187d2abb946a8b708ee9db7e1271fe
JavaScript
amirroaster/AIT-Lab06
/Files/javaScript.js
UTF-8
2,245
2.9375
3
[]
no_license
function homeFunction() { document.getElementById("nav1").style.background = "black"; document.getElementById("nav1").style.color = "#e5e5e5"; document.getElementById("nav2").style.background = "#e5e5e5"; document.getElementById("nav2").style.color = "black"; document.getElementById("nav3").style.background =...
true
6210b68a74971dd60e470c0e97c0c13ce4e52ff6
JavaScript
green-fox-academy/FKinga92
/week-07/day-03/createelement-2.js
UTF-8
517
4.03125
4
[]
no_license
// Remove the Mega juicy candy from the list. // Add 16 list items saying 'Empty box' to the list and add an index to it, like: // Empty box #1 // Empty box #2 // Empty box #3 let megaJuicyCandy = document.querySelector('li'); let unorderedList = document.querySelector('ul'); unorderedList.remo...
true
18ca11f55cfca6072429bcec78cd7c3275a078fb
JavaScript
anacarlagb/manager-academic
/ui/control/managerProfessor.js
UTF-8
787
2.765625
3
[]
no_license
function generateProfessor(id, email, name, startDate){ collaborator.id = id; collaborator.email = email; collaborator.name = name; collaborator.startDate = new Date(startDate); collaborator.type = "PROFESSOR"; collaborator.collaboratorType = "PROFESSOR"; collaborator.productions = []; collaborator.p...
true
7afe8dd65dd705ee1963c2ce3cc2a7fa2aba8ba4
JavaScript
urikhaimov/Test1
/src/suspense/DataTable.js
UTF-8
1,763
2.703125
3
[]
no_license
import React, { useState, useEffect } from "react"; import axios from 'axios'; import TableScrollbar from 'react-table-scrollbar'; import moment from 'moment'; function DataTable({val}) { const [transactions, setTransactions] = useState([]); useEffect(() => { // GET request using axios inside useEffect React...
true
e3a7e0eabcf79db3a9982be32c2c4177eef447e4
JavaScript
thanhphanle/nodejs-asynchronous
/src/async/async.js
UTF-8
546
3.4375
3
[ "MIT" ]
permissive
function firstPromise() { return new Promise((resolve, reject) => { setTimeout(() => { resolve('Success'); }, 2000); }); } async function firstAsync(isValid) { if (!isValid) { return new Error('This is invalid'); } console.log('calling'); let result = await f...
true
01481d58dbb7f797acc313fc87f1830c2f6e1cbb
JavaScript
BertFrontEnd/my-sandbox
/mixed-sandbox/javascript-course/41-find-single-post/solution.js
UTF-8
937
3.921875
4
[]
no_license
/** ЗАДАЧА 41 - Поиск объектов в массиве * * 1. Создайте функцию "findPostById" с двумя параметрами: * - ID поста * - массив постов * * 2. Функция должна вернуть пост с определенным ID * * 3. Если поста с определенным ID в массиве постов нет, * функция должна вернуть "undefined" * * 4. Также внутри функции...
true
464d71f14416497b9ddef4e79d7aae0566d532d6
JavaScript
wanghui2333/JS-Array-2019-5-24-7-43-8-606
/index.js
UTF-8
1,784
4.40625
4
[]
no_license
// 阅读推荐的链接,复习JavaScript中数组的相关方法 // 写程序判断下列变量是不是数组类型。 var a = '[a, b, c, d]'; var b = [1, 2, 3, 4]; //TODO typeof (a); typeof (b); // 编写程序,将下面数组中的每一项都乘以2。 var a = [1, 2, 3, 4, 5]; // TODO should output [2,4,6,8,10] function fun(arr) { for (var i = 0; i < arr.length; i++) { arr[i] *= 2; } } fun(a); cons...
true
d134b50c18ca534a1ff1b8a89c6e61cf2ae741ce
JavaScript
Rishav0907/Web_Projects
/Weather_App/src/App.js
UTF-8
2,888
2.796875
3
[ "MIT" ]
permissive
import React from "react"; import { Grid } from "@material-ui/core"; import UserInput from "./components/UserInput"; import WeatherResult from "./components/WeatherResult"; import Header from "./components/Header"; import "./App.css"; class App extends React.Component { constructor(props) { super(props); //s...
true
2929dd717ec46db0007c947d2afc5ae6dc97bac0
JavaScript
i-am-chauhan/chess_in_cli
/src/possibleMoves/knight.js
UTF-8
675
2.96875
3
[]
no_license
const { getAllCombinations } = require("../util.js"); class Knight { constructor(position) { this.position = position; } possibleMoveDifferences() { const moveDifference = getAllCombinations([1, -1, 2, -2], [1, -1, 2, -2]); return moveDifference.filter(x => Math.abs(x[0]) != Math.abs(x[1])).sort(); ...
true
c592c7f48681392f4deb7a23c4054acc9ef63632
JavaScript
yhzn/angular-project
/src/app.js
UTF-8
2,751
2.578125
3
[]
no_license
// import '../bower_components/angular/angular' import '../bower_components/angular-ui-router/release/angular-ui-router' import '../bower_components/angular-cookies/angular-cookies' import '../bower_components/angular-animate/angular-animate' import Home from './views/home' import Shop from './views/shop' import Shop1...
true
f188be7fb80d743faa60d12c9e495b67470831d6
JavaScript
Yaswant-Kumar-Singhi/playing_with_JSX
/src/JSX.js
UTF-8
1,452
3.8125
4
[]
no_license
/* Why are we importing React and what is the use of importing React -> React using JSX which is not a pure JS and browser understands regular JS. So these JSX expressions needs to transpiled into regular js syntax so that browser can understand. If you try to remove react import then you will face an error ---> --...
true
9cba3c6b8e266d4d6d4a576488f989c087a367f7
JavaScript
jsdelivrbot/node-js-snippets
/blogs/var.js
UTF-8
224
3.3125
3
[]
no_license
'use strict' function foo(input){ var i = input; function bar(){ console.log(i); // undefined if(input%2 === 0){ var i = 10; // do something with i } } console.log(i); // 5 bar(); } foo(5);
true
c904b8eabf77158c5bad86a245845bc99440470b
JavaScript
fabiosikansi/d3-mongo-rest
/server.js
UTF-8
1,019
2.75
3
[]
no_license
//Simple http server to return data from node const MongoClient = require('mongodb').MongoClient; const express = require('express'); const app = express(); //database url var url = 'mongodb://localhost:27017/d3-mongo'; const routes = (db) => { //Index route app.get('/', function (req, res) { res.send...
true
097ddafc0bc14ca4076b376cd2547b1a9cea456b
JavaScript
aesher9o1/ICCT
/themes/assets/js/cms_loadmore_blog5152.js
UTF-8
1,847
2.578125
3
[ "MIT" ]
permissive
jQuery(document).ready(function($) { "use strict"; var pageNum = parseInt(cms_more_obj.startPage) + 1; var total = parseInt(cms_more_obj.total); var max = parseInt(cms_more_obj.maxPages); var perpage = parseInt(cms_more_obj.perpage); var nextLink = cms_more_obj.nextLink; $.countPost = function(total,perpage...
true
2d7dc18697539e17865d089ce4cc0e481eba084f
JavaScript
WilberC/react-showcase
/src/components/Chartkick/Chartkick.js
UTF-8
1,345
2.609375
3
[]
no_license
import React, { useState, useEffect } from "react"; import { ColumnChart, PieChart } from "react-chartkick"; import { population } from "./population"; import "./styles.css"; import "chart.js"; import { getRepos } from "./api"; const groupBy = (array, key) => { const result = {}; array.forEach((repo) => { res...
true
3e3eec70dfab142378f44f200e97eedc89a34ea1
JavaScript
DaggerToothCaster/mex-static-page
/public/js/lang.js
UTF-8
1,546
2.53125
3
[]
no_license
$(document).ready(function () { var defaultLang = 'en'; function getLang() { if (document.cookie.indexOf('buy.kk.bLang') != -1) { var arrCookie = document.cookie.split(';') for (let i = 0; i < arrCookie.length; i++) { var arr = arrCookie[i].split('='); ...
true
73fd2f7d65f9dc5d709edcc5ff3f1b7b0546280a
JavaScript
shiinoMafuyu/Celestial
/celestial-world/SilverRiver/src/WebContent/dn/js/interface/dn.calculator.js
UTF-8
3,859
2.671875
3
[]
no_license
/** * 计算核心类。 */ $.calculator = {}; /** * 初级属性到二级属性的转换map */ $.calculator.transMap = {}; $.calculator.resMap = {"li":0,"min":0,"zhi":0,"ti":0, "wg":0,"yz":0,"xy":0,"xyDK":0,"zm":0,"zmDK":0, "mg":0,"mf":0,"hp":0,"wf":0,"yzDK":0, "gg":0,"hg":0,"sg":0,"ag":0, "gf":0,"hf":0,"sf":0,"af":0, "zz":0,"zmsh":0,"yds...
true
516752b18de552a6c5a1e64b2d68103b1fabd5cd
JavaScript
krishnarudani/javascript
/FibonacciGenerator challange.js
UTF-8
383
3.6875
4
[]
no_license
function fibonaccigenerator(n){ var output=[]; if(n === 1){ output=[0]; } else if(n === 2){ output=[0,1]; } else{ output=[0,1]; for(var i=2; i<n; i++){ output.push(output[output.length-2]+output[output.length-1]); } } retu...
true
0dea03885eef8a0bf582735fb47c1185929f2e21
JavaScript
WaffleBweh/EvolutionAI
/project/public_html/classes/link.js
UTF-8
482
3.0625
3
[]
no_license
class Link { constructor(node1, node2) { if (new .target === Link) { throw new TypeError("Cannot construct Abstract instances directly"); } this.firstNode = node1; this.secondNode = node2; } draw() { this.firstNode.draw(); this.secondNode.draw();...
true
aa92d14cb2680efadf3653e71b15a4751cb8018f
JavaScript
fifa-mobile/discord-bot
/commands/ping.js
UTF-8
839
2.515625
3
[]
no_license
module.exports = (m, args) => { const pingTypes = [ "Testing,testing.Is this thing working?", "Match point.Let's see what you've got.", "Keep on pinging me.", "I am alive.", "Can't play now." + "Got a meeting with the bots. " + "We're planning to conquer the wor... " + "Wait!Did I say ...
true
2a90a45485aafd752bc77502e6ca24b880a7854a
JavaScript
laskar-ksatria/react-crypto-currency
/src/components/Card/Table.js
UTF-8
3,571
2.53125
3
[]
no_license
import React from 'react'; import axios from 'axios'; function Table(props) { const closeOrder = (id) => { axios({ url: `http://localhost:3005/trade/${id}`, method: 'PATCH', headers: { jwttoken: localStorage.getItem('tradetoken') } }) .then(({data}) => { alert('Ord...
true
f1d2636637f7016a89fc77b66332e9a233e91cea
JavaScript
chuddyjoachim/React-graphql-client
/src/pages/Apollo/index.js
UTF-8
1,196
2.59375
3
[]
no_license
import React, { useState, useEffect } from "react"; import { ApolloClient, InMemoryCache, useQuery, gql } from "@apollo/client"; import Select from "../../components/select"; // initialize a GraphQL client const client = new ApolloClient({ cache: new InMemoryCache(), uri: "https://countries.trevorblades.com", }); ...
true
c1262dadf40e48dcdd769dcb3b3ce9e14a36fc0a
JavaScript
Arieg419/Complete-NodeJS
/Intro/node-3-18-bank-account-3/if.js
UTF-8
185
3.390625
3
[]
no_license
var name = 'Julie'; if (name === 'Mike' || name === 'Jen') { console.log('Hello friend!'); } else if (name === 'Chet') { console.log('Hey'); } else { console.log('Hey stranger!'); }
true
d83cc55695805185285159140b2957128501a6b5
JavaScript
future4code/Thales-Milanezi
/semana3/aula3-condicionais/js-vanilla-template/src/index.js
UTF-8
2,630
3.828125
4
[]
no_license
/* Exercícios de interpretação --1-- 1- O código recebe um numero do usuário atraves do prompt e com esse numero, ele verifica se o numero digitado pelo usuário recebe a condição de passou no teste ou não passou no teste. Teste de verificar se o numero é par ou impar, atraves da verificação do resto da divisão por 2. O...
true
ec5253a1fb7cb560e1deb2e6b0ea200da94438d6
JavaScript
zalez/Mandelbrot-Set-generator-in-node.js
/resize.js
UTF-8
4,609
3.546875
4
[]
no_license
/* * Resize.js * * A simple image buffer resizing library in JavaScript. * * See http://constantin.glez.de/mandelbrot for details. */ /* * Normalize the supplied filter kernel so the sum is equal to m. * * kernel: The kernel to normalize. * n: The size of the kernel. */ function normalize_kernel(kernel, n) ...
true
0df38b030e79de697c84b095bfab832825eaf195
JavaScript
sfsoul/macPull
/tx/widgets/deferred/deferred.js
UTF-8
6,269
2.84375
3
[]
no_license
(function(exports){ function mix(d, s){ for(var o in s){ if(s.hasOwnProperty(o)){ d[o] = s[o]; } } } function Promise(){ this._resolves = []; this._rejects = []; this._readyState = Promise.PENDING; this._da...
true
f67392cb46f596c8e8098ccff02c842d629a3dc1
JavaScript
rishigupta1109/datastructure-and-algo-tools
/DSnATools/dsnatools/src/components/stack/functions.js
UTF-8
6,929
3.484375
3
[]
no_license
class Stack{ arr=[]; top; size; constructor(s){ this.size=s; this.top=-1; } push(value){ this.arr[++(this.top)]=value; } pop(){ let x=this.arr[this.top][0]; this.arr.pop(); --this.top; return x; } isEmpty(){ if(this.top==-1){ return true; ...
true
181f1b9d5067615d578768c402c7bede9ae6668e
JavaScript
chao-master/Webtale
/js/Utils.js
UTF-8
659
2.625
3
[ "MIT" ]
permissive
function importScripts(scriptRelative,files){ if (scriptRelative){ var regex = /^(?:[a-z]+:)\//i, curSrc = document.currentScript.src, prefix = curSrc.substring(0,curSrc.lastIndexOf("/")+1); files = files.map(function(f){return regex.test(f) ? f : prefix+f;}); } var promises = files.map(f...
true
5f9bf5ab9822dd8045dcb4598c9adee3ae0e839e
JavaScript
ThinleyJimmyDorji/Snack-Time
/src/redux/orderSlice.js
UTF-8
1,857
2.6875
3
[]
no_license
import { createSlice } from "@reduxjs/toolkit"; // initial const initialState = { tray: [], }; // get total tray amount export const getTrayTotal = (items) => items?.reduce((amount, trayItem) => trayItem.price + amount, 0); // loop through items in tray and get the total amount. //0 is the initial amount. returns...
true
873f81bd0c18842217e8db38d478b184b8f8458e
JavaScript
expenture/ExpenseApp
/app/components/TabView/index.ios.js
UTF-8
2,583
2.609375
3
[]
no_license
/** * TabView.ios.js * A universal tab page and tab bar wrapper, providing tabs across different * platforms with the same API and logic. This is the iOS version. * * @providesModule components/TabView */ import React, { Component, PropTypes } from 'react'; import { TabBarIOS, Image } from 'react-native'; im...
true
a2ee7bfc3d7165ccdeaefc2c96bb9f1c9bfe254c
JavaScript
arbinish/urltiny
/ztiny.js
UTF-8
1,559
2.625
3
[]
no_license
var windoWidth; var windowHeight; var mainWidth; var leftPos; var topPos; setupOutWindow = function(data) { $('#p').remove(); var content = '<img src="/icons/hand.right.png" style="margin-right:1em; position:absolute;" />'; $('<div id="p"></div>').insertAfter('#main').html(data); console.log('top = ' + topPos + '...
true
b89c6bd1849542b9f5612660b9c3ff6b5879554a
JavaScript
Edward-Phillips/news-summary-challenge
/spec/newsitemspec.js
UTF-8
3,971
2.96875
3
[ "MIT" ]
permissive
describe("newsItem", () => { it("can extract a headline from an api response element", () => { const input = apiResult.response.results[0].fields; const testItem = new newsItem(input, 0); const headline = testItem.getHeadlineHTML(); expect(headline.textContent).toEqual(input.headline) }); it("wrap...
true
62ba738b4b99e68822da70224dbb7d8088d7b7f6
JavaScript
MikhailK89/duolog
/src/services/tests.js
UTF-8
3,951
2.8125
3
[]
no_license
export const id1 = [ "В чем разница между ключевыми словами «var», «let» и «const»?", "Что такое поднятие (Hoisting)?", "Что такое область видимости (Scope)?", // "Что такое замыкание (Closures)?", // "Какое значение имеет this?", // "Что такое классы (Classes)?", // "Для чего используется ключевое слово ...
true
b9a3ec71b0464b99b51dda9ed75d48b2be5359ef
JavaScript
uvictum/Matcha
/routes/userRouter.js
UTF-8
741
2.5625
3
[]
no_license
const mysql = require("../config/db") const express = require("express"); const router = express.Router(); const users = [ { id: 1, firstName: 'Bob', lastName: 'Marley' }, { id: 2, firstName: 'John', lastName: 'Snow' } ] // @route api/users // @desc ...
true
d9464250ef31b394cfbf653f07fa9cb38900f6ac
JavaScript
zugaldia/satellatte
/src/satellatte.js
UTF-8
1,839
2.59375
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
/* * See: http://mapbox.com/hosting/api-embed/ and http://leaflet.cloudmade.com/ */ function Satellatte(message_element) { var satellatte = {}, url = 'http://a.tiles.mapbox.com/v3/zugaldia.map-qshm3c0v.jsonp', message_id = "#" + message_element, zoom_out = 3, zoom_in = 11, map, geojsonLayer; satellatte...
true
7734041fa7287ebb46aff8af61e12913f39aa104
JavaScript
raduseremet/Typescript
/classes/classes.js
UTF-8
2,631
3.265625
3
[]
no_license
"use strict"; // PUBLIC - cimpul cu proprietatea public poate fi folosit oriunde // PRIVAT - doar in cadrul unei clase // PROTECTED - in clasa in care a fost declarat si in clasele mostenitoare // ABSTRACT - metodada careia este atribuita termenul abstract trebuie creata in fiecare subclasa // // STATIC - metodele car...
true
0d0fe34cb3d5f3b4b805f3d6d860a2f5395f8be1
JavaScript
125376053/uni-app
/utils/index.js
UTF-8
701
3.546875
4
[]
no_license
export const getMyDate= function(tmpDate){ /* // 1551335972 console.log(getMyDate(new Date("2006-10-12"))) 日期格式转换为字符串 tmpDate---传入的日期对象 new Date("10 12,2006 22:19:35"); //字符串传参 new Date("January 12,2006"); new Date(2006,0,12,22,19,35); new Date(2006,0,12); 数字逗号传参 new Date(1137075575000); 时间戳传参 ...
true
e901c57a7b2b53113c32e4e2db3fdf10dfc3e0cc
JavaScript
errolgh/modern-react-app-bootcamp
/learn-redux/src/index.js
UTF-8
1,377
2.953125
3
[]
no_license
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import { createStore } from 'redux' import rootReducer from './reducers' import { Provider } from 'react-redux' const store = createStore( rootReducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_D...
true
105b67528724801f1ff8db5325a881d90558d416
JavaScript
izidormaklary/chatroom-exercise
/client/views/PrivateRoom.js
UTF-8
538
2.578125
3
[]
no_license
import PublicRoom from "./PublicRoom.js"; export default class PrivateRoom extends PublicRoom{ constructor(socket, user, privateUsr) { super(socket, user); this._private = privateUsr // this.systemMessage(you+" joined the chat") } sendMessage() { let txtMessage = this._me...
true
3f985681e079249ccd13ae015103ebf18d00e354
JavaScript
AHMADZAI-Niamatullah/angular
/typescript/07_constructor/main.js
UTF-8
785
2.90625
3
[]
no_license
var Human2 = /** @class */ (function () { function Human2(name, firstName, age, adress, hairColor, has_children, hobbies) { this.age = age; this.hobbies = hobbies; this.firstName = firstName; this.name = name; this.adress = adress; this.hairColor = hairColor; ...
true
c6c7bd04fbfb4c223af70a681c1229980cd209be
JavaScript
mj2360/mj2360.github.io
/RedButton.js/red-button.js
UTF-8
563
3.546875
4
[]
no_license
let time = new Date(); let hours = time.getHours(); let minutes = time.getMinutes(); console.log(hours); console.log(minutes); let colors = ['red', 'teal', 'blue', 'purple', 'magenta', 'pink', 'orange', 'white', 'black']; const redbutton = document.querySelector('#redbutton'); const theTxt = document.querySelector('...
true
a7e2eeb399dfb67c692eeef9ac29ebd4ffd95a7d
JavaScript
dionjwa/genetic-constructor
/src/models/Annotation.js
UTF-8
3,048
2.609375
3
[ "Apache-2.0" ]
permissive
/* Copyright 2016 Autodesk,Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
true
c6ab0fc31bae8dcc2b8e5ea7f1e3c648ec7d093a
JavaScript
mumer29/node-material
/11-modeling-relationship-bw-connected-data/02-referencing-document.js
UTF-8
3,105
3.5
4
[]
no_license
// in this module we have two models, Author and Course. Means two collections are used in same database // here initiall Course has one property name. here we are going to add another property called author and it'll be refference to the author document in the database. // we have a few helping function for // 1- cre...
true
7a6b5ad583a4651830953ebbb441559e4d322549
JavaScript
vipuly1/linear-ds-assignment
/Q5.js
UTF-8
321
3.046875
3
[]
no_license
//Q5. Read about the Tower of Hanoi algorithm. Write a program to implement it. const no=4 const Hanoi=(n,S,D,A)=>{ if(n!=0){ Hanoi(n-1,S,A,D) console.log('\t',n+'st disc ',S,' --> ',D) Hanoi(n-1,A,D,S) } } Hanoi(no,'Sourse Pole','Destination Pole','Auxilary Pole'...
true
5d244aa31666176fbd6ff244d2ae9dcf8242e248
JavaScript
SizoDevelops/Random-Quote-Gen
/script.js
UTF-8
2,516
2.984375
3
[]
no_license
const colors = [ "#189AB4", "#0000FF", "#050A30", "#F8D210", "#FA26A0", "#F51720", "#2FF3E0", "#CB4E47", "#190204", "#FF8300", "#FF4500", "#B7AC44", "#24E500", "#1D741B" ] let quotesData; let currentQuote = '', currentAuthor = ''; async function fetchQuoteData() { let resp...
true
b6a84e6acff4cbc0cf17ddddac289640c044f5f7
JavaScript
laurabunea/Fred
/app/field.js
UTF-8
884
2.640625
3
[]
no_license
var ValidationDefaults = { "notEmpty": "Please fill out this field", "isAlphanumeric": "This should only contain letters and numbers", "isNZDate": "Make sure this is a date" }; var Field = function(data) { this.data = data; }; Field.prototype = { validate: function(req) { var validat...
true
5273d7c402051c54f618c0789c09272aa571a85c
JavaScript
Kmeco/sp18-midterm-p1
/test/testICO.js
UTF-8
2,061
3.03125
3
[ "MIT" ]
permissive
'use strict'; /* Add the dependencies you're testing */ const Crowdsale = artifacts.require("./Crowdsale.sol"); const Queue = artifacts.require("./Queue.sol"); const Token = artifacts.require("./Token.sol"); // YOUR CODE HERE contract('testICO', function(accounts) { /* Define your constant variables and instantiate ...
true
e9c45e8eb8e6af2efa4f13556dae32f6de30636d
JavaScript
victorcata/jsadvanced-exercises
/js/class03.js
UTF-8
6,784
3.890625
4
[]
no_license
/** * 8 - Hagamos una lista de pasajeros efectiva usando Arrays e imprimamos cada pasajero de la lista y su número de asiento (basado en el orden del índice). * Nota: El primer asiento del tren es el 1 y no el 0. */ (function() { var passengers = [], names = ['Victor', 'Jose', 'Antonio', 'Ramon', 'J...
true
917c79096d4537e4705094cc602430c9fd9395fc
JavaScript
mhamm941/MyFriendX
/src/scenes/play.js
UTF-8
6,890
2.65625
3
[]
no_license
class play extends Phaser.Scene { constructor() { super("playScene"); } preload() { this.load.image('player', './assets/player.png'); this.load.image('block', './assets/block.png'); this.load.spritesheet('allMapTileSprite', './assets/tileTesting.png', { fr...
true
f6c95928f0c2ada6a7f248bc2f033f8a7a256902
JavaScript
jldiegel/js_problems
/test/greater.js
UTF-8
317
2.734375
3
[]
no_license
var greaterThan = require('../greater'); var chai = require('chai'); var expect = chai.expect; describe('', function() { context('given numbers of 9 and 12', function() { it('returns true', function() { let result = greaterThan(9, 12) expect(result).to.equal(true); }); }); });
true
5a4ba1525aa94a8e9606d1cccb86aa249e4d230e
JavaScript
fivge/javascript-in-depth
/array/flatten.js
UTF-8
1,137
3.703125
4
[]
no_license
let flatten_1 = (arr) => { let result = []; for (let i = 0; i < arr.length; i++) { if (Array.isArray(arr[i])) { result = result.concat(flatten(arr[i])); // result.push(...flatten(arr[i])); } else { result.push(arr[i]); } } return result; }; // 乱序 let flatten_2 = (arr) => { fo...
true
3097b9867db03c601af913be17c528343ff2e29f
JavaScript
YoonSL/practiceproblems
/sumofmultiplesof3or5prac.js
UTF-8
208
3.3125
3
[]
no_license
function findSum(n){ var sum = 0; for(i=1; i<=n; i++){ if(i % 3 == 0 || i % 5 == 0){ sum = sum + i; } } console.log(sum); } findSum(10); findSum(20); findSum(100);
true
d4be5acb6ce4abe578469c81d8878cceaba30227
JavaScript
2sb18/chess-trainer
/chess-trainer.js
UTF-8
9,214
3
3
[]
no_license
// chess-trainer glues together the chess.js and chess-board.js var MOVE_BACK_BUTTON = 't'; var MOVE_BACK_BUTTON_CHARCODE = 116; // t var BLACK_TO_MOVE_COLOR = 'rgb(220,220,220)'; var WHITE_TO_MOVE_COLOR = 'rgb(242,242,242)'; var COLOR_WRONG = 'rgb(255, 135, 135)'; var COLOR_RIGHT = 'rgb(103, 224, 90)'; var FLASH...
true
5064c33aca12b5f2e5eb72b189cb67ee51b2d5a7
JavaScript
kazuhikoarase/fixed-length-file-manager
/FLFM/src/sample/03_Nested/flfm/main.js
SHIFT_JIS
570
2.515625
3
[]
no_license
// // Œ蒷t@CǂݍރXNvgłB // !function() { var s = si.peekString(1); trace(s); si.readRecord('wb_.txt'); si.beginNest(); var r = si.readRecord('f[^1.txt'); r.put('__RECORD_NAME__', 'JX^R[h'); si.beginNest(); si.readRecord('f[^1.txt'); si.beginNest(); si.readRecord('f[^2.txt'); ...
true
1aa40721fcbb2de19222b393306f1c09ece20dbb
JavaScript
TheodorCristian/MazeApp
/maze-app.js
UTF-8
6,358
3.078125
3
[]
no_license
const {World, Runner, Render, Engine, Bodies, Body, Events} = Matter; const engine = Engine.create(); engine.world.gravity.y = 0; const {world} = engine; const cellsHorizontal = 4 * 2; const cellsVertical = 3 * 2; const width = window.innerWidth; const height = window.innerHeight; const unitLengthX = width / cellsHor...
true
8a9c66499bc3ac7349d879e19294ac778d78bff9
JavaScript
terkoizmy/full-pesal
/Fcking Number Pattern/SquareNumber.js
UTF-8
2,471
4.25
4
[]
no_license
/** Square Number Diberikan sebuah function squareNumber dimana menerima inputan berupa number. Function ini akan mengembalikan array multidimensi yang isi value tersebut secara proses menyerupai `board snakes and ladders` (angka 1 dimulai dari KOLOM ATAS) TAPI alih-alih menuliskan value angka kamu akan men...
true
8682b9e07918dddd329617d7158652eb3aed6ebc
JavaScript
BJHunnicutt/civic
/packages/component-library/stories/Pie.story.js
UTF-8
2,333
2.609375
3
[ "MIT" ]
permissive
import React from 'react'; /* eslint-disable import/no-extraneous-dependencies */ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { withInfo } from '@storybook/addon-info'; import { withKnobs, text, number, object, array, } from '@storybook/addon-knobs'; impo...
true
416d29900b4fa27313d5d94e6a77fc17c14c113b
JavaScript
abhishekra07/Lit-Element-Example
/MyCard.js
UTF-8
1,311
2.65625
3
[]
no_license
import { LitElement, html, css } from 'lit-element'; class MyCard extends LitElement { static get styles() { return css` .card { box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); transition: 0.3s; width: 300px; } .card...
true
23e10c86ab5e7b3fbeccba80c8fc07ca7818af74
JavaScript
carlacentenor/botnodejs
/index.js
UTF-8
2,011
2.703125
3
[]
no_license
var express = require('express'); var bodyParse = require('body-parser'); var request = require('request'); const APP_TOKEN = 'EAAIM30ZBXoioBAIz3LoYxvt8wgXsd0YZCi8oYVHYUXqQIXMno8ZBga1ZBg3ykJ9yCn3ZCG9g3iiUZBonHBPnldvKy9ovWMv1wtZBWug9kZA7rs7SsQUwxoaBdu8JU6qKEKLa2R7R9q7DZBWn5MVzwzpv9VTiireP5Y6ceBBVQNjZANJgZDZD'; var app...
true
152f2ae33aa97785fdd3520c4ca63cfdbf671e7b
JavaScript
seimon-m/COMGRAP_excercises
/webgl_ex_3.0/Exercise1.js
UTF-8
3,970
3.09375
3
[]
no_license
// // Computer Graphics // // WebGL Exercises // // Register function to call after document has loaded window.onload = startup; // the gl object is saved globally var gl; var globalAngle = 0; // we keep all local parameters for the program in a single object with the name ctx (for context) var ctx = { shaderPro...
true
003179b380d45bba229baa314f32e3853da0e6b6
JavaScript
laxmimohan/Project2
/templates/plots.js
UTF-8
4,143
3.109375
3
[]
no_license
//line chart --------------------------------------------- // reference: week 15, day 1, activity 8 // Create the Traces var trace1 = { x: data.Year, y: data.Alzheimers, mode: "markers", type: "scatter", name: "Alzheimer's Disease", marker: {color: "#2077b4", symbol: "hexagram" } }; var trace...
true
2cd97ee458f5573edd779dafa17f511f144d8321
JavaScript
apodi/multiplayer-quizup
/src/firebase/firebase-server-db.service.js
UTF-8
5,920
2.828125
3
[]
no_license
const firebase = require('../../config/firebase.config.js'); const firebaseDB = firebase.firebaseConfig().database(); const request = require('superagent') /** * storeQuestions - using to store questions in Quiz-engine database */ function storeQuestions(questions) { console.log("Inside storeQuestions method:"); ...
true
d47bc6bd5382fe20caa40bb3a6ca606762ebca56
JavaScript
MinutoDelOr/Projet_Secu
/Front-end/like.js
UTF-8
185
2.640625
3
[ "Apache-2.0" ]
permissive
try{ var buttons = document.getElementsByTagName("button")[3]; if(buttons.className.indexOf("likeButton") > -1){ buttons.click(); } } catch(err){ console.log(err.message); }
true
d6932a1e00e0c80572a311f11178a5e44bd94ab8
JavaScript
tjh1222/js-130
/challenges/easy/scrabble.js
UTF-8
1,511
4.3125
4
[]
no_license
/* Problem: Write a problem that accepts a word and returns the scrabble score Letter values Letter Value A, E, I, O, U, L, N, R, S, T.......... 1 D, G.................................. 2 B, C, M, P............................ 3 F, H, V, W, Y......................... 4 K..................................... 5 J, X....
true
1841ff2b109326fbd420f7efeee58dba80d65280
JavaScript
Pier-39/EventMe
/Web/EventMe.WebApplication/Scripts/file-upload.js
UTF-8
1,086
2.6875
3
[]
no_license
//read uplaoded photo content and title function readURL(input) { var FILE_SIZE = 559959; if (input.files && input.files[0]) { var reader = new FileReader(); var file = input.files[0]; reader.onload = function (e) { $('.upload-shitt-photo-div').show(); $('.uplo...
true
98d8ac64fc6798eddc72e4282695db67665d1a1e
JavaScript
wxwxzhang/lowPassFilter
/lowPassFilter.js
UTF-8
4,331
3.234375
3
[]
no_license
// This is a script to compute the low pass chebyshev filter prototype // It is taken from Matthaei, Young, and Jones (MYJ) lowPass(1.0, 1.5, 0.1, 30); // Outer function to compute the low pass chebyshev filter prototype // It is taken from Matthaei, Young, and Jones (MYJ) function lowPass(fCuttoff, fRejection, dBRip...
true
14a87d684e45bb2f753532690ba74f58b32e1cae
JavaScript
JesusGonzalezPerez/Ejercicios-JavaScript
/TEMA 1/Worksheet 5/Condicionales o if/Ejercicio 4/index.js
UTF-8
431
4.34375
4
[]
no_license
//Script que pide un número por teclado y si es mayor a 100, le aplica un descuento del 15%. //Variables var numero=parseInt(prompt("Introduzca un número")); //Condicional que comprueba si el número introducido es mayor a 100 y muestra un resultado. if(numero>100){ document.write("Aplicando descuento del 15%...<b...
true
53965ed2a95c84feb606f2bef4194b9546885221
JavaScript
nila19/expense
/public/app/core/directives/xx-amount.directive.js
UTF-8
1,519
2.59375
3
[]
no_license
/** ** ./core/directives/xx-amount.directive.js *** */ (function (angular) { 'use strict'; const xxAmount = function (CONSTANTS, $filter) { const amount = function ($scope, $element, $attrs, ctrl) { // validator ctrl.$validators.xxAmount = function (mv, vv) { if (ctrl.$isEmpty(mv) || CONSTANT...
true
46063404dbba4457dd84dd81f949251382bbc2f0
JavaScript
vueComponent/ant-design-vue
/site/src/directives/clipboard/select.js
UTF-8
913
2.96875
3
[ "MIT" ]
permissive
function select(element) { let selectedText; if (element.nodeName === 'SELECT') { element.focus(); selectedText = element.value; } else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { let isReadOnly = element.hasAttribute('readonly'); if (!isReadOnly) { element.setA...
true
4e4c51d792982d04b95bd5d61a100b8d7578b548
JavaScript
Nemra1/webcam_server
/server.js
UTF-8
1,596
2.578125
3
[]
no_license
const path = require('path'); const {spawn} = require('child_process'); const app = require('express')(); const server = require('http').createServer(app); const io = require('socket.io')(server); const cv = require('opencv4nodejs'); const showUsedMemory = () => process.memoryUsage().heapUsed; if (proc...
true
dc996d1b8f4eccca3b66c1429971389a63fa3049
JavaScript
valentinavaloni/programadorWeb-4280
/Clase 08/Alumno/Desafío/js/index.js
UTF-8
786
3.375
3
[]
no_license
var student = { firstName: 'Juan', lastName: 'Perez', dni: 22999333, email: 'juan@gmail.com' } function createStudentNode (newStudent) { var liNode = document.createElement('li') liNode.id = newStudent.dni liNode.className = 'list-group-item' var fullName = '' if (newStudent.firstName && newStude...
true
adc5d1f1acb818649f09b671ff9b8c0704b184a8
JavaScript
wbbhacker/bbCode
/FE-tutorial/Part5.Node.js 全站开发/模块一.Node.js高级编程/06Events/05-js-eventloop.js
UTF-8
754
3.125
3
[]
no_license
// setTimeout(() => { // console.log('s1') // Promise.resolve().then(() => { // console.log('p1') // }) // Promise.resolve().then(() => { // console.log('p2') // }) // }) // setTimeout(() => { // console.log('s2') // Promise.resolve().then(() => { // console.log('p3') // }) /...
true
467b8eacaa6d31cae37d23979f1ec17bbbe20e3b
JavaScript
seldon-hr/fundamentos-js
/clase7.js
UTF-8
620
3.75
4
[]
no_license
var seldon = { nombre: 'Seldon', apellido: 'Romero', edad: 22 } var dimoteo = { nombre: 'Dimoteo', apellido: 'Lucas', edad: 39 } function imprimirNombreEnMayusculas(persona){ //var nombre = persona.nombre var { nombre } = persona console.log(persona.nombre.toUpperCase()) } imprimi...
true
728019622fab6dd15378fd4153c0b52ca3c95bb7
JavaScript
dong2107/kiem-tra-chu-hoa
/script.js
UTF-8
439
3.78125
4
[]
no_license
function isFirstLetterUpperCase(str) { let regexp = /^[A-Z]/; if (regexp.test(str)) { console.log("String's first character is uppercase"); } else { console.log("String's first character is not uppercase"); } } isFirstLetterUpperCase('Abcd'); isFirstLetterUpperCase('abcd'); let txt = "N...
true
3ca35187b5fd388ca232eb751eb12dc083dc07a1
JavaScript
KimiWu123/semaphore
/semaphorejs/src/test_util.js
UTF-8
2,628
2.53125
3
[]
no_license
/* * semaphorejs - Zero-knowledge signaling on Ethereum * Copyright (C) 2019 Kobi Gurkan <kobigurk@gmail.com> * * This file is part of semaphorejs. * * semaphorejs is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
true
4383972f7078cb653628113460840fd600e877de
JavaScript
swtpumpkin/JavascriptAlgorithm
/Exercise/oneToTwenty.js
UTF-8
730
4.28125
4
[]
no_license
//1 ~ 20 사이의 어떤 수로도 나누어 떨어지는 가장 작은 수는 얼마입니까? //반환될 가장 작은 수를 담을 변수를 선언한다. var num = 0; //1부터 1씩 더해지는 무한루프를 만든다. while(true){ num++ var divided = true; //1부터 20까지 나눈 나머지가 0인 수를 찾는 for문을 선언한다. for(var innerNum = 20; innerNum > 0; innerNum-- ){ // 나눈 수가 1개라도 0으로 나누어 떨어지지 않는다면 멈추게 한다. if(num%innerNum !== 0){...
true
8bedc3f6a52d584a3baf366ee8b00433d8995875
JavaScript
alaneh/5IV7_SWyA-Elizalde-Hernandez-Alan
/03 DES/public/validar.js
UTF-8
2,211
3.203125
3
[]
no_license
let arrayNombre, longitud, extension, validacion; const regexTxt = ".txt"; let formulario = document.getElementById("formulario"); function validarCifrado(event) { formulario.setAttribute("action", "/cifrar"); validacion = true; // Validar que no haya campos vacios if (Texto.value == "") { Swal...
true
3c746ea2e36bc28d2ba1122b8d3d51da62c26729
JavaScript
yifei2016/EC-exercise
/repl-it.js
UTF-8
444
3.96875
4
[]
no_license
/*function countBs(str) { // Your code here var count=0; for(x=0;x<str.length;x++){ if(str.charAt(x)=="B"){ count++; } } console.log(count); } countBs("string.Next")*/ function countChar(str, character) { // Your code here var count=0; for(x=0; x<str.length;x++){ if(str.charAt(x)==character){ count++...
true
64c6d0cc1891e6f2c41b7cccb79ed63ba852500b
JavaScript
stefanpenner/if-main
/example.mjs
UTF-8
434
2.921875
3
[]
no_license
// my-file.mjs import ifMain from './index.mjs'; ifMain(import.meta.url, async ([name]) => { console.log(`Hello, ${name}!`); // do stuff if the current file, is also the main file for the program // node <current-file> // if you want to exit with a non zero status code, throw an exception // throw new Erro...
true
cf90388007b5fe67aaddf3afec12e18b54e4df58
JavaScript
oroshazi/neuquen.github.io
/js/employmentByOccupation.js
UTF-8
8,807
2.921875
3
[]
no_license
/** * SOURCES USED: * https://bl.ocks.org/mbostock/3884955 * http://bl.ocks.org/mbostock/3035090 */ // Global Variables var monthYear = d3.time.format("%b-%Y"); var year = d3.time.format("%Y"); var colorScale = d3.scale.category20(); /* * Load the data */ loadData(); function loadData() { d3.csv("data/emplo...
true
dd4441b620aa2f2dbdcc8041daf997d93a041431
JavaScript
PetterNR/BlockGames
/gravityPlayground/Javascript/functions.js
UTF-8
1,451
2.734375
3
[]
no_license
// functions and global contants defined here var scl = 25; var canvas,w,h; // variables for planet creation var planets = new Array(); var currentPoint = [0,0]; var minSize = 10; var currentSize = minSize; var maxSize = 150; var reshapeDelta = 10; // constants const planetDensity = 0.04; const G = 0.1;...
true
004d8e0378c753a66c3054d1740a5f5615cc3476
JavaScript
S1riyS/CLICKSPEED
/app/static/js/form.js
UTF-8
730
2.59375
3
[ "Beerware" ]
permissive
// Показать/скрыть пароль $(document).on('click', '.password-control', function () { let inputField = $(this).siblings('.form__input').eq(0); if (inputField.attr('type') == 'password') { $(this).addClass('view'); inputField.attr('type', 'text'); } else { $(this).removeClass('view');...
true
48e8f3594a43c3c05dddf9485080a6f2ba35f8f6
JavaScript
sregger/sspi-client
/test/integration/sspi-client-test.js
UTF-8
3,467
2.578125
3
[ "MIT" ]
permissive
'use strict'; const net = require('net'); const SspiClientApi = require('../../src_js/index.js').SspiClientApi; const Fqdn = require('../../src_js/index.js').Fqdn; const MakeSpn = require('../../src_js/index.js').MakeSpn; let sspiClient = null; let serverResponse = null; let expectedServerResponseSize = 0; let canIn...
true
a61117cb86f4fa165e78f4579e6bfe04378b19ba
JavaScript
AntiseptikSAD/saveantiseptik
/js/js.js
UTF-8
23,678
2.875
3
[]
no_license
let cvs=document.getElementById("canvas") let ctx=cvs.getContext("2d") cvs.width=innerWidth cvs.height=innerHeight-50 cvs.style.background="rgb(5, 122, 126)" //звук удара шаров function play1(){ let audio=new Audio() audio.src="sounds/e6e94ccf7efd18f.mp3" audio.play() } let sum //сумма радиусов двух ...
true
27fbb3bcab206b4994c200e8bb503e17112e9d2d
JavaScript
Gilpop8663/backjoon
/b3009/app.js
UTF-8
1,386
3.765625
4
[]
no_license
const fs = require("fs"); const filePath = process.platform === "linux" ? "./input.txt" : "/dev/stdin"; //제 개발환경은 리눅스이기에 input.txt를 앞에 두었습니다. // const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; // 실제 백준사이트에 제출할 때는 위에 filePath를 삭제하고 이 부분을 입력하면 됩니다. let input = fs.readFileSync(filePa...
true
8fd143d195d9050fa147130823c2451fc2efa8e5
JavaScript
mhemrg/indicative
/src/validations/regex.js
UTF-8
832
2.921875
3
[]
no_license
import toPromise from '../../lib/toPromise' import skippable from '../core/skippable' /** * Ensures the value of field under validation, passes the regex test. The regex * can be defined as a string or a RegExp object. * * NOTE: For complex `regex`, always use the `rule` method. * * [source, js] * ---- * const...
true
da77cd3190266188112686bdf0aebc1752087959
JavaScript
ms853/react-native-app
/src/reducers/AuthReducer.js
UTF-8
1,736
3.40625
3
[]
no_license
/** * To Do: * First import all the action types * Then create a initial state variable, which will store the initial states * -which are the states such as the user input which will be updated. * Switch case to determine which initial state will be updated based on the action type. */ import { EMAIL_INPUT_...
true
1a74bfcdbe337786856899729f343acee553ff01
JavaScript
tiagocarmo/rtl-create-react-app
/src/components/Form/Form.test.js
UTF-8
2,279
2.71875
3
[]
no_license
import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import Form from '../Form'; describe('Testing Form', () => { const mockCallback = jest.fn(); test('O botao deve estar desabilitado, se o input nao tiver valor', () => { render(<Form />); const buttonSubmit = screen.getBy...
true
3cd4e61870b10dca0b2a535e10dc7f7664557be7
JavaScript
JohnnyRS/PandaCrazy-Max
/js/alarms/ModalAlarmClass.js
UTF-8
11,022
2.65625
3
[]
no_license
/** This class deals with any showing of modals for jobs. * @class ModalAlarmClass ## * @author JohnnyRS - johnnyrs@allbyjohn.com **/ class ModalAlarmClass { constructor() { this.reader = new FileReader(); // Set up a file reader so user can select a audio file on their computer. this.myAudio = null; ...
true
b2524e14c53b0332dca2dc41da11963e2786aa6e
JavaScript
ChainShot/Balancer-Content
/projects/Swaps and Arbitrage/1.0.0/New Spot Price/calculateNewSpotPrice.js
UTF-8
695
2.53125
3
[]
no_license
const calculateOut = require('./calculateOut'); const poolInfo = require('./poolInfo'); /** * @param {Contract} pool A Contract pointed at a BPool * @param {BigNumber} daiIn Amount of DAI to be swapped in */ async function calculateNewSpotPrice(pool, daiIn) { const { daiWeight, wethWeight, daiBalance, wethBalan...
true
125ea101d0f293a89c44353df9a08decc0f67901
JavaScript
limty/snake
/assets/js/generateTable.js
UTF-8
619
3.3125
3
[]
no_license
function generateTable(rows, cols) { let table = document.createElement("table"); table.setAttribute("align", "center"); for (let i = 0; i < rows; i++) { let tr = document.createElement("tr"); for (let j = 0; j < cols; j++) { let td = document.createElement("td"); td.classList.add("grid"); ...
true
f02faa7534a0a5264ca0f4127b76d4a957f11553
JavaScript
renatoalencar/transactions
/src/components/CurrencyControlledField.test.js
UTF-8
2,793
2.640625
3
[]
no_license
import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import CurrencyControlledField from './CurrencyControlledField'; describe('test currency field', () => { test('with common ordinary float input', () => { const handler = jest.fn(); const component = render( <Currenc...
true
dbca6bb493671652930722715f3473c1fcd4ebe0
JavaScript
SteveLee/WebfontsDrupalXmlWithEditor
/sample.js
UTF-8
2,780
2.890625
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
/**** Copyright 2010 Monotype Imaging Inc. This program is distributed under the terms of the GNU General Public License ****/ var WFS = { isIE : (navigator.appName.toLowerCase().indexOf("microsoft internet explorer") >= 0), //Check for IE hideBody:function(){//seems quite clear document.body.style.visibility =...
true
5ca5db3ca96f83c5d047f47562426e58ea7d720c
JavaScript
juanruiz2/Herencias
/Maestro.js
UTF-8
520
2.875
3
[]
no_license
//Superclase class Maestro{ constructor(materia, promedioGrupo){ this.materia = materia; this.promedioGrupo = promedioGrupo; console.log("se creó al Maestro"); } getMateria(){ return this.materia; } getPromedioGrupo(){ let sumaTotal = 0; for (let i...
true