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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4a6f6f97653fb64b7938ba511aabd7d93d08cc5b | JavaScript | chamow97/Quotivate-Me | /quotivate-me/assets/js/index.js | UTF-8 | 4,517 | 3.203125 | 3 | [
"MIT"
] | permissive | /*
* Event Listeners
*/
document.addEventListener('DOMContentLoaded', getRandomFile(141));
document.addEventListener('DOMContentLoaded', getWallpaper(50));
document.getElementById("myButton").addEventListener("click", notifyQuotes);
document.getElementById('system-icon').addEventListener("click", openSettings);
/*
* ... | true |
8593fff6654b81cd6dc0728a6314bf1b44e47c2f | JavaScript | TianylCandy/VueTodoList | /src/main.js | UTF-8 | 2,405 | 2.53125 | 3 | [] | no_license | // The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'todomvc-app-css/index.css'
import Vue from 'vue'
// let Vue=require('vue')
var filters={
all(todolist){
return todolist
},
active(todolist){
... | true |
3350d0f431b3b5664c1aa7cbf41108674777ace3 | JavaScript | clearlinux/clear-linux-documentation | /source/_themes/otc_tcs_sphinx_theme/static/tcs_theme.js | UTF-8 | 2,643 | 2.875 | 3 | [
"CC-BY-4.0"
] | permissive | var i;
var contents = document.getElementsByClassName("content-collapse section");
var bashDollarDivs = document.getElementsByClassName("bash-dollars highlight-bash");
for (i = 0; i< bashDollarDivs.length; i++) {
_pre = bashDollarDivs[i].querySelectorAll("pre");
for (j = 0; j < _pre.length; j++) {
cons... | true |
ac89bf805dbba71d4774e8d31891d94d780df62b | JavaScript | fnoori/SENG_513_assig2 | /main.js | UTF-8 | 931 | 3.03125 | 3 | [] | no_license | const EQUAL = '=';
const TIMES_SYMBOL = 'x';
const CLEAR_SYMBOL = 'c';
const ERROR = 'ERROR';
let toEval = [];
let displayArea = $('#num-display');
buttonClicked = (value) => {
if (value !== EQUAL) {
if (value === CLEAR_SYMBOL) {
if ($('#num-display').text() === ERROR) {
toEval = [];
$('#n... | true |
a1676b0f3759b17363dd46f6b6068c6ed13b049a | JavaScript | melhemdirani/Infinite | /src/Components/Calculate.js | UTF-8 | 2,092 | 2.75 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import { setCalculations } from '../redux/user/user.actions'
import { connect } from "react-redux";
const Calculate = ({x, setCalculations, calculations, userName}) => {
const [variable, setVariable] = useState()
const [answer, setAnswer] = useState([])
con... | true |
f92e0ad2800da803ddaa23f490cf7cd23c112442 | JavaScript | availabs/pyGridMap | /wxatlas/src/components/globe/projections/globes.js | UTF-8 | 15,124 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* globes - a set of models of the earth, each having their own kind of projection and onscreen behavior.
*
* Copyright (c) 2016 Cameron Beccario
*
* For a free version of this project, see https://github.com/cambecc/earth
*/
!(function () {
'use strict'
var globes = module.exports = {}
var d3 = requir... | true |
703a9f8179af28e5dee0be566729eee5dfd29f21 | JavaScript | CAROLZXYZXY/CAROLZXYZXY.github.io | /archive/index.js | UTF-8 | 3,785 | 3.25 | 3 | [] | no_license |
// function that creates dummy data for demonstration
function createDummyData() {
var date = new Date();
var data = {};
for (var i = 0; i < 10; i++) {
data[date.getFullYear() + i] = {};
for (var j = 0; j < 12; j++) {
data[date.getFullYear() + i][j + 1] = {};
for (var k = 0; k < Math.ceil(... | true |
9026c442856d30d678373134503d49981d7e82eb | JavaScript | GeoffreySangston/EscapeFromToyTower | /BohoEngine/engine.js | UTF-8 | 1,117 | 2.90625 | 3 | [] | no_license | var Engine = { // static class
game : null,
lastRenderFrameTime : null,
maxFPS : 60,
millisPerFrame : 1000/60,
lastTimeSinceRender : null
}
Engine.init = function(game){
this.game = game;
};
Engine.destroy = function(){
};
/**
Should return exit success/failure
*/
var TIMESSUM = 0;
var NUMSAMPLES = 0;
Engine.... | true |
365ab262f3de232e8a1295ce0c88a712d58d85bf | JavaScript | curipha/userscripts | /language_switcher_for_microsoft_docs.user.js | UTF-8 | 1,480 | 2.546875 | 3 | [
"Unlicense"
] | permissive | // ==UserScript==
// @name Language switcher for Microsoft Docs
// @namespace curipha
// @description Add language menu
// @include https://docs.microsoft.com/*
// @version 0.0.4
// @grant none
// @noframes
// ==/UserScript==
(function() {
'use strict';
const nav = documen... | true |
b758fce306600f6eb2b9fc9371f034ca9f48e267 | JavaScript | ekwon86/MEAN-newsfeed2 | /routes/authentication.js | UTF-8 | 3,773 | 2.53125 | 3 | [] | no_license | const User = require('../models/user');
const jwt = require('jsonwebtoken');
const config = require('../config/database');
module.exports = (router) => {
/** REGISTER USER ROUTE **/
router.post('/register', (req, res) => {
if(!req.body.username) {
res.json({ success: false, message: 'You mu... | true |
bc05b5feae028cfb684477e4bef9bcc1debfd31a | JavaScript | vkondi/bm-expenses | /src/Redux/Reducer.js | UTF-8 | 783 | 2.734375 | 3 | [] | no_license | /**
* REDUX REDUCER
*
* Defines the initial state of Redux and contains reducer method to update the state.
*/
import {combineReducers} from 'redux';
import {SET_MAIN_DATA, SET_FILTER_VALUE} from '@constants/Constants';
const INITIAL_STATE = {
mainData: null,
filterValue: null,
currentShortMonth: new Date(... | true |
54c8e18411cd0ca3896796061f6a36b152325899 | JavaScript | ElreyB/catdog | /js/scripts.js | UTF-8 | 358 | 2.53125 | 3 | [] | no_license | $(document).ready(function(){
$("#cat").click(function(){
$("ul#cat-talk").prepend("<li>Meow, man. Meow.</li>");
$("ul#dog-talk").prepend("<li>Bowwowwow yo yippie yay.</li>");
});
$("#dog").click(function(){
$("ul#dog-talk").prepend("<li>Bowwowwow yo yippie yay.</li>");
$("ul#cat-talk").prepend("<... | true |
e6ecc05ec35af16a0801dd3dd8e1f326629fbc45 | JavaScript | RonandoL/Address-Book | /js/scripts.js | UTF-8 | 4,385 | 3.984375 | 4 | [
"MIT"
] | permissive | // Business Logic
// Constructor for Contact
function Contact(firstName,lastName) {
this.firstName = firstName;
this.lastName = lastName;
this.addresses = [];
}
// Prototype for fullName: concatonating firstName + lastName
Contact.prototype.fullName = function() {
return this.firstName + " " + this.lastName;
}... | true |
8a23c499f362a58a0a59cb9570938370cd490735 | JavaScript | PeaceAgent/jsp | /async code, promises, callback.js | UTF-8 | 258 | 3.5 | 4 | [] | no_license | //Async code, Promises, Callbacks
//Async code (executed with defined delay)
setTimeout(() => {
console.log('Timer is done!');
}, 2000);
//Sync code(they are executated right after each other with no delay)
console.log("hello");
console.log('Hi');
| true |
4dc0afdae635e6134da34c350b0c716dcc7201d2 | JavaScript | lpy00511/Ccode | /c++/js/maxsub_dp.js | UTF-8 | 344 | 2.921875 | 3 | [] | no_license | function info (str) {
// body...
var a = str.split(" ").map(function(elem) {
return parseInt(elem);
});
var n = a.length;
var f = [];
for(var i = 0; i < n; i++){
f[i] = 1;
for(var j = 0; j <= i; j++){
if(a[j] < a[i]){
f[i] = f[i]>(f[j]+1)?f[i]:(f[j]+1);
}
}
}
return f;
}
console.log(info("1 9 ... | true |
b8b85bf14ae893277546cc2e29c91c3e3209e12b | JavaScript | DuskTillDwan/BestDeal | /javascript.js | UTF-8 | 3,474 | 2.921875 | 3 | [] | no_license | var completeTable;
var isIE;
var xhr;
function init()
{
console.log("began init()");
var completeField = document.getElementById("searchId");
completeTable= document.getElementById("complete-table");
var autoRow = document.getElementById("auto-row");
console.log("completed init()");
}
function doCompletion()
{
... | true |
1bf2eb7afbcf0a446b62c52be478c80e0016858b | JavaScript | Elijah-Hensel/rhymebot | /commands/commands.js | UTF-8 | 930 | 2.515625 | 3 | [] | no_license | const { MessageEmbed } = require("discord.js");
module.exports = {
name: "!commands",
description: "lists all commands rhymeBot offers",
async execute(msg, args) {
const commandEmbed = new MessageEmbed()
.setColor("#FF1493")
.setTitle(
`
HERE IS A LIST OF ALL THE COMMANDS ... | true |
0298b747742fb6c4cc07af81913a508486ce4ef4 | JavaScript | NacimHarfouche/todolist_js | /js/main.js | UTF-8 | 1,729 | 3.9375 | 4 | [] | no_license | // declare the variable that a will use
const entryElt = document.getElementById("entryWrite"),
addButtonElt = document.getElementById("addButton"),
listElt = document.getElementById("list"),
clearAllButtonElt = document.getElementById("clearAllButton");
// when i click on the ADD button
addButtonElt.addEventListener(... | true |
6cc4e78ad6ffa6f06ca740e4e5791dffd0554c08 | JavaScript | dlawlsdud0419/momoton | /js/search.js | UTF-8 | 659 | 2.859375 | 3 | [] | no_license | const searchform = document.querySelector('.search-form');
const search = document.getElementById('Search')
const domain = ['.com','.net','.org','.kr','.in','.tv','.cn','.jp','.biz','.info','.me','.eu','.ac','.cc','.co'];
searchform.onsubmit = function() { return myFunction() };
function myFunction() {
let bool;
... | true |
c6db79afa1572903020b82f1f91b56ac27ae2acf | JavaScript | aherrick/LagerLogger | /public/js/util.js | UTF-8 | 1,015 | 3.234375 | 3 | [] | no_license |
function array_count_values(array) {
var tmp_arr = {},
key = '',
t = '';
var __getType = function (obj) {
// Objects are php associative arrays.
var t = typeof obj;
t = t.toLowerCase();
if (t === "object") {
t = "array";
}
return t;
};
... | true |
324ff9f71b9414675602e245015fc7ac8cc8e823 | JavaScript | nasturtus/recursion | /countdown.js | UTF-8 | 131 | 3.015625 | 3 | [] | no_license | function countdownFrom(val) {
if (val < 0) {
return;
}
console.log(val);
countdownFrom(val - 1);
}
countdownFrom(10);
| true |
ab1a53bc559a33a72a683dc33af72a840d93173e | JavaScript | josephsieang/css-animation | /hamburger menu/menu.js | UTF-8 | 325 | 2.875 | 3 | [] | no_license | const hamburgerBtn = document.querySelector('.hamburger-button');
hamburgerBtn.addEventListener('click', event => {
event.preventDefault();
console.log('hamburger button clicked');
hamburgerBtn.classList.toggle('active');
const overlay = document.querySelector('.overlay');
overlay.classList.toggle('visible')... | true |
2758bbf52a6dd20ce351ce66d9a962f0813a3b21 | JavaScript | DavidJeffPhillips/Pet-Adoption-Dashboard | /Pet_Adoption/static/js/app.js | UTF-8 | 3,737 | 2.859375 | 3 | [] | no_license | function breedViz(catData, dogData) {
var catBreedArray = [];
catData.forEach(element => {
catBreedArray.push(element.breed)
});
var occurences = {};
for (var i = 0; i < catBreedArray.length; i++) {
if (typeof occurences[catBreedArray[i]] == "undefined") {
occurences[catB... | true |
c78ee19fa79f7f342ebdf4f976fa2da01b2a7265 | JavaScript | a-sulami/w07d04-HW15 | /js/gladiator.js | UTF-8 | 391 | 2.78125 | 3 | [] | no_license | class Gladiator{
constructor(name,weapon){
const weapons = ['spear', 'club', 'trident']
this.name = name;
this.weapon = weapon;
if (weapons.includes(weapon)){
console.log("Weclome to the arena where every man for himself");
}else {
console.log("the Gladiator only can use spear, clu... | true |
6a2f3d245f14b98f3ae0e32c1623bb5f6a402e98 | JavaScript | arushimittal143/EJS-Templates-WeekDays | /index.js | UTF-8 | 1,320 | 2.984375 | 3 | [] | no_license | const express = require('express')
const bodyParser=require("body-parser");
const app = express()
app.set('view engine', 'ejs');
app.get('/', function (req, res) {
var today=new Date();
// var currentDay=today.getDay();
var day="";
// if(today.getDay()===6 || today.getDay()===0)
// {
// ... | true |
5485e107a2a4ec027506e95091a0c8710cbf8869 | JavaScript | MiroVatov/SoftUni-Javascript | /JS Fundamentals/Associative Arrays - Lab/1. Phone Book.js | UTF-8 | 531 | 3.15625 | 3 | [] | no_license | function phoneBook(inputArr) {
let contactsDict = {};
for (let contactData of inputArr){
let [ name, phone ] = contactData.split(' ');
contactsDict[name] = phone;
}
// for (let contact in contactsDict){
// console.log(`${contact} -> ${contactsDict[contact]}`);
// }
... | true |
f2bcd15a6c2c804de238fc409ab2298a5397ac04 | JavaScript | Carlmac/nav-1 | /src/main.js | UTF-8 | 2,045 | 2.875 | 3 | [] | no_license | let localSave = localStorage.getItem('hash');
let localHash = JSON.parse(localSave);
console.log(localHash);
let unitHash = localHash || [
{
"thumbnail": "a",
"title": "apple.com",
"URL": "https://www.apple.com"
},
{
"thumbnail": "b",
"title": "bilibili.com",
"URL": "https://www.bilibili.c... | true |
3a9d11c2b53264edf4338d7e984fb639dff16068 | JavaScript | ingleonelrv/simonDiceJS | /js/code.js | UTF-8 | 5,288 | 3.625 | 4 | [
"MIT"
] | permissive | const celeste = document.getElementById('celeste')
const violeta = document.getElementById('violeta')
const naranja = document.getElementById('naranja')
const verde = document.getElementById('verde')
const btnEmpezar = document.getElementById('btnEmpezar')
const ULTIMO_NIVEL =10
class Juego {
constructor() {
... | true |
2a7ca66aca5340238fd5f56bb8be207ac51a0c31 | JavaScript | alla7amad/group-j | /client/src/components/ItemModal.js | UTF-8 | 4,720 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import axios from 'axios';
import {
Button,
Modal,
ModalHeader,
ModalBody,
Form,
FormGroup,
Label,
Input
} from 'reactstrap';
import { connect } from 'react-redux';
import { addItem } from '../actions/itemActions';
class ItemModal extends Component {
construc... | true |
4e78de06ac359b200d01a5637f521b5579395855 | JavaScript | alisbiaa/Algorithm | /AdventOfCode/2020/Day 4/NodeJS/index.js | UTF-8 | 2,290 | 3.296875 | 3 | [] | no_license | import {getInput} from "../../reusableJS/getInput.js";
const data = await getInput();
function check_passport_1(passport) {
const fields = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid'];
const tmp = passport.join(' '); // passport as a string
for (const f of fields)
if(!tmp.includes(f)) return... | true |
72bf55fb3ca121ace5fad07957c8610478093c94 | JavaScript | brandonFaf/AOC2020 | /3/index.js | UTF-8 | 1,172 | 3.59375 | 4 | [] | no_license | //Part 1
// const input = require('./input');
// const l = input[0].length;
// let right = 3;
// input.shift();
// const numOfTrees = input.reduce((acc, row) => {
// if (row[right % l] == '#') {
// acc += 1;
// }
// right += 3;
// return acc;
// }, 0);
// console.log(numOfTrees);
//Part 2
const input = req... | true |
6eace6ef6217f49f89c00a2439e09dedb3ae41b7 | JavaScript | Baymax14/Frontend-THA | /THA DAY-7/main.js | UTF-8 | 1,729 | 3.359375 | 3 | [] | no_license | // var student = { name: "David Rayy", sclass: "VI", rollno: 12 };
// console.log(Object.keys(student));
// console.log(student);
// delete student.rollno;
// console.log(student);
// console.log((objectLength = Object.keys(student).length));
// var library = [
// { author: "Bill Gates", title: "The ... | true |
315d6d705f0431e281acd4b6acd882e72b27c248 | JavaScript | dipshojol/CompositeProject2 | /src/js/jsForTweet.js | UTF-8 | 2,230 | 3.265625 | 3 | [] | no_license | "use strict";
(() => {
let itemsArray = localStorage.getItem('items') ? JSON.parse(localStorage.getItem('items')) : []; //if the localstorage data true then parsing data into js object
const data = JSON.parse(localStorage.getItem('items'));//parsing data into js object
const myTweet = document.getElementB... | true |
79a17725f3615480289280747d46206315ca2168 | JavaScript | blucechen1990/webpack-demo | /test.js | UTF-8 | 982 | 2.890625 | 3 | [] | no_license |
var readline = require('readline');
const dns = require('dns')
// var rl = readline.createInterface({
// input: process.stdin,
// output: process.stdout
// });
// rl.on('line', function (line) {
// if (line == 'exit' || line == 'quit' || line == 'q')
// rl.close();
// else
// console.log('您输入了: ' + lin... | true |
3825a190dec027c4710a6ff13d88fd062bdcbfeb | JavaScript | j-schreiner/WDI_14_HOMEWORK | /Johanna Schreiner/wk01/2-tue/ex3/index3.js | UTF-8 | 379 | 3.234375 | 3 | [] | no_license | var jobTitle = prompt("What is your job title?");
var geographiclocation = prompt("Where do you live?");
var partnersName = prompt("What is your partner's name?");
var numberOfChildren = prompt("How many children do you have?");
console.log("You will be a " + jobTitle + " in " + geographiclocation + ", and married to ... | true |
195e5112c8e643fab399b96cee5f696cbd189df0 | JavaScript | MaBlanck/JavascriptPartie5 | /Exo 6/assets/js/main.js | UTF-8 | 520 | 2.75 | 3 | [] | no_license | let textFocus = document.querySelector('input[type="text"]');
let passWord = document.querySelector('input[type="password"]');
textFocus.addEventListener('focusin', function(){
textFocus.style.border = '5px solid black';
});
textFocus.addEventListener('focusout', function(){
textFocus.style.border = '1px solid black';... | true |
9b430caab65dfe3887c34cf7bfdb4dd906b40f47 | JavaScript | alexjollands/VisAcoDev | /js/model/entities/colony.js | UTF-8 | 2,410 | 2.828125 | 3 | [] | no_license | /**
* Created by Alex on 17/02/2016.
*/
var Colony = Class({
initialize: function(ants) {
this.ants = ants;
this.numActiveAnts = 0;
this.deployingAnts = true;
},
disperseAnts: function(){
for (var i = 0; i < this.ants.length; i++){
var originNode = scenario.ge... | true |
b727ccd9c831d01467946b59591fde38cc439dc7 | JavaScript | SKHolmes/SKHolmes.github.io | /app.js | UTF-8 | 8,828 | 3.046875 | 3 | [] | no_license | (function(document) {
'use strict';
var app = document.querySelector('#app');
window.addEventListener('WebComponentsReady', function() {
app.DisplayEnums = {
NONE: 'none',
CONTACT: 'contact',
REFERENCES: 'references',
WORK_HISTORY: 'work-history',
EDUCATION: 'education',
... | true |
229a0b133ef28bb9acc8d012c437888064840698 | JavaScript | EugTech/main | /projects/adventure-childrens-museum/client/src/utils.js | UTF-8 | 1,478 | 3.25 | 3 | [
"MIT"
] | permissive |
export function sample(array) {
return array[Math.floor(Math.random() * array.length)];
}
export function getFrame(sprite) {
return {
x: sprite.x - (sprite.width / 2),
y: sprite.y - (sprite.height / 2),
width: sprite.width * sprite.scaleX,
height: sprite.height * sprite.scaleY,
};
}
export func... | true |
7424397fd28d40faf8a5eee42ce6bfccf620cb5a | JavaScript | sirigirichandu/React_Js_Learning | /React_Tutorial_react-owner-ownee-relationship/src/App.js | UTF-8 | 479 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
// #6. react-owner-ownee-relationship
class App extends Component {
componentWillMount(){
this.state = {
text : "This is the State Text"
}
}
update(e){
this.setState({text : e.target.value});
}
render(){
return(
<div>
<widget update={this.update.bi... | true |
a8db5d71ebcf9351d8289e55d86b88fe03c50168 | JavaScript | bin8639/portfolio_hkh | /js/register.js | UTF-8 | 3,912 | 2.6875 | 3 | [] | no_license | (function ($) {
// 페이지연결
$('.login_nav a').on('click', function (e) {
e.preventDefault()
var url = $(this).attr('href')
$('#secContainer').remove()
$('#secBox').load(url)
})
// 유효성 체크
$('.join_form').submit(function() {
// 이름 - 한글만가능
var nametxt = ... | true |
2aba68f0fc11e89f6bba6d22c8a27196b887c234 | JavaScript | tanyta78/JSAdvanced-Feb2018 | /09ObjectComp-exercises/02ConstructionCrew.js | UTF-8 | 177 | 2.578125 | 3 | [
"MIT"
] | permissive | function modifyWorker(obj){
if(obj.handsShaking==true){
obj.bloodAlcoholLevel+=0.1*obj.weight*obj.experience;
obj.handsShaking=false;
}
return obj;
} | true |
4d3c4ed562809346e0c1fe05d9b6802dfd4ea9fe | JavaScript | danfal/overman | /lib/reporters/phase_tracker.js | UTF-8 | 2,252 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2014 Per Eckerdal
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | true |
ac038bb79e9f6104676618480e13b25f49b1e009 | JavaScript | duckits/smypo-frontend | /src/components/stock/RealizedStockItem.js | UTF-8 | 1,015 | 2.71875 | 3 | [] | no_license | import React from 'react';
const RealizedStockItem = ({
realizedStockItem
}) => {
const realizedReturn = ((realizedStockItem.price - realizedStockItem.avgCost) * realizedStockItem.quantity).toFixed(2);
const colorRealizedReturn = () => {
if (realizedReturn > 0) return 'stock-item--return-positive';
els... | true |
71b35848f4e8050120e7c25658fd33107700e624 | JavaScript | Michi12345/FD2-hw-1 | /task1.js | UTF-8 | 333 | 3.21875 | 3 | [] | no_license | (function () {
'use strict';
let coordinates = [{x: 12, y: 13}, {x: 56, y: 45}, {x: -10, y: -25}],
result = getPolygonPoints(coordinates);
console.log(result);
function getPolygonPoints(coordinates) {
return coordinates.map(coordinate => coordinate.x + ',' + coordinate.y).join(' ');
... | true |
4504355e661371c351add1ae464b3f8475480c7d | JavaScript | fuunnx/sketches | /sketches/lines.js | UTF-8 | 3,721 | 2.78125 | 3 | [] | no_license | import canvasSketch from "canvas-sketch"
import { renderPaths, createPath } from "canvas-sketch-util/penplot"
import { getRandom, randomInterval } from "../libs/random"
import { range } from "../libs/range"
const settings = {
dimensions: "A4",
orientation: "portrait",
pixelsPerInch: 300,
scaleToView: true,
u... | true |
c14b585b5df098f6601ea359eba28574898c876e | JavaScript | iketari/favicons | /blocks/form/index.js | UTF-8 | 871 | 2.84375 | 3 | [] | no_license | (function(){
'use strict';
class Form{
constructor(opts){
this.el = opts.el;
this.render();
this.bindEvents();
}
render(){
let _template = document.querySelector('#form').innerHTML;
this.el.innerHTML = TemplateEngine(_template, {});
}
trigger (name, data) {
let widgetEvent = new Custo... | true |
408e2c66a2f7f475e2e14a03a4c969346b8dc182 | JavaScript | thaiKari/gis-app | /src/utils/getJsonType.js | UTF-8 | 449 | 2.9375 | 3 | [] | no_license | /**
* Returns the layer type. Eg. 'Polygon', 'MultiPolygon', 'Linestring' etc.
* Assumes all features are of same type as the first.
*/
const getJsonType = (json) => {
var type;
if (json.type === 'FeatureCollection'){
type = json.features[0].geometry.type;
} else if (json.type === 'Featur... | true |
99a4f478c02cbf50cd4b1a8ce1064c62169807ff | JavaScript | Yuiffy/camera-shortcut-rollup | /camera-shortcut-rollup/src/CanvasUtil.js | UTF-8 | 4,134 | 2.8125 | 3 | [
"MIT"
] | permissive | const downloadCanvas = (canvas, fileNamePrefix, type, photoQuality) => {
canvas.toBlob((blob) => {
console.log('toBlob', blob, photoQuality);
const a = document.createElement('a');
const url = window.URL.createObjectURL(blob);
const filename = `${fileNamePrefix}.${type}`;
a.href = url;
a.down... | true |
30a9b5c5eb5a5bacf09ff27047494b66122a59a6 | JavaScript | RoryMagee/leetcode-monthly-challenges | /aug/04-power-of-four.js | UTF-8 | 838 | 4.46875 | 4 | [] | no_license | /*
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example 1:
Input: 16
Output: true
Example 2:
Input: 5
Output: false
Follow up: Could you solve it without loops/recursion?
*/
var isPowerOfFour = function(num) {
const base = 4
let exp = 0;
while (true) {
... | true |
635d52895db2d536236dd0fa2dcb9a4ea3ee5d61 | JavaScript | Silverster98/blog-system | /public/login/log.js | UTF-8 | 1,092 | 2.890625 | 3 | [] | no_license | const hardString = 'this is a hard string'
function submit() {
console.log('begin post infor')
const emailInput = document.getElementById('email')
const pwInput = document.getElementById('password')
if (emailInput.value === '' || emailInput.value === null) {
alert('邮箱不能为空')
return
}
if (pwInput.value === '... | true |
f40b14b24cb05c50cfa63037a893e047fd48458d | JavaScript | Automedon/Codewars | /8-kyu/Function 3 - multiplying two numbers.js | UTF-8 | 195 | 3.421875 | 3 | [
"MIT"
] | permissive | /*
Description:
This function has to be called multiply and needs to take two numbers as arguments, and has to return the multiplication of the two arguments.
*/
let multiply = (a, b) => a * b;
| true |
8c36e3976e7346585b3de753a43db3b3cbec99f6 | JavaScript | dominictarr/crdt | /example/tcp.js | UTF-8 | 2,237 | 3.0625 | 3 | [
"MIT"
] | permissive | var es = require('event-stream')
var net = require('net')
var crdt = require('..')
var assert = require('assert')
/*
this tests CRDTs over an async connection.
it relys on the CRDT deciding to emit stream on next tick.
and emptying the queue.
(those are the two bugs I discovered writing this)
*/
var a ... | true |
b9375cd127b822f651990fef7aa05d1548c53e79 | JavaScript | xiaqiu2233/baidu-efe-2017tasks | /binbin_school/树/DFS和BFS/1.js | UTF-8 | 1,172 | 3.484375 | 3 | [] | no_license | function Node(data){
this.data=data;
this.parent=null;
this.children=[];
}
function Tree(data){
var node = new Node(data);
this._root=node;
}
Tree.prototype.traverseDF=function(callback){
(function recurse(currentNode){
for(var i=0;i<currentNode.children.length;i++){
recurse(currentNode.children[... | true |
dd4c0b05dbdf75349521fd4bae877a1571deff8e | JavaScript | etangreal/hsds-react | /src/utilities/__tests__/focus/incrementFocusIndex.test.js | UTF-8 | 3,225 | 2.59375 | 3 | [
"MIT"
] | permissive | import { incrementFocusIndex } from '../../focus'
test('Returns false for invalid arguments', () => {
expect(incrementFocusIndex()).toBeFalsy()
expect(incrementFocusIndex(true)).toBeFalsy()
expect(incrementFocusIndex('up')).toBeFalsy()
expect(incrementFocusIndex({})).not.toBe(false) // Objects accepted, but fi... | true |
d8c54ab11c8ec02c5247944faf4d8a4cd2dd2e6a | JavaScript | ach-me/Learn-Node | /dang-thats-delicious/models/Store.js | UTF-8 | 5,134 | 3.125 | 3 | [] | no_license | // Mongodb es la base de datos
// Monsoose es un paquete para intereaccionar con la base
// Mongodb puede ser usado con cualquier lenguaje, python, ruby, php
// Mongoose es la forma de interaccionar mas popular con mongodb
const mongoose = require('mongoose');
// Hay varias maneras de esperar por los datos de la base ... | true |
5637de939b061e0a84692503ef78171dff01faa1 | JavaScript | brockstonking/jeffreystokesdds | /src/ducks/reducer.js | UTF-8 | 882 | 2.828125 | 3 | [] | no_license | let initialState = {
currentRoute: '/',
os: 'Mac'
}
const SET_ROUTE_PATH = 'SET_ROUTE_PATH';
const SET_OS = 'SET_OS';
export const updateRoutePath = (currentRoute) => {
return {
type: 'SET_ROUTE_PATH',
payload: {
currentRoute: currentRoute
}
}
}
export const update... | true |
1617a9ad5631aa76d7484f9eba6b3074c689d298 | JavaScript | ashur/eleventy-plugin-find | /index.js | UTF-8 | 1,105 | 2.890625 | 3 | [] | no_license | const dotProp = require( "dot-prop" );
/**
* @param {Array} array
* @param {Array} ruleset
* @return {any}
*/
module.exports = (array, ruleset) =>
{
if( !Array.isArray( array ) )
{
return;
}
if( typeof ruleset === "string" )
{
return array.find( arrayItem => arrayItem === ruleset );
}
if( Array.isArra... | true |
120070b9867fefc9be4920eafebea1e6daa9a166 | JavaScript | jcollado/jcollado.github.io | /js/application.js | UTF-8 | 383 | 2.59375 | 3 | [] | no_license | $(document).ready(function() {
// Get question data from json file in server
$.getJSON('data/projects.json', function(projects) {
console.log('Projects metadata', projects);
// Create application to display given projects
app = new ApplicationModel(projects);
ko.applyBindings(app);
});
});
funct... | true |
9049a91da29ee17eb3da557197fcfcca7ccd6358 | JavaScript | chicoluz10/RedPandaBot | /src/commands/wiki/index.js | UTF-8 | 484 | 2.609375 | 3 | [] | no_license | const axios = require("axios");
const wikiRandom = async (msg, args) => {
/**
* @type {Array<{link:string}>}
*/
const data = (
await axios.get(
`https://en.wikipedia.org/w/api.php?action=query&list=random&format=json&rnnamespace=0&rnlimit=10`
)
).data.query.random;
let url = data[0].title;
... | true |
bd478df627534c455029a57921cc5ea3b00bd257 | JavaScript | ustart-dev/ustart | /src/lib/helpers/loadFastMocking.js | UTF-8 | 1,589 | 2.53125 | 3 | [
"MIT"
] | permissive | import path from "path";
import {
fileLoader
} from "merge-graphql-schemas";
import {
merge as _merge,
cloneDeep as _cloneDeep
} from "lodash";
import {
ENTITIES_PATH,
PLUGINS_PATH,
FASTMOCKS_GLOB
} from "../constants";
/**
* Search, load and merge fast mocking from entities and plugins.
* The root type ... | true |
c4213e191eea97bc3b0e095bb303532981d35803 | JavaScript | justfede/algorithms-datastructures | /leetcode-32-longest-valid-parentheses.js | UTF-8 | 1,345 | 4 | 4 | [] | no_license | /*
# Federico Carrizo
# carrizofg@gmail.com
# https://github.com/justfede
32. Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
Example 1:
Input: "(()"
Output: 2
... | true |
819a153fa37fe7bc5b954a072423825aa79f8da2 | JavaScript | xensers/mnogosdelal-frontend | /src/scripts/preloader.js | UTF-8 | 1,210 | 3.03125 | 3 | [] | no_license | var Preloader = new Preloader();
function Preloader(){
var self = this;
var elemPreloader;
var timer;
var status = false;
this.run = function() {
elemPreloader = document.getElementById('preloader');
document.documentElement.classList.add('loading');
status = false;
... | true |
2440223f121e05c295161f27effd7f4abe8b0aef | JavaScript | A19Sean/to-do-list | /src/Todo.js | UTF-8 | 972 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import "./Todo.css";
import TodoField from "./TodoField.js";
import TodoList from "./TodoList.js";
class App extends Component {
constructor() {
super();
this.state = {
todos: []
};
}
addTodo = todo => {
const updatedTodos = this.state.todos.slic... | true |
450a19ae7d26f76c0043deed01008619236e9edb | JavaScript | rememberlenny/jquery-slider | /slider-function.js | UTF-8 | 3,059 | 2.703125 | 3 | [] | no_license |
// Save variables to modify
var SliderVar = {
sliderHead: jQuery('.slider-head-link li'),
sliderContent: jQuery('.brand-primary-bg div'),
currentSliderHead: jQuery(this.slideHead).find('.active'),
currentSliderContent: jQuery('.brand-primary-bg div.active').index('.brand-primary-bg div'),
... | true |
0b48a376745275c7a856991917a47ebd99e5f248 | JavaScript | alpgul/Design-Patterns | /behavioral/state.js | UTF-8 | 2,028 | 3.703125 | 4 | [
"MIT"
] | permissive | /**
*
State deseni, bir nesnenin davranışını içsel durumuna bağlı olarak değiştirmesini sağlayan bir tasarım desenidir. Nesne, farklı durumlar arasında geçiş yaparak her durum için özelleştirilmiş davranışlar sergileyebilir.
*/
class TableState {
handleCellClick() {
throw new Error("handleCellClick() method mu... | true |
c46df830514f40750cf53280f02e8571aed71a49 | JavaScript | Nysera/restaurant-website | /src/resources/js/modules/forms/contactForm.js | UTF-8 | 4,410 | 2.5625 | 3 | [] | no_license | import formValidation from "../helpers/formValidation";
import formFocus from "../helpers/formFocus";
const contactform = function() {
// form container
const form = document.createElement("form");
form.id = "contact-form";
form.setAttribute("novalidate", "true");
// required input text
const ... | true |
2456dcaac31352d57d2dd6ca5bb7881ddca0e224 | JavaScript | boberxd/boberxd.github.io | /js/todo.js | UTF-8 | 4,139 | 3.1875 | 3 | [] | no_license | class ColorItem {
constructor(color){
this.color = color;
}
}
let yellow = '#ffc972';
let orange = '#ff9b73';
let purple = '#b692fe';
let blue = '#30dcff';
let green = '#e4ee90';
let colorList = [
new ColorItem(yellow),
new ColorItem(orange),
new ColorItem(purple),
new... | true |
18f94e64e9569ab08a55ecdcaffb45be3a100445 | JavaScript | Oleksandr-Karnaushenko/3_kurs_udemi | /Section_5/Exercise_2/main.js | UTF-8 | 429 | 3.109375 | 3 | [] | no_license | const btn = document.createElement('button');
btn.textContent = 'Click';
document.body.appendChild(btn);
const ul = document.createElement('ul');
document.body.appendChild(ul);
let number = 1;
let fontSize = 5;
btn.addEventListener('click', () => {
const li = document.createElement('li');
li.textContent = `Elenent ... | true |
1fb67e4e17c7bb71ff39fc2786ef0206f675b6e3 | JavaScript | phacce/halagram-captain-ms-cli | /index.js | UTF-8 | 3,242 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env node
const program = require('commander');
const fs = require('fs');
var dir = ''; // the directory to save the service
var serviceObj = {};
program.arguments('<service>')
.version('0.2.0')
.option('-P, --port <port>', 'set the service port')
.option('-L, --logger <logger>', 'set the logger... | true |
f4901fdf1ac957e523b783f79682b267101c6bf5 | JavaScript | ilySnowade/HyDiscord | /Commands/bedwars.js | UTF-8 | 3,115 | 2.5625 | 3 | [] | no_license | const Discord = require('discord.js');
const { color, footer } = require('../Storages/embed.json')
const { apikey } = require('../Storages/config.json');
const HypixelAPIReborn = require('hypixel-api-reborn');
const hypixelAPIReborn = new HypixelAPIReborn.Client(apikey);
const commaNumber = require('comma-number');
mo... | true |
45fc1634770bcbbe59ab083ec0fd03ab44154986 | JavaScript | JonathanMEnriquez/Bball_Draft | /basketball.js | UTF-8 | 10,822 | 2.5625 | 3 | [] | no_license | // Global vars
let POINTS4LINE = [100, 70],
LINEINDEX = 0;
PICKSTHRESHOLD = 75,
PICK = 0;
// clicked elements
class SingleAction {
constructor(player, elem) {
this.player = player;
this.element = elem;
this.init();
}
restore() {
this.player.reset();
$(th... | true |
c9a7fba7a3f10efdd5f6643fb1d2ea75afd541cd | JavaScript | cmgriffing/isomorphic-porch-demo | /src/components/projects/project-list.jsx | UTF-8 | 2,165 | 2.734375 | 3 | [] | no_license | "use strict";
var React = require('react');
var cx = React.addons.classSet;
var FluxibleMixin = require('fluxible').Mixin;
var ProjectStore = require('../../stores/project-store');
var ProjectList = React.createClass({
mixins: [ FluxibleMixin ],
/*
* Whenever this component hear... | true |
c9bb45f20ecb52aff4cfe4295c4138807d6fa14e | JavaScript | jeremiahogutu/FreeCodeCamp-Basic-Algorithim | /js/where_I_Belong.js | UTF-8 | 253 | 3.53125 | 4 | [] | no_license | function getIndexToIns(arr, num) {
// 1 add the number to the arr.
// 2 sort the new array
// 3 index position of the num
return arr.concat(num).sort(function(a,b){
return a-b;
}).indexOf(num);
}
console.log(getIndexToIns([40, 60], 50)); | true |
19ae8d5913f0083bc2c6c3af633c0c63b2e23763 | JavaScript | HujiLee/PaizaCodeInJavascript | /Paiza-HatsukoiIdol/「つり目」/「つり目」.js | UTF-8 | 196 | 2.625 | 3 | [] | no_license | var input = [
"1230"
];
function main() {
console.log(
parseInt((input[0]-0)/100+((input[0]-0>1000)?10:0))
);
}
main();
/**
* Created by Administrator on 2016/10/18 0018.
*/ | true |
53a0745913a2326c4f5e6bd8ceeb38407584581f | JavaScript | Universal-Team/Universal-Bot | /commands/Moderation/purge.js | UTF-8 | 879 | 2.671875 | 3 | [
"MIT"
] | permissive | module.exports = {
name: "purge",
args: {
value: {
title: "number of messages to delete",
required: true
}
},
desc: "Deletes a certain amount of messages",
permissions: [ "MANAGE_MESSAGES" ],
async exec(UnivBot, msg) {
// Check the number
const number = parseInt(msg.args.value);
if(number.toString... | true |
c21c3b22c631186b9791eceee0ec7d0c54a5170d | JavaScript | E3Coders/eloquent | /exercises/chap5/everySome.js | UTF-8 | 922 | 4.09375 | 4 | [] | no_license | function every(array, f){
return array.map(f).reduce(and);
}
function some(array,f){
return array.map(f).reduce(or);
}
function or(a,b){
return a || b;
}
function and(a,b){
return a && b;
}
function every2(array, f){
for(var i = 0; i <array.length; i++){
if(!f(array[i]))
return false;
... | true |
7a780f9655a56c5609d4284f9a31fe7af4320c9c | JavaScript | naprirfan/postgre_db_connect | /server.js | UTF-8 | 1,756 | 2.578125 | 3 | [] | no_license | const DB_USERNAME = process.env.DB_USERNAME || 'myusername';
const DB_PASSWORD = process.env.DB_PASSWORD || 'veryCoolPassword12';
var express = require('express');
var app = express();
var massive = require("massive");
var connectionString = "postgres://"+ DB_USERNAME +":"+ DB_PASSWORD +"@localhost/somedb";
var massiv... | true |
c944a92c4c45b621f4d5d17d007464d2d2d6250c | JavaScript | waskelyashwant/Bank-automation | /frontend/src/components/Login.js | UTF-8 | 1,792 | 2.53125 | 3 | [] | no_license | import "./Login.css";
import { useState } from "react";
import axios from "axios";
import Btn from "animated-react-button";
const Login = () => {
const [idd, setId] = useState("");
const [pass, setPass] = useState("");
const submitForm = (e) => {
e.preventDefault();
const send = {
idVal: idd,
... | true |
329def27fa61854aa4ad6b343acc64170d061ead | JavaScript | drwhorx/SLFF-Bot | /setup/score.js | UTF-8 | 3,842 | 2.640625 | 3 | [] | no_license | const fs = require("fs");
var events_json = JSON.parse(fs.readFileSync("../data/events.json"))
function inverf(x) {
var z;
var a = 0.147;
var the_sign_of_x;
if (0 == x) {
the_sign_of_x = 0;
} else if (x > 0) {
the_sign_of_x = 1;
} else {
the_sign_of_x = -1;
}
if (... | true |
aabafe000ff1615066c3a019d97da7f467b23158 | JavaScript | giisele/trybe-exercises | /1 - Introduction/05 - JavaScript: DOM, Eventos e Web Storage/dia_3/script.js | UTF-8 | 5,535 | 4.28125 | 4 | [] | no_license | let year = document.getElementById('year');
let month = document.getElementById('month');
year.innerText = '2021';
month.innerText = 'abril';
function createDaysOfTheWeek() {
const weekDays = ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado']
const weekDaysList = document.querySelector('.week-d... | true |
739bd0111cb321d0b849655ac2f56033b50a34bd | JavaScript | RomaZherko21/CodeWars | /6kyu/ReplaceWithAlphabetPosition.js | UTF-8 | 201 | 2.734375 | 3 | [] | no_license | function alphabetPosition(text) {
return text
.split("")
.map((item) => item.toLocaleLowerCase().charCodeAt() - 96)
.filter((item) => item >=1 && item <= 26)
.join(" ");
} | true |
e6cda0469b0a5e3a5aff158e86b3dc85191ebe50 | JavaScript | yuliachaika/gallery_new | /assets/src/javascript/util.js | UTF-8 | 1,870 | 2.703125 | 3 | [] | no_license | const Utils = new function(){
this.isValidEmailAddress = function(emailAddress) {
var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((2... | true |
7335aaf539822f499522c2545c80b64629d704ae | JavaScript | dalazaro-wdi39/express-personal-api | /server.js | UTF-8 | 5,265 | 2.75 | 3 | [] | no_license | // require express and other modules
var express = require('express'),
app = express();
// parse incoming urlencoded form data
// and populate the req.body object
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
// allow cross origin requests (optional)
// https://devel... | true |
4b95c9d95b966342a06cceecb9b0c120e0a47e07 | JavaScript | BloomBooks/BloomDesktop | /src/content/templates/template books/Wall Calendar/configure.js | UTF-8 | 7,932 | 2.984375 | 3 | [
"MIT"
] | permissive | //
// Javascript configuration file for Bloom Wall Calendar
//
// This function is input to the configuration dialog (run by "onload").
// Get a default year for the Calendar configuration dialog
// If after May use next year, otherwise use the current year.
function getYear() {
var d = new Date();
var month = ... | true |
2e374289f25a28381864b2ced38e841a68250dbf | JavaScript | appprova/fizzbuzz-js | /index.js | UTF-8 | 314 | 3.171875 | 3 | [] | no_license | function fizzbuzz(endIndex) {
return Array.from({ length: endIndex }, (_, index) => {
const number = index + 1
let value = ''
if (number % 3 == 0) {
value += 'fizz'
}
if (number % 5 == 0) {
value += 'buzz'
}
return value || number
})
}
module.exports = fizzbuzz; | true |
e55ab46296b75927303fe3f215663987c2837947 | JavaScript | Romkin7/klaukkalan_rengas_with_chat | /routes/booking/generatetimes.js | UTF-8 | 1,905 | 2.8125 | 3 | [] | no_license | "use strict";
const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const Calendar = require('../../models/calendar');
const adminAuthObj = require('../../api/admin/middleware/adminAuthObj');
// Utility functions
const util = require("../../lib/util");
function getSe... | true |
814524ab18d813919b67954d9cababf4ad395f96 | JavaScript | mpuica/tipico | /app/modules/Tipico.js | UTF-8 | 2,564 | 3.6875 | 4 | [] | no_license | //Tipico.js - main module
const Tipico = ({
cellCorner: '+',
cellHLine: '-',
cellVLine: '|',
cellMaxWidth: 0,
chunkNums: [],
/**
* get the maximum number of digits of a number in the array, which will give th width of a cell
* @param {array} array The array from which we extract the... | true |
23e83368866ab9411cf5fa11010b8b19a83dab76 | JavaScript | luanfonsecap/chuck-norris-jokes | /src/Components/Joke/Index.js | UTF-8 | 1,029 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useCallback } from "react";
import "./Styles.css";
import { Button } from "../../StyledComponents";
import api from "../../services/api";
import { useDispatch, useSelector } from "react-redux";
export default function Joke() {
const categorie = useSelector(state => state.jokes.categorie)... | true |
0eee03801c3e7b0a000329821c54c713ac2e8a9a | JavaScript | ndco/honeybadger_nyc | /week_7/wed/ndco/bank_starter/js/account.js | UTF-8 | 490 | 3.15625 | 3 | [] | no_license | // $(document).ready(function(){
console.log('loaded')
class Account {
constructor (balance=0) {
this.balance = balance;
}
toDeposit (num) {
this.balance += num;
}
toWithdraw (num) {
this.balance -= num;
if (this.balance ... | true |
e9ed32237f644484edaea965c2c5e2086447682d | JavaScript | sesha472/react-lists-conditions2 | /src/usestate/usestate.js | UTF-8 | 1,299 | 2.84375 | 3 | [] | no_license | import React, { useState } from 'react';
import Person from '../Person/Person.js';
const Uses = (props) =>{
const [info,changedinfo]=useState({
persons:[
{name:"sai1", age:21},
{name:"sai2", age:22},
{name:"sai3", age:23},
{name:"sai4", age:24}
],
});... | true |
cdf22643b4104e798f6f3ee7f2c45e2cf17e4497 | JavaScript | AnbuRaghu/MongoDb | /controllers/blogs.js | UTF-8 | 1,660 | 2.734375 | 3 | [] | no_license | // we have to import the models
const { modelName, db } = require('../models/blogs')
const Blog=require('../models/blogs')
exports.getBlogs=(req,res)=>{
//modelName.methodname
Blog.find()
.then((result)=>{
res.status(200).json({message:'Blogs fetched successfilly',blogs:result})
... | true |
6b297de2f5ad07c55936f5922a6165ef40153c41 | JavaScript | nigelLosi93/accen | /3/js_exercises/merge/merge.js | UTF-8 | 870 | 3.484375 | 3 | [] | no_license | function merge(left, right) { //left e right sono vettori ORDINATI
let vettore = [];
let i = 0, j = 0;
while (i < left.length && j < right.length) {
vettore[i + j] = 0;
if (left[i] < right[j]) {
vettore[i + j] = left[i];
i++;
}
else {
vetto... | true |
4f79cca97e1a94d7285179d9beb8f4986ed59a85 | JavaScript | dbasargin/ConsumingTwitterApi | /ConsumingTwitterApi/Scripts/customHomePageScript.js | UTF-8 | 1,678 | 3.09375 | 3 | [] | no_license | // This is my custom script for the homepage
// I am learning Javascript from Lynda.com
// I am applying what I am learning to this project.
//client side validation for TwitterScreenName search box on the homepage
function prepareEventHandlers() {
document.getElementById("search-form").onsubmit = function () {
... | true |
b702926b7578d328981e123d2a2e8dfc10332a9b | JavaScript | SpringUE/workplace | /server/spiders/test/spiders/wangyi.js | UTF-8 | 2,371 | 2.515625 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const config = require('../../config.js');
const puppeteer = require('puppeteer');
// 网易歌词
(async () => {
const browser = await (puppeteer.launch(config.launch));
const page = await browser.newPage();
// 进入页面
await page.goto('https://music.163.com/#');
// 点击搜索框拟人输入 鬼才会想... | true |
41bfa795721f32508f5fd19fde0fcee56267367c | JavaScript | pebblecode/angry-wirds | /src/js/niall.js | UTF-8 | 4,020 | 3.125 | 3 | [] | no_license | // var point = new Point(10, 5);
// var points[] = new Point(50, 50);
angryBool = true;
var pointArray = [
[-100, 100],
[-99,80],
[-88,60],
[-77,40],
[-66,20],
[-55,0],
[-44,-20],
[-33,-40],
[-22,-60],
[-11,-80],
[0,-100],
[99,80],
[88,60],
[77,40],
[66,2... | true |
993d072f7b8b9ce7d01befd02b902e0c878829cb | JavaScript | luacooli/javascript_net-ninja | /chapter_4/sandbox.js | UTF-8 | 647 | 4.34375 | 4 | [] | no_license | // function expression
const speak = function() {
console.log('good day!');
};
greet();
greet();
greet();
// speak();
// speak();
// speak();
// function declaration
function greet() {
console.log('hello there');
}
// arguments & parameters
// const speak = function(name = 'luigi', time = 'night') {
// ... | true |
3fb68eaa7acbb9ea81d740c64efc4853cd2d81d8 | JavaScript | nettotkm/javascript-fundamentals | /extra.js | UTF-8 | 1,906 | 4.875 | 5 | [] | no_license | // ######################################### //
// 1. Write a literal object called obj with 3 properties.
// code here
const obj = {
name: 'Julio',
age: 30,
job: 'Kodak',
};
// ######################################### //
// 2. Write an array called arrEx2 with length 3.
let arrEx2 = [5, 4, 7]
// code here
... | true |
1db44f0e4bc2043a06f2db2211825d5580ce6124 | JavaScript | katurisandeep/uxfactory_regular | /practical/es6.js | UTF-8 | 4,511 | 3.390625 | 3 | [] | no_license | // var x = 6;
// document.write(x);
// 1. round off all the decimal numbers in an array and sum all the values
let decimal = [3.4,5.4, 5,34.5,6.3];
let sum = Math.round(decimal.reduce(e => {
return e;
}))
console.log(sum);
// 2.get all the person name based on age greater than and equal to 18, eligible to vote
le... | true |
7faabac33781b3d7eb710ab5850dd8625c2780db | JavaScript | vandilsonm/scgo | /SGCO/web/js/campeonatos.js | UTF-8 | 3,554 | 2.59375 | 3 | [] | no_license | Campeonatos = function(){
this._data = null;
this._dataUrl = null;
this._type = null;
this._dataSource = null;
this._handlerSuccess = null;
}
Campeonatos.Load = function(){
var _dados = new Campeonatos();
_dados.initialize();
return _dados;
}
Campeonatos.prototype = {
initialize: ... | true |