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
fa11933d86032f73c6e1efea42bd122365050fc7
JavaScript
jazzqi/rosbag.js
/src/MessageWriter.test.js
UTF-8
14,544
2.546875
3
[ "Apache-2.0" ]
permissive
// Copyright (c) 2018-present, Cruise LLC // This source code is licensed under the Apache License, Version 2.0, // found in the LICENSE file in the root directory of this source tree. // You may not use this file except in compliance with the License. // @flow import { MessageReader } from "./MessageReader"; import...
true
0dcdb5ce84b0381bf3bafe90cd5362d5400624b9
JavaScript
MagnaChain/MagnaChain-dev-master
/browser/modules/system/assets/ui/js/foundation.element.js
UTF-8
4,670
2.890625
3
[ "MIT" ]
permissive
/* * October JavaScript foundation library. * * Light-weight utility functions for working with DOM elements. The functions * work with elements directly, without jQuery, using the native JavaScript and DOM * features. * * Usage examples: * * $.oc.foundation.element.addClass(myElement, myClass) * */ +functi...
true
629963b958c04c3cdd075d2555689eddb0a0e1f3
JavaScript
scott113341/contour-example
/src/router.js
UTF-8
1,334
2.625
3
[ "MIT" ]
permissive
export function pushState(routes, path, state) { // console.log('pushState', getHashUrl(path, state)); history.pushState(null, '', getHashUrl(path, state)); getHandler(routes, path)(state); } export function replaceState(routes, path, state) { // console.log('replaceState', getHashUrl(path, state)); history...
true
64ee1abb6a4618cde431aa0bf4a6e6374438bca9
JavaScript
psggit/DeliveryPortal
/source/js/views/OrderPage/components/utils.js
UTF-8
117
2.5625
3
[ "MIT" ]
permissive
export function getTimeDiff(d2) { const d1 = new Date() return Math.round( (d1 - new Date(d2)) / 60000 ) }
true
4ee2040294019d4692dabf0b27436361d55c0f32
JavaScript
lucasmaia19/dev-atividade-jogo-uibabel-
/atividade_caixa_ui/src/example/example-http-function.js
UTF-8
1,240
2.703125
3
[]
no_license
import React, { useEffect, useState } from 'react'; import axios from 'axios'; function ExampleHttpFunction() { // const debug = ''; const [count, setCount] = useState(0); const [atividades, setAtividades] = useState([]); useEffect(() => { let mounted = true; axios.get('http://localhost...
true
f1d9729823ed031db703a57de101cef349e3c06e
JavaScript
ccccourse/ws
/07-session/03-blogSignup/app.js
UTF-8
4,633
2.578125
3
[]
no_license
import { Application, Router } from "https://deno.land/x/oak/mod.ts"; import * as render from './render.js' import { DB } from "https://deno.land/x/sqlite/mod.ts"; import { Session } from "https://deno.land/x/oak_sessions/mod.ts"; const db = new DB("blog.db"); db.query("CREATE TABLE IF NOT EXISTS posts (id INTEGER PRI...
true
20f97cbab8f3522ea6daae57d169fa1bf01a8620
JavaScript
JanetHuang-78/loan_calculator
/dist/script.js
UTF-8
3,651
2.6875
3
[]
no_license
const calculate = document.querySelector('input.calbtn') const form = document.querySelector('form') const UIamount = document.querySelector('.money') const cleanbtn = document.querySelector('.clearbtn') const testbtn = document.querySelector('.test') form.addEventListener('submit', function(e){ //when click,...
true
2762a155cd9c060d40677820fa15cb102d42d238
JavaScript
LuckyZhangWeiwei/javascaript-foundation
/src/p94-私有栈内存中的变量处理/index.js
UTF-8
378
3.125
3
[]
no_license
{ console.log(a, b); var a = 12, b = 12; function fn() { console.log(a, b); var a = (b = 13); console.log(a, b); } fn(); console.log(a, b); } { console.log(a, b, c); var a = 12, b = 13, c = 14; function fn(a) { console.log(a, b, c); a = 100; c = 200; console.l...
true
583eb32a877ed0285a2dc756d09f543919b59cf1
JavaScript
ertyseidohl/stretch
/src/player.js
UTF-8
1,730
2.828125
3
[]
no_license
var Player = function(game, options) { this.size = { x: options.height, y: options.height }; this.center = { x : options.startX, y : game.groundY - (options.height / 2) }; this.game = game; this.height = options.height; this.isAlive = true; this.velocity = 0; this.zindex = 5; }; Player.prototype = { ...
true
62a612eec8d380879de2a089ee828b0963d13b85
JavaScript
7ynstar/tricks
/snapshot/scroll-get.js
UTF-8
436
2.671875
3
[]
no_license
// 桌面端浏览器不能使用document.body.scrollTop // 移动端不能使用document.documentElement.scrollTop // 但都支持window.pageYOffset,但需要IE9+ /** * 获取浏览器窗体滚动高度 */ var winScrollTop = window.pageXOffset || document.documentElement.scrollTop // window.innerHeight需要IE8+ /** * 获取浏览器窗体高度 */ var winHeight = window.innerHeight || document.docume...
true
ca79aa8a24c66e3f65129512c86154194502cb68
JavaScript
nehal221996/Project
/Project/src/main/webapp/resources/js/edit_student.js
UTF-8
967
2.546875
3
[]
no_license
$(document).ready(function() { console.log("even") var std_id = GetURLParameter("id"); $('#std_id').val(std_id); $.ajax({ url : "editStudent_info?schoolId="+std_id, success : function(result) { $('#schoolId').val(result.schoolId); $('#std_name').val(result.std_name); $('#dob').val(result.dob); $('#...
true
4d52baf622b2e3f51c881d9fb1047d49eb2481d6
JavaScript
Oceanwall/robot-navigation
/public/javascripts/returningScreenScript.js
UTF-8
1,066
2.875
3
[]
no_license
const IP_V4 = "http://localhost:3000"; //Make HTTP requests every 2 seconds to see if robot has returned yet window.onload = function() { let timer = setInterval(() => { //Make request every 2 seconds... fetch(IP_V4 + '/checkIfArrived', {method: "POST", headers: {"Content-Type": "application/x-www-form-urlen...
true
b528bd01cbba99f7df484c919aed36d9e4bb4ed8
JavaScript
libinglife/2019study
/动效/序列帧demo/demo.js
UTF-8
1,437
2.53125
3
[ "MIT" ]
permissive
function play_animation() { var framesUrl = []; for (let i = 1; i < 50; i++) { // framesUrl.push('http://ojcokbt6a.bkt.clouddn.com/frame-' + i + '.gif'); // framesUrl.push('img/'+i + '.png'); framesUrl.push('images/frame-' + i + '.gif'); } // frame animation var ani = new fr...
true
3bfc1f0377520e13acfc85e090c2e14cdc38dbe1
JavaScript
natey37/leetcode-problems
/increasingDecreasingString.js
UTF-8
2,375
4.5
4
[]
no_license
/* 1370. Increasing Decreasing String Given a string s. You should re-order the string using the following algorithm: Pick the smallest character from s and append it to the result. Pick the smallest character from s which is greater than the last appended character to the result and append it. Repeat step 2 until yo...
true
e4cb7810e746b234eae72256e015eb75ccb3b00b
JavaScript
CarlosBritoFranca/agendaReact
/backend/src/app/controller/UserController.js
UTF-8
2,828
2.671875
3
[]
no_license
const Yup = require("yup"); const { User } = require("../models"); const Mail = require("../../lib/Mail"); class UserController { //Listar Usuarios async index(req, res) { const user = await User.findAll(); return res.status(200).json(user); } //Salvar usuario async store(req, res) { //Validação...
true
2ec51ede3987b0aa97783ba8f7fd978fb762c8dd
JavaScript
nazeeh/qdacity
/war/tests/acceptance-tests/03_CourseTest.js
UTF-8
3,124
2.53125
3
[]
no_license
var webdriver = require('selenium-webdriver'), By = webdriver.By, until = webdriver.until; var chrome = require("selenium-webdriver/chrome"); var loginHelper = require('./helper/LoginHelper.js'); var Common = require('./helper/Common.js'); var Conditions = require('./helper/Conditions.js'); const SPEC_NAME = 'Cou...
true
60ca66f25ef43b611946d4df755307b367dfe27a
JavaScript
dxcdxcdxcdxc/daily-practice
/practices/算法/排序算法/selectionSort.js
UTF-8
879
4.03125
4
[]
no_license
Array.prototype.selectionSort = function () { // 外层循环的作用是执行 n-1轮 所以长度是this.length -1 // 需要将内层循环中的0 都改成 i 因为比较的数组再变小 // 还有一个当 indexMin === i就是自身不需要交换加个 if for (var i = 0; i < this.length - 1; i++) { // 假设最小元素的索引是第一个元素 var indexMin = i; for (var j = i; j < this.length; j++) { // 判断一下 如果遍历当前元素小于第...
true
bc27419a3b0d237f3712ca6cdedd904dd347537b
JavaScript
project-vlab/Registration-Authentication
/passport-config.js
UTF-8
1,148
2.6875
3
[]
no_license
const { authenticate } = require('passport'); // requiring local strategy and bcrypt const LocalStrategy = require('passport-local').Strategy const bcrypt = require('bcrypt'); function initialize(passport, getUserByEmail, getUserById){ const authenticate = async (email, password, done) => { // sending the...
true
95861f4c20fe9ece88b59dd96c0068e6712ec3ce
JavaScript
desertmark/artic-manager
/src/auth/auth-service.js
UTF-8
3,385
2.5625
3
[]
no_license
const bcrypt = require('bcryptjs'); const config = require('../config/config.js'); const jwt = require('jsonwebtoken'); const ValidationError = require('../util/errors').ValidationError; class AuthService { constructor(opts) { this.userRepository = opts.userRepository; this.currentUser = opts.curre...
true
8531a783c2e90e0550fb0f2d3fcd693ffd816772
JavaScript
Spectrum-McRaj/Restaurant-Hans
/template/assets/js/modules/ingredient.js
UTF-8
862
2.765625
3
[ "MIT" ]
permissive
'use strict' /* * assets/js/modules/ingredient.js * TODO : build module; add functions (overview, view, add, update & delete) to let things happen */ function mainIngredient(){ overviewIngredient(); } /* ----------------------------------------------------------------------------- * overview */ function overviewIngre...
true
ac8440eb933e901c795efe4b186471448b7b89b2
JavaScript
MatthewLarner/terrace
/index.js
UTF-8
4,790
2.515625
3
[ "MIT" ]
permissive
var laidout = require('laidout'), venfix =require('venfix'), translate = require('css-translate'), unitr = require('unitr'); var layers; function getPosition(element){ var rect = element.getBoundingClientRect(); return { top: rect.top, left: rect.left, bottom: window.inner...
true
f3598b086c4ac475f0badc3021b968acd6739e9e
JavaScript
surajsgh/Bankist_WebSite
/practice.js
UTF-8
4,484
3.484375
3
[]
no_license
/* // Selecting the elements const header = document.querySelector('.header'); const allSelector = document.querySelectorAll('.section'); console.log(allSelector); document.getElementById('section--1'); const allButtons = document.getElementsByTagName('button'); console.log(allButtons); console.log(document.getElemen...
true
eaea82146823238155bfc80125c4be8be20cc366
JavaScript
yadulagithub/cd2
/Messagedashboard/server/controllers/comments.js
UTF-8
1,430
2.59375
3
[]
no_license
console.log("Comments.js is running"); const mongoose = require("mongoose"); const Comment = mongoose.model("Comment"); class CommentController { getAll(req, res) { Comment.find({}) .then(Comments => res.json(Comments)) .catch(err => res.json(err)); } create(re...
true
244342cf00ae5b75e28ef5b0788aa7fff03a300c
JavaScript
Gabemb/ac3.1-exam-4
/part-1-ajax/test.js
UTF-8
3,086
3.125
3
[]
no_license
function getCountryName(code) { var codeURL = "https://restcountries.eu/rest/v1/alpha/"; $.ajax({ //uses the three letter code to get the country's full name url: codeURL + code , success: function (data) { console.log(data); var name = data.name; $("ul").append("<li>" + name + "...
true
a8ea5272399b132c2a29d4401982b0d9e9c3fb6a
JavaScript
DevinCarr/mc
/add.js
UTF-8
2,099
2.859375
3
[]
no_license
(function() { 'use strict'; var addForm = document.getElementById('addForm'), submitButton = document.getElementById('submitButton'), statusText = document.getElementById('statusText'); // Initialize Firebase var config = { apiKey: "AIzaSyACPLnIHH01PDQQ8i9oClM86uhFOVCSZKg", authDomain: "mccc...
true
b2c8be8c671052f788b2590583f5e196350a1026
JavaScript
kmcurry/bwjs
/Math/Vector2D.js
UTF-8
400
3.0625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
function Vector2D(x, y) { this.x = x || 0; this.y = y || 0; } Vector2D.prototype.v = function() { var values = [ this.x, this.y ]; return values; } Vector2D.prototype.load = function(x, y) { this.x = x; this.y = y; } Vector2D.prototype.copy = function(vector) { if (ve...
true
d7d4699388d53cf2e1e1dcdd595d6be410b27e20
JavaScript
Lincaiping/Design
/src/main/webapp/js/web/login/resetTel.js
UTF-8
5,077
3.109375
3
[ "MIT" ]
permissive
function getLength(str) { return str.replace(/[^\x00-xff]/g, "xx").length; //\x00-xff 此区间是单子节 ,除了此区间都是双字节。 } function findStr(str, n) { var tmp = 0; for (var i = 0; i < str.length; i++) { if (str.charAt(i) == n) { tmp++; } } return tmp; } window.onload = function () { ...
true
3e492381905b0d90db2b8ae0f545636f017bdc49
JavaScript
hwngtraanf/ebook-reader
/Libri/src/main/webapp/libri/subs/choice-menu/reader/script.js
UTF-8
3,413
3.046875
3
[]
no_license
/*const table = document.querySelector('.table-body'); let searchBarBtn = document.querySelector('.search-bar_btn'); let searchBar = document.querySelector('.search-bar_text'); const list = JSON.parse(localStorage.getItem("book-list") || "[]"); let matchingList = []; let index = 0;*/ //render(); $(functi...
true
ee0f8a2ed3ff48415361913a913de100412ee1ca
JavaScript
19892483978/pinyougou
/pinyougou-search-web/src/main/webapp/js/controller/baseController.js
UTF-8
1,616
2.96875
3
[]
no_license
//分页功能 //有些功能是每个页面都由可能用到,比如分页,复选等,可以通过继承的方式来让这些通用功能只写一次 app.controller('baseController',function ($scope){ //分页控件配置 $scope.paginationConf = { currentPage:1, //从第1页开始 totalItems:10, //每页条数 itemsPerPage:10, //初始页面总共多少条数据 perPageOptions:[10,20,30,40,50], onChange:functi...
true
3ffdf55810d52ec92286ffd74e473a4d4ba76f33
JavaScript
Pashabrown/mongoose-store-hw
/models/Store.js
UTF-8
416
2.59375
3
[]
no_license
// import model and schema const { Schema } = require("mongoose") const {model, schema} = require("../db/connection") //create schema const StoreSchema = new Schema({ itemId: String, title: String, img: String, price: String, stocks:{type: Number, default: 10} }, {timestamps: true}) //create a mo...
true
997ed97b94948d349592311ddb74a9e08727ed51
JavaScript
intermine/cross-repo-contributor-list
/src/ContributorRepository.js
UTF-8
2,724
2.5625
3
[ "MIT" ]
permissive
const octokit = require("@octokit/rest"); const githubApi = new octokit(); const async = require('async'); const Repository = require('./Repository.js'); const Profile = require('./Profile.js'); const settings = require('./settings.js'); function getContributorsByOrg(organisation) { return getReposByOrg(organisati...
true
fd532decf5d4e241ffa5b36f920da58d4b802be1
JavaScript
pahancha/react-task-tracker
/src/App.js
UTF-8
2,598
2.625
3
[]
no_license
import { useState,useEffect } from "react" import { BrowserRouter as Router, Route} from 'react-router-dom' import Header from './components/Header' import Tasks from './components/Tasks'; import AddTask from "./components/AddTask"; import Footer from "./components/Footer" import Aboout from "./components/Aboout"; co...
true
4c330fae55fa907156d609675d02a72051f968c1
JavaScript
lpanjwani/CAMUN-2017-ANDROID-APP
/main/platforms/android/assets/www/js/canvas.js
UTF-8
5,214
2.90625
3
[ "MIT" ]
permissive
function GameObject() {this.zOrder=0;this.x=0;this.y=0;this.startupGameObject=function(x,y,z) {this.zOrder=z;this.x=x;this.y=y;g_GameObjectManager.addGameObject(this);return this;} this.shutdownGameObject=function() {g_GameObjectManager.removeGameObject(this);}} function VisualGameObject() {this.image=null;this.draw=fu...
true
868bebadb43c1d9c9852dc76ce488628ea61a77d
JavaScript
drupal-composer/drupal-composer.github.io
/js/touchfocus.js
UTF-8
442
2.671875
3
[]
no_license
/** * @file * Enabling focus state for touch devices. */ (function($) { $(document).ready(function() { // Make elements focusable. $(".touchfocus") .attr("tabindex", "1") // With using click instead of touchstart, we avoid containing links to // becoming visible in the moment the containe...
true
ecafac0543fc29a206d1a6bff66b033e8feaf52d
JavaScript
dioNode/imageDeliver
/ImageDeliver/script.js
UTF-8
5,727
2.703125
3
[]
no_license
$(document).ready(function(){ var globalDataDict = {}; var globalHeadings = []; $("#filename").change(function(e) { computeCSVFile(e); return false; }); $("#coverFile").change(function(e) { computeCoverFile(e); return false; }); $("#finalFile").change(function(e) { computeFinalFile(e); return f...
true
778953b4757058b349215db55b3031be7f91cd48
JavaScript
ruchika6698/QuantityMeasurement-Frontend
/src/Components/history.jsx
UTF-8
2,656
2.6875
3
[]
no_license
import React from "react"; import Table from '@material-ui/core/Table'; import TableBody from '@material-ui/core/TableBody'; import TableCell from '@material-ui/core/TableCell'; import TableContainer from '@material-ui/core/TableContainer'; import TableHead from '@material-ui/core/TableHead'; import TableRo...
true
683a9e0f06c6dc0a90f57baff5826f08613e2f30
JavaScript
akashbhandwalkar/js-training-assignments
/additional-practice-async-programming/solution/generator.js
UTF-8
514
2.609375
3
[]
no_license
const axios = require('axios'); const apis = require('./../utils/config'); const successHandler = (response) => { console.log('successHandler-->', response.data); return response; } const errorHandler = (error) => { console.log('error-->', error) } const waitForAPI = (msg) => { console.log(msg); } function *l...
true
63fdab9752340578c61ee5d1aebbe2c342758481
JavaScript
Eyad-A/bookstore
/__tests__/books.test.js
UTF-8
2,929
2.515625
3
[]
no_license
process.env.NODE_ENV = "test"; const request = require("supertest"); const app = require("../app"); const db = require("../db"); let book_isbn; beforeEach(async () => { let results = await db.query( `INSERT INTO books (isbn, amazon_url, author, language, pages, publisher, title, year) ...
true
4f890ccf82385c19cf2e3156ecdfdf82eaa4bf1f
JavaScript
ShrutiKadam/Plus91-Technologies-Assignment
/Solution-One/linkedList.js
UTF-8
3,522
4.59375
5
[]
no_license
class Node { // constructor constructor(element) { this.element = element; //holds data of node this.next = null //pointer to the next node } } // linkedlist class class LinkedList { constructor() { this.head = null; //stores the first node of a List ...
true
63f830ae906e443de3f7eaad4def215c1a0578dc
JavaScript
tobilary/DemoReferalTrackingBot
/commands/_start.js
UTF-8
1,244
2.578125
3
[]
no_license
/*CMD command: /start help: need_reply: auto_retry_time: <<ANSWER How to use this bot? /howtouse Get personal affiliate link: /mylink You was attracted by: /myref *Referral List* Get yours Referral List: /reflist Clear Ref List: /clear *TOP* Get TOP 10: /top Clear Top: /cleartop ANSWER keyboard:...
true
c14e15b0d2f3c467a853d77ba2b260e49d2c2018
JavaScript
GuilhermeSevero/app-produtos-categorias
/src/plugins/alerta.js
UTF-8
1,973
2.59375
3
[]
no_license
import { Notify } from 'quasar' class ClassAlertas { error({ title = 'Erro!', message = 'Ocorreu um erro!', error = {}, duration = 0 }){ this.$exibeErroConsole(error) this.$mostraAlerta('negative', title, message, duration) } warning({ title = 'Atenção!', message = 'Ocorreu um alerta!', duration = 0 }){...
true
45dd181e83cff58fbb817432cc8967d8cb0ab2cd
JavaScript
phannam1/myDocument
/TailieukhoatoanHue/src/main/webapp/js/onclickDocumentAdmin.js
UTF-8
1,218
2.8125
3
[ "MIT" ]
permissive
/** * */ var list = []; $(document).ready(function(){ jQuery(".isActive").each(function(){ if(jQuery(this).val()==1){ jQuery(this).attr("checked","checked"); list.push(jQuery(this).attr("name")); } }); }); function myFunction(val){ if(document.getEleme...
true
4a8ed03a4d6ddf494a17ab6479e70d47ba478759
JavaScript
isfe-team/rodash
/__tests__/lang/eq.js
UTF-8
595
2.71875
3
[ "MIT" ]
permissive
/* global describe, it, expect */ const eq = require('../../lib/lang/eq') const testValue = { 'a': 1, 'b': 2, 'c': 3 } describe('no value specific', function () { it('should return value is true', function () { expect(eq()).toBe(true) }) }) describe('value is NaN', function () { it('should return true', f...
true
1d378d345ad07153ba40acec0aa180a64a2e63ac
JavaScript
cateland/devfest-2019
/src/assets/map.js
UTF-8
180
3.109375
3
[]
no_license
function toUpperCase(value) { return value.toUpperCase(); } ['value1', 'value2', 'value3'].map(toUpperCase); // => ["VALUE1", "VALUE2", "VALUE3"] [].map(toUpperCase); // => []
true
8b80ca7a0b12d02e42149af6ead910f92e1f03cb
JavaScript
ManuelSerna/mario_game
/mario_client_server/mario.js
UTF-8
7,112
3.015625
3
[]
no_license
// Mario's position on the floor let playerFloor = screenHeight - 63 - 95;// total height - floor - mario's height // Downward acceleration let downAcceleration = 1.9;//2.2; //===================================================================================================================== // Mario "class" //=====...
true
25b0e2d0bac39634db331e433bfa4c7fd6a3cb91
JavaScript
jaydenhinrichsen/wechat
/controllers/chatController.js
UTF-8
1,360
2.515625
3
[]
no_license
// Utils const toObjectId = require("../utils/toObjectId"); // Models const Chat = require("../models/Chat"); const User = require("../models/User"); const Category = require("../models/Category"); // Vailidation const validateChatInput = require("../validation/chat"); module.exports = { // Create a new chat create...
true
a5c63a107a5a3b1d42914a6af9d22e4fd2f818ed
JavaScript
Soriphen/student-profile-search
/src/App.js
UTF-8
2,565
2.734375
3
[]
no_license
import "./sass/styles.scss"; import { useEffect, useState, useRef } from "react"; import Student from "./components/Student"; import NameSearchBar from "./components/NameSearchBar"; import TagSearchBar from "./components/TagSearchBar"; export default function App() { const [students, setStudents] = useState(null); ...
true
fcd1ebb14ab64d4b798060e6c03586beaedc46d6
JavaScript
emrido/miniquery
/miniquery.js
UTF-8
3,785
3.53125
4
[]
no_license
const SweetSelector = { select: (element) => { return element[0] === '#' ? document.querySelector(element) : document.querySelectorAll(element); } } const DOM = { hide: (element) => { if (element[0] === '#') { return document.querySelector(element).hidden = true; } else ...
true
59462a77249f3dd17e3c94176095d80b6aa9d5ed
JavaScript
huangke0802/nodeJsStudy
/study/models/optfile.js
UTF-8
1,755
2.84375
3
[]
no_license
//操作文件 var fs = require('fs'); //fs是node操作文件的模块 module.exports = { readfileSync: function (path) { //同步读取 var data = fs.readFileSync(path, 'utf-8'); console.log(data); console.log('同步方法执行完毕'); return data; }, readfile: function (path, recall) { //异步执行 fs.readF...
true
d9d2df51a0a397e598029fcadeddf57f6a2f8255
JavaScript
anderslarsson/archive
/src/shared/helpers.js
UTF-8
1,365
2.875
3
[]
no_license
'use strict'; /** * Normalize a tenantId (to lower case) so we can use * it as part of the ES index name. * * ES only allows lower case index names and tenantId * are persisted in a case-insensitive manner -> convert to lower. * * */ function normalizeTenantId(tenantId) { let normalizedTenantId = tenantId;...
true
0fe3bf955a7fd974303880799a634664534ace81
JavaScript
CLKarlsen/lemon
/lemon/theme/static/theme/js/lemon.js
UTF-8
413
2.78125
3
[]
no_license
$(document).ready(function(){ $(".add-likes-link").click(function(event) { event.preventDefault(); var message_id = $(this).data("messageid"); var likes_element_id = "#id-likes-for-message-" + message_id; $.ajax({ url: "/lemon_messages/" + message_id + "/add_likes" }) .done(function(data) { var like...
true
dd4cc532db8354af4b72484c77bb84c4fae37b4d
JavaScript
dardosordi/lux
/src/packages/freezeable/set/index.js
UTF-8
654
2.859375
3
[ "MIT" ]
permissive
/* @flow */ import freeze from '../utils/freeze' import isFrozen from '../utils/is-frozen' /** * @private */ class FreezeableSet<T> extends Set<T> { add(value: T): FreezeableSet<T> { if (!this.isFrozen()) { super.add(value) } return this } clear(): void { if (!this.isFrozen()) { ...
true
7a9a1076b3226a144c5c3f9537797b6192d1cfee
JavaScript
intactile/redux-normalized-module
/tests/utils.spec.js
UTF-8
1,558
2.71875
3
[ "Apache-2.0" ]
permissive
import { removeElement, moveAtTheEnd } from '../src/utils'; describe('utils', () => { describe('removeElement', () => { function assertElementRemoved(array, object, expectedArray, expectedIndex) { const index = removeElement(array, object); expect(expectedIndex).toEqual(index); expect(array).to...
true
78a6adfb02c33fde7c3fd9409b204556c21020aa
JavaScript
Irene-GA/prodAsturianosV3
/routes/auth.js
UTF-8
1,138
2.515625
3
[]
no_license
/* Despliegue de los servicios de los productos, Login y Logout */ const express = require('express'); let router = express.Router(); //Encriptación de contraseñas const SHA256 = require('crypto-js/sha256'); const CryptoJS = require("crypto-js"); let Usuario = require(__dirname + '/../models/usuario.js'); // Re...
true
1084431aa3e1e01e737be0cb70e832e2c9c95ff8
JavaScript
javiermortiz/bluebook
/frontend/components/session_form/signup_form.jsx
UTF-8
17,272
2.5625
3
[]
no_license
import React from 'react'; class SignupForm extends React.Component { constructor (props) { super(props); this.state = { firstName: '', surname: '', email: '', password: '', month: '', day: '', year: '', ...
true
248524e8701f6e2f758091aeca0992602cbf6597
JavaScript
lhl622/3dspace
/webapps/SMAAnalyticsCharting/controlPanels/paramControl/ra-paramcontrolelement2.js
UTF-8
2,257
2.65625
3
[]
no_license
(function(GLOBAL, template) { var pcePrototype = { is: 'ra-paramcontrolelement2', behaviors: [GLOBAL.DS.RAComponents.droptarget] }; pcePrototype.createdCallback = function() { var that = this; GLOBAL.DS.RAComponents.droptarget.createdCallback.call(this); var clone ...
true
ff63258339b100b797c499b6632e92ae9a5d7841
JavaScript
tahminarasoli/javascript-30-g5
/Custom-Video-Player/src/handlers/handleProgress.js
UTF-8
504
2.75
3
[ "MIT" ]
permissive
'use strict'; /** * @param {} '.player' */ const player = document.querySelector('.player'); /** * @param {} '.viewer' */ const video = player.querySelector('.viewer'); /** * @param {} '.progress__filled' */ const progressBar = player.querySelector('.progress__filled'); /** * update the progress bar style. ...
true
9f3870f267cfa999b872d592c4d4770ed0ba236b
JavaScript
jolson615/btt-winternship-launch-template
/sketch1.js
UTF-8
911
3.25
3
[]
no_license
/* global createCanvas, round, stroke, triangle, rect, noFill, windowWidth, windowHeight, colorMode, HSL, textSize, text, random, background, fill, ellipse, mouseX, mouseY, collideCircleCircle, width, height, color, abs, noStroke, sqrt, PI */ // List all p5 methods you plan to use in the global so that Glitch can reco...
true
2ceee94bc2f6769093db5fd218c9723fcd6d744a
JavaScript
nowe98/Allreadypay-server
/server/app/models/slotModel.js
UTF-8
2,262
2.671875
3
[]
no_license
'user strict'; const sql = require('../../config/db.js'); //Task object constructor const Slot = function(slot){ this.MachineID = slot.MachineID; this.NumberSlot = slot.NumberSlot; this.ProductID = slot.ProductID; this.Amount = slot.Amount; }; module.exports = Slot; Slot.getSlotById = function (id, n...
true
907f803124a6a0c87019ebe1fc8b173565ff8202
JavaScript
blinds52/fotostrana-api
/lib/utils/agent.js
UTF-8
1,808
2.640625
3
[]
no_license
/** * @author "Evgeny Reznichenko" <kusakyky@gmail.com> */ var Promise = require('bluebird'), r = require('request'), // HOST = 'http://fotostrana.ru/'; /** * * @type {agent} */ module.exports = agent; /** * Подготавливаем Request для наших запросов * * @param {string} method * @param...
true
bdc93feb901a19571da435879e224b484de3ca88
JavaScript
spacerockzero/dev-rdr
/functions/lib/sentiment.js
UTF-8
390
2.671875
3
[]
no_license
const Sentiment = require('sentiment'); const sentiment = new Sentiment(); // take a document object, and extract sentiment from relevant fields const getSentiment = doc => { let input = ` ${doc.title}, ${doc.text}, ${doc.opengraph.title}, ${doc.opengraph.description}`; const sent = sentiment.an...
true
e161dc5bd69f3aa4bf9bb257ee94eb325be179ad
JavaScript
nicolecomputer/advent-of-code
/solutions/day-02.js
UTF-8
1,862
3.140625
3
[]
no_license
const fs = require("fs"); function parseTobogganInputLine(input) { const [policyString, password] = input.split(":").map((s) => s.trim()); const [repeatRangeString, targetChar] = policyString.split(" "); const [minimumOccurence, maximumOccurence] = repeatRangeString .split("-") .map((i) => parseInt(i)); ...
true
f8cb9d1b143d0bf702ae2b586938b05520d1d4b8
JavaScript
thesakshi/WeatherApp
/web-servers/public/js/app.js
UTF-8
2,257
3.15625
3
[]
no_license
const weatherForm = document.querySelector('form') const search = document.querySelector('input') const temperatureValue = document.querySelector('#temp') const humidityValue = document.querySelector('#hum') const weatherdescValue = document.querySelector('#weatherdesc') const precipValue = document.querySelector('#pr...
true
4a4840956d95d45d0b3ffc58ecb3090ef6ff1481
JavaScript
kostyantin2216/phaser-pooping-snake
/src/components/linear-layout.js
UTF-8
3,054
3.234375
3
[]
no_license
export default class LinearLayout { static get GRAVITY_LEFT() { return 'gravity.left'; } static get GRAVITY_RIGHT() { return 'gravity.right'; } static get GRAVITY_CENTER() { return 'gravity.center'; } constructor(config) { this.scene = config.scene; this.container = config.container ...
true
2dcaece70c81d4a94fa1c2a7f84c50d7237d9c88
JavaScript
jr1412594/hacker-jest
/likes.js
UTF-8
919
4
4
[]
no_license
function likes(array) { if(array.length === 0){ return 'no one likes this' } else if(array.length === 1){ return `${array[0]} likes this` } else if(array.length === 2){ return `${array[0]} and ${array[1]} like this` } else if(array.length === 3){ return `${array[0]}, ${ar...
true
9db6a261849be8820ad76504b2af98d98be9dae4
JavaScript
MomokaMiki/merri
/javascript/study/09-arrow.js
UTF-8
1,547
4.5625
5
[]
no_license
const add = function(a,b){ return a + b; } //add(1,2); const add = (a, b) => { return a + b; } add(1, 2); // 評価項目がひとつしかない場合 // 暗黙的なreturnが発生 勝手に戻り値として返る const add = (a, b) => a + b; add(1, 2); // 可読性を重視して、1行か複数行(returnあり)にするかを考える const double = (number) => 2 * number; double(8); // 引数が一個の場合、()も省略可能 const ...
true
c9057704fe9060a2997b690ff44b4a3c4f712435
JavaScript
michaelleeallen/reducto
/lib/batch.js
UTF-8
482
2.5625
3
[ "MIT" ]
permissive
const service = require('./service'); const nextStub = () => {}; /** * Batches services calls and resolves responses after each have completed. * @param {object} config - route config * @param {object} services - services config * @returns {function} */ module.exports = (config, services) => (req, res, next) => { ...
true
f0e657f6140e0d41698061cac0067d824c35a689
JavaScript
Jaco-Miras/waw
/javascripting/function_arguments.js
UTF-8
119
3.140625
3
[]
no_license
function math(add, multiply1, multiply2) { return multiply1 * multiply2 + add; } console.log(math(53, 61, 67));
true
061f7df90dbf4c03465a7d6b77264cbf063db7f8
JavaScript
MtFzz99/CursoIngresoJS
/5-InstruccionWhile/jsIteraciones (4).js
UTF-8
338
3.421875
3
[]
no_license
function mostrar() { var numero = prompt("ingrese un número entre 0 y 10."); while (numero < 1 || numero > 10 || isNaN(numero)) { numero = prompt("Numero erroneo, ingrese el numero valido."); numero = parseInt(numero); } alert("Numero Ingresado Correctamente.") document.getElementById("Numero").value = numero }//F...
true
dc01a3c63264e14baa9ed9a6c1970cc6cb06edc5
JavaScript
deepakvenkat/JsCodeExamples
/examples/localStorage/index.js
UTF-8
1,604
3.46875
3
[]
no_license
/** * Adding items to local storage */ function addStorageClick () { const key = $('.storeKey').val(); const keyValue = $('.storeValue').val(); console.log(`key: ${key}, value: ${keyValue}`); window.localStorage.setItem(key, `${keyValue}`); $('.storageLength').html(JSON.stringify(window.localStorage)); } /**...
true
7fe8425c3b4e126c87a95fb8676314042d5f8d76
JavaScript
eliasrs/validacao-cadastro
/WebContent/js/filtra.js
UTF-8
5,214
3.921875
4
[]
no_license
/* Arquivo para criação da funcionalidade de friltragem de nomes na tabela de usuarios - Filtrar conforme o usuário vai digitando o nome, ou seja, dinâmico ----- no final, tem um exemplo comentado de como criar um contador de campo text aréa pra limite de caracteres */ // 1° Cria no Html o imput acima da tabela //...
true
6b9f83f2f07b659e1d00a0b2632d01e5dc12f94a
JavaScript
MunicipalSoftwareGroup/msg-website
/js/closeMenu.js
UTF-8
162
2.53125
3
[]
no_license
function closeMenu() { var cb = document.getElementById("burger-input"); if (cb.checked) { cb.checked = false; toggleMenu(); } }
true
8512ed094c4f2069f12148b31bf4cc95ffd9e013
JavaScript
zhuangxuchi/js
/542. 01 矩阵.js
UTF-8
885
3.21875
3
[]
no_license
/** * @param {number[][]} matrix * @return {number[][]} */ var updateMatrix = function(matrix) { let height=matrix.length, width=matrix[0].length; for(let i=0;i<height;i++){ for(let j=0;j<width;j++){ if(matrix[i][j]==1){ matrix[i][j]=Infinity; if(i>0){ ...
true
85da13d9e1a566a57f12faba993fe5b43ac324b6
JavaScript
AlexandreSanscartier/urban-octo-robot
/Projects/Arrays/js/main.js
UTF-8
5,647
3.984375
4
[ "MIT" ]
permissive
// FOREACH function doubleValuesArray(arr) { var newArr = []; arr.forEach(function (value, index, array) { newArr.push(value * 2); }); return newArr; } function onlyEvenValues(arr) { var newArr = []; arr.forEach(function (value, index, array) { if (value % 2 === 0) newArr.push(v...
true
06b15a86122af4a0e7e7134e077aeb5212d4f32a
JavaScript
PichaiLim/react-landing-page
/src/Card.js
UTF-8
7,212
2.5625
3
[]
no_license
import React, {Component} from "react"; class Card extends Component { constructor() { super(); this.state = { countClick: 0, titleName: "Card Title" }; // TODO Register event this.counterClick = this.counterClick.bind(this); this.changeTitle = t...
true
7fd819617a4ff8daa67c20bde14b7ce2e97c30f4
JavaScript
michaelnomura/itc230
/music.js
UTF-8
1,101
3.78125
4
[ "Apache-2.0" ]
permissive
//a data array of at least 5 items, where each item has at least 3 attributes (key:value pairs). //Determine which attribute will serve as a unique key (e.g. book title) to prevent duplicates, var music = [ { name : "Sublime", album : "Sublime", year : 1996 }, { name : "Misfits", album : "Walk Among Us", year : 1982 }...
true
0dc55f220f8b8d0adb345669803b57e5e7832952
JavaScript
likelionlabtdd/tdd_with_nodejs
/index.spec.js
UTF-8
1,383
3.015625
3
[]
no_license
/*** 테스트 코드 파일 ***/ const assert = require('assert'); // node 기본 모듈 const should = require('should'); const request = require('supertest'); // API 기능 테스트 const app = require('./index'); describe('GET /users', () => { /** 첫 번째 테스트 */ it('응답값이 배열이고, name속성을 포함한다.', (done) => { request(app) ...
true
f418582ebc24f38ab0d8841295653b82951fe9ad
JavaScript
Touseef-haider/zakat-kasih
/src/utils/Validation.js
UTF-8
1,250
2.90625
3
[]
no_license
import * as EmailValidator from 'email-validator'; import * as PasswordValidator from 'password-validator'; export const emailValidation = (email) => { return EmailValidator.validate(email) } export const passwordValidation = (password) => { var pwdSchema = new PasswordValidator(); pwdSchema .is().m...
true
8a0c2a97f6b6d9349b004b34db27ebe1bb85c119
JavaScript
Alexpebbleclsassic/js_course
/module_3/ui_controller.js
UTF-8
547
2.5625
3
[]
no_license
import MaskInput from 'mask-input'; export default class UIController { constructor() { this.cardInput = document.getElementById('card'); } } this.initCardInput(); this.initNameInput(); } const maskInput = new MaskInput(tis.cardInput, { mask: '0000-0000-0000-0000', alwaysShowMask: true, maskChar: '_...
true
5fe8bdef6af6c42042c1587725ae6f4606c3830e
JavaScript
alurosu/Activ8
/data/js/game.js
UTF-8
15,329
3.015625
3
[]
no_license
var PU = null; function powerUp(){ this.type = 0; this.x = -50; this.xSpeed = cWidth/5; this.xDirection = 1; this.y = cHeight+100; this.width = cHeight/17; this.height = cHeight/17; this.cx = this.x + this.width*0.5; this.cy = this.y + this.height*0.5; // animation modifiers this.angle = Math.PI; this.sdY =...
true
93b2ea49cee5ec9299b08aaf98d999bb489f43bb
JavaScript
samit4me/eslint-demo
/validateMsg.js
UTF-8
1,344
2.75
3
[]
no_license
'use strict'; var fs = require('fs'); var hasToString = function (x) { return x && typeof x.toString === 'function'; }; var bufferToString = function (buffer) { return hasToString(buffer) && buffer.toString(); }; var validate = function (msg, isFile) { if (!validateMessage(msg)) { var incorrectLogFile ...
true
12198f66674aef86f4eba953b9ad0620ad71dd3d
JavaScript
webfrontup/mini-node
/8.charset/1..charset.js
UTF-8
1,411
3.671875
4
[ "MIT" ]
permissive
// 一般情况下能打印出来的都是10进制 console.log(0b11,'123'); // 二进制 3 console.log(0o17); // 15 console.log(15); console.log(0x1f); // 31 0-9 a b c d e f // 一个字节有多少个位 1b = 8bit // 一个字节最大是多少 最大255 console.log(parseInt('11111111',2),'parseInt'); // 转化程10进制 console.log((300).toString(16)); // 转化2进制 12c console.log(0xf...
true
77a07ad188532eb1909fdc9f4f318c7aeeb182dc
JavaScript
Painatalman/helpers-js
/utils/logAndReturn.js
UTF-8
659
3.90625
4
[]
no_license
/** * Wraps a function in order to log its return value * @param {Function} func The function to be wrapper * @return {Function} The wrapped function itself * @example <caption>Example for the wrapper function</caption> * function add(a, b) { return a + b } * var addAndLog = logAndReturn(add); * addAndLog(4, 4) ...
true
5acd6787383432d410e834bdb00a539025164456
JavaScript
NicolaMoon/MarkDownWatcher
/public/js/home.js
UTF-8
4,852
3
3
[]
no_license
// 作为被评论文本的全局存储 let commentForText = undefined; // 判断单击还是长按的变量 let clickStart = undefined; let clickEnd = undefined; // 获取URL的querys function getQuerys() { let url = window.location.href; let querys = {}; url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { querys[key] = value; }); return quer...
true
745e8236b94fbcff53fe2105a12b4f73a4edb19c
JavaScript
logesh-kumar/es6-webpack-starter
/src/app.js
UTF-8
164
3.53125
4
[]
no_license
class Greeter{ constructor(){ this.message = "hello world"; } greet(){ console.log(this.message); } } const obj = new Greeter(); obj.greet();
true
496e45951caf112ce77a031b447e87b64393dbe1
JavaScript
stef-levesque/dash-ext
/js/content_script.js
UTF-8
784
2.984375
3
[ "MIT" ]
permissive
function extractTagName(str) { var e = document.getElementsByTagName(str)[0]; if (e != null) { document.documentElement.style.overflow = 'hidden'; document.body = document.createElement('body'); document.body.appendChild(e); var w = window.outerWidth - window.innerWidth; var h = window.outerHeight - window...
true
4c01dda1f3732ac8637415c7d8a8e305c78e741d
JavaScript
biancacraciun/JavaScript
/Basic algorithms/Basic-Alg.js
UTF-8
10,283
4.3125
4
[]
no_license
// 1. Vreau sa am o functie care sa-mi calculeze suma dintre 2 numere // daca ele sunt diferite iar daca sunt egale sa-mi imulteasca suma lor cu 5 // ex myFunction(10, 5) - output 15 // myFunction(10,10) - output 100; // ES5 function operation(nr1, nr2) { if (nr1 !== nr2) { return nr1 + nr2; } else i...
true
1a4ddad7a7930126f0d2ad109f54a6489177bf98
JavaScript
miken619/ToDo_APP
/client/components/App.jsx
UTF-8
1,524
2.5625
3
[]
no_license
import React, { Component } from 'react'; import { Form, Button, ButtonContorl } from 'react-bootstrap'; import axios from 'axios'; import ToDoList from './ToDoList.jsx'; export default class App extends Component { constructor() { super(); this.state = { lists: [], input: '' } this.hand...
true
fb8484ef793a46f37ea587b1ca970f3493058970
JavaScript
rafperdev/sesion8
/src/utilities/temperature.js
UTF-8
571
3.1875
3
[]
no_license
const CONVERSIONS = { C: (f) => (f - 32) * (5 / 9), // from F to C: (fahrenheit -32) * (5/9); F: (c) => c * (9 / 5) + 32, // from C to F: (celsius *9/5) + 32; }; const VALID_UNITS = ['C', 'F']; export const convertTo = (from, to, value) => { if (value.length === 0) return ''; else if (from === to)...
true
f367a6cc389361c0ec74643c001537c32df590ba
JavaScript
a-ignatov-parc/Marrow
/static/js/tests/core.transits.js
UTF-8
12,908
2.984375
3
[ "MIT" ]
permissive
test('Проверка существования класса ядра необходимого для инициализации', function() { equal(typeof(window.WebApp), 'object', 'Объект WebApp не инициализирован'); equal(typeof(window.WebApp.Core), 'function', 'Класс WebApp.Core не инициализирован'); equal(typeof(window.WebApp.Core.prototype.constructor), 'function',...
true
249740cc01cba9e435c8ee81b27522a500c49175
JavaScript
yangxin1994/simpleRouter
/router.js
UTF-8
1,758
2.671875
3
[ "MIT" ]
permissive
"use strict"; class Router { constructor(root = '/') { this.mode = 'history'; this.routes = []; this.root = root; } get root() { return this._root; } set root(val) { this._root = val; } get mode() { return this._mode; } set mode(val) { this._mode = val; } get ro...
true
1a30603415aa455c0bcdb7f39b249770711f8b84
JavaScript
wenxuan-xia/net_info_publisher-SE_1_5
/dist/js/inputCheck.js
UTF-8
1,572
2.828125
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
function name_required(field,alerttxt){ with (field) { if (value.length<6) {alert(alerttxt);return false;} else {return true} } } function pwd_required(a,alerttxt){ var pwdt; with (a){ if (value.length<6) {alert(alerttxt); return false;} } return true; } function repeat_pwd_required(a,b,alert...
true
fedf033d8884873e80805180d64311493349d071
JavaScript
veacks/webgl2
/src/js/gl/object/Object3D.js
UTF-8
2,868
2.828125
3
[]
no_license
/** * Created by siroko on 19/10/16. */ 'use strict' import { mat4, vec3 } from 'gl-matrix'; export default class Object3D { constructor() { this._lookAtMatrix = mat4.create(); this._translationMatrix = mat4.create(); this._rotationMatrix = mat4.create(); this._scaleMatrix = ma...
true
ebe8739831719134692b18d297221d770d47617e
JavaScript
DaniTodorowa/123
/FUNDAMENTALS/arrays_advanced_exercise/04_last_K_numbers_seq_2.js
UTF-8
707
3.578125
4
[]
no_license
function solve(length, seq) { let res = [1]; function sumCurrLessSeq(arr = []) { let sum = 0; for (let j = 0; j < arr.length; j++) { sum += arr[j]; } return sum; } function sum2(array) { let sum = 0; for (let k = res.length - 1; k > res.leng...
true
083dda2417203dade27a965c0fff1ad3bb92e981
JavaScript
maximan3000/VideoChat
/chat-server/src/websocket/partial/socketControllerWebRtc.js
UTF-8
2,622
2.578125
3
[]
no_license
const SocketEvents = require('./../SocketEvents'); const OfferContext = require('../struct/webrtc/OfferContext'); const AnswerContext = require('../struct/webrtc/AnswerContext'); const IceCandidateContext = require('../struct/webrtc/IceCandidateContext'); /** * Partial logic of linked class. Implements WebRtc behavio...
true
15bbaee0027645c9ba241179f9585b9504edb3b7
JavaScript
EngagingNetworks/ens-import-nodejs
/index.js
UTF-8
1,442
2.703125
3
[]
no_license
const fs = require('fs') const FormData = require('form-data') const fetch = require('node-fetch') // import service endpoint const url = 'https://e-activist.com/ea-dataservice/import.service' // https://us.e-activist.com for US clients // Replace the following const token = '***YOUR***PRIVATE***TOKEN***' /...
true
d79a2231a1726e55cd29199b86c2e636b0922be9
JavaScript
mrbut1995/DDMHTML5
/client/js/animation/transitionanimation.js
UTF-8
1,308
2.53125
3
[]
no_license
define(["animation/timeranimation"],function(TimerAnimation){ var TransitionAnimation = TimerAnimation.extend({ ///////////////////////////////Overloading init(from,to,interval){ this.from = from this.to = to this.val = this.from this._super(interva...
true
675b0dfc4f56df8c981d0630c5358e82db3e004a
JavaScript
antonydevanchi/serverless-plugin
/lib/entities/messageQueue.js
UTF-8
1,062
2.640625
3
[ "MIT" ]
permissive
'use strict'; module.exports = class MessageQueue { constructor(serverless, initial) { this.serverless = serverless; this.initialState = initial; this.newState = null; this.id = initial ? initial.id : undefined; this.url = initial ? initial.url : undefined; } setNew...
true
6c4c1225c1069d3ad91d74eaa918a0a09a461d73
JavaScript
Avnerus/tribeca
/src/app/model/timer.js
UTF-8
1,134
2.75
3
[]
no_license
'use strict' import mathUtil from '../util/math' export default class Timer { constructor() { } init() { console.log("Initialising timer"); this.onThreshold = null; this.paused = true; this.reset(); } update(dt) { if (this.paused) { return; ...
true
5188523123feaef93525029f9910797bd553d300
JavaScript
abahalkar/foodninja
/js/app.js
UTF-8
1,504
2.578125
3
[]
no_license
if('serviceWorker' in navigator){ /* * this inside code only run when service worker is support by browser * register the service worker using navigator object,service worker property * and register function. in which pass file and it's path. * this is asychronous jobs so may take time to run/complete hence run ...
true