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
b48f142b492153a78014ab48892bf308d415bea3
JavaScript
cooperlovano/font-cycling
/cycling.js
UTF-8
653
3.171875
3
[]
no_license
$(document).ready(function() { var element = $("#holder"); var maxCycles = 10; var counterObj = 0; function secondChange() { if (counterObj < maxCycles) { counterObj++; element.removeClass("two").addClass("one"); setTimeout(redToBlue, 100); console.log(counterObj); } else { ...
true
777dd3e6d7422e37591fe3e197368b82d50fa8be
JavaScript
lianaipeng/webrtc_demo
/one-to-one/web/client.js
UTF-8
11,604
2.703125
3
[]
no_license
//var connection = new WebSocket('ws://10.10.10.87:8888'), var connection = new WebSocket('wss://xx.xxxxx.com:28887'), localName = ""; var loginPage = document.querySelector('#login-page'), localNameInput = document.querySelector('#localName'), loginButton = document.querySelector('#login'); var callPage = document.q...
true
fa684d9bec2a4a58a571a63ceaaf5df41f3b8dd3
JavaScript
njwallace315/Vidbits
/test/routes/create-test.js
UTF-8
2,108
2.5625
3
[]
no_license
const {assert} = require('chai'); const {connectAndDrop, disconnect} = require('../setup-teardown-utils.js') const {buildVideoObject, parseTextFromHTML} = require('../test-utils'); const request = require('supertest'); const app = require('../../app.js'); const {jsdom} = require('jsdom'); describe('server path /videos...
true
7e8da004ac5caf76a565699e6e07437460e53159
JavaScript
mattbierner/atum
/lib/builtin/hosted/math.js
UTF-8
1,081
3.203125
3
[ "MIT" ]
permissive
/** * @fileOverview Number builtins defined in the hosted language. */ "use strict"; /** * `Math.max(value1, value2, ...)` */ Object.defineProperty(Math, 'max', { 'value': function(value1, value2 /*, ...*/) { var largest = -Infinity; for (var i = 0; i < arguments.length; ++i) { var ...
true
ddca189c5afd06ff2027294c0f1eb8af916f41c9
JavaScript
GMartinage/tp_javascript
/js/exo_9.js
UTF-8
314
3.8125
4
[]
no_license
var addition = function(parameter1, parameter2) { return parseInt(parameter1) + parseInt(parameter2); } var printMath = function() { var result = document.getElementById("myDivP"); result.innerHTML = addition(document.getElementById("number_1").value, document.getElementById("number_2").value); }
true
9d1e89106772bd45d9fd387d468f2d8b937c9b02
JavaScript
ayzaqwash/Isaac-ip2
/app.js
UTF-8
588
3.125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
$(document).ready(function () { $("#calc").submit(function (event) { event.preventDefault(); const fd = new FormData(this); const dob = new Date(fd.get("birthday")); const day1 = dob.getDay(); const male = ["Kwasi", "Kwado", "Kwabena", "Kwaku", "Yaw", "Koffi", "Kwame"]; ...
true
faeb8b3a8ee38372efadf5d712cffbea50b55262
JavaScript
shushiqi/leetcode
/398.随机数索引.js
UTF-8
762
3.5625
4
[]
no_license
/* * @lc app=leetcode.cn id=398 lang=javascript * * [398] 随机数索引 */ // @lc code=start /** * @param {number[]} nums */ var Solution = function (nums) { this.map = new Map(); for (let index = 0; index < nums.length; index++) { const element = nums[index]; if (!this.map.has(element)) { this.map.set...
true
9249e0589e45eb19106e183ef99e74037446e9f4
JavaScript
msorins/IronCoders
/juniorcodersSubdomain/kiwi/tutorials/core/states/SwitchingStates/src/states/state1.js
UTF-8
843
2.640625
3
[ "MIT" ]
permissive
var SwitchingStates = SwitchingStates || {}; SwitchingStates.State1 = new Kiwi.State('State1'); /** * The PlayState in the core state that is used in the game. * * It is the state where majority of the functionality occurs 'in-game' occurs. * */ /** * This create method is executed when a Kiwi state has finished ...
true
e49de83be322682407aa14790f191bc8d01ca08c
JavaScript
tdomingo/TicTacTotes
/game.js
UTF-8
4,335
3.390625
3
[]
no_license
const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }) const mem = { player: 1, names: {}, board: (new Array(9).fill(0)), moves: 0, }; const changePlayer = () => { mem.player = mem.player === 2 ? 1 : 2; } const colorizeTextPlayer = (t...
true
2e25b86f93730722ad36d2e965255bf34f562fad
JavaScript
MohamedAmal/Mongoose-CRUD
/routes/products.js
UTF-8
1,404
2.609375
3
[]
no_license
const express = require('express') const Product = require('../schemas/product') const router = express.Router() router.get('/list', async (req, res) => { const response = await Product.find({}) res.send(response) }) router.get("/:id", async (req, res) => { const id = req.params.id const response = aw...
true
fb4e32746b627d44ce3fc4c928335d3a6d55a643
JavaScript
Weerapat1993/modular-antd
/src/components/FolderStructure/FolderStructure.js
UTF-8
2,497
2.5625
3
[]
no_license
import React from 'react' import { any, arrayOf } from 'prop-types' import _ from 'lodash' import { Tree } from 'antd' const { TreeNode } = Tree const renderTreeNodes = (data, name) => { const sortFunc = (a,b) => { if(a < b) return -1; if(a > b) return 1; return 0; } /** * Sort Tree * @param ...
true
a4311550af58918abe6801c2a40ee8cfdab95866
JavaScript
Bottlem4n/ProgramacionWeb
/Examen Segundo Parcial/Segunda Parte/AutomovilesLujoGeneral.js
UTF-8
1,481
3.234375
3
[]
no_license
// 1) De un arreglo de 10 Automóviles. Determinar los que son autos de lujo y el total a pagar. // El Automóvil tiene como propiedades: marca, modelo, tipo, precio // Crear 10 automoviles (austeros, compactos, deportivos y de lujo) var catalogo = [{nombre: "Whisky Johnnie Walker", descripcion: "Red Label 700 ml", prec...
true
c0dd850239fbbf947ff04b471bb71293f20ca066
JavaScript
LoginShield/test-enterprise-website-html5
/src/sdk/input.js
UTF-8
1,049
3.09375
3
[ "BSD-2-Clause" ]
permissive
/* Copyright (C) 2019 Cryptium Corporation. All rights reserved. */ /* eslint-disable no-console */ const nameRegex = new RegExp('[A-Z0-9]', 'i'); // simple rule: just has to include a letter or digit; TODO: allow all unicode letters const emailRegex = new RegExp('^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$', 'i'); const...
true
86291b5d1baf70833b9d825b65d6be957993dcb2
JavaScript
Mohammad-Bilal-Bhatti/plain-redux
/src/redux/posts/reducer.js
UTF-8
1,586
2.75
3
[]
no_license
import { ADD_POST, FETCH_POST_SUCCESS, FETCH_POST_ERROR, FETCH_POST_BEGIN, UPDATE_POST, DELETE_POST, } from "../actions" const initState = { posts: [], isLoading: false, lastFetch: null } let nextId = 0 export default function( state = initState, action ){ switch( action.type ){ case...
true
16d98697715302f9c3d2fd1cfdee1d0f8ba229b7
JavaScript
John123Yu/AlgorithmnsInJavascript
/Dojo/LinkedList/reverseSLL.js
UTF-8
341
2.90625
3
[]
no_license
var { SLL } = require("./singlyLL"); let sll = new SLL(); // console.log(sll.popBack); sll.pushBack(1); sll.pushBack(2); sll.pushBack(3); sll.pushBack(4); sll.pushBack(5); sll.reverse(); console.log(sll); . . w, r, 1,2,3,4,5;//2 to 4 || w.n to r.n, 3 to 2 || r to w.n, 1 to 3 || w to r w r 1,3,2,4,5//2 to 5,...
true
8a1eaaf2b6389eee3b7280324ae819b04b5bd45c
JavaScript
snailuncle/autoRead
/天猫/短租获取手机号码.js
UTF-8
1,916
3.078125
3
[]
no_license
// xiaofanxiaoyu6|4b7ed34cc6867fce445771775bd95f06 酒链项目ID='51652' // 获取手机号之后必须延迟两秒钟 baseUrl='http://api.jmyzm.com/http.do' // http://api.jmyzm.com/http.do?action=getMobilenum&pid=项目ID&uid=用户名&token=登录时返回的令牌&mobile=&size=1 res=http.post(baseUrl,{ 'action':'getMobilenum', 'uid':'xiaofanxiaoyu6', 'token':'4b7ed3...
true
f8a87e244691ca15b1f759c5a537e094733a596b
JavaScript
Christina-Kashevar/App-Home_Finance
/scripts/script.js
UTF-8
50,595
2.53125
3
[]
no_license
// Список копонентов (from components.js) const components = { enter: enter, overlay: overlay, summary: Summary, exchange : Exchange, navbar: NavBar, content: Content } // Список роутов (from pages.js) const routes = { income: IncomePage, outcome: OutcomePage, dayInfo:...
true
c3c5f28e38f350ba849f387b22aa37f7cf0db6e9
JavaScript
touryung/FE-Learning
/设计模式/观察者模式.js
UTF-8
1,077
4.28125
4
[]
no_license
/** * 猎人类 * @param {*} name * @param {*} level */ function Hunter(name, level) { this.name = name; this.level = level; this.subcribeList = []; } /** * 订阅 * @param {*} target 订阅目标 * @param {*} func 目标发布事件后执行的函数 */ Hunter.prototype.subcribe = function (target, func) { console.log(`${this...
true
fc7a4dfa452a75dffa69fb97ed85902ff3b0d329
JavaScript
AdamSalma/Lurka
/app/utils/time.js
UTF-8
1,444
3.515625
4
[ "MIT" ]
permissive
import moment from 'moment' /** * Converts a timestamp to seconds ago * @param {Integer} timestamp - From calling Date.now() * @return {Integer} - Seconds since timestamp */ export const secondsAgo = (timestamp) => { return (Date.now() - timestamp) / 1000 } /** * Converts milliseconds to a more re...
true
a50d5b0ac984c6f621f3d3d6d174b13d445daf9b
JavaScript
GorillaStack/athena-cloudtrail-partitioner
/src/s3.js
UTF-8
3,260
2.6875
3
[ "MIT" ]
permissive
import aws from 'aws-sdk'; const createNode = (name, children) => ({ name, children }); /** * list the given bucket at the given path * * @param {String} bucket * @param {String} path */ export const listBucketAtPath = (bucket, path) => new Promise((resolve, reject) => { const s3 = new aws.S3({ apiVersion: '2...
true
c998254928bf03e27f3cf8d17246becbd189d398
JavaScript
moshuchao/waterfall-layout
/docs/data.js
UTF-8
569
3.03125
3
[ "MIT" ]
permissive
var $app = document.querySelectorAll('.app'); var getRandom = function () { var opts = [60, 80, 100, 120, 160, 300]; var random = Math.floor(Math.random() * opts.length); return opts[random] } var getImageUrl = function (n) { return `https://fakeimg.pl/${getRandom()}x${getRandom()}?text=${n}`; } var re...
true
fe17afc0aee1f3cd188090cf1a210beb02e3b2fe
JavaScript
hanainibin/business-brigade
/util/lobal.js
UTF-8
1,580
3.3125
3
[]
no_license
export function pad (num, n, flag) { return Array(n > num.toString().length ? (n - ('' + num).length + 1) : 0).join(flag) + num } /** * date format * @param {*} date Date 对象 * @param {*} str 时间格式字符串 */ export function dateFormat(date, str = "yyyy-MM-dd"){ if ("" === date || null === date || undefined === date...
true
240ecc63ccb10867e675a261b07a66441096bc27
JavaScript
sergeyzwezdin/hexo-related-posts
/lib/text/extractWords.js
UTF-8
374
2.71875
3
[ "MIT" ]
permissive
const removeNonAlphaChars = require('./removeNonAlphaChars'); const extractWords = (source, reservedWords, wordLength) => removeNonAlphaChars(source) .split(' ') .map((word) => word.trim()) .filter((word) => Object.keys(reservedWords).indexOf(word) !== -1 || (word.length >= wordLength && !/...
true
34015a40d7a54e0ff3b0bc15250826adac1b7e23
JavaScript
Sureshkumartv/TechniecodeWebsite
/js/core/main.js
UTF-8
469
2.59375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
var SITE_ROOT = document.location.origin; var PAGE_PATH = document.location.pathname; $(function () { highlight_PageName(); }); function highlight_PageName() { var cnt = 0; $('ul.navigation > li').each(function() { if (PAGE_PATH.indexOf($(this).find('a').attr('href')) != -1) { ...
true
96d7805a694b67b8cc19b1ed99a8df057b5abc5d
JavaScript
DaniRiccardi/movie-react
/src/App.js
UTF-8
738
2.546875
3
[]
no_license
import logo from "./logo.svg"; import "./App.css"; import { useState, useEffect } from "react"; import Header from "./components/Header"; import Frase from "./components/Frase"; // <img src={logo} className="App-logo" alt="logo" /> function App() { const [frase, guardarFrase] = useState({}); const consultarApi ...
true
c3ab105adc7c05a86ae3cedda334523d433a1866
JavaScript
AbdallahAbuKhurma/todo-app
/src/components/Login/Signup.jsx
UTF-8
1,786
2.59375
3
[ "MIT" ]
permissive
import React, { useState, useContext } from 'react'; import { useHistory } from 'react-router-dom'; import { AuthContext } from '../../context/auth/context'; function Signup() { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [role, setRole] = useState('user'); ...
true
f75d3d4e623e0ff583a9e3e16f02d50c614cb488
JavaScript
Audrav07/Week-7-Train
/assets/javascript/app2.js
UTF-8
6,087
2.796875
3
[]
no_license
var config = { apiKey: "AIzaSyBFe5pf-EIoVc2Q8DM1Bp07-k6wAY0FqTA", authDomain: "train-scheduler-bec06.firebaseapp.com", databaseURL: "https://train-scheduler-bec06.firebaseio.com", storageBucket: "train-scheduler-bec06.appspot.com", messagingSenderId: "539406827719" }; firebase.initializeApp...
true
bcd19acd7697cbb90ddf516be25854e44e2ce0bc
JavaScript
DevinHarris/photira
/src/components/Photira.js
UTF-8
2,191
2.640625
3
[]
no_license
import React from 'react'; import Header from './Header'; import AddPhoto from './AddPhoto'; import Gallery from './Gallery'; import Fullscale from './Fullscale'; class Photira extends React.Component { state = { message: 'Welcome to Photira', photos: [], displaySrc: '' } ...
true
ab26d4e389f61c0f2e3efd806e322f8c9602b9c5
JavaScript
nlevchuk/url_shortener
/frontend/src/urls.js
UTF-8
331
2.625
3
[ "MIT" ]
permissive
const isUrlValid = (url) => { const regex = new RegExp(/^((http|https|ftp):\/\/)?\S+\.[a-zA-Z]{2,5}$/); return url.match(regex) ? true : false; } const prepareUrl = (url) => { const regex = new RegExp(/^((http|https|ftp):\/\/)\.*/); return url.match(regex) ? url : ('http://' + url); } export { isUrlValid, pre...
true
48a9c71ba8aae52da2ae7f29cb2c901206286a9e
JavaScript
Mastel22/weather-app
/src/components/navbar.js
UTF-8
1,678
2.578125
3
[ "MIT" ]
permissive
import React from 'react'; import './navbar.css'; import { logo} from '../assets/images'; export default class NavSearch extends React.Component { constructor (props){ super(props); this.state = { matching: [], text: '', }; } onTextChanged = (m) => { ...
true
649ccaf8b60ba9a7d54581311b963ca2780e6ee8
JavaScript
poppinlp/leetcode
/code/20.js
UTF-8
285
3.171875
3
[ "MIT" ]
permissive
const map = { "(": ")", "[": "]", "{": "}" }; const isValid = (s) => { if (s.length & 1) return false; const stack = []; for (const char of s) { if (!map[char] && map[stack.pop()] !== char) return false; map[char] && stack.push(char); } return stack.length === 0; };
true
ab1f2bf19a167485df9f4d21faed4d96b9ad930c
JavaScript
thinkful-ei-quail/DSA-Sorting-Nicoco-V
/sort-linkedlist.js
UTF-8
3,068
3.703125
4
[]
no_license
const LinkedList = require('./LinkedList'); const linkedList = new LinkedList(); linkedList.insertLast(5); linkedList.insertLast(8); linkedList.insertLast(7); linkedList.insertLast(3); linkedList.insertLast(1); linkedList.insertLast(0); linkedList.insertLast(9); linkedList.insertLast(23); linkedList.insertLast(5); lin...
true
505b3023486f3583eb7e28e99580f6e8b347073f
JavaScript
luck5656/gitdemo
/abc.js
UTF-8
491
2.84375
3
[]
no_license
#!/usr/bin/env node let fs=require("fs"); //IFFI (function(){ let n=process.argv[2]; let name=process.argv[3] if(!Number.isInteger(+n)||typeof name!="string" || n<=0){ console.log("invalid input"); return; } //if same name file exist then delete it if(fs.existsSync(`${name}-0`)){ for(let i=0;i<n;i++){ ...
true
c93ba453075fcf6dfe51d4976a4c2a4e69556980
JavaScript
gepeng820/nodestudy
/10.express/1.http.js
UTF-8
1,245
3.328125
3
[]
no_license
/*用原生和http模块实现路由 根据客户端请求的方法和路径不同返回不同的内容 *GET /signup 注册 *GET /signin 登陆 * */ //引入http模块, let http=require('http'); //创建一个http服务器,参数是一个请求监听函数,当服务器收到客户端的请求的时候会执行此监听函数 //req=请求对象 res=响应对象 //乱码的原因是编辑器的编码(utf-8)和浏览器的的编码(GBK)不一样 //1.业务全部放在一个函数里会导致此函数过于庞大 //2.以后重构起来的风险比较大 http.createServer(function (req,res) { //获取本次请求的方...
true
7a2f3d56717b87dd06b073ac4f89cefd70b76a93
JavaScript
wei3hua2/awesome-iohk-papers
/sourcecode/index.js
UTF-8
2,964
2.625
3
[]
no_license
const _ = require("lodash"); const fs = require("fs"); const dayjs = require("dayjs"); const { reverse } = require("lodash"); const getYear = (dateStr) => dayjs(dateStr).year(); // https://iohk.io/page-data/en/research/library/page-data.json const readPapers = () => JSON.parse(fs.readFileSync("./data/papers.json","...
true
a7b442907d87c294875e75c656053e7fd812c3fb
JavaScript
Yosefc/Movie-Info
/API_Routes/routes.js
UTF-8
1,827
2.65625
3
[ "MIT" ]
permissive
const express = require("express"); const axios = require("axios"); const router = express.Router(); const API_KEY = process.env.OMDB_API_KEY; router.get("/movies/current_year", async (req, res) => { const titles = [ "one", "blood", "private", "eye", "star", "red", "bad", "dead", ...
true
b25f05f4a706263c766c299fecfa039056b3a839
JavaScript
kayjayhogan/hrla29-react-review
/client/Components/App.jsx
UTF-8
1,283
3.1875
3
[]
no_license
import React from 'react'; import List from './List.jsx' // var App = (props) => ( // <div>Hello from {props.first} {props.last}</div> // ); class App extends React.Component { constructor(props) { super(props); this.state = { firstName: 'React', lastName: '' }; this.handleFirstChange...
true
e28a35df0fb7364f29554419ab6c8162ee04556e
JavaScript
WildCodeSchool/Lyon-0917-HappySens
/web/assets/script/ajax/testAjax.js
UTF-8
1,399
2.609375
3
[]
no_license
let el = document.getElementById("test"); let link = '{{ project.slug }}'; el.addEventListener("click", function( ) { swal({ title: "Vous allez rejoindre l'équipe du projet, en êtes vous sur ?", icon: "warning", buttons: { cancel: "Annuler", joinTeam: { ...
true
44a46002e8e22bbd6938a36a0c3f3ed09b505456
JavaScript
alina80/JavaScript-Evercises
/1_Exercises/Day_1/6_Advanced_functions/js/exercise02.js
UTF-8
884
4.34375
4
[]
no_license
/** * Nesting functions. * Study all the lines of code one by one. All of them! * Try to write a comment for each line. */ //Your comment... function one() { //Your comment...variable1 is declared inside function one var variable1 = 1; //Your comment... function two() { //Your comment.....
true
c5d44eafd4643874119dd624125a8db1a6c3b81a
JavaScript
msqart/Projects
/visa/src/js/modules/tabs.js
UTF-8
1,119
2.546875
3
[]
no_license
module.exports = (tabs) => { const tabsBtn = tabs.querySelectorAll('.tabs .tab_btn'); const tabsElem = tabs.querySelectorAll('.tabs_body .content_box'); const tabsBody = tabs.querySelector('.tabs_body'); const getHeight = require('./functions/getHeight'); let startElem = 0, startHeight = 0; for...
true
76a1abf99858e93cf2aa85c7c7b08f4d15ba9a4a
JavaScript
Deepali2/YelpCamp
/seeds.js
UTF-8
1,903
2.546875
3
[]
no_license
const mongoose = require("mongoose"); const Campground = require("./models/campground"); const loremIpsum = require("lorem-ipsum"); const Comment = require("./models/comment"); const data =[ { name: "Crystal Cove State Park", image: "https://img.hipcamp.com/images/c_fill,f_auto,g_auto,h_504,q_60,w_770/v15062...
true
d6604b9c3b734b2179fb03860dbb2a26a6cb5818
JavaScript
lufylegend/lufylegend.js
/examples/demo/RunningGirl/js/SoundPlayer.js
UTF-8
3,276
2.734375
3
[ "MIT" ]
permissive
/** * @author lufy */ function SoundPlayer(){ var self = this; self.loadIndex = 0; self.background = new LSound(); self.background.parent = self; //如果IOS环境,并且不支持WebAudio,则没有预先读取的音频 if(LGlobal.ios && !LSound.webAudioEnabled){ return; } //如果没有预先读取的音频 if(!dataList["sound_background"]){ return; } self.back...
true
b4f9e913cd9b9a282b1d10c409be0bc3a9a68ac9
JavaScript
iwanikhalid/ainActivity
/activity3.js
UTF-8
2,168
2.703125
3
[]
no_license
$(document).ready(function() { var answers = ["Berehat", "keluarga", "membaca", "menonton", "tetamu", "berbincang", "selera", "istirehat", "tamu", "penyediaan", "penyimpanan", "Menyimpan", "pembersihan", "penyelenggaraan", "meletak", "Dapur", "Garaj", "berehat", "menyimpan", "Membersih", "mengemas", "tidur", "mandi"...
true
d81db7920acc8ddd15c6f3589cd1afa7d0636a9b
JavaScript
alexking/dry-land
/game/app/js/main.js
UTF-8
15,661
2.828125
3
[ "MIT" ]
permissive
var debug = false; var debugConsole = false; var hardness = 8; var fishBeforeLevel2 = hardness * 1; var fishBeforeLevel3 = hardness * 2; var volume = 0.4; window.onload = function() { // Play some music var context = new AudioContext(); var out = new WebAudiox.LineOut(context); out.volume = volume; va...
true
7fff95af4f82a5a424b6507f6fa6587266ee67d0
JavaScript
Mekabita/todoapp
/src/App.js
UTF-8
4,332
2.90625
3
[]
no_license
import React from 'react'; import TodoForm from './components/TodoForm'; import TodoList from './components/TodoList'; import TodoSearch from './components/TodoSearch'; import './css/App.css'; import '@fortawesome/fontawesome-free/css/all.css' class App extends React.Component { constructor(props) { super(...
true
940d9564ae373e0d4b483ad86e3bc222c9d77edf
JavaScript
asiikaluoma/product-event-counter-demo
/lambda.js
UTF-8
622
2.53125
3
[]
no_license
require('dotenv').config() const mysql = require( 'mysql' ); exports.handler = function(event, callback){ let connection = mysql.createConnection({ host : process.env.DBHost, user : process.env.DBUser, password : process.env.DBPassword, database : process.env.DBName, port : process.env.DB...
true
b78a062949b69a299891d342915608a19614537d
JavaScript
mpetrakis13/LA6-Michael-Petrakis.appstudio
/forms/membership/membership.js
UTF-8
427
2.765625
3
[]
no_license
let members = ["Mary","Sam","Joey","Paul","Mike","Char","Jenny","Kennedy","Kaden","Kurt","Anne"] let names = "" btnName.onclick=function(){ names = inptName.value if (members.includes(names)) { lblName.value = names + ", you are already a member." } else { members.push(names) lblName.value = names + ", you...
true
e8669cc5a57567dd891fd948d7ba12d047df8a27
JavaScript
rexrana/pdfjs-viewer-shortcode
/vendor/htmlburger/carbon-fields/packages/core/store/reducer.js
UTF-8
1,258
2.734375
3
[ "Apache-2.0", "GPL-2.0-only", "GPL-2.0-or-later" ]
permissive
/** * External dependencies. */ import { combineReducers } from '@wordpress/data'; import { omit, without } from 'lodash'; /** * The reducer that keeps track of the field's validation status. * * @param {Object} state * @param {Object} action * @return {Object} */ export function validation( state = {}, acti...
true
5e28928334a683f23e109fdc680b8058dbdee1dc
JavaScript
step-batch-7/geometry-anil-muraleedharan
/test/rectangleTest.js
UTF-8
3,970
3.359375
3
[]
no_license
const Rectangle = require('../src/rectangle'); const Point = require('../src/point'); const { strictEqual, deepStrictEqual, isOk, isNotOk } = require('chai').assert; describe('Rectangle', function() { describe('toString', function() { it('should give a proper representation of a rectangle', function() { c...
true
24b67619f8be3e47f9e6b2f26c41ddb4ef71d666
JavaScript
qwop/userscript
/monolith/26/432975.user.js
UTF-8
4,018
2.6875
3
[]
no_license
// ==UserScript== // @name YouTube - New video checker // @namespace http://userscripts.org/scripts/show/432975 // @include https://www.youtube.com/feed/subscriptions // @version 1.0.3 // @grant none // ==/UserScript== // Helpers Element.prototype.closestByClassName = function(className...
true
980164c1458542d267141995ccfbdf39937d3d22
JavaScript
muricans/rolesbot
/commands.js
UTF-8
1,156
2.671875
3
[ "MIT" ]
permissive
const { prefix, } = require('./settings.json'); module.exports.register = (client) => { client.on('message', message => { if (message.content.indexOf(prefix) !== 0) return; const args = message.content.slice(prefix.length).split(' '); const command = client.commands.get(args.shift().toL...
true
8ae4012d6a3404b5a80c746ecb76358afa2f57e2
JavaScript
mosqueradvd/wacommerce
/src/components/Register.js
UTF-8
1,934
2.5625
3
[]
no_license
import React, { useState } from "react"; // import firebase from '../firebase' import firebase from 'firebase' require('firebase/auth') const Register = (props) => { const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); return ( <form o...
true
c21a27e6d12284416aac318c79a77f4db975b839
JavaScript
SkylarMark/IndianStates
/index.js
UTF-8
2,024
3.125
3
[]
no_license
const xlsx = require('node-xlsx'); const firebase = require("firebase/app"); const firestore = require("firebase/firestore"); var firebaseConfig = { // YOUR FIREBASE CONFIG }; // Initialize Firebase firebase.initializeApp(firebaseConfig); const db = firebase.firestore(); var obj = xlsx.parse('./Indian-States-and-...
true
a212c9d62a27eba7621b056e459eeac070dce6d9
JavaScript
laithalenooz/OCA-projects
/Project2-Dynamic Website/code/javascript/homepage.js
UTF-8
560
2.984375
3
[]
no_license
function changeColor() { var color = document.getElementById("color").value; document.getElementById("one").style.backgroundColor = color; } var changeFontStyle = function (font) { document.getElementById("text").style.fontFamily = font.value; } var onsize = function (font) { document.getElementById...
true
dc4a2fc46f796fb34d6a2870a097f58007f097e8
JavaScript
blainelawson/squeeky-wheel-frontend
/src/actions/fetchIssues.js
UTF-8
1,267
2.875
3
[]
no_license
// synchronous actions export function setIssues(issues) { return { type: 'SET_ISSUES', payload: issues } } export function setUserIssues(issues) { return { type: 'SET_USER_ISSUES', payload: issues } } // async actions export function fetchIssues(){ return (di...
true
2de7d4995256428c26819d29f1e65edc4efe5ece
JavaScript
gaurav-verma-au3/attainu
/coding-challenges/week26/day03/index.js
UTF-8
636
3.5625
4
[]
no_license
const accum = s => { s = s.toLowerCase(); let result = ""; for (i = 0; i < s.length; i++) { let char = s[i]; if (result.length > 0) result += "-"; for (j = 0; j < i + 1; j++) { if (result.length > 0) { if (result[result.length - 1].toLowerCase() != char.toLowerCase()) ...
true
7d3f6bf5aa14f50f8018873328dc41d18785d7a8
JavaScript
Lordnibbler/colorpicker-legacy
/static/scripts/models/color.js
UTF-8
511
2.59375
3
[]
no_license
var app = app || {}; $(function() { "use strict"; app.Color = Backbone.Model.extend({ defaults: { h: 0, s: 0, l: 0 }, /** * Returns a manipulable color object */ getColor: function() { return Color({ h: this.get("h"), s: this.get("s"), l: ...
true
fd0f45789f9cee4cbd11403a494008dc43b5bd20
JavaScript
WuSeHunxi/School
/node/12.11/模块系统/main.js
UTF-8
182
3.03125
3
[]
no_license
//加载 var ret = require("./foo"); // console.log(ret.foo);//得到的是一个对象 // console.log(ret(1, 2)); //-->bar console.log(ret); //此时得到的是一个对象
true
6243361f2c407081f1d9b313d55ac7da71c952b3
JavaScript
didymus707/Arcade-game-master
/js/app.js
UTF-8
4,099
3.859375
4
[]
no_license
// Enemies our player must avoid var Enemy = function(x, y) { this.x = x; this.y = y; this.length = 101; this.height = 45; this.width = 95; this.sprite = 'images/enemy-bug.png'; }; // Update the enemy's position, required method for game // Parameter: dt, a time delta between ticks Enemy.prot...
true
df84957081245c5bf2622b3903afc44e8e405086
JavaScript
kevinzamperetti/feedback-dbc
/frontend/src/Untitled-1.jsx
UTF-8
2,473
2.625
3
[]
no_license
import React, { Component } from 'react'; import api from '../../services/api' import '../geral-detalhes.css' export default class Elfo extends Component { constructor(props){ super(props) this.state = { nome: '', status: 'RECEM_CRIADO', qtdVida: '', ...
true
627ad5f555e377b3e0d2d110b34fbf6410b92a06
JavaScript
kaurk/Weather-App
/src/index.js
UTF-8
5,303
3.3125
3
[]
no_license
function formatDate(timestamp) { let currentDate = new Date(timestamp); let date = currentDate.getDate(); let days = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", ]; let day = days[currentDate.getDay()]; let months = [ "Jan", ...
true
90be700c603cdcf40ac5c639f4732f52e657bf88
JavaScript
ozcankursun/Project1
/server.js
UTF-8
1,526
2.53125
3
[]
no_license
var http = require("http"); var url = require("url"); const { Client } = require("pg"); const fs = require("fs"); http.createServer(function (request, response) { var parsedUrl = url.parse(request.url, true); attendees = [ {"engin":"ali","ahmet":"veli"} ] const client = new Client({ ...
true
7dcf7e4842a397abf86760fe29ffe7c71c6e017a
JavaScript
lnx1337/intangible-node
/app/test/testApiMocha.js
UTF-8
14,583
2.921875
3
[]
no_license
//This file contains tests done to the API users sending requests GET POST PUT //DELETE and verify success and error messages //so manually running this //script is using mocha //$ mocha testApiMocha.js --reporter nyan --timeout 5000 var should = require('chai').should(); var supertest = require('supertest'); var a...
true
54ed7ce9d5f8b09b05715fac86f5ea5ee0ac2a17
JavaScript
ktodoran/Daily-Planner
/assets/script.js
UTF-8
3,410
3.4375
3
[]
no_license
// Variable to store and loop through the Scheduler var theDay = [ {id: "0", hour: "09", time: "09", meridiem: "am", reminder: ""}, {id: "1", hour: "10", time: "10", meridiem: "am", reminder: ""}, {id: "2", hour: "11", time: "11", meridiem: "am"...
true
ee87f9190db8a9c794196852f201d9afd66c4aea
JavaScript
egonelbre/jstricks
/slide_code/debug.js
UTF-8
1,631
4
4
[]
no_license
myFunction = function(a,b,c){ b = a * c + b; return a + b + c; } // and when we start debugging myFunction = function(a,b,c){ console.log("enter:", a,b,c); b = a * c + b; r = a + b + c; console.log("exit:",a,b,c, "res:",r); return r; } debug = function(fun, name){ return function(a,b,c){ ...
true
b19efdc63ab6df07129e9f96b44657b7cb9959ae
JavaScript
Trolent/DECRYPTOR3001
/decryptor.js
UTF-8
3,766
3.28125
3
[]
no_license
let alphabet01 = 'UdZ7FvkX1fmqx@hSs3wJip09IQaNPDHn!$M6gVAtTeoB?O8W4j2GEYruRybcLK5_Clz' let alphabet02 = '?tBGbfkLel_jqKWhNY4ZSIH7TFc!uaxX3vn628dzEUP9Cw@DgoryR05Mis1Op$QJAmV' let alphabet03 = 'Y!ON7BADZhGXbskgaK_WT1w5QVq2CEyrv3zRLJjm9neUStlIducMpiF80$4?HxP6@fo' Number.prototype.mod = function(n) { return ((this%n)+...
true
0da4b486ca65937958ca4714e64b7a3da52f94e1
JavaScript
CodigoTec/MaterialCodigo
/SEMANA-CINCO/es6-clases/6.Destructuring/app.js
UTF-8
347
3.4375
3
[]
no_license
//Mostrar los valores cada uno de las propiedades. const peliculas = { id:1, nombre: "El sexto sentido", director: "M. Night Shyamalan", clasificacion: "Drama" } let {id,nombre,director,clasificacion} = peliculas //Rest //Mostrar informacion // (...datos) const persona = (...datos)=>{ ...
true
1aabc0def825429e1d9cf3991c19948db3b3a161
JavaScript
Utkarshbhimte/Devmash-CatGame
/js/script.js
UTF-8
423
2.578125
3
[]
no_license
$(document).ready(function() { var height = $('#pic-wrap').height(); var width = $('#pic-wrap').width(); console.log(height, width); $('#pic-wrap').on('mouseover', function(event) { $('#pic-wrap').css({ 'left': Math.random() * (90) + '%', 'top': Math.random() * (80) + '%' })...
true
27dbae428462616c5aedd1e6796ec19468de73a4
JavaScript
matthi01/algorithms
/algorithms/meanMedianMode/meanMedianMode.js
UTF-8
1,148
3.578125
4
[]
no_license
// mean Median Mode const getMean = numArr => { let sum = 0; numArr.forEach(num => { sum += num; }); return sum / numArr.length; }; const getMedian = numArr => { numArr.sort(); let median; if (numArr.length % 2 === 0) { let mid1 = numArr[numArr.length / 2 - 1]; le...
true
0b2dc6bc68fa290c0fc85cdd8f7d89f9152984e5
JavaScript
itoumlilt/L3_PACS
/TME09/devine.js
UTF-8
640
3.140625
3
[]
no_license
// Voir devine2.html pour le test. nbadeviner = 0; delai = 10000; function init() { nbadeviner = Math.floor(Math.random() * 10) + 1; d = setTimeout("termine()", delai); } function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function controle(inp) { var str = (!isNumeric(inp.value)) ? "...
true
883e51c442a4c380b1aa3c6aa9809c41c860c937
JavaScript
JakeEU/pandora
/commands-p.info.js
UTF-8
629
2.578125
3
[]
no_license
const Discord = require ('discord.js') module.exports.run = (client, message, args) => { let user = message.mentions.users.first(); const uinfo = new Discord.RichEmbed() .setColor(0xffa5f1) .setAuthor(`Essential information for ${user.username}`, user.displayAvatarURL) .setImage(user.displayAvatarUR...
true
fa0805c5956470026778664026d2a168004c8ada
JavaScript
meghatelang/leetcode-problems
/middle-of-the-linked-list.js
UTF-8
526
3.46875
3
[]
no_license
/** * Definition for singly-linked list. * function ListNode(val, next) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } */ /** * @param {ListNode} head * @return {ListNode} */ var middleNode = function(head) { let current = head, count = 1; ...
true
c736382d25287e0be2ee732ce91ca20e3ba5432b
JavaScript
jordan-huitema/Lab-2
/index.js
UTF-8
593
4.6875
5
[ "MIT" ]
permissive
//Write a block of code that takes numbers and console log the sum of its cubes. let power = 3; //creating and asigning the power var, I have made this a variable so it can be easily changed let cube1 = 1**power; //creaating and calculating the 1st cubed var let cube2 = 5**power; //2nd cubed var let cube3 ...
true
35e8eaebd587795be828dc45699cb42a5c32b4ce
JavaScript
kainlite/comments
/configs.js
UTF-8
1,221
2.703125
3
[ "MIT" ]
permissive
var inputs = document.querySelectorAll('input'), i, data = {Config: {}}, saveConfig = function(data) { chrome.storage.sync.set(data, function() { var _status = document.getElementById('status'); _status.textContent = 'Options saved.'; setTimeout(function() { ...
true
77f98a940fca1b45e63dd0ce626570a9eea9040f
JavaScript
jiahuang/n1-octopart-plugin
/lib/octopart-sidebar.jsx
UTF-8
3,261
2.546875
3
[]
no_license
import { React, FocusedContactsStore, } from 'nylas-exports'; import OctopartStore from "./octopart-store"; export default class OctopartSidebar extends React.Component { static displayName = 'OctopartSidebar'; // This sidebar component listens to the FocusedContactStore, // which gives us access to the Co...
true
594948e82da90900d272fd71a258c0bc81ff3b90
JavaScript
Duangkamol-AI/Homework_codecamp_4_
/Week 1/Week 1 - HTML+CSS+JavaScript(data structure)/ข้อ 11/11.js
UTF-8
268
3.5625
4
[]
no_license
var array = [0,9,1,8,2,7,3,6,4,5] for(i=0;i<(array.length -1);i++){ for(j=0;j<array.length -i;j++){ if(array[j] < array[j+1]){ swap = array[j] array[j] = array[j+1] array[j+1]= swap } } } console.log(array);
true
58a09678c33701512f07d18015c9a7fb951374aa
JavaScript
nicoleshasha/javascript_fizzbuzz
/jasmine/spec/fizzBuzzSpec.js
UTF-8
949
3.203125
3
[ "MIT" ]
permissive
describe("fizzBuzz", function() { var fizzBuzz; describe('knows when a number is', function(){ it('divisible by 3', function(){ fizzBuzz = new FizzBuzz(); expect(fizzBuzz.isDivisibleByThree(3)).toBe(true); }); it('not divisible by 3', function(){ fizzBuzz = new FizzBuzz(); expe...
true
168f7173bea6531dcd0ee9bba4fee6d88816370d
JavaScript
lalalaura/calculator
/scripts.js
UTF-8
898
3.6875
4
[]
no_license
document.getElementById('calculeaza').onclick = function() { calculator(); }; function calculator() { var x_val = document.getElementById('x').value.trim(); var y_val = document.getElementById('y').value.trim(); var operatie_val = document.getElementById('operatie').value; if (x_val.length =...
true
5cf28795f1657417027f92c73eb3054487e0c700
JavaScript
devbytyler/practice
/exercism/javascript/hamming/hamming.js
UTF-8
431
3.5
4
[]
no_license
// complete on May 9, 2017 Hamming = function() {}; counter = function(str1, str2) { var diff = 0; for (var i = 0; i <= str1.length - 1; i++) { if (str1[i] !== str2[i]) { diff ++; } } return diff; }; Hamming.prototype.compute = function(dna1, dna2) { if (dna1.length !== dna2.length) throw...
true
e70e09758ffc1711fc186cfeb548772aafa27853
JavaScript
miabueno/intro-node
/index.js
UTF-8
296
2.703125
3
[]
no_license
const sh = require('superheroes'); const sv = require('supervillains'); //console.log("There are " + sh.all.length + " superhero names"); //console.log("There are " + sv.all.length + " supervillain names"); console.log("Superhero: " + sh.random()); console.log("Supervillain: " + sv.random());
true
42d242eb0b78f18937aafab4936808e69c8a33cd
JavaScript
JakeShelterwin/js-jq-grigliaquadrati
/main.js
UTF-8
4,986
3.296875
3
[]
no_license
// Creare in JAVASCRIPT una griglia formata da 8x8 rettangolini tutti vuoti. // 15 di questi rettangolini (scelti a caso dal programma) se cliccati mostrano dei fiori, gli altri saranno il prato che li circonda. In alto alla griglia creata ci sono i contatori col numero di caselle con fiori cliccate e il numero di case...
true
9032e577b5f03a2e5a44b895ca9e1cd25ec6f862
JavaScript
guanqing123/demo-wx
/demo-wx/src/main/resources/static/js/utils/sort.js
UTF-8
8,223
2.703125
3
[]
no_license
var sort = (function () { function init(citys, callback) { var Initials = $('.initials ul'); var SortBox = $(".sort_box ul"); Initials.html(""); SortBox.html("").removeClass("no-city-ul"); if (citys.length == 0) { SortBox.html("<li class='no-city'>无结果</li>"); ...
true
165d544f71254d6a62956f071ba6414ca88c9238
JavaScript
luizrosalba/IntroReactJs
/lesson-01/configuration/src/index.js
UTF-8
341
2.59375
3
[ "MIT" ]
permissive
import React from "react" import ReactDOM from "react-dom" import "./styles.css" const App = () => { return ( <div className="App"> Hello World </div> ) } const rootElement = document.getElementById("root") /// pega o elemento root criado no public ReactDOM.render(<App />, rootElement) /// execu...
true
fe4e5787dba2335e650e85f54d798b73a5ca418e
JavaScript
upisfree/education-raytracer
/src/gl.js
UTF-8
613
2.796875
3
[]
no_license
import Vector3 from './vector3.js'; import Color from './color.js'; const gl = { putPixel: function(v, c) { let i = (v.y * this.canvas.width + v.x) * 4; this.buffer.data[i] = c.r; this.buffer.data[i + 1] = c.g; this.buffer.data[i + 2] = c.b; this.buffer.data[i + 3] = c.a; }, render: fun...
true
b025e7fda37a93f336125117ee9c8379881f8a4b
JavaScript
Victorsloop/Facebock-Frontend
/src/Components/AddPost.js
UTF-8
2,375
2.625
3
[]
no_license
import React, { Component } from 'react' import {connect} from 'react-redux' import {addPosts} from '../Redux/actions' import './Stylesheet.css' class AddPost extends Component{ state = { content: "", img_url: "", wall_id: null } componentDidMount(){ this.setState({wall_...
true
8acdd5bef0f676ee7ced3b47d4f1871c8081cea9
JavaScript
MermaidMode/wk9HW
/sketch.js
UTF-8
885
2.9375
3
[]
no_license
var x = 0; var y = 0; function setup() { createCanvas(800, 800); } function draw() { background(0, 195, 255); noStroke(0); //hairback fill(61, 36, 4); rect(200, 50, 400, 700); // body fill(175, 86, 101); rect(225, 600, 350, 400); // neck fill(201, 190, 175); rect(350, 450, 100, 150); // face ...
true
a38ce30e89189f0aff85f2bd42d1d25d571e2b2d
JavaScript
JiguBigu/FTP-Cloud-NetworkDisk
/web/js/test.js
UTF-8
1,410
2.796875
3
[]
no_license
function getFilePath() { $("input[type='file']").on('change', function () { var oFReader = new FileReader(); var file = document.getElementById('xFile').files[0]; oFReader.readAsDataURL(file); oFReader.onloadend = function(oFRevent){ var src = oFRevent.target.result; ...
true
3c7e955925d50fe56b5479cb5a9d356ce55cd521
JavaScript
daveschafer/hslu-hs19-weblab
/Day03/Javascript/Ex05/classes/classes.test.js
UTF-8
287
2.96875
3
[ "MIT" ]
permissive
const Person = require('./classes'); let outputData = ""; storeLog = inputs => (outputData += inputs); console["log"] = jest.fn(storeLog); test('should say hello', () => { let person = new Person('Patrick'); person.sayHello(); expect(outputData).toBe('Hello Patrick'); });
true
accafa2eaed264e65db6369d4ebb6d5876d47a5e
JavaScript
ramonfritsch/leetcode
/solutions/121-best-time-to-buy-and-sell-stock/index.js
UTF-8
474
3.453125
3
[ "MIT" ]
permissive
/** * @param {number[]} prices * @return {number} */ var maxProfit = function(prices) { if (!prices || !prices.length) { return 0; } var min = prices[0]; var max = prices[0]; var maxProfit = 0; for (var i = 1, l = prices.length; i < l; i++) { if (prices[i] < min) { min = prices[i]; max = min; } e...
true
224418aa9c8896a4972c6f508c9b272c5a4bb96d
JavaScript
kskiran2906/Capitals-App
/src/components/Capitals/index.js
UTF-8
1,846
2.921875
3
[]
no_license
import {Component} from 'react' import './index.css' const countryAndCapitalsList = [ { id: 'NEW_DELHI', capitalDisplayText: 'New Delhi', country: 'India', }, { id: 'LONDON', capitalDisplayText: 'London', country: 'United Kingdom', }, { id: 'PARIS', capitalDisplayText: 'Paris'...
true
4c20048970c1b1a6dbf0ba51c4bbd78e9989182a
JavaScript
Anikkhan-web/api-practice
/api.js
UTF-8
2,316
3.234375
3
[]
no_license
// function loadData(){ // fetch('https://jsonplaceholder.typicode.com/todos/1') // .then(res => res.json()) // .then(data => console.log(data)) // } // function loadUser(){ // fetch('https://jsonplaceholder.typicode.com/users') // .then(res => res.json()) // .then(data => displayUsers(data)) // } // fu...
true
f2d4304172bf669081a429053eac45c1bd10c630
JavaScript
douglasbrgs/rocketseat-discover
/javascript/contaCaracteres.js
UTF-8
111
3.03125
3
[]
no_license
let word = 'Paralelepipedo'; console.log(word.length); let number = 1234; console.log(String(number).length);
true
2d641f1af03d23693576f0c5d3db68a4538b92c5
JavaScript
DHsustainer/ishotdog
/index.js
UTF-8
856
2.765625
3
[ "LicenseRef-scancode-unknown-license-reference", "ISC" ]
permissive
const vision = require("@google-cloud/vision") /* * * @param {object} [GCKeyFile] - The Google Cloud API configuration object. * @param {string} [projectId] - Google Cloud project ID. * @param {string} [image] - Image URL * */ const notHotDog = async (GCKeyFile, projectId, image) => { const labelList = [] const c...
true
6f3a1496eb57e99936d160244999ecba7b2e6dbe
JavaScript
DmitriyS87/test-august-2021
/src/store/product/monthStats/monthStats.js
UTF-8
2,882
2.515625
3
[]
no_license
import { action, computed, makeObservable, observable, toJS } from "mobx" import { ProductStats } from "../../../core/api/product"; import { ProductPropertiesConstant } from "../../../constants/product"; const graphProppertyNames = [ ProductPropertiesConstant.MoneySales, ProductPropertiesConstant.CountSales, ...
true
d9816ebfb7ea69b7064fd797f4a1deef2bae9721
JavaScript
dcastaneda82/Sprint-Challenge-React-Wars
/starwars/src/components/StarWarsData.js
UTF-8
3,569
2.96875
3
[]
no_license
import React, { useEffect, useState } from "react"; import axios from "axios"; import StarWarsCards from "./StarWarsCards.js"; import "./StarWars.css"; // export default function StarWarsData() { // const [side, setSide] = useState([]); // const [character, setCharacter ] = useState([]); // useE...
true
69c4c56c6127e85391ec0de47d2d6ec210f8ed6d
JavaScript
deepakmishra21/javascript
/zigzag.js
UTF-8
997
3.46875
3
[]
no_license
/** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val===undefined ? 0 : val) * this.left = (left===undefined ? null : left) * this.right = (right===undefined ? null : right) * } */ /** * @param {TreeNode} root * @return {number[][]} */ var zigzagLevelOr...
true
4b3f845b9d95b7a2e8c3bee8e6d65015dbcdf4e4
JavaScript
markbayley/visualdata
/src/charts/Bar.js
UTF-8
2,229
2.8125
3
[]
no_license
import React, { useEffect, useRef } from "react"; import * as d3 from "d3"; import styled from "styled-components"; import chartData from "../data/barData.csv"; const Canvas = styled.div` display: grid; place-items: center; rect { fill: yellowgreen; &:hover { fill: green; transition: all 0.2s...
true
722bde501ef69ace09b398729c05db29bc07bd1d
JavaScript
Wayne-Bai/AST-normalize
/data/tutao/tutanota/web/js/generated/entity/tutanota/FileDataReturnPost.js
UTF-8
2,805
2.578125
3
[]
no_license
"use strict"; tutao.provide('tutao.entity.tutanota.FileDataReturnPost'); /** * @constructor * @param {Object=} data The json data to store in this entity. */ tutao.entity.tutanota.FileDataReturnPost = function(data) { if (data) { this.updateData(data); } else { this.__format = "0"; this._fileData =...
true
ca96bc98eaf4c41652d81973de340cd5c14317c9
JavaScript
tarling/potato-flickr
/dev/js/data-service.js
UTF-8
1,549
2.515625
3
[]
no_license
define(['./app', './constants'],function(app, constants){ app.factory(constants.dataService, ['$http', '$sce', '$q', '$timeout', '$rootScope', function($http, $sce, $q, $timeout, $rootScope){ var items; return { getData:function(){ if (items) { ...
true
225b90905d8e3027d399d6eaa5402a1743a5a823
JavaScript
lojack636/js-algorithm
/5_LeetCode每日一题_持续更新/327. 区间和的个数.js
UTF-8
696
3.140625
3
[]
no_license
function countRangeSum(nums, lower, upper) { let sum = 0 let len = nums.length; if (len == 0) return 0 let prefix = new Array(len) prefix[0] = nums[0]; if (nums[0] >= lower && nums[0] <= upper) sum++ // 累加和 for (i=1;i<len;i++) { prefix[i] = prefix[i - 1] + num...
true