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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8f398f0a3f8f41863ea707e905bbf8dbd443793e | JavaScript | katthartic/fsa-random | /first/calculator-copy.js | UTF-8 | 1,336 | 3.609375 | 4 | [] | no_license | /* eslint-disable linebreak-style */
/* eslint-disable-next-line linebreak-style */
/* eslint-disable no-unused-vars */
function createCalculator() {
const newCalculator = {
currentValue: 0,
value() {
return this.currentValue
},
add(num) {
this.c... | true |
b743c553bec091065f198a3624b0f35a23b49389 | JavaScript | mannut2014/Leetcode | /javascript/medium/3Sum.js | UTF-8 | 920 | 3.484375 | 3 | [
"MIT"
] | permissive | /**
* @param {number[]} nums
* @return {number[][]}
*/
var threeSum = function(nums) {
nums.sort(function(x,y){ return x-y; });
const res = new Array();
let num = 0, i = 0;
while(i < nums.length) {
if(i > 0 && nums[i] == num) {
i++; continue;
}
num = nums[i];
... | true |
1ec79baddc36b6df8cfc3fe6f80ad12a129409e6 | JavaScript | TerriaJS/terriajs | /lib/Core/overrideProperty.js | UTF-8 | 1,364 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
var defined = require("terriajs-cesium/Source/Core/defined").default;
var knockout = require("terriajs-cesium/Source/ThirdParty/knockout").default;
/**
* Overrides a Knockout property definition. Change notification is raised on the old property, if any, to encourage
* listeners to subscribe to the n... | true |
b28d105142791d9b64ef76da04fb343514db984e | JavaScript | Mysterious-Owl/spin-shellhacks | /js/script1.js | UTF-8 | 2,966 | 2.609375 | 3 | [] | no_license | var data = [], user_data=[];
var d1;
var user1;
function load_data() {
var database = firebase.database().ref('data/');
var content = document.getElementById("main");
database.get()
.then(function (snapshot) {
snapshot.forEach(function(childSnapshot){
d1 = childSnapshot.val(... | true |
6d95aa5c4a4c834ecfff89c25133241251c87b73 | JavaScript | Nidzo234/Nikola-Jovanovski | /JS.js | UTF-8 | 485 | 2.546875 | 3 | [] | no_license | var my_window = $(window);
var position = my_window.scrollTop();
my_window.scroll(function () {
if (my_window.scrollTop()>30)
{
$('.nav').addClass('nav-up');
}
else
{
$('.nav').removeClass('nav-up');
}
position= my_window.scrollTop();
});
window.addEventLis... | true |
895f745d4ddb540349e78479f0f11a50d2dfabc2 | JavaScript | catherine-lim/basic-calculator | /client/assets/js/main.js | UTF-8 | 3,153 | 3.15625 | 3 | [] | no_license | $(document).ready(initializeApp);
var calculationArray = [];
var displayArray = [];
var stringNumberToPush = "";
var calculationResult = null;
function initializeApp(){
applyClickHandlers();
}
function applyClickHandlers(){
$('#number-block').on('click','.number',numberButtonHandler);
$('#operator-column')... | true |
c49e1259ba8e9faab3c212fc510170f1d324b867 | JavaScript | Yazon562/Final-Project-IS-445 | /PROJECTIS445/public/main.js | UTF-8 | 19,595 | 2.96875 | 3 | [] | no_license |
function indexPage(){
const indexButton = document.getElementById('index')
const newButton = document.getElementById('newtab')
newButton.style.backgroundColor = 'rgb(0, 152, 253)'
newButton.style.color = 'lightgray'
newButton.style.borderColor = 'lightgray'
var targetArea = document.querySele... | true |
0105f2b037512f8c8cf187e737f21f1cdc440aa8 | JavaScript | nduhamel/pwdremind | /src/www/js/modules/srpsession/libsrp/sha1.js | UTF-8 | 5,073 | 3.078125 | 3 | [] | no_license | define([], function () {
SHA1 = {};
/************************************************
* SHA1 and HMAC
************************************************/
var hex_chr = "0123456789abcdef";
function hex(num)
{
var str = "";
for(var j = 7; j >= 0; j--)
str += h... | true |
674dc023c9eb84709e90512bdae5cac167ef76a7 | JavaScript | Volodymyrprodyus/Home-Work-7-JS-Piano | /main2.js | UTF-8 | 1,153 | 3.328125 | 3 | [] | no_license | const keys = ["a", "s", "d", "f", "g", "h", "j", "k"];
function buttonId(key) {
return document.getElementById('batton' + key);
}
function soundId(key) {
return document.getElementById('audio' + key);
}
// натискання на клавіші кнопками клавіатури
document.addEventListener("keydown", (e)=> {
function playBy... | true |
a1aad8a5665d2f9fde0147014566023b1d278b72 | JavaScript | porybox/porybox | /client/userMenu/user.ctrl.js | UTF-8 | 413 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* A small controller to explain the syntax we will be using
* @return {function} A controller that contains 2 test elements
*/
module.exports = class User {
constructor (io, errorHandler) {
this.io = io;
this.errorHandler = errorHandler;
}
logout () {
return this.io.socket.postAsync('/api/v1/lo... | true |
ff009f3f11761716302f421142a3abf9a2c0c442 | JavaScript | leaf-club/fe-camp-2017 | /第1组/冯啟垚/第八次作业/voter/voter.js | UTF-8 | 1,314 | 3.3125 | 3 | [] | no_license | var headimg = document.getElementsByClassName("head-img");
for (var i=0; i< headimg.length; i++){
headimg[i].onclick = vote;
headimg[i].onmouseover = showticket;
headimg[i].onmouseout = hideticket;
}
function vote() {
// this.nextElementSibling.nextElementSibling.offsetHeight =
// parseInt(this.ne... | true |
074b5e4160c2ca89a290040cfb92794e7d93f2ca | JavaScript | viniciusrschiffler/Boletim-online-professor | /web/src/Pages/Notes/scripts/main.js | UTF-8 | 5,530 | 3.09375 | 3 | [] | no_license | async function start() {
// variavel do elemento html que deve aparecer quando as notas não estiverem salvas
const saved = document.querySelector('#saved')
// Criando variavel para o objeto "table" do html
const tableElement = document.querySelector('tbody#list')
//Pegando id da turma
const class_id = sessionSt... | true |
41a50648be928c4574a1e854b6eaa8c97e553722 | JavaScript | pmfai25/CodeExampleFB | /DOTNET/OLD_DOTNET/CentralFinanceManagerUI_OLD/wwwroot/js/SearchFieldTableJS.js | UTF-8 | 366 | 2.71875 | 3 | [] | no_license | // Quick Table Search
$('#search').keyup(function () {
var regex = new RegExp($('#search').val(), "i");
var rows = $('table tr:gt(0)');
rows.each(function (index) {
title = $(this).children("#title").html()
if (title.search(regex) != -1) {
$(this).show();
} else {
... | true |
0098e33ba644c29ba43a96072dc173287d1bfd95 | JavaScript | crccheck/lazy-projects | /lazyColor/js/utils.js | UTF-8 | 278 | 3.15625 | 3 | [] | no_license | // random helper utilies
var colorRE = /^([0-9a-f]{3}){1,2}$/i;
// returns the color in hex or false
var isColor = function(str) {
if (str[0] === '#') {
str = str.substr(1);
}
if (colorRE.test(str)){
return str;
}
return false;
};
exports.isColor = isColor;
| true |
b7ffd3582544ee0ad842d3fd4e2e1a6d93c69f66 | JavaScript | Al-Jarah/JavaScriptFrameworks2020 | /exercises/04-state/src/CharacterCount.js | UTF-8 | 307 | 2.703125 | 3 | [] | no_license | import React, {useState} from "react";
let CharacterCount = () => {
const [count, setCount] = useState(0);
return( <div>
<h1> Character Count {count} </h1>
<textarea onChange={(e)=>{setCount(e.target.value.length)}}>
</textarea>
</div>)
}
export default CharacterCount; | true |
5c81b41d5a2326761eb94de79782d33cd2454589 | JavaScript | RedEarthBlueSky/frontend-technical-test-2 | /test/api.spec.js | UTF-8 | 1,044 | 2.515625 | 3 | [] | no_license | /**
* Created by brett.hadley on 10/10/2016.
*/
const expect = require('chai').expect;
import { getVehicles, getVehicleDetail } from '../src/api'
const server = require('../server');
import store from '../src/store'
describe('Test Vehicle Detail.', function() {
let vehicles, api
before(done => {
... | true |
146cc19da1d5e3b79158d99f8969db4eee39dab6 | JavaScript | joyloove/trello | /js/app.js | UTF-8 | 2,989 | 3.203125 | 3 | [] | no_license | var box = document.getElementById('container');
var tarea = document.getElementById('span');
window.onload = function() {
add();
};
function add() {
// función que crea un input y le botón
tarea.addEventListener('click', function() {
var btn = document.createElement('button');
var icon = document.creat... | true |
da4825c77103c7fdc1ffc666c3a28c5210e70d5e | JavaScript | kristinatong/woof-woof-js-practice-nyc-web-080618 | /src/index.js | UTF-8 | 1,552 | 3.046875 | 3 | [] | no_license | const dogBar = document.getElementById('dog-bar')
const dogInfo = document.getElementById('dog-info')
const filter = document.getElementById('filter-div')
const URL = 'http://localhost:3000/pups'
document.addEventListener('click', (e) => {
const pupId = e.target.dataset.id
const pupObj = allPups.find(pup => pup.id... | true |
2fe4c0090d1ec438795ede4fb107cbf49462fe14 | JavaScript | JoshuaOndieki/oneforma-chrome-extension | /content.js | UTF-8 | 24,817 | 2.625 | 3 | [
"MIT"
] | permissive | /*
author: Joshua Ondieki
github: htpps:github.com/JoshuaOndieki
*/
window.onload = function checkIframeLoaded() {
console.log('checking if iframe is loaded...');
// Get a handle to the iframe element
var iframe = document.getElementById('webapp_frame');
var iframeDoc = iframe.contentDocument || ifram... | true |
b60c8766601e77c595406c969eae7473ab735663 | JavaScript | mindplay-dk/fre | /demo/useReducer.js | UTF-8 | 824 | 2.765625 | 3 | [
"MIT"
] | permissive | import { h, render, useReducer } from '../src'
function count(state, action) {
switch (action.type) {
case 'add':
return { count: state.count + 1 }
case 'cut':
return { count: state.count - 1 }
}
}
function sex(state, action) {
switch (action.type) {
case 'boy':
return { sex: 'boy'... | true |
4f9363d9d72a627ce96a3bb282a53ad30b4be304 | JavaScript | licic1995/ToowakeCC | /debangSer/controllers/debangUser.js | UTF-8 | 3,285 | 2.546875 | 3 | [] | no_license | var Sequelize = require('sequelize');
/**
*
* 以下为Sequelize 和 相关数据库信息 的初始化
*
* **/
var config = {
database:'licic',
username:'root',
password:'',
host:'localhost',
port:'3306'
}
//TODO: WARNING!!! Create mysql modul.
var sequelize = new Sequelize(config.database, config.username, config.passw... | true |
9849c0d5ed399930e5e18763fbbeb6b08de03715 | JavaScript | Olga-Salt/goit-js-hw-06 | /js/task-01.js | UTF-8 | 374 | 3.359375 | 3 | [] | no_license | const listItemRef = document.querySelectorAll("#categories > li");
console.log(`Number of categories: ${listItemRef.length}`);
// ======== 1.2 ==============
const listTitleRef = document.querySelectorAll(".item");
listTitleRef.forEach((title) => {
console.log(`Category: ${title.firstElementChild.textContent}
Element... | true |
79643eb08884ce21f24a1e6acc38036840bec176 | JavaScript | ydnay/learningJavaScript-3rd-Edition | /chapter13_functionsAndThePowerOfAbstractThinking/passAFunctionIntoAFunction.js | UTF-8 | 1,577 | 4.96875 | 5 | [] | no_license | // Pass a Function into a Function
// This is an easy enough exercise, but what if we then need a function that
// returns the sum of squares? We could, of course, simply write a new function called
// sumOfSquares…but what happens when we need the sum of cubes? This is where the
// ability to pass a function can be v... | true |
bbdfd73e07d4170603bc20a253f780093b8db114 | JavaScript | YegorLuz/canvas | /src/db/database.js | UTF-8 | 1,795 | 2.765625 | 3 | [] | no_license | import { PAINTER_STEPS } from '../constants/';
class DataBase {
constructor () {
this.getData();
};
clear () {
localStorage.removeItem(PAINTER_STEPS);
}
add (data) {
const newData = {...data, show: true};
this.getData();
this.history.push(newData);
... | true |
5c844ffa66d6a22458507ec546d5cdf3b1f7ae44 | JavaScript | emirsayis/chainrings | /public/javascripts/chainrings.js | UTF-8 | 5,550 | 2.609375 | 3 | [
"MIT"
] | permissive | class Random {
constructor(seed) {
this.seed = seed
}
random_dec() {
this.seed ^= this.seed << 13
this.seed ^= this.seed >> 17
this.seed ^= this.seed << 5
return ((this.seed < 0 ? ~this.seed + 1 : this.seed) % 1000) / 1000
}
random_between(a, b) {
re... | true |
bf742ac0d1034165740c61b619315f013161cca6 | JavaScript | Antonio-Albert-monteiro/zero-two.canary | /serve.js | UTF-8 | 613 | 2.921875 | 3 | [] | no_license | const express = require('express');
const app = express();
app.get("/", (request, response) => {
const ping = new Date();
ping.setHours(ping.getHours() - 3);
console.log(`Ping recebido às ${ping.getUTCHours()}:${ping.getUTCMinutes()}:${ping.getUTCSeconds()}`);
response.sendStatus(200);
});
const port = normaliz... | true |
290d37b772a92c071a165fe37e994ecbace4c9d8 | JavaScript | dashkamix1989/testsite | /js/test.js | UTF-8 | 540 | 3.015625 | 3 | [] | no_license | let form = document.querySelector("form");
let ans= document.querySelector(".answer");
form.addEventListener("submit", function(e){
e.preventDefault();
let counter=0;
if(test.q1[1].checked) {counter++;}
else{document.getElementById("q1").style.background="red";}
if(test.q2[2].checked) {counter++;}
else{documen... | true |
875630618338997e6d2c23f7f684478d8410a3b1 | JavaScript | whysokara/FunWithTriangle | /isTriangle.js | UTF-8 | 718 | 3.890625 | 4 | [] | no_license | const inputs = document.querySelectorAll(".angle-input");
const isTriangleBtn = document.querySelector("#is-triangle-btn");
const outputEl = document.querySelector("#output");
function calculateSumOfAngles(angle1, angle2, angle3) {
const sumOfAngles = angle1 + angle2 + angle3;
return sumOfAngles;
}
function isTri... | true |
5fdb1bf2d5e3782a115d9006cc48b33493725d00 | JavaScript | mohsen1/checkbox-list | /test/specs.js | UTF-8 | 1,304 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict';
var expect = require('chai').expect;
var driver = require('./driver');
var webdriver = require('selenium-webdriver');
describe('checkbox-list', function () {
it('opens the demo page', function (done) {
setTimeout(driver.get.bind(driver, 'http://localhost:8123/demo'), 2000);
setTimeout(done, 40... | true |
52d82458d1ee6ca3b02eaf3a91628e4158e8c7cf | JavaScript | Myloveiszero/Es6 | /array/1.js | UTF-8 | 318 | 3.671875 | 4 | [] | no_license | const ages = [32,15,19,12];
const nums = [];
for(let age of ages) {
if(age >= 18) {
nums.push(age);
}
}
console.log(nums);
//2.
const adultArr = ages.filter(age => age >= 18);
const adultPresent = ages.some(age => age >= 50);
const allOldEnough = ages.every(age => age>=10);
console.log(adultPresent); | true |
b967bda1ee56dad0965a9be70b8ef9db71252b15 | JavaScript | kabaclo/send-it | /UI/js/main.js | UTF-8 | 707 | 3.03125 | 3 | [] | no_license |
const form_elements_int =()=>{
const inputElements = document.querySelectorAll('.form-element input');
Array.from(inputElements)
.forEach(input => {
input.onchange = evt =>{
const label = evt.target.parentNode.querySelector('label');
if(evt.targ... | true |
6719ef005a6648791ec398fc69a73d408a407bac | JavaScript | havictor/staleOnions | /routes/api.js | UTF-8 | 3,083 | 2.578125 | 3 | [] | no_license | const cheerio = require('cheerio');
const request = require("request");
const mongoose = require("mongoose");
var Article = require("../models/article");
let links = [];
let titles = [];
let summaries = [];
let articles = [];
module.exports = function(app) {
app.get("/scrape", function (req, res) {
reque... | true |
dd0c8f0e3f2202536825a66a764a3164c78413e8 | JavaScript | asaberwd/guestbook-api | /app/controllers/messageControllers.js | UTF-8 | 6,243 | 2.515625 | 3 | [] | no_license |
const Message = require("./../models/message");
const { validateMessage } = require("./../../helper/validate");
const { idFromToken } = require("../../helper/idFromToken")
const message = require("./../../constants/responseMessages")
const { validateId } = require("./../../helper/validateId");
exports.createMessage... | true |
b0405c3b812872e2dbb42dae31f5902cbd59fbbc | JavaScript | Zkellogg/Week10 | /day-three-server/app.js | UTF-8 | 898 | 2.75 | 3 | [] | no_license | const express = require("express");
const cors = require("cors");
const app = express();
app.use(cors());
app.use(express.json());
const books = [
{
title: "Test1",
author: "John Smith",
publisher: "goodBooks",
year: "1997",
},
{
title: "Test2",
author: "Mark Smith",
publisher: "good... | true |
daf31ce9bbd1b828822c99e894512f1dac1cee61 | JavaScript | Rafik-Belkadi/node-mongo-smail | /controllers/UserController.js | UTF-8 | 3,321 | 2.9375 | 3 | [] | no_license | const UserModel = require('../models/UserModel')
const bcrypt = require('bcrypt')
const getAllUsers = (req, res) => {
UserModel.find().then(users => res.json(users)).catch(err => { throw err })
}
const createUser = (req, res) => {
// On récupère le le body de la requête et on le met dans une variable
var... | true |
14d54926b91602b3a4a42e5dc1a57cc04e2659a6 | JavaScript | renatoramiro/serial-electron | /renderer.js | UTF-8 | 3,356 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const serialport = require('serialport');
let gasSensorDevice;
serialport.list((err, ports) => {
console.log('[Gas Sensor Device] Ports', ports);... | true |
0b24ffbd0a58a5cd63e0de5c32f3909ddde148b3 | JavaScript | kardrean/WEBMODERNOJS | /ARRAY/Reduce1.js | UTF-8 | 530 | 3.8125 | 4 | [
"MIT"
] | permissive | //usando para somar valores
const alunos = [
{nome: 'Naruto', nota: 7.7, bolsista: true},
{nome: 'Sasuke', nota: 9.1, bolsista: true},
{nome: 'Sakura', nota: 8.2, bolsista: true},
{nome: 'Temari', nota: 9.5, bolsista: false}
]
console.log(alunos.map(a => a.nota))
const resultado = alunos.map(a => a.no... | true |
322380416f601866e11ccab0f05e3e3e781e3748 | JavaScript | NatkaDzoll/FD3_Zholudz | /iShop3/script/cosmetics_list.js | UTF-8 | 4,066 | 2.875 | 3 | [] | no_license | 'use strick'
var CosmeticsList = React.createClass({
displayName: 'CosmeticsList',
propTypes: {
items: React.PropTypes.array.isRequired, // ------------- массив с товарами
itemSelectNumb: React.PropTypes.number, // ------------- key выбранного товара
itemSelectClassN... | true |
b30714a84a963fc8b2769ce7bc70452bd60fae7a | JavaScript | devDzign/pluginJs | /js/filtre.js | UTF-8 | 1,263 | 2.640625 | 3 | [] | no_license | /**
* Created by mc on 01/11/2015.
*/
(function ($) {
$("#filtreCategory").focus().keyup(function (event) {
var input = $(this);
var val = input.val();
if(val == ''){
$('#filtre li').show();
$('#filtre span').removeClass('highlighted');
return true;
... | true |
670e17bb781aaefe0f13ad1c7e33cd7a236015bd | JavaScript | cx478815108/KCCompile | /compiler/src/config/KCConfig.js | UTF-8 | 3,218 | 2.625 | 3 | [] | no_license | const path = require('path');
const fs = require('fs-extra');
class KCConfig {
constructor(jsonPath) {
this.configWithJSONPath(jsonPath);
}
configWithJSONPath(jsonPath) {
this.jsonPath = jsonPath;
this.json = this.checkJSON();
this.srcFolderPath = path.dirna... | true |
618ee852fbbea45cad9cf003b88cf2dfb8303217 | JavaScript | paigetech/CMS_Dowloader | /cms_pdf_download.js | UTF-8 | 1,013 | 2.640625 | 3 | [] | no_license | var fs = require('fs');
var request = require('request');
var myArgs = process.argv.slice(2);
var pdfParse = require('./pdfParse');
var exec = require('child_process').exec;
//load the file from the argument
var loadedFile = fs.readFileSync(myArgs[0], 'utf8');
//get the file names
var filesToGet = loadedFile.split("\n... | true |
c939363dc46dbef1194cd1a1ccaf0ea794ebd445 | JavaScript | umeshraghav/pizza2 | /lib/data.js | UTF-8 | 3,545 | 2.796875 | 3 | [] | no_license | // library for storing and editing data
const fs = require('fs');
const path = require('path');
const helpers = require('./helpers');
var lib = {};
lib.baseDir = path.join(__dirname, '../.data/');
// non-blocking function to ensure some dir exists
// use this only during app init phase
lib.ensureDirExists = (dir, ... | true |
00ae9ac755d960926d497064ea2e31710eead3d9 | JavaScript | kausmos/notification_service | /services/notification_service.js | UTF-8 | 590 | 2.53125 | 3 | [] | no_license | const medium_factory= require('../factories/notification_medium_factory');
class NotificationService{
scheduleNotifications(message,medium,frequency){
const mediumSingleton = this.getMediumSingleton(medium);
mediumSingleton.scheduleNotifications(message,frequency);
}
sendAdHocNotificat... | true |
a9758ab1674201cf302f005582c392c9ed17f0fc | JavaScript | swatter555/Php-MVC-Framework | /public/js/functions.js | UTF-8 | 955 | 2.828125 | 3 | [
"MIT"
] | permissive | //-------------------------------------------------------------------
// Globals variables
//-------------------------------------------------------------------
myApp =
{
general:
{
timerCount:5
}
}
//-------------------------------------------------------------------
//---------------------------... | true |
01902ee77a0176ae6715a195568224ec24b80923 | JavaScript | clind3/DailySchedule | /script.js | UTF-8 | 2,745 | 3.359375 | 3 | [] | no_license |
var ul = $('#timestamps');
var scheduleItemsToSave = [];
//calls out to the moment method to calculate and format dates/times
var todaysDateHeader = moment();
function updateTime(){
$("#currentDay").text(moment().format(' MMMM D, YYYY H:mm:ss'));
// console.log(todaysDateHeader);
setInterval(update... | true |
9fa2ff1b040fad698f0a0fa353cf73e771699280 | JavaScript | niktechnopro/algosPython | /CoffeeRunFetchversion/scripts/main.js | UTF-8 | 4,708 | 3.21875 | 3 | [] | no_license | console.log('sanity check');
//global variables
var form = document.querySelector('[data-coffee-order="form"]');
var submit = document.querySelector('[type="submit"]');
var reset = document.querySelector('[type="reset"]');
var divelement = document.querySelector('#order');
var emailRegExp = /^[a-zA-Z0-9._#!&%+-]+@[a-zA... | true |
74dfcb76ad30b8da5d73c5767c68f2accbf83730 | JavaScript | bootting/react_todoList | /src/components/Footer/index.jsx | UTF-8 | 1,372 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
//引入prop-types包
import propTypes from 'prop-types';
//引入样式文件
import './index.css';
export default class Footer extends Component {
//对接收到的props进行验证
static propTypes = {
todoList:propTypes.array.isRequired,
changeCheckAll:propTypes.func.isRequired,
handleClearChe... | true |
b138e14da78105d6ace0beeb6da5589c26fbe575 | JavaScript | huxinhai/learn-web | /JavaScript/design-pattern/01-oop.js | UTF-8 | 811 | 3.75 | 4 | [] | no_license |
/**
* 多态:将“做什么”和“谁去做以及怎样去做”分离开来;
* “不变的事情”与“可能改变的事情”分离开来。把不变的部分隔离出来,把可变的部分封装起来
* @param {*} animal
*/
// 动物都会叫是不变,封装起来
const makeSound = function(animal) {
animal.sound && animal.sound()
}
const Duck = function(){}
Duck.prototype.sound = function() {
console.log('嘎嘎嘎')
}
// makeSound(new Duck())
// 地图显示... | true |
2add2228b9b97f11d83d2b8068953680ac28e8af | JavaScript | stas-vilchik/bdd-ml | /data/8111.js | UTF-8 | 393 | 2.84375 | 3 | [
"MIT"
] | permissive | {
if (Array.isArray(latest)) {
var res = [];
sealed = Array.isArray(sealed) ? sealed : [sealed];
extended = Array.isArray(extended) ? extended : [extended];
for (var i = 0; i < latest.length; i++) {
if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
res.push(latest... | true |
694348286afcf2f997225e2fa7199b3abd0213e6 | JavaScript | FrostySoup/SportoAik-teli-Organizatorius | /WebApplication3/src/WebApplication3/wwwroot/js/Turnyras/Create/script.js | UTF-8 | 1,563 | 2.5625 | 3 | [] | no_license | (function () {
var makeID = function () {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < 20; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
var crea... | true |
0bf69c4f0bbba076725d6d6f98e1769bdeb333b1 | JavaScript | xujingquan/realworld-nuxtjs | /plugins/request.js | UTF-8 | 1,098 | 2.578125 | 3 | [] | no_license | //与请求相关的插件,使用插件是确保能够获取数据,使用普通方式是获取不到的
//封装axios
import axios from "axios";
//插件请求对象
export const request = axios.create({
baseURL: "https://conduit.productionready.io",
});
//通过插件机制获取到上下文响应对象
//例如(query,params,req,res,app,store ...)
//插件导出函数必须作为 default成员(default只能有一个)
export default ({ store }) => {
//请求拦截器
//任何... | true |
fe3ce9cbdb51943e0efdc76edd39ddd90cb768d7 | JavaScript | nicholaspierre/numerouno | /scrap.js | UTF-8 | 287 | 4.71875 | 5 | [] | no_license | // Write a function that takes an array as an argument,
// and returns a copy of the array with the last element at the front.
function lastToFront (arr) {
arr.splice(0, 0, arr.pop());
return arr
}
var arr = [1, 2, 3, 4]
console.log(lastToFront(arr));
// returns [4, 1, 2, 3] | true |
dbc4b14ef5a693eb19bb6324a8c9fe5933bd7946 | JavaScript | tarepan/remainingLife | /calculateLife.js | UTF-8 | 5,123 | 2.734375 | 3 | [] | no_license | console.log("hello, world");
(async () => {
let resjson = await getLifeTable();
let [men, women] = processDeathRates(resjson);
document.DeathRates = [men, women];
update();
document.querySelector("#update").addEventListener("click", update);
})();
async function getLifeTable() {
const baseURL = "https://ap... | true |
c06847d9308060cb743aa0d9efa4177306b95c67 | JavaScript | zillBoy/react-party | /src/components/ReactParty/ReactParty.js | UTF-8 | 2,529 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import './ReactParty.css'
const ReactParty = ({ delay = 0, duration, showDefault = true, limit, content, size, onStart, onStarted, onCompleted }) => {
const [partyShowDefault, setPartyShowDefault] = useState(showDefault)
const [animationDuration, setAnima... | true |
4355e8668715d83d896d379e4269eab0f6659b75 | JavaScript | Octiembre80/energy_dashboard | /js/weather_chart.js | UTF-8 | 5,429 | 2.546875 | 3 | [] | no_license | $(function() {
$.getJSON("./data/weather.json", function(data) {
var temp = [],
rain = [],
clouds = [],
wind = [],
time = [],
newTime = []
i = 0;
for (var i in data) {
time.push([
data[i][2]
... | true |
9ddc40e1b1c93e6b349afe4c21e0a0593272de55 | JavaScript | shakhban777/JS | /Food/js/modules/timer.js | UTF-8 | 2,725 | 3.078125 | 3 | [
"MIT"
] | permissive | function addZero(num) {
if (num < 10) {
num = '0' + num;
}
return num;
}
function timer(id, deadLine) {
// * Timer
function getTimeRemaining(endtime) {
const total = Date.parse(endtime) - Date.parse(new Date()),
days = Math.floor(total / (1000 * 60 * 60 * 24)),
hours = Math.floor((total / (1000 * 60 ... | true |
791ae5b806c774624525ec9e28aef148225316f0 | JavaScript | FrederikDahlin/Bootcamp | /operatorer.js | UTF-8 | 607 | 3.640625 | 4 | [] | no_license | // let forste = 5;
// let anden = 7;
// console.log(forste + anden);
// let forste = 39;
// let anden = 11;
// forste %= anden;
// console.log(forste);
// let navn = "Mads";
// let efternavn = "Larsen";
// if(navn == "Mads" && efternavn == "Larsen"){
// console.log("if");
// }
// else {
// console.log("else... | true |
850f9ddb65b8815e9a0d2d9941266af5d7382e07 | JavaScript | S4mLab/react-d3 | /src/components/svg-canvas/svg-canvas.component.jsx | UTF-8 | 1,502 | 2.65625 | 3 | [] | no_license | import React, {Component} from 'react'
import * as d3 from 'd3'
import { firestore } from "../../firebase/firebase.util"
import Rectangle from '../rectangle/rectangle.component'
class SVGCanvas extends Component {
constructor(props) {
super(props)
this.state = {
data: []
}
}
// because d3.j... | true |
7922464fea621f283b75596244f571da498fbc8b | JavaScript | AlanVidalll/Curso-Web-Moderno | /fundamentos/funcaoEmQuaseTudo.js | UTF-8 | 219 | 3.609375 | 4 | [
"MIT"
] | permissive | // Verificando o tipo de objeto, retorno será uma função...
console.log(typeof Object)
//Criamos uma classe
class Produto{}
// Verificando o tipo da classe, retorno será uma função...
console.log(typeof Produto)
| true |
e8e78f5b3bc97e5aa8ca2a9d2f6c403cb0538639 | JavaScript | flowerField/Promises | /test/index.js | UTF-8 | 1,071 | 3.171875 | 3 | [] | no_license | let Promise = require("../dist/Promise_ES");
// let p = new Promise((resolve, reject) => {
// setTimeout(() => {
// reject(100);
// }, 1000);
// })
// p.finally(() => {
// console.log("finally");
// }).then(data => {
// console.log("success", data);
// }, err => {
// console.log("fail", err... | true |
15cfeff5b578909928132faf1371cf0871644e3a | JavaScript | tippytap/react-redux-tutorial | /voting-server/test/immutable_spec.js | UTF-8 | 1,672 | 3.140625 | 3 | [] | no_license | import {expect} from 'chai';
import {List, Map} from 'immutable';
describe('immutability', () => {
describe('a number', () => {
function increment(currentState){
return currentState + 1;
}
it('is immutable', () => {
let state = 42;
let nextState = increme... | true |
85cfedbf31a0cfb1cc392f7aff6068386d820853 | JavaScript | MykolajKrusser/css-drop-menu-with-animation | /animationControl.js | UTF-8 | 451 | 2.6875 | 3 | [] | no_license | /**
* Created by Nicolas on 17/01/2018.
* add animation to menu_dropdown-content
*/
// When the user make event "mouseover", fire AnimationControl
window.addEventListener("mouseover",animationControl);
// Add the animated class to the animated object
function animationControl() {
// Get the animated object from... | true |
129f10c5431e69d0b924fdb4d02ad8ebb458db3c | JavaScript | ZakariaSelassi/JavascriptS1 | /04-dates/04-locale-date/script.js | UTF-8 | 446 | 3.890625 | 4 | [] | no_license | // 04-dates/04-locale-date/script.js - 4.4: textual date
(() => {
// to change the content of a tag: document.getElementById("element-id").innerHTML = "new-value"
// your code here
let today = new Date(Date.now());
console.log(today.toDateString());
//let today = now.getFullYear() + " - " + (no... | true |
34c3881d6e4b1c7d82a79a3361d92be653388bcf | JavaScript | liuxiwen-read/JS- | /03 第三阶段/05 练习题/js/04 原型练习.js | UTF-8 | 653 | 3.875 | 4 | [] | no_license | function C1(name) {
// name : undefined
if (name) { // 条件不成立...
this.name = name;
}
}
function C2(name) {
// name : undefined
// this.name = undefiend
this.name = name;
}
function C3(name) {
// name : undefined
// undefined 转换布尔值是 false
// this.name = undefined || 'join' =... | true |
6801a67334e27326aabd104f7075947510d77a1f | JavaScript | jackphan96/nodeS2 | /functions_temp.js | UTF-8 | 289 | 3.890625 | 4 | [] | no_license | function celsiusToFahrenheit (celsius) {
Fehrenheit = celsius * 1.8 + 32
console.log(`${celsius}°C is ${Fehrenheit}°F`);
}
function fehrenheitToCelsius(f) {
cel = (f-32) / 1.8
console.log(`${f}°F is ${cel}°C`);
}
celsiusToFahrenheit(40)
fehrenheitToCelsius(33)
| true |
6cf6f49b9a68d2245469a5ff2fee1bf4967cd7ec | JavaScript | rjsalamanca/react_memory_game | /src/App.js | UTF-8 | 2,802 | 3.28125 | 3 | [] | no_license | import React, { Component } from 'react';
import MemoryCard from './MemoryCard';
import './App.css';
import './MemoryCard.css';
function generateDeck(){
const symbols = ['∆', 'ß', '£', '§', '•', '$', '+', 'ø'];
const deck = [];
for(let i = 0; i < 16; i++){
deck.push({'isFlipped' : false, 'symbol':symbols[... | true |
c75774b57c48614b017cf9361b095f993282b69a | JavaScript | KostadinZapryanovRaychev/JavaScript-Basic-Functionalities-Course | /appLoops.js | UTF-8 | 2,052 | 4.375 | 4 | [] | no_license | // loop allows us to repeat some code
// fo instance we can print hello 10 times
// FOR loop syntax
// for (
// [initialExpression];
// [condition];
// [incrementExpression]
// );
for (let i = 1; i <= 20; i++){
console.log(i);
};
// we will make a loop presenting even numbers
for (let i = 0; i < 21; i += ... | true |
5c8ce7dbf8d16629fcdf151a5f8e52629bee4b98 | JavaScript | datanews/landslide | /tests/utils.js | UTF-8 | 3,684 | 2.96875 | 3 | [] | no_license | /**
* Test utils
*/
const test = require('tape');
const utils = require('../lib/utils.js');
// Tests for parseMinutes function
test('utils | parseMinutes', function(t) {
var parseTests = [
['', undefined],
[null, undefined],
[undefined, undefined],
[[ 1 ], undefined],
[0, undefined],
['0',... | true |
37f1b960be96fcdffc9f3be8f2b14c2a3d74bec6 | JavaScript | 12meses12katas/Noviembre-KataPotter | /gonzalo123/nodejs/potter.js | UTF-8 | 1,891 | 2.84375 | 3 | [] | no_license | (function() {
var Potter;
Potter = (function() {
function Potter() {
this.discounts = [0, 1, 0.95, 0.9, 0.8, 0.75];
this.basePrice = 8;
this._blankBooks = [0, 0, 0, 0, 0];
this._price = function(shopingCart) {
var newBooks, size;
size = this._calcSize(shopingCart);
... | true |
0908b71132b4e841c72c48199530f04bce8683ae | JavaScript | suprabhatmaiti/todo | /src/app/App.jsx | UTF-8 | 1,842 | 2.765625 | 3 | [] | no_license | import React from "react";
import ListItem from "./components/ListItem";
class App extends React.Component {
state = {
todo: "",
list: [], // {title,checked}
};
onChangeTODO = (e) => {
this.setState({ todo: e.target.value });
};
addTODO = () => {
const { todo, list } = this.state;
this.se... | true |
32fc8c3f9562c029222db9e58a0057fbf66bee7d | JavaScript | sajacaros/react-hello | /src/ch04/EventPractice06.js | UTF-8 | 1,004 | 2.75 | 3 | [] | no_license | import React, { useState } from 'react';
const EventPractice = () => {
const [form, setForm] = useState({
username: '',
message: ''
});
const { username, message } = form;
const onChange = e=> {
setForm({
...form,
[e.target.name]: e.target.value
});
};
const onClick = () => {
... | true |
e321480fd89bf97ef74154edcf7921dde78769a0 | JavaScript | Pritammorajkar15/Ticket-Master | /client/src/component/departments/DeptForm.js | UTF-8 | 1,012 | 2.578125 | 3 | [] | no_license | import React from 'react'
export default class Form extends React.Component{
constructor(){
super()
this.state={
name:''
}
}
handleChange=(e)=>{
this.setState({
[e.target.name]:e.target.value
})
}
submit=(e)=>{
e.prevent... | true |
93546d4de8ff9da53c5f7ca422fb25ee8a45118f | JavaScript | clindsey/nodeAppDemo | /clientSide/lib/components/results.js | UTF-8 | 1,975 | 2.65625 | 3 | [
"Unlicense"
] | permissive | var common = require("./common"),
_ = require("lodash"),
$ = require("jquery"),
accounting = require("accounting");
exports.show = function (data) {
common.hideEverything();
var $table = $("<table class=\"table table-striped table-hover\"><tr>\n\
<th>ID</td>\n\
<th>Birth Da... | true |
a53e5aa5391b34dde7097a47f9847b69427bddcd | JavaScript | seunghyun3309/nodejsTextbook | /4장/server2.js | UTF-8 | 526 | 2.546875 | 3 | [] | no_license | const { fstat } = require('fs');
const http = require('http'); //http 모듈 사용
const fs = require('fs');
http.createServer((req, res) => { //req : 객체의 요청에 관한 정보 res : 객체의 응답에 관한 정보
fs.readFile('./server2.html', (err,data)=>{
if(err)
{
throw err;
}
res.end(data);
});
}).... | true |
63a5971d701086d6a07592a270f38ec1d6b69935 | JavaScript | ricardo-quinones/Photo-Tagger | /app/assets/javascripts/views/photo_form_view.js | UTF-8 | 599 | 2.5625 | 3 | [] | no_license | (function (root) {
var PT = root.PT = (root.PT || {});
var PhotoFormView = PT.PhotoFormView = function () {
this.$el = $('<div>')
this.$el.on("submit", "form", this.submit.bind(this));
};
PhotoFormView.prototype.render = function () {
this.$el.html(JST["photo_form"]());
return this.$el;
};
... | true |
922ca256a461e21867824df0eab54d6d6734c000 | JavaScript | ezenteam2/EzenCrowdFunding | /gr2_lhj/page/views/indicator.js | UTF-8 | 1,244 | 3.3125 | 3 | [] | no_license | {
const titleLengthIndicator = document.querySelector('.title_length_indicator');
const projectTitle = document.getElementById("project_title");
const rightPriceIndicator = document.querySelector('.right_price_indicator');
const projectTargetFund = document.getElementById('project_target_fund');
function handleTitleLe... | true |
e83bb09f26230c0ffb0eb7c949df68f025181e58 | JavaScript | piyushsabla/CTDI | /CTDISample/Content/VehicleController.js | UTF-8 | 2,996 | 2.578125 | 3 | [] | no_license |
var app = angular.module('app', []);
var url = '/api/Values/';
app.factory('vehicleFactory', function ($http) {
return {
getVehicle: function () {
return $http.get(url);
},
addVehicle: function (vehicle) {
return $http.post(url, vehicle);
},
deleteVe... | true |
9a94d764eec3c34aa181a834f2a9e88560e6b9e2 | JavaScript | nov321/services | /packages/string-fn/src/standalone/pascalCase.spec.js | UTF-8 | 351 | 2.71875 | 3 | [] | no_license | import { pascalCase } from './pascalCase'
const expectedResult = 'FooBarBaz'
test('happy', () => {
expect(pascalCase('foo BarBAZ')).toEqual(expectedResult)
})
test('from camel case', () => {
expect(pascalCase('fooBarBaz')).toEqual(expectedResult)
})
test('from dot case', () => {
expect(pascalCase('foo.bar.baz... | true |
f3b808bb7f6cc18396932217fd32fa2b7c4f0a71 | JavaScript | Juke-Jitsu/Server | /api/main.js | UTF-8 | 4,175 | 2.515625 | 3 | [
"MIT"
] | permissive | var gmusic = require('./gmusic.js');
var array = require('array');
var Player = require('./player.js');
var www = require('../bin/www');
var bufferSong = require('./bufferedSong.js');
var config = require('../config.json');
var Rx = require('rx');
var ShadowCopy = require('./shadowcopy.js');
var fs = require('fs');
va... | true |
37b42c3adc00ed42f2d36cefb74d6076f6407b0e | JavaScript | bharvi-bissa/HackerRank_Repo | /Day_13/SherlockAndValidString.js | UTF-8 | 1,621 | 3.34375 | 3 | [] | no_license | 'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split(... | true |
ec3587a069ad1389f7bac8a30b72785973c2f6a2 | JavaScript | opdemiden/opdemiden.github.io | /hw3/js/infoPanel.js | UTF-8 | 2,098 | 3.109375 | 3 | [
"MIT"
] | permissive | /** Class implementing the infoPanel view. */
class InfoPanel {
/**
* Creates a infoPanel Object
*/
constructor() {
}
/**
* Update the info panel to show info about the currently selected world cup
* @param oneWorldCup the currently selected world cup
*/
updateInfo(oneWorld... | true |
e45f889f30836c808122a62da0daf0620727b5a2 | JavaScript | dordarnirrine/TeamProjects | /Test/js/index.js | UTF-8 | 920 | 3.0625 | 3 | [] | no_license |
function choosePage(){
//var user = document.getElementById("form-user").value;
//var pass = document.getElementById("form-pass").value;\console.log(user + pass);
var element = document.getElementsByClassName("form-input");
var user = element[0];
var pass = element[1];
switch(user.value){
... | true |
28fc8995306ba518b048125aeedd87102ef4ce05 | JavaScript | JS-LIU/live | /src/entity/Order.js | UTF-8 | 5,159 | 2.53125 | 3 | [] | no_license | /**
* Created by Liudq on 2019-07-30
*/
import {TimeManager} from "./TimeManager";
import {OrderProduct} from "./OrderProduct";
import {Teacher} from "./Teacher";
export class Order {
constructor(orderInfo){
this.orderNo = orderInfo.orderNo;
this.payPrice = orderInfo.payPrice;
this.payLa... | true |
5b614cdc6ac29bf13e7d8850fd69398d4f7a23e5 | JavaScript | jacobmajors/TriviaGame | /assets/javascript/app.js | UTF-8 | 4,231 | 3.1875 | 3 | [] | no_license | //opening variables
var gameArea = $('#quiz-area');
var startCounting = 30;
//click events
$(document).on('click', '#start-over', function(event) {
game.reset();
});
$(document).on('click', '.answer-button', function(event) {
game.clicked(event);
});
$(document).on('click', '#start', function(event) {
... | true |
cb6e9c4e1a1c105b282c83aafd73dd2200d5b0e4 | JavaScript | synthetichealth/module-builder | /src/utils/keys.js | UTF-8 | 648 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive |
export function findAvailableKey(root, keys){
// eslint-disable-next-line no-sequences
let keys_index = keys.reduce((r, i) => (r[i] = true, r), {})
let next = root;
let index = 1;
// check if this pattern already exists, so we don't chain key_2_2_2 etc
let endsInNumber = /_(\d+)$/g;
let matches = endsI... | true |
14ccb94827f87b3e8326c86c6717d661ff894ebd | JavaScript | AlexHimchak/solarize | /src/twilio/linked.js | UTF-8 | 478 | 2.515625 | 3 | [] | no_license | let email = require('./sendgrid');
let sms = require ('./twiliosms');
let voice = require('./twiliovoice')
//Email function format : email(Email TO, Subject Title, Body)
//SMS function format : (Phone number TO, Body)
//Voice function format : (Phone number TO, URL to voice message)
//Twilio Does not work right now, N... | true |
7072c548d561012da6d5baa80cef49a83265641f | JavaScript | jde-maga/discord-wow-raid-helper | /RaidHandler.js | UTF-8 | 4,969 | 2.5625 | 3 | [] | no_license | const emoji = require("node-emoji");
const moment = require("moment");
const RaidEvent = require("./models/RaidEvent");
class RaidHandler {
constructor(client, msg, type) {
this.client = client;
this.message = null;
this.tanks = [];
this.healers = [];
this.dps = [];
if (type === "new") {
... | true |
b2dc4770aa8e74d09e47edb0f52fe467af80fb9c | JavaScript | tsvetanbg/Softuni---JS-advanced | /Arrays/Lab/Last-K-Numbers-Sequence.js | UTF-8 | 753 | 4.59375 | 5 | [
"MIT"
] | permissive | /*
You are given two integers n and k. Write a JS function that generates and prints the following sequence:
• The first element is 1
• Every following element equals the sum of the previous k elements
• The length of the sequence is n elements
The input comes as two number arguments. The first element represents the n... | true |
b4870918027e1eae69dd3873a48d4846bb0ae92f | JavaScript | fazliddin2001/regex | /matching-same-text-again-again.js | UTF-8 | 499 | 3.09375 | 3 | [] | no_license | /**
* https://www.hackerrank.com/challenges/matching-same-text-again-again/problem
*/
var Regex_Pattern = /^([a-z])(\w)(\s)(\W)(\d)(\D)([A-Z])([a-zA-Z])([aeiouAEIOU])(\S)\1\2\3\4\5\6\7\8\9\10$/;
function processData(Test_String) {
console.log(!!Test_String.match(Regex_Pattern));
}
process.stdin.resume();
proce... | true |
bb77a4c0862cee0e6f5763bf9aec32f76e839be3 | JavaScript | RileyVaughn/ChaosGame | /move.js | UTF-8 | 1,959 | 3.625 | 4 | [] | no_license |
//Narrative: Moves a point around the screen
//Preconditions: An input a which is either 1,2,3
//Postconditions: The point is moved half it’s distance from the selected point
function MovePoint(a) {
turnCount = turnCount + 1;
point = [(point[0] + triangle[a][0]) / 2, (point[1] + triangle[a][1]) / 2];
Dr... | true |
94499f242a44e9766f674ccc919a2e424ec5784a | JavaScript | RisvanUnasT/petcommunity | /Source/nodejs project/petcommunity/test/test_scheduler/test.js | UTF-8 | 972 | 2.890625 | 3 | [] | no_license | //스케쥴러
// nodejs scheduler
// cron expression ..
/*
* * * * * *
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ │
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
│ │ │ │ └───── month (1 - 12)
│ │ │ └────────── day of month (1 - 31)
│ │ └─────────────── hou... | true |
f0eecb6f492c4e78447a40ec4f86f115848481ad | JavaScript | maxIrvine/stripe-test | /public/main.js | UTF-8 | 702 | 2.53125 | 3 | [] | no_license | var checkoutHandler = StripeCheckout.configure({
key: "pk_test_xccDXirNQNMdCwM6kRdzqDnr",
locale: "auto"
});
var button = document.getElementById("buttonCheckout");
button.addEventListener("click", function(ev) {
checkoutHandler.open({
name: "Skimmer Scooper",
amount: 39900,
description: "The Best Po... | true |
489e2b4c09c5e125bec3d5832cb900831e14fa85 | JavaScript | michaelshum321/leetcode | /contest-154/1190.js | UTF-8 | 1,018 | 3.859375 | 4 | [] | no_license | // 1190. Reverse Substrings Between Each Pair of Parentheses
// https://leetcode.com/contest/weekly-contest-154/problems/reverse-substrings-between-each-pair-of-parentheses/
/**
* @param {string} s
* @return {string}
*/
var reverseParentheses = function(s) {
if (!s || s.length === 1) {
return s
... | true |
0234f6d310c38639318ebb37b3ae8f3d4bbfaca1 | JavaScript | KPMGE/Learning-Node-Express | /file-system-module/read-file-sync.js | UTF-8 | 486 | 3.375 | 3 | [] | no_license | // Reading files with sync functions
const { readFileSync, writeFileSync } = require("fs");
firsFile = readFileSync("./some-folder/first-file.txt", "utf-8");
secondFile = readFileSync("./some-folder/second-file.txt", "utf-8");
console.log(firsFile);
console.log(secondFile);
console.log("Writing in the result-sync.t... | true |
adf985b6b219b688e4f4d09094116620a61ccadf | JavaScript | tom79108/Jay-Li | /lab11_Scope/Demo5.js | UTF-8 | 325 | 2.984375 | 3 | [] | no_license | function scopeTest(){
var x1 = 5;
var x1 = "500";
console.log(x1);
let x2 = 4;
// let x2 = "400"
console.log(x2)
}
function scopeTest2(){
var j = 0;
for (let i=j; i<10; i++){
// for (var i=j; i<10; i++){
console.log(i+1);
}
// console.log(i,j);
}
scopeTest();
scopeTe... | true |
e72e7efeba6b51d54dc1c5312757820a1731c24d | JavaScript | BugbearR/bugbearr.github.io | /clientwebexp/form/input_color/index.js | UTF-8 | 470 | 3 | 3 | [] | no_license | (function () {
function init() {
var color1Elm = document.getElementById("color1");
color1Elm.addEventListener("change", function (evt) {
document.getElementById("color1_onchange").value = evt.target.value;
})
color1Elm.addEventListener("input", function (evt) {
... | true |
cba78ad71f7d9c76a80dd2f4f60809ec7c5c3d02 | JavaScript | R-Plascencia/project-say | /interests/static/interests/js/say-coverpage.js | UTF-8 | 437 | 2.59375 | 3 | [] | no_license | (function(){
//
// Module and controllers for the Cover Page
//
var app = angular.module('sayCoverPage', []);
app.controller('CoverController', function(){
this.activeLink = 1; // Start with the 'Welcome' link set active
this.setActiveLink = function(link){
this.activeLink = link;
... | true |
d6be2e2817b6824bae12a0f138298f964e412eb5 | JavaScript | SaitTalhaNisanci/URL_Shortener | /frontend/my-app/src/component/App.js | UTF-8 | 2,432 | 2.671875 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import './App.css';
import './styles.css';
import axios from 'axios';
import {Button, Alert, FormControl} from 'react-bootstrap';
import {CopyToClipboard} from 'react-copy-to-clipboard';
import serverIP from './constants';
class App extends Component {
constructor(props){... | true |
1a979b894ea79c5c7afe35f8d7c9cc729d194b6f | JavaScript | jjregist/IoT | /server.js | UTF-8 | 2,546 | 2.8125 | 3 | [] | no_license |
// BASE SETUP
// =============================================================================
// call the packages we need
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
//configure jade and views
app.set('view engine', 'jade');
app.set('views', __dirname... | true |
a6a0becda8b44b8379fb26dfb53dcc26b61867ce | JavaScript | suguru03/leetcode | /algorithms/0120.Triangle/index.js | UTF-8 | 434 | 3 | 3 | [] | no_license | 'use strict';
module.exports = { minimumTotal };
/**
* @param {number[][]} triangle
* @return {number}
*/
function minimumTotal(triangle) {
for (let i = 1; i < triangle.length; i++) {
const prev = triangle[i - 1];
const row = triangle[i];
for (let j = 0; j < row.length; j++) {
row[j] += Math.mi... | true |