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
0565b1eabf7071f3a9c0bbaacc79b14103e4fe43
JavaScript
dailc/leetcode
/algorithms/301-Remove-Invalid-Parentheses/Remove-Invalid-Parentheses.js
UTF-8
1,957
3.1875
3
[ "MIT" ]
permissive
/* 作者: dailc * 时间: 2017-07-31 * 描述: Remove-Invalid-Parentheses * * 来自: https://leetcode.com/problems/remove-invalid-parentheses */ (function(exports) { /** * @param {string} s * @return {string[]} */ var removeInvalidParentheses = function(s) { if (!s) { return [""]; ...
true
e554d31504d7b07dc89c283a57f5c13567898acb
JavaScript
puhakkaJ/fullstackopen2021
/part5/bloglist-backend/utils/list_helper.js
UTF-8
2,041
3.015625
3
[]
no_license
const blog = require("../models/blog") const _ = require('lodash') const dummy = (blogs) => { return 1 } const totalLikes = (blogs) => { const reducer = (sum, item) => { return sum + item } return blogs.map(blog => blog.likes).reduce(reducer, 0) } const favoriteBlog = (blogs) => { if (blogs.length === ...
true
b67002fcf72525ed4858104d8427c03a23efa6f6
JavaScript
xthecoolboy/Amaterasu
/commands/Music/search.js
UTF-8
2,954
2.6875
3
[ "MIT" ]
permissive
const Command = require("../../util/Command.js"); const handleVideo = require("../../util/MusicHandling.js"); const { RichEmbed, Util } = require("discord.js"); const he = require("he"); const ytapi = require("simple-youtube-api"); const youtube = new ytapi(process.env.GOOGLE_API_KEY); const idx = ["0️⃣", "1️⃣", "2️...
true
3beeb6d4c5c18c4c8a5bed17588dc425276a964f
JavaScript
dstuessy/louis-js
/src/louis.js
UTF-8
3,436
2.8125
3
[ "MIT" ]
permissive
/*jslint fudge, white: true */ (function () { 'use strict'; var requestAnimationFrame = window.requestAnimationFrame; if (requestAnimationFrame === undefined || requestAnimationFrame === null) { requestAnimationFrame = function(fn) { return setTimeout(fn, 0); }; } ...
true
071de96cc906e06cb4a67cf0fd34ad3b6dafd64a
JavaScript
amigo92/Resourcer
/public/app/controllers/customerCtrl.js
UTF-8
2,731
2.609375
3
[]
no_license
angular.module('customerCtrl', ['customerService']) .controller('customerController', function(Customer) { var vm = this; // set a processing variable to show loading things vm.processing = true; // grab all the customers at page load Customer.all() .success(function(data) { // when all the customers com...
true
d1d93517dd72594c099c6aabea1955a330094eea
JavaScript
jingjing721/ddc-wx
/utils/util.js
UTF-8
1,505
2.546875
3
[]
no_license
/* * Description: 对象转可拼接参数。 url: 跳转的URL;params: 对象形式的参数 * Types:url -> String; params -> Object * Author: yanlichen <lichen.yan@daydaycook.com.cn> * Date: 2019/1/8 */ export function navigateTo(url, params) { url += (url.indexOf("?") != -1) ? "" : "?"; for(var i in params) { url += ((url.indexOf("=") != -1) ? ...
true
e95cc59d9b03973d0ac99c89f88f5900e1299a81
JavaScript
imparthgalani/AP_MART
/AP_MART/build/web/js/image.js
UTF-8
519
2.59375
3
[ "MIT" ]
permissive
function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#showimg').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); // convert to base64 string } } $("#addimg").change(func...
true
6cf9750a44fe8184b6f303b97c7bcfe73cea63c9
JavaScript
awdsza/algorithm
/leetcode/easy/1678_Goal_Parser_Interpretation/awdsza.js
UTF-8
1,127
4.125
4
[]
no_license
/** * @param {string} command * @return {string} */ /*정규식을 이용해 푸는방법*/ /* Runtime: 72 ms, faster than 92.54% of JavaScript online submissions for Goal Parser Interpretation. Memory Usage: 39.1 MB, less than 5.48% of JavaScript online submissions for Goal Parser Interpretation. */ var interpret = function(command) { ...
true
e5518b20256840bb6cd9dacc736d7eb12b92f8fa
JavaScript
sergio8999/DWEC
/Unidad 1/Ejercicio 5/1_1.js
UTF-8
288
3.15625
3
[]
no_license
// var name = prompt("Tell me your name: "); var nombre = prompt("Introduce nombre: "); var apellidos = prompt("Introduce apellidos: "); var edad = prompt("Introduce edad: "); document.write("<p>"+nombre+"</p>"); document.write("<p>"+apellidos+"</p>"); document.write("<p>"+edad+"</p>");
true
b01e493eb74e9ce0a35c9960e1fbbd23e5c7855e
JavaScript
programmistik/MyInstagramOnContainers
/MyIdentityService/wwwroot/js/site.js
UTF-8
5,637
2.640625
3
[]
no_license
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification // for details on configuring this project to bundle and minify static web assets. // Write your JavaScript code. $(document).ready(function () { $(window).scroll(function () { if ($(this).scrollTo...
true
36e59143241ca05333ed5a9f279411dcffe2b475
JavaScript
Dung288-806/BuggerApp
/src/store/Reducer/ReducerBuilder.js
UTF-8
1,356
2.859375
3
[]
no_license
import * as ActionType from "../Actions/ActionType"; const INGREDIENT_PRICE = { meat: 0.5, bacon: 1, salad: 0.5, cheese: 1, }; const initialState = { ingredients: {}, totalPrice: 4, }; const reducer = (state = initialState, action) => { switch (action.type) { case ActionType.ADD: { const newI...
true
c3774eca3f24f530b702b7104566030ed2080002
JavaScript
bbukaty/VG-relations
/explorer.js
UTF-8
5,025
3.109375
3
[ "MIT" ]
permissive
// Load data into window subjects = null; d3.json("data/subjects_all.json", function(error, json) { if (error != null) { console.log(error); document.getElementById('loadGif').remove(); document.getElementById('loadError').style.visibility = 'visible'; return; } subjects = js...
true
876c91dc38740a6d2dd1a15c5c1993df4149dd49
JavaScript
yejing2514/ewj-
/emj/js/jquery.cookie.js
UTF-8
924
3.328125
3
[]
no_license
var cookieMy = new Object(); //遍历数组方法 cookieMy.arrsearch = function(value, arr) { for(var i = 0; i < arr.length; i++) { if(value == arr[i]) { return true; } } return false; } //添加cookie cookieMy.addCookie = function(key, value, day) { var date = new Date(); date.setDate(date.getDate() + day); do...
true
3c270be49f00c2296374e2a5a4dfaad22fe7566e
JavaScript
prudhvi2244/26-05-2021
/myscript2.js
UTF-8
691
2.984375
3
[]
no_license
var employee={ eid:1, ename:"Prudhvi", isSenior:true, mobiles:[9090901234,7878781234,899912345], address:{ streetno:'44/44', city:'Bangalore', state:'Karnataka' } } console.log(typeof(employee)) console.log('Diaplaying Employee Data') console.log(employee) console.log('E...
true
3bac44cbf88e749956b2d2d59fcc5fde563cae53
JavaScript
stas-yushkov/learn-js
/js/hw-01/practice/ternary.js
UTF-8
1,723
3.234375
3
[ "MIT" ]
permissive
{// ДЗ на тернарные const loginRight = '1111'; //это логин. лень долго вводить ручками при тесте const passwordRight = '2222'; //это пароль. лень долго вводить ручками при тесте let loginEntered = null; let passwordEntered = null; const messageNeedLogin = 'введи ло...
true
db882fbb575bcad0da18fd2475ea33ff7c1f3933
JavaScript
bkpetitt/Arrays
/matcharray02.js
UTF-8
3,919
3.09375
3
[]
no_license
// Programmer: BKP // Date: 09/05/2017 // Subject: Create two-dimensionmal array using Randomizers // arRow is current row of array // arCol is current column of array // maxRow and maxCol are maxium size of arrays rows and columns // // var matches= [ // ['day:','month:','date:','opponent:','locale:','time:','lafSc...
true
8cbd88ab495fafc5c22ca6528e6878116dc37d12
JavaScript
s-davies/aA_Classwork
/W9D4/skeleton/frontend/users_search.js
UTF-8
1,133
2.8125
3
[]
no_license
const APIUtil = require("./api_util.js"); const FollowToggle = require("./follow_toggle.js"); class UsersSearch { constructor($el) { this.$el = $el; this.$input = $el.find('input'); this.$ul = $el.find('.users'); this.searchString = []; this.handleInput(); } handleInput() { this.$input.o...
true
e2cc97bd3d5a78d67f6e50652785c7863ec5b363
JavaScript
Jinnapat/thinkfood-backend
/server/login.js
UTF-8
3,196
2.53125
3
[]
no_license
/*{ ... data : { user : customer or shop id : int } --->can i use '/profile/:user/:id' to get req.parms data required when user press profile button to enter to profile page }*/ // var bodyParser = require('body-parser'); // app.use(bodyParser.json()); // support json encod...
true
a53e24a63aa8f82c9c30bebc8863e26071cf7641
JavaScript
csmr/random-dev-notes
/nodejs-express-couch-fun.js
UTF-8
2,232
2.6875
3
[ "MIT" ]
permissive
/** Notes on express.js & cradle **/ // Routes // parametrizing a route app.get( '/showPlace/:place?', function( req, res ) { res.send( req.param('place', 'Helsinki')); // if no param place, uses default Helsinki }); // request-object // source https://github.com/visionmedia/express/blob/master/lib/request.js...
true
a538b485a66c58ce536add36bcfd4d9a6699cd34
JavaScript
Isaqb/SuperHeroApi-desafio
/src/component/AddGrupo.js
UTF-8
2,256
2.78125
3
[]
no_license
import React, { useState } from "react"; import "./AddGrupo.css" const AddGroup = (props) => { const { heros } = props.location.state; const [search, setSearch] = useState(''); const filtered = search.length === 0 ? [] : heros.filter( h => h.name.toLowerCase().includes(search.toLowerCase()) )...
true
a1980cd9ee9d54af86c5b1c19c7cce6efa2edcd7
JavaScript
andrewp24/is448
/chapter5_js/eg2-load/load.js
UTF-8
871
3.671875
4
[]
no_license
window.onload = pageLoad; function pageLoad() { load_greeting(); var quote_button = document.getElementById("quote_button"); quote_button.onclick = display_quote; var mood = document.getElementById("change"); mood.onclick = changeImage; } //the onload event handler function load_greeting() { alert("You are vis...
true
3411f8527067a02f3b22f770cece19310ef7b531
JavaScript
sdague/serverless-home-automation
/ibm_cloud_functions/conversation.js
UTF-8
1,407
2.890625
3
[ "Apache-2.0" ]
permissive
/** * * main() will be invoked when you Run This Action. * * @param OpenWhisk actions accept a single parameter, * which must be a JSON object. * * In this case, the params variable will look like: * { "message": "xxxx" } * * @return which must be a JSON object. * It will be th...
true
b73f042d0bca1a797c8d53a3290e58ec293406f4
JavaScript
mamilla11/ana-shishoit
/source/kekstagram/js/preview.js
UTF-8
1,398
3.046875
3
[]
no_license
'use strict'; (function () { /** * @class Preview * @description All future preview behaviour should be added to this class. * @prop {Object} picture - picture information. * @prop {Element} view - root element of picture preview DOM element. * @prop {Object} elements - child elements of picture previ...
true
09624b6a216c58073aac2fb84536e03c291dfbf8
JavaScript
CLLKazan/Webbication
/js/get_categories.js
UTF-8
611
2.875
3
[]
no_license
/* Ajax запрос получения списка категорий и их аттрибутов */ function get_categories() { var request = new XMLHttpRequest(); //ajax переменная request.open("GET", "php/get_categories.php", false); //соединяемся с сервером. Т.к. параметров нет, отправляем запрос методом GET request.onreadystatechange = parse_cate...
true
5da7136a23e0b650c1e6ab60db86191c1f68e461
JavaScript
hoangbdUET/file-browser-backend
/src/_file-sys/path-stat.js
UTF-8
3,075
2.65625
3
[]
no_license
const fs = require('fs'); const {s3} = require('../_aws'); const withFs = dir => { return new Promise((resolve, reject) => { fs.lstat(dir, (err, stat) => { if (err) return reject(err); // return resolve(stat) return resolve({ isDirectory: () => stat.isDirectory(), isFile: () => stat.isFile(...
true
36aeacf06180c8b44b44cac8376d155608603345
JavaScript
Anisha7/spiced-rotten-potatoes
/models/user.js
UTF-8
2,643
2.921875
3
[]
no_license
const mongoose = require('mongoose'); const bcrypt = require('bcryptjs'); const session = require('express-session'); const UserSchema = new mongoose.Schema({ username: { type: String, unique: true, required: true, trim: true }, password: { type: String, required: true, ...
true
083217140cda846b34e632e2752ff50f31e27f9b
JavaScript
xAlessandroC/TrickyRace
/js/environment/environment.js
UTF-8
1,542
2.921875
3
[ "Apache-2.0" ]
permissive
var environment_texture function setUpEnvironmentMapping(){ var faceInfos = [ { target: gl.TEXTURE_CUBE_MAP_POSITIVE_X, url: 'resources/images/environment/x+.jpg', }, { target: gl.TEXTURE_CUBE_MAP_NEGATIVE_X, url: 'resources/images/environment/x-.jpg', }, { target: g...
true
8105f17607d64f927cc9a97c4a62f7b921a03e34
JavaScript
adimelamed/ds_frontend
/home.js
UTF-8
383
2.6875
3
[]
no_license
$(document).ready(function() { searchBars(); }); function searchBars(){ $("#content div").each(function(i, curr) { var name = $(curr).attr('id'); var sn = document.getElementById('search').value.toLowerCase(); if (sn == "") { $('#content > div').show(); } else if(sn == name){ $("#content > div").hi...
true
18852fce17c121f75d69ddd1badb26c7f2694f2d
JavaScript
subhodip7/repo
/src/main/webapp/js/administrator.js
UTF-8
4,117
2.625
3
[ "MIT" ]
permissive
/* * This Javascript file is included in all administrator pages. Functions here * should be common to the administrator pages. */ // AJAX var xmlhttp = new getXMLObject(); // OPERATIONS var OPERATION_ADMINISTRATOR_ADDINSTRUCTORINATOR = "administrator_addinstructor"; var OPERATION_ADMINISTRATOR_LOGOUT = "adminis...
true
fdc38484390467e2710c61c722fd9ecf1adb848f
JavaScript
realglobe-Inc/hec-jissho1
/lib/common_func.js
UTF-8
1,932
3.15625
3
[ "MIT" ]
permissive
/** * Server 側と UI 側の共通関数 */ const camelcase = require('camelcase') const snakecase = require('snake-case') const CAMEL = 1 const SNAKE = 2 const DELIMITER = '#' const commonFunc = { /** * 通報情報 report をフォーマットする */ formatRawToDb ({report, actorKey, event}) { let [lat, lng] = report.location let {id:...
true
398b9bbae90ff8ada439b39d510a311f292cc52b
JavaScript
fatexik/js--touchsoft
/task-04/TatyanaTimoshek/myFilter.js
UTF-8
785
3.125
3
[]
no_license
/* eslint no-extend-native: ["error", { "exceptions": ["Array"] }] */ /** * Написать реализацию метода .myFilter, который работает * аналогично оригинальному * https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Array/filter */ Array.prototype.myFilter = function myFilter(callback, contex...
true
fb47a2406a3e014bd6f52a9f7c949d0a64730eef
JavaScript
starfishda/Graphics
/[Term Project] Eating Villan/Script/Abstract/DrawingObject.js
UTF-8
1,202
2.859375
3
[]
no_license
// This is a variable for managing static class-specific resources var Resource = {}; class DrawingObject { static geometry = null; static material = null; mesh; radius = 1; Initialize(resource) { } Enable() { // Initialize when the class is first used (only one executed) ...
true
7b55642f24212a34516b8e884095c8544f20c976
JavaScript
KennyNathalia/Horeca-app
/horeca.js
UTF-8
3,382
3.703125
4
[]
no_license
const frisPrice= 2.00; const bierPrice= 2.50; const wijnPrice= 3.00; const bit8Price= 4.00; const bit16Price= 5.00; var frisAmount= 0; var bierAmount= 0; var wijnAmount= 0; var bit8Amount= 0; var bit16Amount= 0; var loop= false; while(loop==false){ var drinken = prompt("Hallo en welkom bij Caf...
true
cacd6530dd33407a063f27698da58cafa4565c36
JavaScript
qingyangmoke/js-asynctask
/index.js
UTF-8
453
2.984375
3
[ "MIT" ]
permissive
/** * 执行异步任务 * @param {Array<Function>} middleWares - 数组 * @param {any} ...args - 可变参数 */ async function runAsyncTask(middleWares, ...args) { if (middleWares.length === 0) return; const len = middleWares.length; let index = 0; async function next() { if (index < len) { const func = middleWares[ind...
true
ccfdfd54f5c2e769dee6e35c097664915041c45c
JavaScript
SamuelDorado/breakout-ES6
/js/bricks.js
UTF-8
1,488
3.234375
3
[]
no_license
export class Brick { constructor(width, height, padding, offsetTop, offsetLeft, color) { this.width = width this.height = height this.padding = padding this.offsetTop = offsetTop this.offsetLeft = offsetLeft this.color = color } } ...
true
fea4fa9011e09286355de02dc100c7d44fd191bc
JavaScript
snehalkadam393/review-job
/jobs/UTIL_H2INMEM_QUERY/buildScripts/helperJavaScript.js
UTF-8
9,792
2.625
3
[]
no_license
/* TEST_PROCESS_IMAGELIST: HelperJavaScript.js Introduces DOM manipulation with jQuery to enhance the creation of the ANNOTATION_PLAN ANNOTATION_PLAN no longer shares the same dropdown as PROPERTIES but gets a dedicated cloned copy @Since JAN-09-2019 @Author: Ioannis K. Moutsatsos */ /* wait for the document to be f...
true
78e24ec65577735a0b681991b5f5c6c1c7d55b2a
JavaScript
uverpro/JavaTUT
/App-Academy/W1/W1D1/W1D1-Problems/Variable-Exercise.js
UTF-8
842
5.0625
5
[]
no_license
// Variables Exercise // 1. Declare a variable called `firstName` and assign it your first name as a string: let firstName = "Cory"; // 2. Declare a variable called `lastName` and assign it your last name as a string: let lastName = "Pedigo"; // 3. Declare a variable called `age`: let age; // 4. Print out the `f...
true
b08d8cd6822f263570c95f567df8e825d07e0237
JavaScript
bgran/full-stack
/osa2/kurssitiedot/App.js
UTF-8
1,207
2.671875
3
[]
no_license
import React from 'react' import ReactDOM from 'react-dom' import Course from './Course' const Header = (props) => { return ( <h1>{props.course_name}</h1> ) } const Courses = (props) => { let o = props.courses return ( <div> <Header course_name={"Web development curriculum"} /> ...
true
efc19ad4d93bd3dbf60c81a3a7b7954ab46ab691
JavaScript
volkaankarakus/JavaScript
/SıfırdanJS/1-Temeller/11-AsenkronProgramlamaPart1/12-AjaxveDELETE/app.js
UTF-8
3,429
3.390625
3
[]
no_license
class Request{ constructor(){ this.xhr = new XMLHttpRequest(); } get(url,callback){ this.xhr.open("GET",url); this.xhr.onload = () => { if(this.xhr.status==200) { callback(null,this.xhr.responseText); } els...
true
b8b24b51c29bce59de63886caefd8ec97110565b
JavaScript
wing00/drnktank
/apps/front/static/front/js/pong_components/topbar.jsx
UTF-8
4,136
2.515625
3
[]
no_license
import React from 'react'; import { Link } from 'react-router'; function PlayerIcon(props) { const onFire = props.stats[2]; return ( <div className="player"> {props.value} <br /> {props.current == props.value ? ( <i className...
true
9062eb78b9206c36455c2b7f66dfbf112fc5b573
JavaScript
MichaelMerc/village88
/Algorithm I/algo1-3.js
UTF-8
78
3.125
3
[]
no_license
for(var i=0; i<5; i++) { i = i + 3; console.log(i); } //Answer is 3, 7
true
1b4f8fec9922c91c941de266b3b5c88917277247
JavaScript
chrismarcosgomes/caloriesMeal
/js/app.js
UTF-8
10,300
3.5
4
[]
no_license
// storage //item controller // ify func that runs right away const itemCtrl=( ()=>{ // item constructor const Item = function(id, name, calories){ this.id = id; this.name = name; this.calories = calories; } // data structure/state const data={ items:[ // { // id:0, // nam...
true
ee47488d9d1dde49a556917f2ed7b2cfa9659dd1
JavaScript
kernsinator/frostykernel
/scripts/puzzle-scripts/chickasaw.js
UTF-8
1,532
3.25
3
[]
no_license
let answers = [ 'Hattakat ihooã hollo.', "Kowi'at shoha.", "Holloli.", "The woman loves me.", "The dog dances.", "I chase the cat." ]; let accuracy = [false, false, false, false, false, false]; let q1 = document.getElementById('q1'); let q2 = document.getElementById('q2'); let q3 = document.ge...
true
e5d9492b01f769f9988487ddfa43ba4dc854366e
JavaScript
lullabyjune/leetcode
/prevPermOpt1.js
UTF-8
1,678
3.3125
3
[]
no_license
/** * @param {number[]} A * @return {number[]} */ var prevPermOpt1 = function(A) { let isIncrement = true, length = A.length, max = '0' function findSuitable (index) { let aimNum = A[index], max = Number.MAX_SAFE_INTEGER, maxIndex = -1 for (let ...
true
8a65ead9adced02f8ab4ef829d80f95ab7c32548
JavaScript
pierman1/Browser-Technologies
/1.2.funda-fork/funda/js/modules/constants.js
UTF-8
2,558
2.59375
3
[]
no_license
var constants = (function () { var loader = document.querySelector('#loader'); var noMatchError = document.querySelector('#matches .error'); var inputElements = (function () { var locationElements = (function () { var input = document.querySelector('#location .input'); v...
true
92ad24d49c77faaaa1820731d44211b29b468c7e
JavaScript
MireGitHub/EVA
/code/node/webserver/test_json.js
UTF-8
87
2.703125
3
[]
no_license
var string = "{'key':'value'}"; var obj = JSON.parse(string); console.log(obj.key);
true
85b837122b378783c416a86a4426203816ee12bf
JavaScript
10wpressure/JavaScript
/Tutorial/learn-javascript-main/1. Build a Passenger Counter App/9. Using functions to write less code/index.js
UTF-8
272
3.15625
3
[]
no_license
// Setting up the the race 🏎 🏎 🏎 function countdown() { for (let i = 5; i > 0; i--) { console.log(i) } } // GO! 🏁 // Players are running the race 🏎 💨 // Race is finished! 🍾 // Get ready for a new race 🏎 🏎 🏎 countdown()
true
87d7f2fc4c63334c8dee6baf8197b925b625b657
JavaScript
QQzs/HTML_Day
/Demo/瀑布流/jQuery实现瀑布流/js/index.js
UTF-8
2,340
2.640625
3
[]
no_license
// 页面加载完毕 $(window).on('load',function () { // 实现瀑布流布局 waterFall(); $(window).on('scroll',function () { // 是否加载 if(checkWillLoad()){ var data = {'dataImage': [{'image': '10.jpg'}, {'image': '11.jpg'}, {'image': '14.jpg'}, {'image': '15.jpg'}, {'image': '13.jpg'}, {'image': '17.jp...
true
b909e0cfbc0a3e4d4ee16381c160a1321fdcc65f
JavaScript
runandrew/codeWars-practice
/practice-problems/7kyu-find-next-perfect-square.js
UTF-8
398
4.21875
4
[]
no_license
// Find the next perfect square const findNextSquare = (sq) => { // Return the next square if sq if a perfect square, -1 otherwise // Take the square value and evaluate if it's a perfect square // If not, return -1 // If so, increment the value and return the square of it const root = Math.pow(sq, 0.5); ...
true
58728520fb9326f8341d1d9941e66fbf23b1f1db
JavaScript
nolonwabo/my_screen
/where_to_eat.js
UTF-8
431
2.921875
3
[]
no_license
var mealTemplate = document.querySelector('.mealTemplate').innerHTML; var mealTemp = Handlebars.compile(mealTemplate); var slide = 0; burgers(); function burgers() { var i; var x = document.getElementsByClassName('mySlides'); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } slide++; if...
true
01e3b5de0f216e05a4bbfb3f495c4ea7e5f2a0d1
JavaScript
Toast-Glitch/phase-1-arithmetic-lab
/index.js
UTF-8
202
3.015625
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
let num1 = 1; let num2 = 62; let num3 = 16; let num4 = 6; let multiply = (num1 * num2) let random = Math.floor(Math.random() * 10) + 1; let mod = (num3 % num4); let max = Math.max = (2,16,8,14,20);
true
c6949fe9d065e54b15965b64521d5fcc194f0cc3
JavaScript
jsagardoy/react-promise-tracker
/src/trackPromise.test.js
UTF-8
1,900
2.578125
3
[ "MIT" ]
permissive
import {trackPromise, emitter} from './trackPromise'; import {Emitter} from './tinyEmmiter'; describe('trackPromise', () => { test('On Initial case, promise fired, promise emitter.emit is called', () => { // Arrange emitter.emit = jest.fn((a,b) => { return; }); const myPromise = Promise.reso...
true
63899300a6739c6b2adf5725c824bc76fd5ff57c
JavaScript
nvlled/ddcsum
/tools/genformat.js
UTF-8
1,053
2.71875
3
[]
no_license
Promise = require("bluebird"); const fs = Promise.promisifyAll(require("fs")); const process = require("process"); async function writeJson(summary) { let json = JSON.stringify(summary, null, 4); await fs.writeFileAsync("data.json", json); } function writeSqlite(summary) { // TODO: } async function main...
true
5c291f4849b3f9d3480c39701bd97930aa533e56
JavaScript
sunesimonsen/chance-generators
/src/createGeneratorFacade.js
UTF-8
595
2.59375
3
[ "MIT" ]
permissive
const createGeneratorFacade = Generator => { const generatorFacade = (...args) => new Generator(...args); const defaultGenerator = new Generator(); generatorFacade.isGenerator = true; generatorFacade.generatorName = defaultGenerator.generatorName; [ "expand", "first", "generate", "map", ...
true
7dff4ecf8e064a36b97cd96a1eea87701a581591
JavaScript
themtrx/SoftwareUniversity
/JS Advanced/Exam prep/Exam - 07 July 2019/01. SoftDo_Ресурси/scripts/index.js
UTF-8
5,014
3.078125
3
[]
no_license
// NOTE: The comment sections inside the index.html file is an example of how suppose to be structured the current elements. // - You can use them as an example when you create those elements, to check how they will be displayed, just uncomment them. // - Also keep in mind that, the actual skeleton in judge...
true
18eb4c38913ce3d574c862c0705f329cb2746bb3
JavaScript
hongqizhang/hongqizhang.github.io
/js/newscenter.js
UTF-8
5,034
2.96875
3
[]
no_license
$(function(){ //获取浏览器可视窗口的宽和高 // (function(){ // //有坑,不能用document.body.clientWidth document.body.clientHeight // var innerHeight1 = document.documentElement.clientHeight; // var innerWidth1 = document.documentElement.clientWidth; // //让轮播图大小适应不同的浏览器第一屏 // $(".header").css({"height":innerHeight1,"width":innerWi...
true
c05d27f6306f3d7bf84dd7952b306bdf2ee6b6eb
JavaScript
mayankmandloi/sugamsurajangular
/newToDo/main.js
UTF-8
349
2.734375
3
[]
no_license
var task1={ id:0, title:"Some Task", description:"detailed description of our task", creationdate:new Date(), enddate: new Date("2018-01-20"), status:false }; function createTask(id,title,description,enddate) { this.id=id; this.title=title; this.description=description; this.creationdate= new Date(); this.enddate...
true
c1612d6bcdbc15bc36dbdcf6a6b155444c3ce227
JavaScript
sonhero981/Homework
/ss3/homework2.js
UTF-8
618
3.296875
3
[]
no_license
//Bài5 Đăng nhập // let username = ''; // let password = ''; // while (username !== 'mindx'|| password !=='codethechange'){ // username = prompt('Nhap username: '); // password = prompt('Nhap password: '); // if (username !== 'mindx'){ // alert('username sai '); // } else if (password!== 'codeth...
true
f1cf23227189d3065b4bd8c553a1474bfa600d51
JavaScript
putrairawan992/ecommerce-prototype
/src/hoc/withApiMethod.jsx
UTF-8
2,452
2.640625
3
[]
no_license
import React, { Component } from "react"; import { fetchDataService } from "../api/services"; // getMethod, getMethodWithoutParam, fetchData, // import { compose } from "redux"; // import { connect } from "react-redux"; const withApiMethod = WrappedComponent => { class WithApiMethod extends Component { construc...
true
e28a55863520053c626aaf05875ee844c13fa804
JavaScript
benzed3/FriendFinder
/app/data/friends.js
UTF-8
279
2.609375
3
[]
no_license
var friendsArray = [ { friendName: "Edward", photo: "", scores: [3, 4, 1, 5, 4, 4, 4, 4, 5, 3] } ]; console.log(friendsArray); // Note how we export the array. This makes it accessible to other files using require. module.exports = friendsArray;
true
2e1fce9a946b0f54f5a74814603721433a38c72d
JavaScript
jonsullivan/aws-ec2
/index.js
UTF-8
5,242
2.546875
3
[ "MIT" ]
permissive
var aws = require('aws-lib'); function processInstanceDescription(err, response, callback) { var instance; try { instance = response.reservationSet.item.instancesSet.item; } catch (e) { err = 'Could not find instance: ' + err; instance = response; } callback(err, instance); } module.exports = function (a...
true
ea05989ce14e84b6ea11e2599621003a8496079b
JavaScript
kvlinden-courses/cs336-code
/unit06-http/server.js
UTF-8
2,124
2.734375
3
[]
no_license
/** * This implements some HTTP method/code, form and cookie examples. */ const express = require('express'); const app = express(); const http_status = require('http-status-codes'); const bodyParser = require('body-parser'); const cookieParser = require('cookie-parser'); const HOST = "localhost"; const PORT = 3000...
true
7631ad508b9e6b692fd44809c944229d4f6741f8
JavaScript
virtorodrigues/listing-github-repositories
/src/pages/main/index.js
UTF-8
2,064
2.53125
3
[]
no_license
import React, { useState, useEffect } from 'react' import './styles.css' import logo from '../../assets/logo.svg' import { apiRepos } from '../../service/api' import loadingImg from '../../assets/spinner.gif' import ListRepository from '../../components/listRepository' export default function Main({ match, history })...
true
07932a8f7c8208274f0a53388a0d26c87f8399d2
JavaScript
KirillLitvinenko/slot
/script.js
UTF-8
6,548
2.75
3
[]
no_license
const ROWS = 3; const COLS = 3; const SPIN_DURATION = 2000; //duration in ms const STOP_DELAY = 500; // stop delay in ms let testMatrix = []; let testModeBlockShow = false; function createTestModeView() { let testModeElement = $('#test-reels'); let template = $('#reel').html(); let generatedHtml = ''; for (le...
true
58ff340dfb808aa2a4a8b586f9bd9366479012ea
JavaScript
bluebrid/base-knowledge
/javascript/advance/Nodejs/9.AsyncHooks全链路信息/demo.3/AsyncLocalStorage.js
UTF-8
1,885
2.8125
3
[]
no_license
// AsyncLocalStorage.js const asyncHooks = require('async_hooks'); const { executionAsyncId } = asyncHooks; class AsyncLocalStorage { constructor() { this.storeMap = new Map(); // {1} this.createHook(); // {2} } createHook() { const ctx = this; const hooks = asyncHooks.create...
true
dcc273434681f08d423b41ddd86a8442ebfacd61
JavaScript
linkesch/psd.js
/lib/psd/nodes/search.js
UTF-8
925
2.59375
3
[ "MIT" ]
permissive
// Generated by CoffeeScript 1.7.1 (function() { var clone, flatten; clone = require('lodash/clone'); flatten = require('lodash/flatten'); module.exports = { childrenAtPath: function(path, opts) { var matches, query; if (opts == null) { opts = {}; } if (!Array.isArray(path...
true
832ba72b2a80fe9b40f0839d9e97e5100ce29d83
JavaScript
batar/tutorial-udemy
/js/03 - Weitere Grundlagen/Aufgabe-Strings.js
UTF-8
1,939
3.296875
3
[]
no_license
"use strict" let shopping = " Apfel, Pfirsich, +++Avocado, Mango " // Bei einer Einkaufsliste haben sich ein paar Fehler // eingeschlichen. Unsere Texterkennung des Scans hat ein // paar Leerzeichen zu viel erkannt, sowie ein paar // Plus-Zeichen eingelesen, die im Original gar nicht // existieren. Das möchte...
true
1f10d0faf4aa7d873b0a1d944be4f4472eae3a53
JavaScript
6pm/conway-game-of-life
/src/js/modules/gameOfLife/index.js
UTF-8
13,931
3.296875
3
[]
no_license
// export default class GameOfLife class GameOfLife { constructor(selector, options = {}) { this.itemWidth = options.itemWidth || 15 this.gameSize = options.gameSize || 200 this.state = options.state || this.getInitialState(this.gameSize) this.selector = selector this.loop = false this.ifPlay...
true
0f69f5f126970b54d93f259a0400d52601e4dad6
JavaScript
tamerMarzouk/glitch-fccPersonalLibraryAPI
/tests/2_functional-tests.js
UTF-8
6,934
2.890625
3
[]
no_license
/* * * * FILL IN EACH FUNCTIONAL TEST BELOW COMPLETELY * -----[Keep the tests in the same order!]----- * */ var chaiHttp = require('chai-http'); var chai = require('chai'); var assert = chai.assert; var server = require('../server'); var insertedIds=[]; chai.use(chaiHttp); suite('Functional Tests',...
true
5f150f9690f92766fca24ce68811ee36a1b1928a
JavaScript
littlehour/littlehour.github.io
/learn-webpack/src/app1.js
UTF-8
274
2.9375
3
[]
no_license
import {cube} from './math.js'; function component(){ var ele=document.createElement('pre'); ele.innerHTML=[ 'hello webpack!', '5 cubed is equal to '+cube(5)+' '+square(5) ].join('\n\n'); return ele; }; document.body.appendChild(component());
true
a28df4c5df8e794c670634e7db0aca3953a3226b
JavaScript
Oslandia/workshop-jitenshea
/jitenshop/webapp/static/city.js
UTF-8
3,533
2.53125
3
[ "MIT" ]
permissive
// Jitenshea functions for the 'city' page // Map with all stations with Leaflet $(document).ready(function() { var tile = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' }); var city...
true
e749874edc440887e1ab767cab91b741603d0510
JavaScript
alexconway808/makeadeck
/public/js/deck.js
UTF-8
1,563
4.1875
4
[]
no_license
//Creating the class var Deck = function() { //Creating the constructors this.cards = []; //Calling the generate function this.generate(); } //Adding the generate function to the Deck class Deck.prototype.generate = function(){ var suitNames = ["Diamonds", "Spades", "Clubs", "Hearts"]; var tempCard = 1; ...
true
94b092cae88677c9927769c057435813d354420d
JavaScript
aberkow/nexus-tone-test
/js/index.js
UTF-8
2,928
2.75
3
[]
no_license
var $ = require("jquery"); //var nx = require('nexusUI'); var tone = require('tone'); var delay = new tone.FeedbackDelay('16n', 0.5).toMaster(); var sampler = new tone.Sampler({ 0: '../studderSchool.wav' }, { player: { loop: true, } }).connect(delay); //the .onload method is deprecated. this is correct. ...
true
623330cb1ec232319bca0b0a945c2aaab2483af7
JavaScript
thedanielmark/xstack-status
/js/support.js
UTF-8
2,872
2.859375
3
[]
no_license
// listen for "submit" click var supportForm = document.querySelector("#supportForm"); supportForm.addEventListener("submit", e => { e.preventDefault(); document.getElementById("supportFormLoader").classList.remove("d-none"); document.getElementById("supportFormButton").setAttribute("disabled", "disabled");...
true
8fb0860bf5205eeb93d8626930e166e05dc55254
JavaScript
mshoard/omg-js
/packages/omg-js-childchain/src/watcherApi.js
UTF-8
612
2.671875
3
[]
no_license
const fetch = require('node-fetch') const JSONBigNumber = require('json-bigint') class WatcherError extends Error { constructor ({ code, description }) { super(description) this.code = code } } async function get (url) { const resp = await fetch(url) const body = await resp.text() let json try { ...
true
e2ee86c46f6fb2d8f3da3161ac92307e68e0e9b8
JavaScript
haarabi/test-site
/scripts/main.js
UTF-8
1,311
3.890625
4
[]
no_license
// var myHeading = document.querySelector('h3'); // myHeading.textContent = "Hello world!"; // function multiply(num1, num2){ // return num1*num2; // } // // attaching evenets to an element // // line of code displays an alert on user clicking anywhere on the page // document.querySelector('html').Onclick = funct...
true
73d15b7c2d6a6ea61db861060401f54ee7be0ad6
JavaScript
Brockwest2351/West_Brock_SDI
/loops_worksheet/js/loops_worksheet.js
UTF-8
1,313
3.46875
3
[]
no_license
/* Brock West Section 00 20JUL15 Loops Worksheet */ //alert("testing to see if this work!"); // calculate how many days until your next game var nextGame= prompt ("when in your next game? "); while(isNaN(nextGame)||nextGame===""){ nextGame=prompt ("Please enter a number and do not leave this blank.\nWhen is...
true
ebc2e921a39a5f44b9deae747af75f8db32ea88d
JavaScript
halented/halgos
/35-count-valid-teams/solution.js
UTF-8
606
3.625
4
[]
no_license
function validTeams(ratings) { let numTeams = 0 let i = 0 for (i; i < ratings.length - 2; i++) { for (let j = i + 1; j < ratings.length - 1; j++) { for (let k = j + 1; k < ratings.length; k++) { if (ratings[i] < ratings[j] < ratings[k] || ratings[i] > ratings[j] > ratings...
true
462e3ae67eedd6984e7c23def61962eff444a202
JavaScript
ps0305/Javascript-Algorithms-And-Data-Structures
/leetcode/split-array-with-same-average/index.js
UTF-8
1,079
3.40625
3
[]
no_license
/** * @param {number[]} A * @return {boolean} */ var splitArraySameAverage = function(A) { const sum = A.reduce((acc, cur) => acc + cur, 0); const n = A.length; if (!isSplittable(sum, n)) { return false; } const dp = createCombinationSum(A, n, Math.ceil(n / 2)); for (let k = 1; k <= n / 2; k++) { ...
true
8b9acec8ee9404d90f0178c4273c633ba54e20ce
JavaScript
moshfiqrony/nextjs-tailwindcss-imdb
/utils/index.js
UTF-8
267
2.75
3
[ "MIT" ]
permissive
export const storeLocalStorage = (key, data) => { if(typeof window !== 'undefined'){ localStorage.setItem(key, data) } } export const getLocalStorage = (key) => { if(typeof window !== 'undefined'){ return localStorage.getItem(key) } }
true
8fa793e6ea59f366fbe9eaf057bdfa2730e860a1
JavaScript
Shantanu28/ruready
/WebRoot/include/jquery/.svn/text-base/jquery.menugroup.js.svn-base
UTF-8
8,023
2.921875
3
[]
no_license
//================================================================== // -jQuery MenuGroup Plugin- // // @author Oren E. Livne <olivne@aoce.utah.edu> // @date November 6, 2007 // // This plugin groups several drop-down menus. It plugins AJAX // action URLs for menu pre-population and on-change event response. //...
true
67ac1721e68071c110621cec744abbecd7312762
JavaScript
edu22snt/importaCSV
/web/src/main/webapp/resources/scripts/componentes.js
UTF-8
1,740
3.4375
3
[]
no_license
/** * JS com a função que verifica se o valor horas por dia está utrapassando o valor máximo. */ function verificaValorHoraDia() { var vhd = $(".cadastro_proprietario_txtVazaoHoraDia").val(); if(vhd > 24) { vhd = 24; } $(".cadastro_proprietario_txtVazaoHoraDia").autoNumeric('set', vhd); } /** ...
true
2c3e959f901d58da0da31062830669b7564e03ea
JavaScript
milestone-sys/web-design-system
/components/button-cards/card.js
UTF-8
2,070
2.640625
3
[ "MIT" ]
permissive
function ensureSameHeight(nodes) { let maxHeight = 0 for (let i = 0; i < nodes.length; i++) { nodes[i].style.height = 'auto' maxHeight = Math.max(nodes[i].offsetHeight, maxHeight) applyMaxHeight(nodes, maxHeight) } } function applyMaxHeight(nodes, maxHeight) { for (let i = 0; i < nodes.length; i++...
true
dc08552bea82f2c4c49b94ff4efd5ec7ea61e136
JavaScript
14raryana/employeeTracker
/Services/employeeService.js
UTF-8
1,856
2.890625
3
[]
no_license
const connection = require("../connection"); module.exports = function() { return { add: function(employee){ const query = "INSERT INTO employees(first_name, last_name, role_id, manager_id) VALUES(?, ?, ?, ?)"; return new Promise(function(resolve, reject){ con...
true
d77680f31c9cef480b14b14e3c9b6be10e359365
JavaScript
nicong622/account-book
/src/js/utils/utils.js
UTF-8
1,841
2.75
3
[ "MIT" ]
permissive
import moment from 'moment' export var Store = (function() { // Store.js var store = {}, win = (typeof window != 'undefined' ? window : global), storage = win['localStorage']; store.serialize = function (value) { return JSON.stringify(value) }; store.deserialize = function...
true
b39dcebfce858059a23cca089231a8db2fe39882
JavaScript
uivan1/uaqride
/public/img/login.js
UTF-8
1,863
3
3
[]
no_license
document.getElementById("reg").addEventListener("click",send_form); function val_correo(){ var email=document.getElementById("email").value; var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; return regex.test(email) ? true : false; } function send_form(){ var nombre=document.g...
true
5058b6d89668a2aaaba1fc6885d2861f75102a42
JavaScript
TheClarity/Brooks_5_Journals
/NewFrontier/NewFrontier.js
UTF-8
1,036
2.9375
3
[]
no_license
$(document).ready(function() { var day = true; $("#switch").click(function() { current = document.getElementById("main").class; if(current == "off"){ document.getElementById("main").class="on"; var background = document.getElementById("main"); background.style.backgr...
true
9f820b8bd19154275724f79e36a5984774dbb31b
JavaScript
Doesntmeananything/coding-problems
/Algorithms/Duplicate Encoder.js
UTF-8
306
3.21875
3
[]
no_license
function duplicateEncode(word) { const workArray = word.toLowerCase().split(''); const result = workArray.map((char) => { if (workArray.indexOf(char) !== workArray.lastIndexOf(char)) { return ')'; } return '('; }); return result.join(''); } console.log(duplicateEncode('(( @'));
true
744379a1364b5caa0d72773d4f87991bf3ba6023
JavaScript
lvachon/SkiSim
/js/tasks.js
UTF-8
2,273
3.015625
3
[]
no_license
function Tasks(terrain, workers){ this.terrain = terrain; this.workers = workers; this.tasks = []; this.addTask = (x,y,task)=>{ x=Math.floor(x)+0.5; y=Math.floor(y)+0.5; if(x<0||x>=this.terrain.gridWidth||y<0||y>this.terrain.gridDepth){return false;} if(this.tasks.filter(t=>t.x==x&&t.y==y&&t.task==task).len...
true
7befa2a22d2c75e06a417594332011b203aa653d
JavaScript
lopis/StockPortfolioUbuntu
/src/qml/data.js
UTF-8
7,559
3.140625
3
[]
no_license
// Keeps a pointer to the listModel to allow // assync return of values. var portfolio = {listModel: {}}; var defaultNames = "MSFT,Microsoft,1"; //";AMZN,Amazon,1;AAPL,Apple,1"; // max and min value calculated for the chart var max = 0.0; var min = 999999; var dates = []; var isReady = false; // is true if the p...
true
400dc875a7eee1b243f5221e5a6614eacdb69a56
JavaScript
hieunm286/MyShopFianl
/src/components/HoaDon.js
UTF-8
4,846
2.59375
3
[]
no_license
import React, { useState } from 'react' import Data from '../components/data.json' export default function HoaDon(props) { const data = Data const [id, setId] = useState('') const [name, setName] = useState('Tên sản phẩm') const [origin, setOrigin] = useState('Xuất sứ') const [price, setPrice] = us...
true
0dd21d37859fd1520b5856e9580f2d06a186e9c2
JavaScript
ssthurai/lowagner.github.io
/js/records.js
UTF-8
5,361
2.890625
3
[]
no_license
// GLOBAL parameters YOU CAN SET var recordsMAXpp = 4; // max number of records to display per page var recordsSHOWbackTOtopAFTER = 3; // after X records, show the back to top link. this should NOT be greater than or equal to recordsMAXpp. // SET INTERNALLY IN THE CODE var recordsDISPLAYED = 0; // number of records ...
true
186753e808c14d00184558815c378d88b55d6ef4
JavaScript
Hisham-401-advanced-javascript/data-structures-and-algorithms
/Data-Structures/graph/__test__/graph.test.js
UTF-8
1,348
3.609375
4
[ "MIT" ]
permissive
'use strict' const {Node, Graph} = require('../graph.js'); let testNode1 = new Node('Alpha'); let testNode2 = new Node('Beta'); let testNode3 = new Node('Gamma'); // Node can be successfully added to the graph it ('Should allow a node to be added to a graph', () => { const graph = new Graph(); expect(graph).to...
true
fed33650f09457f9123f8c39561357240798abe6
JavaScript
Vvijin/display_test
/src/components/album/function.js
UTF-8
408
2.625
3
[]
no_license
import axios from 'axios'; export async function fetchAlbum(id) { const res = await axios.get(`https://jsonplaceholder.typicode.com/albums/${id}`) return res.data; //console.log(res.data); } export async function fetchPhoto(id) { const res = await axios.get(`https://jsonplaceholder.typ...
true
0a099320bb7fb14b6d965291ff7e7bc362e4e5ea
JavaScript
littleflute/Live-Stream-Web-Plugins
/News/Bitcoin/js/app.js
UTF-8
329
2.6875
3
[]
no_license
var app = (function () { var start = function() { getPrice(); setInterval(getPrice, 60000); } var getPrice = function () { $.getJSON("https://api.coindesk.com/v1/bpi/currentprice.json", function( data ) { $("h1").text("Bitcoin $" + data.bpi.USD.rate); }); } return { start: start } })(); app...
true
0190f63a66b756384ad4d856abdbf34d03ab1157
JavaScript
aerol457/FilesManage
/static/projects/7.Stopwatch App/stopwatch.js
UTF-8
2,391
2.890625
3
[]
no_license
$(function(){ var appMode = false; var timeCounter = 0; var lapCounter = 0; var action; var numOfLaps = 0 ; var timemMinutes,timeSecond,timeCentiseconds,lapmMinutes,lapSecond,lapCentiseconds; HideAndShow("#startButton","#lapButton"); $("#startButton").click(function(){ HideAndSho...
true
d15d0d4546b2754e24ccebbb01781476c6a812d8
JavaScript
willsparrowc/the-game-of-24dots
/Code/pages/main/game_manager.js
UTF-8
5,658
2.65625
3
[]
no_license
var app = getApp() var util = require('../../utils/util.js') var Card = require('../../utils/card.js') var Box = require('../../utils/box.js') var Banner = require('../../utils/banner.js') var Timer = require('../../utils/timer.js') var Expression = require('../../utils/expression.js') function GameManager() { this....
true
1b786ed21d61cf490b2fadcb4345c3d8309d32d1
JavaScript
Diplomatiq/resily
/scripts/check-release-tag.mjs
UTF-8
1,154
2.75
3
[ "MIT" ]
permissive
/** * This script reads the version field from package.json * and checks if the current git HEAD has a matching tag. * * E.g. if the current version is '1.0.0', the matching tag is 'v1.0.0'. * * Runs automatically on `npm publish`. */ import { spawnSync } from 'child_process'; import { readFileSync } from 'fs';...
true
3973acdb0dc81695edb2948ddb2800b1795fcec1
JavaScript
dnhart/giphy-api
/assets/javascript/giphyapi.js
UTF-8
3,985
2.9375
3
[ "MIT" ]
permissive
var topics=["angry","bored", "confused", "happy dance", "unimpressed", "good job", "bye", "mind blown", "eye roll", "inspired", "no", "yes", "whatever", "thank you", "shocked"]; var searchTerm; function setup(){ $("#buttonBox").html(""); $.each(topics, function(i, value) { var newButton =$("<button type='butto...
true
35345273c3ced905f939b824c68eb0e8218613af
JavaScript
schoenflies/cracking_the_coding_interview
/src/chapter_1/1.6 String_Compression.js
UTF-8
429
3.265625
3
[]
no_license
//Time complexity is O(n) export function strComp(str) { if (!str || str.length === 0) { return str; } let store = {}; for (let i = 0; i < str.length; i++) { let char = str.charAt(i); if (store[char]) { store[char]++; } else { store[char] = 1; } } let comp = []; for (let ke...
true