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
1aa215626fc63eed9dddfaad5576482a6fa7f800
JavaScript
tmaegel/whiteboard-server
/src/models/sqlite.model.js
UTF-8
7,173
2.703125
3
[ "MIT" ]
permissive
/** * sqlite/database module * @module models/sqlite.model * @see module:models/sqlite.model */ // Database const sqlite3 = require("sqlite3").verbose(); // Importing objects const cmdline = require("../cmdline"); let db; /** * Open database */ open(); /** * Initialize database */ if (cmdline.initDatabase)...
true
e765f596134c120b78b033a9852719092357f250
JavaScript
taoqf/ulog
/mods/formats/record.js
UTF-8
643
2.515625
3
[ "MIT" ]
permissive
var grab = require('../../core/grab') /** * Records a record for a log call based on the ulog instance, the logger and leven and the call arguments. * * Collects all record functions from all mods and allows each of them to contribute to the result. * * @param {} ulog Ulog instance * @param {*} logger Logger ins...
true
a9c201c142f04f31e89370ff0167f8588c914d5b
JavaScript
l3dlp-sandbox/mithril-helpers
/store.js
UTF-8
1,774
2.609375
3
[ "CC-BY-4.0", "BlueOak-1.0.0", "MIT", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
/** * Use this if you want the ease of use you'd get with v0.2's `m.prop()`, but * you don't want to pull in an entire stream library just to have it. * * It's also safe against recursive modifications when observing - they instead * don't notify like they would normally, avoiding a quick stack overflow. */ ;(fu...
true
02fef853f6e2e05c1687635fd7ca4bc529f0e25b
JavaScript
mondalraj/My_Nodejs_backend_Cheatsheet
/MongoDB/models/blog.js
UTF-8
864
2.921875
3
[]
no_license
// Require Mongoose const mongoose = require('mongoose'); //Making Schema const Schema = mongoose.Schema; //Schemas are the structure of the document that we are gonna store inside the collection. //Schema is a constructor const blogSchema = new Schema({ title: { type: String, required: true ...
true
964f2327b815d91db66896df3da01a5b8eb4feb7
JavaScript
mindsworth/mydiary-project
/server/controllers/reminder.js
UTF-8
980
2.625
3
[ "MIT" ]
permissive
import client from '../models/database/dbconnect'; class ReminderController { /** * @description - Deleting an Entry * * @param { object } req * @param { object } res * * @returns { object } object */ async updateReminder(req, res) { try { const userId = req.userData.userID; ...
true
5f16f45ab2d54ef284214d79e99df08ec8247d54
JavaScript
Miratechnologies/Bulkmailing
/assets/js/createtemplate.js
UTF-8
38,204
2.75
3
[]
no_license
var rows = 0; var cols = 0; var cntt = 0; var selects = []; var selected = null; // how do I allow these variables respond to editing, without saving them in the database? // when are they used? // rows, only to add content // cols, only to add content // cntt, for adding contents too // But, my fear is that ID's cou...
true
8f03d4ef881491afccf5b3ddbcaa48cf92f2f2f7
JavaScript
art9626/HintsPro
/js/script.js
UTF-8
1,369
3.109375
3
[]
no_license
(() => { function counter(maxValue, countDisplay, speed, time) { let value = 0; countDisplay.textContent = value; let step = (maxValue / (time / speed)); let timerId = setInterval(() => { if(value >= maxValue * 0.7) { clearInterval(timerId); timerId = setInterval(() => { ...
true
21c219f624292600a09c8d26aa4bb2e43831d941
JavaScript
chichao89/introtodeve2
/Module2/Lesson2/js/controlstrcutures1.js
UTF-8
828
4.28125
4
[]
no_license
/** * Types of control strcutures * 1. If * The argument passed to the function is a number; check it it greater than 5 * 2. if... else... * 3. if ... else if * 4. Switch */ /** * if condition is true then execute a statement */ function controlStructure(inputNumber) { console.log('inside functio...
true
4dc73873af0830279823925d83b2e03f5d4c2e27
JavaScript
ariana20/oracle-of-baseball
/get_players.js
UTF-8
2,978
3.203125
3
[]
no_license
// https://www.baseball-reference.com/teams/ class Player { constructor(name, url) { this.name = name; this.url = url; } } /* Ref: https://stackoverflow.com/users/3954175/jcc-sanabria https://stackoverflow.com/a/68330734/3562468 */ //download (type_of = "text/plain", filename= "...
true
42957e4cb0088ecafe9e5509faa897dedd1567c1
JavaScript
apetugideon/teamwork
/controllers/categoriesController.js
UTF-8
2,720
2.671875
3
[]
no_license
const dbconn = require('.././dbconn'); exports.getAllCategories = (request, response, next) => { dbconn.query('SELECT * FROM categories') .then((data) => { const categories = data.rows response.status(200).json(categories); }) .catch(error => { response.status(500).json({ "status":"Error, Co...
true
3b6abc127bcb4fd2712d0bd6e5be6380ad24a5a6
JavaScript
mariopl/campusparty-firefoxos-push
/Pocket-Kitten/js/util.js
UTF-8
575
2.640625
3
[]
no_license
// Perform a request against the simplepushclient server var doRequest = function doPost(type, uri, data, cb) { if (uri.indexOf('http://') != 0) { uri = 'http://catservice.eu01.aws.af.cm' + uri; } var xhr = new XMLHttpRequest({mozSystem: true}); xhr.onload = function onLoad(evt) { if (xhr.status === 20...
true
de1beccf82393d178af9d62688f45992cd149915
JavaScript
tmollov/SoftUni-Software-Engineering
/JSCore/JS-Advanced/Exercises/05.jQueryLibrary/src/incrementCounter.js
UTF-8
931
3
3
[ "MIT" ]
permissive
function increment(selector) { let element = $(selector); let textArea = $('<textarea>') .addClass('counter') .attr('disabled',true) .text(0); let buttonIncrement = $('<button>') .addClass('btn') .attr('id','incrementBtn') .text('Increment') .on('cli...
true
a82dba2e809df7efb879b1d3677f9894c5bd4c49
JavaScript
mikewong-sfsu/GeneDive
/automation/lib/ui/automation/view/Graph.js
UTF-8
4,304
2.828125
3
[ "MIT" ]
permissive
/** * @class Graph * @brief Results Graph Viewer API * @details Automates the MVC Graph Viewer. * @authors Mike Wong mikewong@sfsu.edu * @ingroup MVC */ let Graph = (superclass) => class extends superclass { // ============================================================ constructor( page, brows...
true
3d8ae58155b30e4097b20ea15e04a900300a0855
JavaScript
michaelpautov/leetcode
/easy/252-meeting-rooms.js
UTF-8
427
3.375
3
[]
no_license
/** * @param {number[][]} intervals * @return {boolean} */ var canAttendMeetings = function(intervals) { intervals.sort((a,b) => { return a[0] - b[0] }) for(let i = 0; i < intervals.length - 1; i++) { if (intervals[i][1] > intervals[i + 1][0]) { return false; } } return true; }; consol...
true
239a37008c1ab2549dcc6041a1fcaa92edeaeb28
JavaScript
selva3003/react-gu6arc
/src/ReactReduxAxios.js
UTF-8
947
2.59375
3
[]
no_license
/* 1. Create a reactApp "npx create-react-app {appName}" 2. install axios for the http request calls. 3. npm install redux react-redux redux-thunk redux-devtools-extension --save 4. create actionTypes 5. create action creators for the action types. 6. create reducers js which will hold the initial state. ...
true
b371ebf4f8ce1dbd5ba887843d9ff119fddd7c86
JavaScript
emmynice/JavascriptTask
/script.js
UTF-8
346
3.21875
3
[]
no_license
var userName = "Daniel Emmanuel Enyojo"; var myCourses = ['HTML', 'CSS','JAVASCRIPT','PHP','NODE JS']; console.log("Name:" + userName); console.log(myCourses); if(myCourses.length%2 !=0){ var n; for(n=1;n<=200; n++){ if((n%2)!=0){ console.log(n); } } } if(myCourses.length%2 ==0){ var n; for(n=1;n<=200; n++){ i...
true
68d591356385d804739ec879b299d2a71f78622e
JavaScript
Borgaard/jsd3-solution-files
/16-deploying-your-app/01-make-a-person/app.js
UTF-8
761
3.75
4
[]
no_license
var applicant = { age: 58, zip: 08142, gender: 'f' } var rating = (function runAnalysis(age, zip, gender) { var x = 52.38975, y = 0.9824; // a closure: var calculate = (function() { var intermediate = (zip / x) * (age * y); if (gender = "m") { final = intermediate + 16.83; } else if (gender = "f") { ...
true
4d661dc4dc3839ea772ad6e990414c11fb58c8a8
JavaScript
OGNova/hastebin.js
/test/jest.test.js
UTF-8
986
2.859375
3
[ "MIT" ]
permissive
const Hastebin = require('../src/index.js'); let h; describe('Basic client', () => { h = new Hastebin(); test('client values', () => { expect(typeof(h.options)).toBe('object'); expect(typeof(h.dev)).toBe('boolean'); expect(typeof(h.url)).toBe('undefined'); expect(typeof(h.baseURL)).toBe('string'); ...
true
ded69e26092fe7ffc1968cc4df4dcafb4c4e888e
JavaScript
iamelisandromello/sistema_profileit
/public/js/questionario/answer.js
UTF-8
7,043
2.53125
3
[ "MIT" ]
permissive
jQuery(document).ready(function() { var ok = "#btnOK"; var clean = "#btnClean"; var radio = ":radio"; var color; var i = 1; var parte1 = "question_"; var parte2 = "msg-box"; var msg; var successBack; var failureBack; var answer; var state = true; $("input[type='radio...
true
2b460a3fd242b80d290aae0710e9a0ca767499b3
JavaScript
eerojala/Cyber-Security-Base-Project-Backend
/controllers/users.js
UTF-8
1,366
2.625
3
[]
no_license
const bcryptjs = require('bcryptjs') const usersRouter = require('express').Router() const User = require('../models/user') usersRouter.get('/', async (request, response) => { try { const users = await User.find({}) response.json(users.map(User.format)) } catch (exception) { console.lo...
true
258222d7ce029e22e8faf3ec7eccf02b196e946e
JavaScript
sudipto68/emazon
/src/components/Cart/Cart.js
UTF-8
995
2.65625
3
[]
no_license
import React from "react"; import "./Cart.css"; const Cart = (props) => { const { cart } = props; const price = Math.round( cart.reduce((sum, product) => sum + product.price * product.quantity, 0) ); let shipping = 0; if (price === 0) { shipping = 0; } else if (price > 20) { shipping = 0; } ...
true
1bb384504c5951dd9163f31a2788251b9af6e9a7
JavaScript
VasilVP/Software-University-Courses
/Level 1/JavaScript-Basics-November2014/03. Loops, Arrays, Strings/06.MaxSequence/scripts/06.MaxSequence.js
UTF-8
874
3.53125
4
[]
no_license
function readInput() { var input = [2, 'qwe', 'qwe', 3, 3, '3']; // modify input here printMaxSequence(input); } function printMaxSequence(input) { var maxSequence = []; var currentSequence = []; var lastElement = input[0]; for (var index = 0; index < input.length; index++) { if (las...
true
9a50d8c44fba285c935fc654e17eddb344ec3b54
JavaScript
joseluismonrealeusebio/proyectoiot
/public/js/main.js
UTF-8
1,536
3.21875
3
[]
no_license
<canvas id="canvas" width="500" height="500"></canvas> var base = new Image(); var eje = new Image(); var rota; let apagador = document.getElementById("checkbox"), slider = document.getElementById("range"); function fun(val) { let x = val == 0 ? 10 : 0; apagador.value = x; clean(); slider.value = x; } ...
true
e4e7c8cfe1b215fa7b6f4ef3a50d738fc0646acf
JavaScript
nwong25/beauty-store
/client/store/product.js
UTF-8
5,628
2.546875
3
[ "MIT" ]
permissive
import axios from 'axios' /** * ACTION TYPES */ const GET_ALL_PRODUCTS = 'GET_ALL_PRODUCTS' const SELECT_PRODUCT = 'SELECT_PRODUCT' const ADD_TO_CART = 'ADD_TO_CART' const SEARCH_PRODUCTS = 'SEARCH_PRODUCT' const GET_CART = 'GET_CART' const CLEAR_CART = 'CLEAR_CART' const EDIT_CART_QUANTITY = 'EDIT_CART_QUANTITY' co...
true
950b2fca23ad34da7f19c134dea95e7d01802cab
JavaScript
loraruffin/portfolio
/projects/particles/js/particles.js
UTF-8
3,238
2.765625
3
[]
no_license
var container, stats, texture; var camera, scene, renderer, particles, geometry, materials = [], parameters, i, h, color, size; var mouseX = 0, mouseY = 0; var image; var canvasWidth = 800; var canvasHeight = 400; var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeigh...
true
3b262788b504be9e2c6ba2a0a81aa68990150904
JavaScript
austinkret/lighthouse-js-fundamentals
/lighthouse-js-fundamentals/merge-arrays.js
UTF-8
336
3.296875
3
[]
no_license
function merge(array1, array2) { let newArr = array1.concat(array2).sort(function (a, b) { return a - b; }); { return newArr.sort(); } } console.log(merge([4, 5, 6], [1, 2, 3, 4]), "=?", [1, 2, 3, 4, 4, 5, 6]); console.log(merge([4], [2, 5, 8]), "=?", [2, 4, 5, 8]); console.log(merge([1, 2, 6], []), "=...
true
267dad0eea82f3247509bb3237eb0b920135aad8
JavaScript
deannaberg/arctic_berg_portfolio
/js/carousel.js
UTF-8
1,868
3.046875
3
[]
no_license
const forwardButton = document.querySelector(".rightButton"); const backButton = document.querySelector(".leftButton"); const carousel = document.querySelector(".carousel"); let width = carousel.offsetWidth; let carouselContent = document.querySelector("#carouselInner"); const moveForward = function () { carousel.sc...
true
2e8f92f94dd3680af31881e84665b0a10ab753f4
JavaScript
Marnay1/Project--82
/main.js
UTF-8
1,575
3.390625
3
[]
no_license
var mouseEvent="" canvas= document.getElementById("myCanvas"); ctx= canvas.getContext("2d"); var color= "red"; var radius= 20; var linewidth= 5; canvas.addEventListener("mousedown", my_mousedown); function my_mousedown(e){ color= document.getElementById("color").value; linewidth= document.getElementB...
true
7733e75805363efd40f2538bd49d510b8d832705
JavaScript
plusxp/ARCHIBUS_Dev
/schema/ab-products/common/mobile/src/Common/util/TableDef.js
UTF-8
9,864
2.796875
3
[]
no_license
/** * Utility class to manage operations on TableDef objects * * @author Jeff Martin * @since 21.1 */ Ext.define('Common.util.TableDef', { alternateClassName: [ 'TableDef' ], requires: 'Common.Session', singleton: true, /** * Extract the enumerated list information from the the TableDef Fiel...
true
72fbb047295c14e4542ac57e10050a050d52fc13
JavaScript
tk1/dup
/readdirPromise.js
UTF-8
484
3.03125
3
[]
no_license
const fs = require('fs'); /* fulfilled */ listDir('.') /* rejected */ listDir('xxx') function listDir(path) { readdirPromise(path).then( files => { files.forEach(function (fileName) { console.log(fileName) }); }, err => console.log(err) ) } func...
true
f7d8ae6bcc70f6064d4a5b1c1eb0cdbb99d7304d
JavaScript
rvishwakarma101992/mod1
/api/publishers.js
UTF-8
2,139
2.515625
3
[]
no_license
(function () { 'use strict'; module.exports = function(app, db){ app .get('/publishers',get_all_publishers) .post('/publishers',insert_into_publishers) .delete('/publishers/:publishers_id',delete_from_publishers) .get('/publishers/:publishers_id',get_by_id_from_publishers) .put('/publishers/:publishers_id',upd...
true
f1a6abeaf20ad075cf78e1be8556d01f4c9d531e
JavaScript
Thabiso22/bootcamp-terminal-tests
/countAllFromTown.js
UTF-8
487
2.921875
3
[]
no_license
//const assert = require ("assert") var countAllFromTown=function countAllFromTown(regNum,location){ var splitString = regNum.split(","); var results = []; for (i = 0;i<splitString.length;i++){ if ( splitString[i].startsWith(location)){ results.push(splitString[i]); } } return results.length; } console.log(countAll...
true
08b67fff260d6c21737c69714f267d906f28ae2e
JavaScript
Neuron-The-Coder/Mid-Project-LnT-2021
/Portfolio/Part1JS.js
UTF-8
4,517
2.59375
3
[]
no_license
$(document).ready(function(){ AOS.init(); var words="Welcome to my portfolio" var j = 0 window.addEventListener('scroll', Appeared) window.addEventListener('mouseenter', TextAppear) function typeP(){ if (j == words.length) return var temp = $("#welcome").text()...
true
ea51adcd758721b94de52d9d053748a9cd8adfac
JavaScript
naoxink/is
/src/is.lib.js
UTF-8
690
3.234375
3
[ "MIT" ]
permissive
class Is { defined(v){ return typeof v !== 'undefined' } boolean(v){ return typeof v === 'boolean' } number(v){ return typeof v === 'number' } null(v){ return v === null } array(v){ return v.constructor === [].constructor } object(v){ return v.constructor === {}.const...
true
c4e3862ef21416217dc5031d2f7bcf5909501522
JavaScript
JeremieAstray/AIE_tender_Service
/WebRoot/js/register.js
UTF-8
1,008
2.671875
3
[]
no_license
$(document).ready(function(){ var num = 1;//初始化num //页面加载初始化操作 $("div.showDiv div").hide();//隐藏所有内容 $("div.content h1").hide(); $("ul li a:first").addClass("active");//选中第一个 $("div.showDiv .Menu1").show();//显示第一个内容 $("div.content .registerText1").show(); //为切换描点绑定点击事件 $("ul li a").click(function(){ ...
true
da4bf42c4df13be9444b1e1f8104a0774ad2df4a
JavaScript
brellin/DOM-I
/js/index.js
UTF-8
6,520
2.734375
3
[]
no_license
const siteContent = { "nav": { "nav-item-1": "Services", "nav-item-2": "Product", "nav-item-3": "Vision", "nav-item-4": "Features", "nav-item-5": "About", "nav-item-6": "Contact", "img-src": "img/logo.png" }, "cta": { "h1": "DOM Is Awesome", "button": "Get Started", "img-sr...
true
8e7a69186b8b64afa5adb8354c2e18327a50d53e
JavaScript
dannyevega/interview-questions
/hbc.js
UTF-8
1,717
4.3125
4
[]
no_license
// Build a Image Gallery with HTML/CSS and JS <html> <head> <style> body { background-color: #1d2126; color: white; } </style> </head> <body> <h1>Hello, World</h1> </body> </html> // Problem 1 (() => { console.log('this is the start'); setTimeout(function cb() { ...
true
0cfb7769aa3ad60fe8d98457562f80ec66f8088c
JavaScript
orangecig/vade-mecum-shelf
/renderer/units/JSON Formatter/json.js
UTF-8
15,294
3.484375
3
[ "MIT" ]
permissive
// // The state of the parser, one of // 'go' The starting state // 'ok' The final, accepting state // 'firstokey' Ready for the first key of the object or the closing of an empty object // 'okey' Ready for the next key of the object // 'colon' Ready for the colon // 'ova...
true
affce0f216f7e0fb072c670c4a46ee5350e2d0bf
JavaScript
enunez91/ShoppingCart
/sample-code/crud-operations.js
UTF-8
938
2.5625
3
[]
no_license
var mongodb = require('mongodb'); var test = require('assert'); var uri = 'mongodb://localhost:27017/example'; mongodb.MongoClient.connect(uri,function(error,db){ test.equal(null,error); //docs var movie = [ { title:'Jaws', year:1975, director:'Steven Spielberg', rating:'PG' }, ...
true
c2002671e198e45d71ebe3e8cdd549f1ef3b3c70
JavaScript
ihgazni2/webidl2-mozilla-compatible
/lib/validators/helpers.js
UTF-8
1,612
2.875
3
[ "MIT" ]
permissive
/** * Yields direct references to dictionary within union. */ export function* dictionaryWithinUnion(subtypes, defs) { for (const subtype of subtypes) { const def = defs.unique.get(subtype.idlType); if (def && def.type === "dictionary") { yield subtype; } } } /** * @return the type reference t...
true
0a62e08c21e18c1c3a1ebdb605bde606b08efce0
JavaScript
alenia/code-on-versal
/react-boilerplate-master/scripts/components/app_component.js
UTF-8
1,548
2.578125
3
[ "MIT" ]
permissive
/** @jsx React.DOM */ var React = require('react'); var EditComponent = require('./edit_component'); var LearnComponent = require('./learn_component'); module.exports = React.createClass({ getInitialState: function() { return {editable: false}; }, setAttributes: function (attributes) { this.props.play...
true
e91ce93c55358d9066803f43f76de60bf39b5dcd
JavaScript
brain2/guess-melody
/js/utils.js
UTF-8
607
2.5625
3
[]
no_license
import timerLayout from './components/timer'; export const createElement = (template) => { const container = document.createElement(`template`); container.innerHTML = template; return container.content; }; const main = document.querySelector(`.app .main`); export const changeView = (view) => { main.innerHTM...
true
035dc1300df6e907a48f18a89bf31a8e3c542770
JavaScript
ChinaHuangDY/MovieWeb
/Web_UI/JavaScript/common/jokeep.dateformat.js
UTF-8
8,541
3.390625
3
[]
no_license
// 对Date的扩展,将 Date 转化为指定格式的String // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) // 例子: // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 Date.prototype.Format = funct...
true
025352a6e773052613a994ab70656576649d9ccd
JavaScript
lincx-code/local_site_search
/web/js/site.js
UTF-8
618
2.859375
3
[]
no_license
$(document).ready(function() { //Required for strict JS code "use strict"; //Static Search box function ***************************************** let baseURL = ""; $("#search").keypress(function(e) { let key = e.which; if (key === 13) { //alert("Enter key pressed"); let searchTerm = $(th...
true
225294328e87f76e1610ced1b3f7a5526414ea1d
JavaScript
artikhovich/php7examples
/app/js/app.js
UTF-8
2,480
2.71875
3
[]
no_license
import {User, createProduct, vanillaProducts as Products, category} from './lib.js'; function productsDataBegin(){ let read_products_html=``; read_products_html+=`<table class="products"><tbody>`; read_products_html+=`<tr> <th class='head'>ID</th> <th class='head'>Название</th> <th class='head'>Описан...
true
7451b6d2b8b311e4ee8608a33438d178f0738ed6
JavaScript
qinfangge/Gift
/Web/Admin/js/checkBox.js
UTF-8
307
2.6875
3
[]
no_license
$(document).ready(function () { $("#checkAll").click(function () { if ($(this).attr("checked")) { $(this).parents("table").find(":checkbox").attr("checked", "checked"); } else { $(this).parents("table").find(":checkbox").attr("checked", ""); } }); });
true
cc3f8fd99a67795eba4bab9e6a4c1942fef63ebf
JavaScript
chaitumanne/Advanced-Software-Engineering-Assignments
/Assignment4/Source/Assignment4/Weather.js
UTF-8
2,663
2.59375
3
[]
no_license
/** * Created by VARSHA-PC on 2/17/2016. */ var app = angular.module('weatherapp',[]) app.controller('ctrl',function($scope,$http){ document.getElementById('destination-input').onkeydown = function(e){ if(e.keyCode === 13){ $scope.checkWeather = function (e) { var source = do...
true
9ff01e8aa901b9496e4351127bf1209387800df9
JavaScript
fillerwriter/geo.js
/test/distance.js
UTF-8
322
2.625
3
[]
no_license
test( "distance test", function() { var nashville = { type: 'Point', coordinates: [-86.7878, 36.1538] }; var chicago = { type: 'Point', coordinates: [-87.6718, 41.865] }; ok(Math.round(geoJS.distance(nashville, chicago)) == 640 , "Distance between Nashville and Chicago is roughly 640 km. "); }...
true
a6d0ff9e6433bf02cca24c679cd3f84706beda20
JavaScript
niuzhiyong2016-11/201611node
/8.react/js/5.status.js
UTF-8
774
3.390625
3
[ "MIT" ]
permissive
/** * 1.状态只能在组件内部初始化 * */ var Person = React.createClass({ //定义初始状态 getInitialState(){ return {happy:true} }, handleClick(){ //setState用来修改状态对象,修改完成后会重新触发组件的渲染 // this.state.happy = !this.state.happy; this.setState({happy:this.state.happy}); }, render(){ co...
true
aa80d03e834ca9a7b969df0463a5ac8a5c3adeea
JavaScript
milkis-road/remont
/repairs/js/main.js
UTF-8
506
2.578125
3
[]
no_license
$('.container').on('mousemove', (e) => { const x = e.pageX / $(window).width(); const y = e.pageY / $(window).height(); $('.left-earphone').css( 'transform', 'translate(-' + x * 60 + 'px, -' + y * 50 + 'px)' ); $('.smartphone').css( 'transform', 'translat...
true
f9ca3bb2d5b02fd160d6f27f66719fab09d32e44
JavaScript
dev-cats/BetterDiscordStuff
/BDPluginLibrary/src/ui/settings/types/file.js
UTF-8
916
2.5625
3
[ "MIT" ]
permissive
import SettingField from "../settingfield"; import {DiscordClasses, DOMTools} from "modules"; /** * Creates a file picker using chromium's default. * @memberof module:Settings * @version 0.0.1 * @extends module:Settings.SettingField */ class FilePicker extends SettingField { /** * @param {string} name - na...
true
fcf0919f76ddfbe5c25e446663b02d0318864ed0
JavaScript
nobilo/hacker_news
/src/Components/Stories.js
UTF-8
678
2.59375
3
[]
no_license
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Story from './Story'; class Stories extends Component { render() { let stories; if(this.props.stories) { stories = this.props.stories.slice(); /* Sort list of stories by index property. On this way we...
true
ee79b225c5c60072909d308deb5f29321daa6ece
JavaScript
samyarmodabber/React
/examples/mobx-examples/vanilla-mobx-example/main.js
UTF-8
965
3.4375
3
[ "CC-BY-4.0" ]
permissive
(function () { // ******* Model/state/store ******* const person = mobx.observable({ name: 'nouran', get nameWithGreetings() { return 'Hallo,' + this.name + '!'; }, addNewName: mobx.action('addNewValue', function (value) { person.name = value; ...
true
82f2d246ab7e30e1edff206c3c66e6150147c06c
JavaScript
stanford-oval/project-cardiology
/server/routes/auth.js
UTF-8
1,340
2.578125
3
[]
no_license
var express = require('express'); var router = express.Router(); var bcrypt = require('bcrypt'); var connection = require('../database'); router.post('/signup', (req, res) => { let username = req.body.username; let password = req.body.password; if (username === null || username.length < 1) { return res.stat...
true
8c60935efe01dd17761e00d9c1c10abc98182102
JavaScript
peizhuli/mpvueCloudMusic
/cloudMusic/src/utils/index.js
UTF-8
1,999
3.09375
3
[]
no_license
function formatNumber (n) { const str = n.toString() return str[1] ? str : `0${str}` } export function formatTime (date) { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.getHours() const minute = date.getMinutes() const second = date.getS...
true
3a98c80bd90775756713464418fcd1c5011146a0
JavaScript
flushentitypacket/concepts
/algos/mergesort.js
UTF-8
1,461
4.28125
4
[ "MIT" ]
permissive
// Merge: given 2 sorted lists, combine to make 1 sorted list // NOTE: `merge` mutates listA and listB const merge = (listA, listB) => { const merged = [] while (listA.length > 0 && listB.length > 0) { if (listA[0] <= listB[0]) { merged.push(listA.shift()) } else { merged.push(listB.shift()) ...
true
d749b7343ec398d830b7d7012ebb9dae873f1ba6
JavaScript
guillaumearm/Fjs
/async_test.js
UTF-8
1,893
2.78125
3
[ "MIT" ]
permissive
import { _do, _doAsync, print, Writer, Just, Nothing, Async, id } from './F' import './basic_test' console.log("-------- Begin asynchronous tasks ---------") /******************************************************************************/ const task = i => Async (done => { setTimeout(() => { console.log(i) d...
true
5530f417f9669f4fca7621887c94cdd13747d9ed
JavaScript
The-hated-one/leetcode-interview-prep
/rotate-image/rotate-image.js
UTF-8
778
3.453125
3
[]
no_license
/** * @param {number[][]} matrix * @return {void} Do not return anything, modify matrix in-place instead. */ var rotate = function(matrix) { const transpose = (matrix) => { const n = matrix.length; for (let i = 0; i < n; i++){ for (let j = 0; j <= i; j++){ [matrix[i][j...
true
670f73a4c4ebc05615258d8ae21c122ee9ebc685
JavaScript
wedgey/music-library-server
/app/apiManagers/youtubeManager/queryBuilder.js
UTF-8
539
2.515625
3
[]
no_license
const BASE_URL = "https://www.googleapis.com/youtube/v3/"; const YOUTUBE_API_KEY = process.env.YOUTUBE_API_KEY; const createParams = (params) => { let paramsArray = Object.entries(params).map(param => `${param[0]}=${param[1]}`); let keyParam = paramsArray.length > 0 ? `key=${YOUTUBE_API_KEY}&` : `key=${YO...
true
cb29233448f40ffbdb5eb4a7e9269faf8979367c
JavaScript
mathoglu/cat-testing
/src/reducers/cats.js
UTF-8
862
2.609375
3
[]
no_license
const _initialState = { status: 'DONE', cat: {} }; const reducer = (state = _initialState, action) => { switch (action.type) { case 'NEW_CAT': return Object.assign( {}, state, { cat: action.cat, sta...
true
1a6521e81924a775192c9d1e4b46a4de8ccdbe41
JavaScript
lumiwazeare/covid19
/src/App.js
UTF-8
1,226
2.640625
3
[]
no_license
//import logo from './logo.svg'; import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; import { useState , useEffect} from 'react'; import Home from './Home'; import PageHeader from './PageHeader'; import useFetch from './FetchData'; function App() { const {data:countries} = useFetch("data/dat...
true
b4c24fb8d6f6cc539912d4832b297e8aed6c5907
JavaScript
liushudan/Jackal
/Scripts/utilities.js
UTF-8
1,131
3.015625
3
[]
no_license
/* Различные вспомогательные функции */ /* Принимает событие с абсолютными координатами и ссылку на канвас, возвращает объект с относительными координатами (относительно канваса) */ function getCursorPosition(e, gCanvasElement) { var x; var y; if (e.pageX != undefined && e.pageY != undefined) { ...
true
e4b339f9a7c21c0474f4325d93bc905e8b96ea58
JavaScript
lollang/Algorithm_
/Two Pointers/16_3Sum_Close.js
UTF-8
510
3.390625
3
[]
no_license
/** * @param {number[]} nums * @param {number} target * @return {number[][]} */ function Three_Sum_Close(nums, target) { nums.sort((a, b) => a - b); let result = nums[0] + nums[1] + nums[nums.length - 1]; for(let i = 0; i < nums.length - 2; i++){ let start = i + 1, end = nums.length - 1; while(start < end){ ...
true
5c66c02d7a4dc1da509ad8ddc5b4d59bf0b38367
JavaScript
DerekHung/react-semantic-module
/client/containers/editor/react-html-parser/src/utils/ProcessNodes.js
UTF-8
1,736
2.96875
3
[ "MIT" ]
permissive
import ElementTypes from '../elementTypes'; /** * Tests a htmlparser2 node and returns whether is it a text node at the start and end of the line containing only * white space. This allows these node types to be excluded from the rendering because they are unnecessary. * * @param {Object} node The element object a...
true
53835a7f64987ee895b47aeda669104d7b6b9410
JavaScript
toiletgaming/libjewtrick
/index.js
UTF-8
1,097
2.734375
3
[ "MIT" ]
permissive
const fetch = require( "node-fetch" ); class JewTrickAPI { Status( callback ) { try { fetch( "http://server.jewtrick.xyz/jewtrickstatus.html" ) .then( res => res.text( ) ) .then( body => callback( false, body ) ) .catch( error => callback( true, error ) ); } catch( error ) { callback( tru...
true
455b5e859b1b27f5b053e36357d381a6a80173c1
JavaScript
jfernandezcorral/wc-tree
/src/components/servicios.js
UTF-8
2,476
2.5625
3
[]
no_license
const get = (url)=>{ let headers = new Headers(); headers.append('Accept', 'application/json') headers.append('x-j_gid_cod_app','e2') return fetch(url,{credentials: 'same-origin', headers}).then(resp=>{ if (resp.ok){ const ct = resp.headers.get('content-type') if (ct && c...
true
8030517e98b76c13d04f2ca60c9f9797f7af8029
JavaScript
vanderson-henrique/trybe-exercises
/FRONT-END/BLOCO_12/12_2/conteúdo/my-form/src/SelectTecnologia.jsx
UTF-8
622
2.515625
3
[]
no_license
import React from 'react'; class SelectTecnologia extends React.Component { render() { const { value, handleChange } = this.props; return ( <label> Escolha sua Tecnologia: <select name="tecnologia" value={value} ...
true
17623f7913c9ab0e87d95f655b77bb825c3ce12b
JavaScript
sameermithani/The_Odin_Project
/Javascript_Projects/TODO_List/src/index.js
UTF-8
8,048
2.640625
3
[]
no_license
import { createTODO } from './todo'; import { createSidePanel, createProject } from './sidepanel' import { createMidPanel } from './midpanel' import { editPopup, projectPopup } from './popup' class TODO { constructor(title, description, priority, dueDate, magic) { this.title = title; this.descripti...
true
368172a6f6469afeb3a07a9221261b9994a1b9ed
JavaScript
juanpabloch/ejercicios-javascript
/ejercicio1.js
UTF-8
932
4.1875
4
[]
no_license
//problema 1 //funcion parametros name, lastName, userId, que devuelva un string //con iniciales, nombre completo, y userId let name = prompt("ingrese nombre: ").toLowerCase(); let lastName = prompt("ingrese apellido: ").toLowerCase(); let userId = Number(prompt("ingrese numero de usuario: ")); //se llama la funci...
true
663afb801c20eb68ea93fb46b1819bb667b96990
JavaScript
TKRchamak/es6-practice
/inheritance.js
UTF-8
467
3.328125
3
[]
no_license
class Parents{ constructor(){ this.parentsName = "Kanak Kumar Roy"; this.title = 'Kumar Roy'; } } class Child extends Parents{ constructor(name){ super(); this.childName = name; } fullName() { return this.childName + " " +this.title; } } const parent = ne...
true
9baf8b27c22add3840af6483685a5ae46e433abd
JavaScript
Gideon877/waiters_2018
/src/api/api.js
UTF-8
1,719
2.515625
3
[]
no_license
'use strict' const _ = require('lodash'); const bcrypt = require('bcrypt'); const moment = require("moment"); const API = require("./general"); module.exports = function(models) { const Api = API(models); const registerNewUser = async (data) => { // const data = {} ; //req.body || {}; const ...
true
b57268082441ea45d6c51fc655e0673a3531f0c5
JavaScript
solkaz/metroid-password-generator
/src/components/Missiles.jsx
UTF-8
1,053
2.78125
3
[ "MIT" ]
permissive
import React, { PropTypes } from 'react'; import { numberToBitset, padBitsetRight, isNumeric } from '../utils.js'; const missileCountMax = 255; const isValidInput = (val) => { return isNumeric(val) && val <= missileCountMax; }; const Missiles = ({ saveMissileCount, value }) => { const onChange = (ev) => { //...
true
a6c2e74ad701ac73e2b3c66f43daf9febef30ec8
JavaScript
hemyan-ha1401812/Enterprise-Resoure-From-S2019
/Lab 6-AsyncJS/Totorial/UnitConverter/UnitConverter.spec.js
UTF-8
479
2.65625
3
[]
no_license
const unitConverter = require('./UnitConverter') const expect = require('chai').expect; describe("Unit Converter Test Cases", () => { //test case 1 describe("Weight Methods test cases ", () => { it('1 kgToOunce should return 35.274 ', () => { expect(unitConverter.kgToOunce(1)).to.equal(35.2...
true
e67193e565c8806f63ebb46d7cff35881b0e2c96
JavaScript
zxymgl/gatsby-site-test
/utils/functions.js
UTF-8
195
2.5625
3
[]
no_license
export const getRouteNode = (path, parentPath) => { let node = path.substr(parentPath.length) if (node.substr(node.length -1 ) === '/') node = node.substr(0, node.length - 1) return node }
true
84f971398b0d02322c39a632f19abde47e2a16f2
JavaScript
caitie-gorham/teamProfileGenerator
/index.js
UTF-8
7,816
3.390625
3
[ "MIT" ]
permissive
// required packages const inquirer = require("inquirer"); const jest = require("jest"); const fs = require("fs"); const util = require("util"); const writeFileAsync = util.promisify(fs.writeFile); // read in class files const Engineer = require("./lib/Engineer"); const Intern = require("./lib/Intern"); const Manager ...
true
f371090eeac3c43bc6fce690b0f2da58afdeb552
JavaScript
mellor29j/timetracker
/js/timetracker.js
UTF-8
20,039
2.53125
3
[]
no_license
$(document).ready(function() { // Start app initialiseTimetracker(); Timetracker.retrieveTimers(); Timetracker.startUpdateTimers(); // Click handlers ================================================================== // Timetracker.element.submitNewTask.on("click", function(){ Timetrac...
true
6a435675ebcb707531bd3ec82cd28ea4ee89ec05
JavaScript
NickEU/misc
/misc-algo/grokk-book/2-divide-and-conquer/01-3-array-max-number.js
UTF-8
208
3.0625
3
[]
no_license
'use strict'; const findMaxElement = arr => { if (arr.length === 1) { return arr[0]; } return Math.max(arr[0], findMaxElement(arr.slice(1))); }; console.log(findMaxElement([5, 8, -2, 7, 13, 4]));
true
e0be372a6a3000c952ecd19b6b320af923bc5f27
JavaScript
AltufjevFrol/social-network
/social-network/src/components/status/status.jsx
UTF-8
1,945
2.71875
3
[]
no_license
import React from 'react'; import {Field, reduxForm} from 'redux-form'; let FormStatus = (props) => { return ( <form onBlur={props.handleSubmit} onSubmit={props.handleSubmit}> <Field component={'input'} placeholder={'new status'} name={'status'} autoFocus={true}/> </form> ); }; FormStatus = reduxForm({form:...
true
111390607cd68fa1ee3798b8716bb2cb2c209dc6
JavaScript
kaztros/take-home-challenge
/htmlTableFromRoles.js
UTF-8
2,191
2.90625
3
[]
no_license
'use strict'; const TABLE_PARAMETERS = [ { name : "Role", htmlFromRole : htmlRoleNameFromRole } , { name : "Users", htmlFromRole : htmlRoleUsageFromRole } , { name : "Permissions", htmlFromRole : htmlRolePermissionsFromRole } ] function htmlRoleNameFromRole(role, permissions) { return document.cr...
true
057cad2b39d244bb71df45d99d8d4ba5d8d4f2be
JavaScript
jeharcha/IIC3103-Taller-de-Integracion-2021-jeharcha-
/T1/src/components/counter.jsx
UTF-8
3,371
2.953125
3
[]
no_license
import React, { Component } from 'react'; import styled from 'styled-components'; import '../styles/a_button.css'; import heading from '../styles/heading.css'; class Counter extends Component { state = { title_: 'Tarea 1', author: 'Jorge Harcha', value_deprecated: this.props.counter.value, tags: ['ta...
true
89c1896aec99f377e7e060049da363782988ae04
JavaScript
humuyao98/StudioGhibli
/script.js
UTF-8
4,749
3.46875
3
[]
no_license
var producer; var director; var description; var score; var title; // access the root div in index.html const app = document.getElementById('movie'); // create a container as a div in the html const container = document.createElement('div'); container.style.backgroundColor = "#fcf3cf"; container.setAttribute('class'...
true
ae83b584ea3ab40d4499bc8edc89ec133dee47d5
JavaScript
bdmostafa/weather-app
/js/UI.js
UTF-8
3,296
3.234375
3
[]
no_license
// Handle UI of Weather App ================================= class UI { constructor() { // Selectors ====================================================== // day, date, location, temp, icons, time, feelings, cloudiness, humidity, pressure, sunrise, sunset, wind this.dayToday = document.get...
true
9f8a94d4a507a8213b83d262f05ddc1ffab7a5b1
JavaScript
livsi8/courseReact
/src/js/propTypes/rules.js
UTF-8
4,485
3
3
[]
no_license
export default [ { id: 1, props: 'optionalArray:', example: 'PropTypes.array', description: 'You can declare that a prop is a specific JS type. By default, these are all optional.' }, { id: 2, props: 'optionalBool:', example: 'PropTypes.bool', }, ...
true
d1b0419552e14d70f641093b121c7afde05223af
JavaScript
maxzintel/networking
/2-Streams-Basics/ex8-duplexStream.js
UTF-8
413
2.59375
3
[ "MIT" ]
permissive
const net = require('net'); // for tcp connections net.createServer((stream) => { // net takes this stream arg as a default. // Each incoming tcp connection takes a stream. A duplex stream, in particular. stream.pipe(stream) // Not an infinite loop since input and output are decoupled. Instead this acts as an echo ...
true
e8f61e70c63c611ce262c06b72b68157c230b31c
JavaScript
FredL17/Countdown-Timer-React
/src/components/UI/Message/Message.js
UTF-8
489
2.703125
3
[]
no_license
import React from "react"; // CSS. import classes from "./Message.module.css"; function Message(props) { let message = null; const timeLeft = props.minutes * 60 + props.seconds; if (props.ticking && timeLeft < props.totalTime / 2 && timeLeft > 0) { message = <p className={classes.message}>More than halfway t...
true
6ee7d19459bc1ec256f23bc96e033987cdd6c7ac
JavaScript
shephard-azaniyah-wm/dragonslayer-exercise-
/dragonslayer-excercise-.js
UTF-8
769
3.25
3
[]
no_license
/** * Created by session1 on 9/28/15. */ slaying = 1; youHit = Math.floor(Math.random()* 2); damageThisRound = (Math.random()* 5 + 1); totalDamage = 0 var slaying = 3; while(slaying) { if (youHit) { console.log("You have have poked the dragon successfully! "); totalDamage += damageThisRound; ...
true
bb6a26b3cc7710e315db261637e4e4a5c19ba73d
JavaScript
Lideqiang2019/JavaScript-LeetCode
/动态规划/Offer14- I. 剪绳子.js
UTF-8
985
3.671875
4
[]
no_license
/** * 剑指 Offer 14- I. 剪绳子 给你一根长度为 n 的绳子,请把绳子剪成整数长度的 m 段(m、n都是整数,n>1并且m>1),每段绳子的长度记为 k[0],k[1]...k[m-1] 。请问 k[0]*k[1]*...*k[m-1] 可能的最大乘积是多少?例如,当绳子的长度是8时,我们把它剪成长度分别为2、3、3的三段,此时得到的最大乘积是18。 示例 1: 输入: 2 输出: 1 解释: 2 = 1 + 1, 1 × 1 = 1 示例 2: 输入: 10 输出: 36 解释: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36 */ var cuttingRope = function(n...
true
85255c1b7a746d5de939ff61b8399958c88e3ffa
JavaScript
Jaypopy/CSGO-Web-Updated
/openNav.js
UTF-8
653
3.015625
3
[]
no_license
function openNav() { document.getElementById('myNav').style.width = '100%' document.getElementById('myNav').style.animation = 'animation: fadeIn ease 2s' } function closeNav() { document.getElementById('myNav').style.width = '0%' } function displayNextImage() { x = x === images.length - 1 ? 0 : x + 1 docume...
true
fc5960eebc3bd3a5bf8e218aec94a49d50cbf7cd
JavaScript
ArjunReddyD/eight-track-normalize-multipart
/lib/eight-track-normalize-multipart.js
UTF-8
894
2.8125
3
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
// Load in dependencies var _ = require('underscore'); // Define helper function to parse data function normalizeMultipart(info) { // Find the content type header var contentTypeKey = 'content-type'; var contentType = info.headers[contentTypeKey]; if (!contentType) { contentTypeKey = 'Content-Type'; co...
true
8b3ac5f9bd76a7e6c328f97757bb97ed7116adbb
JavaScript
kongkmj/lastFinalRoadBeta
/index.js
UTF-8
18,458
2.859375
3
[]
no_license
var express = require('express'); var app = express(); var path = require('path'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'); var querystring = require('querystring'); var data_1,data_2,data_3,data_4,data_5; //데이터 변수 var r11,r21,r31,r41,r5...
true
c6bb5d7d91cb38627b546d6a95d22b6baaffd991
JavaScript
liquid36/CuandoLlegaAndroid
/app/src/main/assets/www/Scripts/ws.js
UTF-8
8,954
2.6875
3
[]
no_license
$(document).ready(function () { var recDni = localStorage.getItem('keyDni'); var recTarjeta = localStorage.getItem('keyTarjeta'); document.getElementById("txtDni").value=recDni; document.getElementById("txtNumTajeta").value=recTarjeta; if(recDni != null){ document.getElementById("chkRecordar").checked...
true
1796e8a9c458c2a463818e14f9acd429d75b5c7f
JavaScript
ChangedNameTo/PartyCheck
/src/Components/PartyTable.js
UTF-8
2,363
2.671875
3
[ "MIT" ]
permissive
import React, {useState} from 'react'; import {Table,Segment,Dimmer,Container,Loader} from 'semantic-ui-react'; import PartyTableRow from './PartyTableRow' function PartyTable(props) { const [column, setColumn] = useState('pulls'); const [direction, setDirection] = useState('descending'); const handleSort = cl...
true
bab604a6ccbed194ee93b2de387acb3316723a7f
JavaScript
PacktPublishing/MERN-Quick-Start-Guide
/Chapter02/Chapter2/3 Writing middleware functions/middleware-functions.js
UTF-8
414
2.6875
3
[ "MIT" ]
permissive
const express = require('express') const app = express() app.use((request, response, next) => { request.allowed = Reflect.has(request.query, 'allowme') next() }) app.get('/', (request, response, next) => { if (request.allowed) { response.send('Hello secret world!') } else { response.send('You are not allowed ...
true
a339f7d0dffc93896a234d2295c6cd53b4f6bbcd
JavaScript
Project-Fluid/Project-Fluid.github.io
/wiki.js
UTF-8
1,051
2.796875
3
[]
no_license
// Functions var getJSON = function(url, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'json'; xhr.onload = function() { var status = xhr.status; if (status === 200) { callback(null, xhr.response); } else { callback(status, xhr.response); } }; xhr.send(); }...
true
2c19bb6734e41721867d14cc978924bcd8d7afc4
JavaScript
mawusikpodo/Income-expence-tracker
/src/components/transaction/TransactionForm.js
UTF-8
1,820
2.53125
3
[]
no_license
import { Button, makeStyles, TextField, Typography } from "@material-ui/core"; import React, { useState, useContext } from "react"; import { GlobalContext } from "../../context/GlobalState"; const useStyles = makeStyles((theme) => ({ root: { "& .MuiFormControl-root": { width: "100%", }, }, newButto...
true
d4aa6bdb8943dfb3b1525abe6c453063bee6a2fa
JavaScript
wangjue666/Leetcode-Written-Using-Js
/路径总和.js
UTF-8
542
2.9375
3
[]
no_license
var hasPathSum = function(root, sum) { if (root == null) { return false; } if (root.left == null && root.right == null) { return sum - root.val == 0; } return hasPathSum(root.left, sum - root.val) || hasPathSum(root.right, sum - root.val); }; var hasPathSum2 = function(root,...
true
5e5f7715c0f34c19e5139dc918822f692005f253
JavaScript
dpfens/notificationProvider
/notificationProvider.js
UTF-8
5,246
2.59375
3
[]
no_license
"use strict"; (function(w) { var notifications = isNotifiable(), preferences = { notifications: localStorage.getItem("notifications") === "true" || false, }; navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; /* * @returns {void} toggles User prefe...
true
b63e792199d4a934fff4a7f7ed0fc4af79cc8643
JavaScript
kawarashige/furima-29821
/app/javascript/calc.js
UTF-8
596
3
3
[]
no_license
window.addEventListener('load', function () { const item_price = document.getElementById("item-price"); const add_tax_price = document.getElementById("add-tax-price"); const sell_profit = document.getElementById("profit"); item_price.addEventListener('input', function calc() { const num = parseInt(item_pri...
true
ee841827cb9ec844606c1dbb714addf7c6b74456
JavaScript
Reviewscouk/JsModel
/src/Model.js
UTF-8
9,109
2.640625
3
[]
no_license
import Builder from "./Builder"; import ModelCollection from "./ModelCollection"; import clone from 'clone'; /** * A base Model class. */ export default class Model { /** * Constructor * * @param {Object} [data={}] */ constructor(data = {}) { this.url = '/'; this.pri...
true
c0a91b1ab4a9ba120ef17f3288fcf70a1a107b9c
JavaScript
mikahjc/cs313-php
/web/assets/script/teams.js
UTF-8
356
2.640625
3
[]
no_license
function deleteTeam() { var teamSelect = document.forms["teamSelect"]["team"]; var teamName = teamSelect[teamSelect.selectedIndex].text; if (confirm("Are you sure you want to delete " + teamName + "?\nYour Pokemon will not be released.")) { document.forms["teamSelect"].action = "deleteTeam.php"; document....
true