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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
50ac3fe96c08b381647c951a2c7da2aac104f839 | JavaScript | DRJDHEERAJ/pp-10-1-2DevLecture | /7decimalTobinary.js | UTF-8 | 504 | 3.640625 | 4 | [] | no_license | let decimal = 26;
function dtb(decimal){
let binary = 0;
let pv = 1;
while(decimal>0){
console.log(decimal); // print the quotient
let rem = decimal%2;
binary = binary+ rem*pv;
pv = pv*10; //change the place value by 10^1, 10^2, 10^3
decimal = Math.floor... | true |
9ef01c358da3c36ed573059f3d237e0c010b8fa8 | JavaScript | dmk1111/JS-Core | /JS - Fundamentals/06. Lab Arrays and Matrices/01. Sum First Last.js | UTF-8 | 120 | 3.1875 | 3 | [] | no_license | function sum(arr) {
console.log(Number(arr[0]) + Number(arr[arr.length - 1 ]));
}
console.log(sum(['1','3','4'])); | true |
6812b7913a31f013bfb2b801c8632f49991be941 | JavaScript | mattpardee/nodemanual.org-examples | /js_doc/RegExp/regexp.2.js | UTF-8 | 415 | 4 | 4 | [] | no_license | // Example: Using a regular expression with the "sticky" flag
var text = "First line\nsecond line";
var regex = /(\S+) line\n?/y;
var match = regex.exec(text);
print(match[1]); // prints "First"
print(regex.lastIndex); // prints 11
var match2 = regex.exec(text);
print(match2[1]); // prints "Second"
print(regex.last... | true |
78893fe515c572e78543299ae4498c1d30f74f87 | JavaScript | solongtony/enigma | /demo/cryptanalysis_demo.js | UTF-8 | 1,725 | 2.875 | 3 | [] | no_license | "use strict";
var cryptanalysis = require('../src/cryptanalysis.js');
var shiftTextWithWrap = cryptanalysis.shiftTextWithWrap;
var offsetTextWithSelf = cryptanalysis.offsetTextWithSelf;
var countLetter = cryptanalysis.countLetter;
var indexOfCoincedence = cryptanalysis.indexOfCoincedence;
var utils = require('../src/sh... | true |
a699df00ffa2ee267433a7cd16d98b66d85ec07f | JavaScript | liyshou/- | /nodejs/route.js | UTF-8 | 327 | 2.65625 | 3 | [] | no_license |
var os =require("os");
console.log(process.platform);
console.log(process.execPath);
console.log(process.cwd());
console.log(process.version);
console.log(process.memoryUsage());
//cpu ๅญ่ๅบ
console.log(os.endianness());
console.log(os.type);//ๆไฝ็ณป็ปๅๅญ
console.log(os.totalmen());
console.log(os.freemen()); | true |
7448506da09689ff84db480af55b546d297fcebe | JavaScript | Hermon-22/foursquare-API | /src/App.js | UTF-8 | 1,120 | 2.515625 | 3 | [] | no_license | import { Component } from 'react';
import Api from './components/Api';
import './App.css';
import axios from 'axios'
class App extends Component {
constructor(props){
super(props)
this.state={
vName:'',
searchList:[],
inpt:'',
userId:'HTNPB3CXTEH3ERLA3QJHQ50UOGYCRGJNPTNO5GT... | true |
2be77e2a9a9788e87bf8d053f4e6b4e4789618e6 | JavaScript | setr/meguca | /server/radio.js | UTF-8 | 1,761 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
R/a/dio API handler
*/
var common = require('../common'),
hook =require('../util/hooks').hook,
OK = require('./okyaku'),
request = require('request');
var json,
songMap = [
[/Girls,? Be Ambitious/i, 'Joe'],
[/Super Special/i, 'Super Special'],
[/Turning Japanese/i, '\u540D\u7121\u3057'],
[/Make a Man... | true |
e91aac8a23781dac8d0bc2cbccbe8d66a5be11fc | JavaScript | liaa2/wdi30-homework | /arun_dhungel/week01/Wednesday/exercise-2.js | UTF-8 | 424 | 4.875 | 5 | [] | no_license | // Define a function max() that takes two numbers as
// arguments and returns the largest of them. Use the
// if-then-else construct available in Javascript.
function max(firstNum, secondNum){
if (firstNum > secondNum) {
console.log(firstNum + " is larger than " + secondNum);
} else {
console.... | true |
6696c16a9d4293eba6e0fd5331b061e4c211dbae | JavaScript | jjrush/mern-solo | /client/src/components/ListOrders.js | UTF-8 | 5,147 | 2.671875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
// import { Link } from '@reach/router';
import axios from 'axios';
import '../css/ListOrders.css'
const ListOrders = (props) => {
const { userId } = props;
const [ favorite, setFavorite ] = useState({});
const [ orders, setOrders ] = useState([]);
co... | true |
30849f97c8de0f68814dc3791df858832630a305 | JavaScript | khitrukhina/calendar | /my-app/src/components/Month.jsx | UTF-8 | 1,330 | 2.640625 | 3 | [] | no_license | import React from "react";
import uuid from "react-uuid";
import { Link } from "react-router-dom";
import styled from 'styled-components';
import { Day } from "./Day";
import './year.css';
import { createDayOfWeekNames } from "../tools/dateTools.js";
export const StyledLink = styled(Link)`
text-decoration: none;
... | true |
4caef9111a08f4646251fdb103c5fc2eedf2d506 | JavaScript | MaximKisseloff/mk-start | /files/app/js/scripts/config.js | UTF-8 | 1,772 | 2.671875 | 3 | [] | no_license | /* global window, document */
class GlobalConfig {
constructor(defaultConfig) {
this.config = defaultConfig;
this.setMutableValues();
const body = document.querySelector('body');
if (this.config.touch) {
body.classList.add('touch');
} else {
body.classList.remove('touch');
}
}... | true |
429c1ec9fa116b7ec0a4b0702127b4cbef9d4921 | JavaScript | blackstack1174/minu_vuejs | /project_2/utils/date.js | UTF-8 | 356 | 2.9375 | 3 | [] | no_license | import moment from 'moment'
/**
* ๋ฐ์ ํฌ๋งท ํ์์ผ๋ก ํ์ฌ ์๊ฐ์ ๋ฐํํด์ค
* @param {*} format
* @returns
*/
function makeDate (format) {
try {
const today = moment();
return today.format(format);
} catch (err) {
console.error('/utils/date.js -> makeDate', err);
return false;
}
}
export default {
makeDate... | true |
5faf1654dcd38b0b3a2c3da06c98a6c74cd3f418 | JavaScript | jon101514/Squared | /StartScene.js | UTF-8 | 7,239 | 2.625 | 3 | [] | no_license | class StartScene extends Phaser.Scene {
constructor() {
super({ key: 'StartScene' })
}
/**
* Preload all of the assets like sounds and sprites.
*/
preload() {
this.load.image('logo', 'assets/logo.png');
this.load.image('tutorial1', 'assets/tutorial1.png');
this.load.image('tutorial2', 'assets/tutorial2... | true |
01a412686336baaa7e867e4b41ad395d28a1d1fa | JavaScript | kpete2017/Leet_Code | /Javascript/sumZero.js | UTF-8 | 170 | 2.75 | 3 | [] | no_license | var sumZero = function(n) {
result = n % 2 === 0 ? [] : [0]
for(let i=1;i<n;i+=2){
result.push(i,-i)
}
return result;
};
module.exports = sumZero | true |
cee8a6ddc11a0f7a6279c45f7aaee7e8a4aa07ec | JavaScript | brianpkelley/instep.js | /src/js/cssRules.js | UTF-8 | 2,830 | 2.875 | 3 | [] | no_license | // Charlie.js
// http://coding.smashingmagazine.com/2013/11/18/the-future-of-video-in-web-design/
in_.cssRules = function() {
this.rules_ = {};
this.rules_.keyframe = this.findRules( this.findKeyframeRules.bind(this) );
this.rules_.animation = this.findRules( this.findAnimationRules.bind(this) );
};
in_.cssRule... | true |
3b2019ba62b698d79cd78e69fa7a360e1cf1664b | JavaScript | bfi-kaernten-gmbh/IT-Lab-Startseite | /build/js/script.js | UTF-8 | 11,216 | 2.609375 | 3 | [] | no_license | function mobileCheck(n) { return window.innerWidth <= n };
console.log(mobileCheck(900));
var scheduleStatus = true;
var scheduleHeight = null;
$(document).on('click', '.close_schedule, .mini', animateSchedule);
function animateSchedule() {
var schedule = $('#schedule');
scheduleHeight === null ? schedul... | true |
785eb2e55484068320e7d3659c984701faa521ea | JavaScript | aneetromana/SpringMidterm | /comps/menu/index.js | UTF-8 | 1,411 | 2.71875 | 3 | [] | no_license | function Menu() {
return `
<div id="menu" style="
position:fixed;
width:150px;
background-color:#F2FFF6;
padding:10px;
transition:left 0.5s;
left:-100px;
height:100vw;"
class="close">
<button style="
width:100%;
text-align:right;
background-color:... | true |
4164396c2c776cd899881b49d9b9e9f69ed8e8bf | JavaScript | Har-zheng/Node02 | /06nodejs็้้ปๅกio,ๅผๆญฅไปฅๅไบไปถ้ฉฑๅจEvent/01้้ปๅก.js | UTF-8 | 427 | 2.921875 | 3 | [] | no_license |
var fs = require('fs');
// //้้ปๅก
// console.log('1');
//
// fs.readFile('./mime.json',function (err,data) {
//
// console.log(data);
// console.log('2');
//
// });
// console.log('3')
function getMime() {
//1
fs.readFile('mime.json',function (err,data) {
// console.log(data.toString());
... | true |
27e8d99ed16650d1319656b2198484bb960f8f8a | JavaScript | slnamtarn/6210110566-lab-react | /src/WordCard.js | UTF-8 | 2,198 | 3.171875 | 3 | [] | no_license | import React, { useState} from 'react';
import _, { attempt } from 'lodash';
import CharacterCard from "./CharacterCard";
const preparestateFromWolrd = given_word => {
let word = given_word.toUpperCase()
let chars = _.shuffle(Array.from(word))
return {
word,
chars,
attempt: 1,
... | true |
b6bc0965e20d464a6bb7200fa8c898a804485c56 | JavaScript | LBWright/lf-testing-demo | /src/__tests__/App.test.js | UTF-8 | 3,167 | 2.578125 | 3 | [] | no_license | // axios.get.mockResolvedValue(resp);
// axios.get.mockImplementation(() => Promise.resolve(resp))
import React from "react";
import { mount } from "enzyme";
import App from "../App";
describe("<App />", () => {
it("should render without crashing", () => {
const app = mount(<App />);
expect(app).toBeTruthy(... | true |
3c771349f08ecd75013d57a5173762000a396f56 | JavaScript | kyle-jorve/KyleJorve.com | /KyleJorve.com/src/scripts/sources/components/introScreen.js | UTF-8 | 1,042 | 2.703125 | 3 | [] | no_license | ๏ปฟ(function () {
var nodes = {
enterBtn: document.querySelector('#closeIntro'),
intro: document.querySelector('#introWrp')
};
var introTrans = parseFloat(window.getComputedStyle(nodes.intro).getPropertyValue('transition-duration')) * 1000;
var eventListeners = function () {
docu... | true |
2ada14dd9140d9696625f6ba679c9ca7250c6760 | JavaScript | kwbbpc/Learning-React | /2 Emerging JS/craps.js | UTF-8 | 1,249 | 2.765625 | 3 | [] | no_license | module.exports = {
craps: (roll, point) => new Promise((gameOver, rollAgain) => {
// If roll is not sent as a number between 2 and 12, rollAgain
if (!roll || typeof roll !== "number" || roll < 2 || roll > 12) {
rollAgain("to roll a number")
// If a point is not set, then this must be the... | true |
0886fef569f4e99aa552c1a8d7b7cea659a6ba14 | JavaScript | petersod11/FinalProject | /src/components/NewUser/NewUser.js | UTF-8 | 1,325 | 2.796875 | 3 | [] | no_license | import React, { useState } from 'react'
export const NewUser= () =>{
var [userName, setUserName]=useState()
var [password, setPassword]=useState()
const nameUpdate=(event)=>{
setUserName(event.target.value)
}
const passwordUpdate = (event)=>{
setPassword(event.target.valu... | true |
1719eb4ed02cbea39c1289a332f3094646568cb5 | JavaScript | adiwawan90/Node-eCommerce | /routes/admin_product.js | UTF-8 | 7,223 | 2.5625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var mkdirp = require('mkdirp');
var fs = require('fs-extra');
var resizeImg = require('resize-img');
var Product = require('../models/products');
var Categories = require('../models/categories');
router.get('/', function(req, res) {
var count;
Produ... | true |
d0183dd3b7d233c49a441caddaf71ad787795ce8 | JavaScript | jkoontz2010/the-three-review-a11y | /src/app/services/reviews.js | UTF-8 | 1,144 | 2.578125 | 3 | [] | no_license | class ReviewService {
constructor($firebaseArray, $firebaseObject) {
this.root = firebase.database().ref();
this.reviewsRef = $firebaseObject(this.root.child("reviews"));
this.$firebaseArray = $firebaseArray;
}
addReview(restaurantId, review, reviewer, stars) {
const restaurantReviews = this.$fir... | true |
edd47bc73cd1488ed575fb3111b1c0e7ad91bf05 | JavaScript | supersheep/browserman | /public/js/dev/reporter/mocha.js | UTF-8 | 670 | 2.546875 | 3 | [] | no_license | exports.run = function(options) {
var doNothing=function(){};
var pass = options.pass||doNothing;
var fail = options.fail||doNothing;
var end = options.end||doNothing;
var mocha = options.instance;
function Reporter(runner) {
runner.on('pass', function(test) {
pass({
title: test.title,
fullTitle: t... | true |
2bdd0494600e7c070284c5a462759d7e68f8d9be | JavaScript | silverhoodlum/openCurren.github.io | /js/indexCurrencyFirst.js | UTF-8 | 4,332 | 3 | 3 | [] | no_license | //fill the select options with the available currencies
fetch("https://api.exchangeratesapi.io/latest?base=")
.then((resp) => resp.json())
.then(function(data){
var allRates = data.rates;
var selectA = document.getElementById("from");
var selectB = document.getElementById("to"... | true |
847b446bd1a60d6745c33ff6afc41871fee1cdbb | JavaScript | PDXostc/amb_simulator | /js/demoScriptsController.js | UTF-8 | 1,892 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /*global ScriptController*/
/**
* @module AMBSimulatorApplication
*/
/**
* Controller which copies demo scripts from application package to scripts folder during application startup. List of scripts
* which should be copied are specified by {{#crossLink "DemoScriptsController/demoScriptsList:property"}}{{/crossL... | true |
44896d062679da2f13372c8a87e025724d64f42b | JavaScript | african-marketplace-5/frontend | /src/components/BrowsePage.js | UTF-8 | 1,290 | 2.734375 | 3 | [] | no_license | import './BrowsePage.css';
import Search from './Search'
import Browse from './Browse'
import React, { useState, useEffect } from 'react';
import axios from 'axios'
function BrowsePage() {
const [search, setSearch] = useState({category: '', item_name: ''})
const [items, setItems] = useState([])
const [selectedIt... | true |
798d92a0558533e128982e2e16475717ad1f8e9c | JavaScript | hleoc/Trybe | /Bloco4/exercises/4_4/exercise_7.js | UTF-8 | 328 | 4.6875 | 5 | [] | no_license | //Crie uma funรงรฃo que receba um array de inteiros e retorne o รญndice do maior valor.
let array = [2, 3, 6, 7, 10, 1], maior = 0;
function maiorValor(){
for(let chave in array){
if(array[maior] < array[chave]){
maior = chave
}
}
return maior;
}
console.log(maiorValo... | true |
3c1af68b89989c320327cd36e6143601d31c1c79 | JavaScript | ChromeAppsFactory/zxcvbn4Chrome | /src/js/popup/popup.js | UTF-8 | 4,802 | 2.625 | 3 | [
"MIT"
] | permissive | function Popup() {
var _api = {};
var _emptyPasswordError = "No Password entered.";
var _colors = ["#FF0000", "#FF0000", "#FFB200", "#45cfc9", "#00FF00"];
var _strengths = ["Very Weak", "Weak", "Fair", "Good", "Strong"];
var _personalInfoWarning = "Do not use personal information in the password.";
_api.c... | true |
f157840a2bdf79bab28b3297115f62099b0b7f9a | JavaScript | MattMav21/Roster-Management-Project | /react-app/src/store/member.js | UTF-8 | 4,367 | 2.578125 | 3 | [] | no_license | const LOAD_MEMBERS = "member/LOAD_MEMBERS"
const CREATE_MEMBER = "member/CREATE_MEMBER"
const EDIT_MEMBER = "member/EDIT_MEMBER"
const DELETE_MEMBER = "member/DELETE_MEMBER"
const ADD_PROPERTY = "member/ADD_PROPERTY"
const CHANGE_PROPERTY = "member/CHANGE_PROPERTY"
const loading_everyone = (members) => ({
type: L... | true |
f95a5545159fa0257b87e50e1ffb3a8d05632562 | JavaScript | sarahpopelka/Games | /BingoCage/logic.js | UTF-8 | 4,553 | 2.984375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', (event) => {
const choices = {
'B': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
'I': [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
'N': [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45],
'G': [46, 47, 4... | true |
3dc7d26d5823a6aa75213178e029d83253ebe003 | JavaScript | liyi1234/coz | /lib/util/file/is_dir.js | UTF-8 | 696 | 3.015625 | 3 | [
"MIT"
] | permissive | /**
* Detect a file is directory or not.
* False if file not exists.
* @memberof module:coz/lib/util/file
* @function isDir
* @param {string} filename - File name to detect.
* @param {function} callback - Callback when done.
*/
"use strict";
var core = require('../../core'),
fs = core.fs;
/** @lends isDir... | true |
47de611304d04c5a2d3130e1539a3b80c6f03796 | JavaScript | kukuhBaiquni/challenge-codago | /c7.js | UTF-8 | 449 | 3.3125 | 3 | [] | no_license | function weirdMultiply(sentence){
let hasil = 1;
let angka = sentence.toString().split('') ;
if(angka.length===1){
return sentence
}
for(let i=0;i<angka.length;i++){
angka[i]= +angka[i];{
hasil=hasil*angka[i];{
if(i===angka.length-1){
return weirdMultiply(hasil)
}
... | true |
2114a893ace0b45d2dc8e30a002b50091262a9b5 | JavaScript | saipavan-narasaraj/passport_programming_challenge | /routes/updateFactory.js | UTF-8 | 1,690 | 2.578125 | 3 | [] | no_license | const factorySchema = require('../models/factorySchema');
const generateRandomNumbers = require("../helpers/generateRandomNumbers")
const factoryValidator = require('../helpers/factoryValidator');
/*
This file contains logic to update factory and emit details to all clients.
*/
module.exports = async (req, res, ne... | true |
eee63f641b62fd04fe4dd8caf629826966db3a69 | JavaScript | mjb236/Programming_Work | /University of Pittsburgh/CS1520 - Web Development/Homework/ex6/ex6.js | UTF-8 | 407 | 2.796875 | 3 | [] | no_license | (function($) {
//regular expression matching the required input
var regEx = new RegExp('[Cc][Ss][0-3][0-9]{3}');
//on submit, disallow submission if string does not match the regEx
$('.search').on("submit", function(e) {
if(!regEx.test($('.searchbox').val())) {
$('#out_lbl').remove();
alert("Search stri... | true |
ef402b35b87cad59272eeb606b3f775ffc151c07 | JavaScript | ravana69/moodlight-pro | /main-code/v1/features/tapping-tempo.js | UTF-8 | 1,856 | 2.640625 | 3 | [] | no_license | var TapTempo = (function(){
var listOfTapDates = [];
var listOfTapsDelays = [];
var triggerTimer;
var pushDate = function() {
listOfTapDates.push(Date.now());
};
var pushDelay = function() {
$.each(listOfTapDates, function(index, value) {
if (index > 0) {
var thisTapDate = value;
... | true |
55dbffe8efa966f56d32973d27c882ffad4fa70b | JavaScript | susemeee/SCloud | /_js/file_upload.js | UTF-8 | 4,982 | 2.625 | 3 | [] | no_license | if(window.File && window.FileReader && window.FileList && window.Blob){
//.uploadable div and JQuery draggable element has weird behavior if we strech it to 100% height
//so we assign holder to body instead
var holder = $('body');
holder.bind('drop', drop);
holder.bind({
dragenter : cancel, dragover : cancel
})... | true |
1302a7cfa844c33627fb0d419f44805d9b79cdcb | JavaScript | santiagosdm/clase6JS | /scripts/main.js | UTF-8 | 1,651 | 3.6875 | 4 | [] | no_license | /*Comentarios Imprime informaciรณn por consola*/
console.log("Hola mundo");
var numero1 = 52.5;
var numero2 = 45;
console.log(numero1+numero2);
var nombre = "Santiago";
var apellido = 'Delgado';
console.log(nombre);
console.log(apellido);
var tiene_mascota = true;
tiene_mascota = false;
var frutas = ['manzana', 'per... | true |
4349f1e8784e2dc65305c32cbbd1e49857bf9633 | JavaScript | nraibaud/HeadlessBrowser | /loadHtmlForTest.js | UTF-8 | 383 | 2.765625 | 3 | [] | no_license | define([], function(){
var
beginTag = '<!-- headless -->',
endTag = '<!-- /headless -->',
beginTagLength = beginTag.length,
fs = require('fs');
return function(path){
var
file = fs.readFileSync(path, 'utf8'),
snippet = file.substring(file.indexOf(beginTag) + beginTagLength, file.indexOf(endT... | true |
0ab4b56f0d0d7e730787ce38ae7ceb32aeffd55f | JavaScript | somya1234/Web-Technology | /Lecture4/application.js | UTF-8 | 1,634 | 3.203125 | 3 | [] | no_license | const chalk = require("chalk");
const figlet = require("figlet");
const print = console.log;
const readline = require("readline");
const reader = readline.createInterface({
input:process.stdin,
output:process.stdout,
prompt:"$$$"
});
var task=[];
console.clear();
print(chalk.blue(figlet.textSync("Tasker"... | true |
f629c8328c83f091dcfdf3439466c5c9c61e4843 | JavaScript | LuOfLuck/covid-19 | /docs/js/main.js | UTF-8 | 5,587 | 2.921875 | 3 | [] | no_license | const countrySelect = document.getElementById("countries")
const casesDiv = document.getElementById("cases")
const countryH1 = document.getElementById("contry-select")
const modalCountry = document.querySelector("#modal-country");
const liList = document.querySelectorAll(".articul--li")
const init = async() => {
t... | true |
68a61800ee2ed0bb56072307c856369991948951 | JavaScript | Vanshsuri14/CRUMPLED-BALLS-3 | /sketch.js | UTF-8 | 1,046 | 2.671875 | 3 | [] | no_license |
var paperIMG,ground,dustbinIMG
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var paper;
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
ground = new Ground(400,600,800,10);
block = ne... | true |
e36f81b537ad3119e20029fe815c48c8a8d5bc44 | JavaScript | bradencodes/coding-challenges | /isCryptSolution/mySolution1.js | UTF-8 | 762 | 3.125 | 3 | [] | no_license | function isCryptSolution(crypt, solution) {
let solutionHash = {}
for (let i=0 ; i < solution.length ; i++) {
let pair = solution[i];
solutionHash[pair[0]] = pair[1];
}
function wordToStringNum(word, hash) {
let string = "";
for (let i=0 ; i < word.length ; i++)... | true |
513a035554e78b9def13a8fd56139dff750d1c18 | JavaScript | SamratDe/Bouncing-DVD-logo | /script.js | UTF-8 | 846 | 3.078125 | 3 | [] | no_license | let x,y;
let xspeed,yspeed;
let dvd;
let r,g,b;
function preload(){
dvd=loadImage('dvd_logo.png');
}
function changeColor(){
r=random(100,256);
g=random(100,256);
b=random(100,256);
}
function setup(){
createCanvas(windowWidth, windowheight);
x=random(width);
y=random(height);
xspeed=... | true |
9b71d5fd19c80004e67f524a28a990b24ced5e00 | JavaScript | ramyamalluru/Freecodecamp | /Algorithms/Ceasers-cipher.js | UTF-8 | 507 | 3.40625 | 3 | [] | no_license | /* code by ramya https://www.freecodecamp.com/ramyakatakam */
function rot13(str) {
var b=[];
for(i=0;i<str.length;i++)
{
if((str.charCodeAt(i)>=78)&&(str.charCodeAt(i)<=90))
b.push(String.fromCharCode(str.charCodeAt(i) -13));
else if((str.charCodeAt(i)>=32)&&(str.charCodeAt(i)<=64))... | true |
8fdbc543a6d1a29636f6df464a8ac4cff3469cd8 | JavaScript | yanchapanta/teacherWeb404 | /JAVASCRIPT/03 EstructuraSelectivaMultiple/problema_28/js/funciones.js | UTF-8 | 648 | 3.328125 | 3 | [] | no_license | export const solution=function (ope,num1,num2) {
let result;
const suma=(num1,num2)=>num1+num2;
const resta=(num1,num2)=>num1-num2;
const multiplicacion=(num1,num2)=>num1*num2;
const division=(num1,num2)=>num1/num2;
switch (ope) {
case '+':result=suma(num1,num2)
... | true |
304fb4575163ad8363e9ce71b1e6224b7e2b5b02 | JavaScript | shims80/DI_Bootcamp | /WEEK3/Day 4/daily chellenge/script.js | UTF-8 | 253 | 2.578125 | 3 | [] | no_license | let listTasks = [];
let input = document.getElementsByClassName("form-control")[0];
let button = document.getElementById("button-addon2");
function addtask() {
let text = input.value;
if (text != '') {
listTasks.
let (i=0
}
}
| true |
7955ae5f1435654c8753d124238b862bb07c3f06 | JavaScript | anupsunni/humaps-neo4j | /Backend/DatabaseHandlers/Setters/validate.js | UTF-8 | 1,821 | 2.65625 | 3 | [] | no_license | /*
POST DATA
{
"UNM":"Anup",
"PHN":"9040664424",
"CON":[
{
"PHN": 7947798184,
"UNM": "Logan"
}, . . . . . . .]
*/
/*MODULES*/
var neo4j = require('neo4j-driver').v1;
var url = require('../url');
const PNF = require('google-libpho... | true |
4bec2dad7994dc51ad51266f8685b5ade92c337a | JavaScript | jonathasobelo/projeto-lanchonete | /js/form.js | UTF-8 | 2,940 | 3.171875 | 3 | [] | no_license | // var lsProdutos = [
// {qt:0, cod:"01", valor:10, grupo:"Salsicha na Chapa", categoria:"HOTDOG", descricao: "Pรฃo, Salchicha, queijo e batata Palha"}
// ,{qt:0, cod:"02", valor:12.5, grupo:"Salsicha na Chapa", categoria:"HOTDOG", descricao: "Pรฃo, frango desfiado, queijo e batata Palha"}
// ,{qt:0, cod:"03... | true |
ccaebec14b5aef5a9b2c74ef3f397ea4e2de9020 | JavaScript | buinguyentung/webserver_db | /imp01_webServer/code/server.js | UTF-8 | 1,683 | 2.578125 | 3 | [] | no_license | // In package.json: "start": "node ./bin/www"
// server.js
// load the things we need
const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const app = express();
const UserRoute = require('./UserRoute');
const LedRoute = require('./LedRoute');
const PORT... | true |
d206701f85ac8716b96ccfa6fbbfaae9241626e9 | JavaScript | ryanburgess/2021-conferences | /build.js | UTF-8 | 5,091 | 3.015625 | 3 | [] | no_license | 'use strict';
const fs = require('fs');
const obj = require('./list.json');
const ical = require('ical-generator');
const countryList = require('country-list');
const cal = ical();
const year = 2021;
const items = [];
const duplicates = [];
let content = `# ${year} Engineering Conferences
A list of ${year} conferences.... | true |
d8330fc75ac3ef5f598941c1a1dc4057d960008c | JavaScript | jaimeirazabal1/api-coinmarketcal | /index.js | UTF-8 | 991 | 2.59375 | 3 | [] | no_license | require('dotenv').config()
const axios = require('axios');
async function peticion(){
try {
const options = {
headers: {
"Content-Type": 'application/json',
"x-api-key": process.env.API_KEY
},
params:{
"qs": {
... | true |
cae10de3b1395a5a4d0cf55a62ecc418460ae1fe | JavaScript | writefgj/skill.a5.15 | /js/ryaba.js | UTF-8 | 988 | 2.984375 | 3 | [] | no_license | const dataURL = "https://api.myjson.com/bins/jcmhn";
let text = "";
function handleButton() {
$.getJSON(dataURL, function(data) {handleData(data)})
}
function handleData(data) {
text = "";
data.text.forEach(replaceVar);
}
function replaceVar(item) {
const var1 = $("input[name=var1]")[0].value;
const var2 = ... | true |
37a99457c4770e0c4db9cfee2922fd4598f30bb6 | JavaScript | jiangshanruhua24/pjzc | /src/assets/js/utils.js | UTF-8 | 1,235 | 2.671875 | 3 | [] | no_license | let obj = {
setRem() {
// console.log(111)
// ่ฎพ่ฎก็จฟๅฎฝๅบฆๅ่ฎพๅคๅฎฝๅบฆ
var uiW = 750,
winW = document.documentElement.clientWidth,
// ๅฎไนๆฏไพ
rate = winW / uiW;
var oWrap = document.getElementById("app");
// if(winW > uiW) {
// oWrap.style.width = uiW + "px";
/... | true |
110534d340a97ca5e4585161f30512288d59f013 | JavaScript | arkency/devsnap | /frontend/tests/unit/utils/get-random-int-test.js | UTF-8 | 375 | 2.5625 | 3 | [] | no_license | import getRandomInt from 'devsnap/utils/get-random-int';
import { module, test } from 'qunit';
module('Unit | Utility | get random int');
test('it works', function(assert) {
assert.equal(getRandomInt(10, 15, () => { return 0; }), 10);
assert.equal(getRandomInt(10, 15, () => { return 0.999; }), 15);
assert.equal... | true |
4281f091130a233ef359af13212e0ad820c0c592 | JavaScript | jaketripp/quick-copy | /src/components/App.js | UTF-8 | 4,158 | 2.828125 | 3 | [] | no_license | // packages
import React, { Component } from "react";
import uuidv4 from "uuid/v4";
// components
import RecentlyCopied from "./RecentlyCopied";
import Toast from "./Toast";
import Header from "./Header";
import DeleteToggle from "./DeleteToggle";
import SplitCharacterToggle from "./SplitCharacterToggle";
import Split... | true |
90e0aa7b6aae49d50cf7b241a8cd78c87d135dc2 | JavaScript | CarlJamesRoxas/pomodoro-timer | /js/timer.js | UTF-8 | 3,561 | 3.296875 | 3 | [
"MIT"
] | permissive | // selector variables
const play = document.querySelector("#btn-2");
const play2 = document.querySelector("#btn-4");
const pause = document.querySelector("#btn-1");
const resetbtn = document.querySelector(".reset");
const minutes = document.querySelector(".mins");
const seconds = document.querySelector(".sec");
const t... | true |
1dcccb6f662599157e7236b3f5fd1a62c1f3f57f | JavaScript | nickhericks/scroll-down-animation | /main.js | UTF-8 | 295 | 2.875 | 3 | [] | no_license | // select scroll down helper emoji
const arrow = document.querySelector('.arrow');
// delay for scroll reminder down-pointing emoji
const scrollDelay = 7000;
// Display down-pointing emoji to tell user to scroll down
window.setTimeout( function() {
arrow.style.opacity = '1';
}, scrollDelay); | true |
4b674f83b2590a3d21f3e0e1ddd7b68e64dfa47f | JavaScript | davifurtado/Cardastro | /src/contexts/CarContext.js | UTF-8 | 915 | 2.65625 | 3 | [] | no_license | import React, { createContext, useState, useEffect } from 'react';
import uuid from 'uuid/v1';
export const CarContext = createContext();
const CarContextProvider = (props) => {
const localData = localStorage.getItem('cars')
const [cars, setCars] = useState(
localData ? JSON.parse(localData) : []
... | true |
84bdff2bfd1f4bb485eca23cf6c84ca637980696 | JavaScript | scottwalker87/node-framework | /core/Response.js | UTF-8 | 2,538 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | /**
* ะัะฒะตั ะฟัะธะปะพะถะตะฝะธั
*/
class Response {
// ะะพะดั ะพัะฒะตัะฐ
static STATUS_OK = 200
static STATUS_NOT_FOUND = 404
static STATUS_ERROR = 500
/**
* ะะฝะธัะธะฐะปะธะทะธัะพะฒะฐัั ะพัะฒะตั ะฟัะธะปะพะถะตะฝะธั
* @param {Object} serverResponse ะพัะฒะตั node ะฑะธะปะธะพัะตะบะธ http/https
* @param {Object} headers ะทะฐะณะพะปะพะฒะบะธ ะพัะฒะตัะฐ
* @param {... | true |
026aa06d063fde1e20980047b4c6340c174735b0 | JavaScript | jaycee425/Arbetsprov | /helpers.js | UTF-8 | 1,854 | 2.921875 | 3 | [] | no_license | function debounce(callback, wait, withLoading) {
var timeout;
return function() {
if(withLoading){
toggleLoadingState(true)
}
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(function() {
timeout = null;
callback()
}, wait);
}
}
function removeNodeByID... | true |
3dbca308bf900490bad461e609b00f477516d1e8 | JavaScript | towski/disc-jockey | /cookie.js | UTF-8 | 1,070 | 2.65625 | 3 | [
"MIT"
] | permissive | var Cookie = {
set: function(name, value, daysToExpire, path) {
var write = (encodeURIComponent(name) + '=' + encodeURIComponent(value || ''));
if (daysToExpire !== undefined) {
var d = new Date();
d.setTime(d.getTime() + (86400000 * parseFloat(daysToExpire)));
write += '; expires=' + d.toGM... | true |
efd36a2840095bfb4eb012f5fbcbfac3fb72af7f | JavaScript | Pe3Hu/iwatao | /src/js/craft/jewelryHouse.js | UTF-8 | 3,816 | 2.796875 | 3 | [] | no_license | //tptpt growth process display
class jewelryHouse {
constructor ( offset ){
this.const = {
a: cellSize,
l: 8
};
this.array = {
tptpt: [],
view: [],
edit: [],
id: []
};
this.var = {
firstShift: 0,
secondShift: 1,
mode: 'solo'
};
this.off... | true |
50d0024eb4ebae9b592ab968994ae9529edd08f6 | JavaScript | nigeymc/portfolio-app-2021-reactjs | /src/actions/fetchExperienceDataAction.js | UTF-8 | 1,842 | 2.640625 | 3 | [] | no_license | import database from '../firebase/firebase';
const setDataLoading = loading => ({
type: "FETCH_DATA_LOADING",
payload: loading,
});
const fetchDataSuccess = payload => ({
type: "FETCH_DATA_SUCCESS",
payload, // { firstName, lastName }
});
const fetchDataFailure = () => ({
type: "FETCH_DATA_FAILUR... | true |
4f09e9ee5c1f43cf6a7abb1d1a021e5a4a1cef0a | JavaScript | jooj123/mosaic | /js/client.js | UTF-8 | 6,655 | 2.75 | 3 | [] | no_license | // the mosaic client namespace
(function(mosaicClient) {
'use strict';
// default if not passed through config
var config = {
tileHeight: 16,
tileWidth: 16,
fileId: 'file_input',
apiUrl: '', // default to localhost
loadingId: 'loading_msg',
mimeTypesAccepted... | true |
96ec50d038bd0013bdd7c5f38d0d068fcac8061b | JavaScript | epice/simpleTable | /src/js/util.js | UTF-8 | 839 | 3.15625 | 3 | [] | no_license | /**
* @module excel
*/
define(function () {
/**
* @class Util
* @static
*/
var Util = {
/**
* ไธใใใใ้
ๅใฎๅ
ๅฎนใไธ่ดใใใ
*
* @method checkArrayEquality
* @param {Array} a
* @param {Array} b
* @return {Boolean}
*/
checkArrayEquality: function (a, b) {
var ret = true, i, len;
for (i = 0, ... | true |
8874bfbbde1eb9905f08233f2a7b2d5fb434afb5 | JavaScript | Krafalski/GA-NYC-Bowie | /w09/d01/instructor/tokens_starter/db/pg.js | UTF-8 | 1,391 | 2.53125 | 3 | [
"MIT"
] | permissive | const pgp = require('pg-promise')({});
const cn = "postgres://generalassembly:generalassembly@localhost/tokens_test";
const bcrypt = require('bcrypt');
const salt = bcrypt.genSaltSync(10);
const db = pgp(cn)
function createSecure(email, password, callback) {
bcrypt.genSalt(function(err, salt) {
bcrypt.hash... | true |
9fb01e21bfc849c094550793c6237b696de9e6d3 | JavaScript | arsevys/alexademo | /ex.js | UTF-8 | 1,217 | 2.515625 | 3 | [] | no_license | var express=require('express')
var app=express();
var bodyparser=require('body-parser')
var bd=require('./bd');
app.use(express.static(__dirname + '/public'));
app.use(bodyparser.json({verify: function getRawBody(req, res, buf) {
req.rawBody = buf.toString()}}));
app.use(bodyparser.urlencoded({ // to suppor... | true |
b0dfab16aed9251e9bb1894c585b240d9fd75806 | JavaScript | Murillo-Me/restaurant-page-top | /src/menu.js | UTF-8 | 2,555 | 2.875 | 3 | [] | no_license | import headerTemplate from './header.html'
import footerTemplate from './footer.html'
import Logo from './assets/images/logo-clear.png'
import ChickenDishImage from './assets/images/menu/chicken-dish.jpg'
import PastaDishImage from './assets/images/menu/pasta-dish.jpg'
import RibsDishImage from './assets/images/menu/ri... | true |
763e72889aeec49084dd6a3705503df3180bf6e3 | JavaScript | onshape-public/apikey | /Node/expensiveDoNothing.js | UTF-8 | 1,319 | 2.609375 | 3 | [
"MIT"
] | permissive | var util = require('./lib/util.js');
var errors = require('./config/errors.js');
var minimist = require('minimist');
var app = null;
var argv = minimist(process.argv.slice(2));
if (argv['u'] || argv['usage'] || argv['h'] || argv['help']) {
console.log('\nThis app will create an element then delete it, resulting in ... | true |
0b6f67fa9ce0af7eef0925f1015c3e4165012ec4 | JavaScript | AngelaNYC20/javascript-arrays-bootcamp-prep-000 | /arrays.js | UTF-8 | 1,187 | 4 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var chocolateBars = ["snickers", "hundred grand", "kitkat", "and", "skittles"]
function addElementToBeginningOfArray (array,element){
var addElement1 = [element,...array]
return addElement1
}
function destructivelyAddElementToBeginningOfArray (array,element){
array.unshift(element)
return array
}
function ac... | true |
ba6eaed07550a17b5d031dfab85e917307f9ac4e | JavaScript | GabrielEssenio/projeto_trivia | /src/services/helpers/getAvatar.js | UTF-8 | 340 | 2.84375 | 3 | [] | no_license | import { MD5 } from 'crypto-js';
// Recebe um email, trata ele com MD5, cria um hash e devolve a url do avatar do usuario
const getAvatar = (email) => {
const treatedEmail = email.trim().toLowerCase();
const URL = 'https://www.gravatar.com/avatar/';
const hash = MD5(treatedEmail);
return URL + hash;
};
export... | true |
8bda2dd0ef4e094b115c309c73254d607f7b9849 | JavaScript | dino-21/0828_2 | /js/likaimg.js | UTF-8 | 301 | 2.78125 | 3 | [] | no_license | $(function(){
$(".likaimg").mouseover(function(){
$(".likaimg img").stop().animate({ marginTop:"-3000px" }, 3000);
});
$(".likaimg").mouseleave(function(){
$(".likaimg img").stop().animate({ marginTop:0 }, 2000);
});
}); | true |
67e1bf44c537761aeca8e5e68ccb90d8d758f130 | JavaScript | JonathanGenier/HomeIntellegy | /intellegy/pages/admin.js | UTF-8 | 3,166 | 2.53125 | 3 | [] | no_license | import { clientAuthorization } from '../modules/authorization';
import { Component, useEffect, useState } from 'react'
import axios from 'axios'
import { v4 as uuidv4 } from 'uuid';
import styles from '../styles/Admin.module.css'
// TODO: On devra vรฉrifier si l'utilisateur est ADMIN ou TECHNICIEN
export const getServe... | true |
fbfea1581d9b24fdcbff85c6e777eec64671f1da | JavaScript | kaveeshadinamidu/student-management-system-backend | /public/Database/getRequestsID.js | UTF-8 | 350 | 2.546875 | 3 | [] | no_license | const connection = require("./Connection");
const getRequestsID = (id,callback) =>{
connection.query("SELECT * "+
"from requests where owner_id= '"+id+"'", function (error, rows) {
if (error) {
console.log(error);
return;
} else {
return callback(rows);
}
});
};
m... | true |
2b6887704646cea01524d36c3b4b56f5413edeb4 | JavaScript | AAI-USZ/FixJS | /input/100+/before/5a5896d29f5c6444d0cae8a09472b0551f44ff28_0_2.js | UTF-8 | 775 | 2.78125 | 3 | [
"MIT"
] | permissive | function(event, callback) {
var _this = this;
var find_listener = function() {
var is_callback = function(val) {
return val.__original_callback__ === callback || (val.listener && val.listener.__original_callback__ === callback);
};
if (!_this._events || !_this._events[event]) { return null; }... | true |
eb45acdd25d0a95d11760a4152216a2b0c47bce9 | JavaScript | Delermando/learnAngular | /referenceFromCodeSchoolClass/views/js/app02.js | UTF-8 | 1,325 | 2.765625 | 3 | [] | no_license |
(function(){ //wrap your app in a Closure
var app = angular.module('store',[]);
app.controller('StoreController', function(){ //create e name a controller
this.products = gems; //set the 'gem' like a attibute
});
var gems = [
{
name: 'Dodecahedron',
pr... | true |
d855d7b4a20739fe40f685ed1057d87187b9d03b | JavaScript | rodu/d3-learning | /visualize-cpu/visualize-top.js | UTF-8 | 3,292 | 2.6875 | 3 | [] | no_license | /* global: d3 */
window.onload = function onLoad(){
var
DATA_PROP = "virt",
margin = {top: 20, right: 20, bottom: 130, left: 80},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom,
barHeight = 20,
x = d3.scale.ordinal()
.r... | true |
d6abe3826f5842029c3fefd9703f7ca9cdbd1212 | JavaScript | majorAndrea/Design_Patterns | /Creational_Patterns/Prototype/index.js | UTF-8 | 1,078 | 3.875 | 4 | [] | no_license | class Shopper {
constructor(name = "unnamed person") {
this._name = name;
this._shoppingList = [];
}
set name(value) {
this._name = value;
}
get name() {
return this._name;
}
get shoppingList() {
return this._shoppingList.join(", ");
}
addItemToList(item) {
this._shoppingLi... | true |
285efa6383cd6c84fdb476644a012df8ca4eaf25 | JavaScript | akashtambe11/javascript-sdk | /assets/js/pay.js | UTF-8 | 1,419 | 2.53125 | 3 | [] | no_license |
// OPTION 1 START -----
// WITH CUSTOM FILE
// var HoopylightBox = function () {
// this.init = () => {
// var iframe = document.createElement('iframe');
// var body = document.getElementById('iframeBody');
// iframe.style.width = '400px';
// iframe.style.height = '600px';
// iframe.src = 'index.html';
//... | true |
de72368c2d3bec88afed8efb027083819766606f | JavaScript | ElementalSystems/selection | /selection.js | UTF-8 | 766 | 3.140625 | 3 | [] | no_license | function start()
{
createLevel();
}
var board=0;
function createLevel()
{
board=document.getElementsByClassName('board')[0];
var items=board.getElementsByClassName('piece');
var text="";
var baseElCount=items.length;
for (var i=0;i<baseElCount;i+=1) {
var item=items[i];
var count=item... | true |
12f1d55ebbe818305106c5728e60feca59e12c11 | JavaScript | kn0rki/Screeps | /functions.js | UTF-8 | 177 | 3.21875 | 3 | [] | no_license | function getAllProperties(obj) {
var properties = '';
for (property in obj) {
properties += '\n' + property;
}
alert('Properties of object:' + properties);
}
| true |
6d349fcfdb7a6344f6910611cd319f6da9803d58 | JavaScript | BryantCabrera/giftgiver | /src/components/App.test.js | UTF-8 | 2,957 | 3.0625 | 3 | [] | no_license | import React from 'react';
//shallow lets us render the outer .jsx, but not the content in the child components
// returns an object that represents our app environment
import { shallow } from 'enzyme';
import App from './App';
// gather related tests and group them together in a describe function
// refactoring i... | true |
e6c88dbbe7ed3f025ff4e3ebd90b6d2a222496b8 | JavaScript | VANTHO15/HuLaWEBJavascrip | /20MenuHoanChinh/1.js | UTF-8 | 1,209 | 2.625 | 3 | [] | no_license | ๏ปฟdocument.addEventListener("DOMContentLoaded",function(){
var nut=document.getElementsByClassName("declick");
var nd=document.getElementsByClassName("dehienthi");
for(var i=0;i<nut.length;i++)
{
nut[i].onclick=function()
{
if(this.classList[1]=="mautrang")
{
... | true |
af32a762b85e4a70c8c9cb848b93bcff166245da | JavaScript | DougAnderson444/js-did-hypns | /lib/document/utils/index.js | UTF-8 | 2,564 | 2.609375 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.assertDocument = exports.generateDocument = exports.isEquivalentId = exports.createId = exports.SEPARATORS = void 0;
var _lodash = require("lodash");
var _utils = require("../../utils");
var _errors = require("../../utils/errors"... | true |
14dec0cc76b2b94e71b7798b75567b4af9eafea0 | JavaScript | dev-z/docker-node-api | /server.js | UTF-8 | 1,365 | 2.84375 | 3 | [
"MIT"
] | permissive | /* ----------------------------------------------- *
* API Server *
* ----------------------------------------------- */
// Importing the core modules ------------------- //
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors')... | true |
3aeaff5b4f1bddef647fcc6134812c84bbd17556 | JavaScript | kjalen/dockerized-weather-app | /dwa-backend/services/WeatherApi.service.js | UTF-8 | 1,351 | 2.875 | 3 | [] | no_license |
const fetch = require("isomorphic-unfetch")
const querystring = require("querystring");
class WeatherAPI {
constructor(config) {
this.api_key = config.api_key
this.basePath = "https://api.openweathermap.org/data/2.5"
}
request(endpoint = "", options = {}) {
let url = this.b... | true |
9889733197b7a7ee9dcc86537008e93dd0c4fccd | JavaScript | paulorobertoalmeida/learning-P5 | /exemple10/mandelbrot-zoom.js | UTF-8 | 1,739 | 3.140625 | 3 | [] | no_license | let cenX = 0;
let cenY = 0;
let scale = 1;
function setup() {
createCanvas(600, 400);
noStroke();
colorMode(HSB);
drawBrot();
}
function draw(){
let redraw = false;
if( keyIsDown(LEFT_ARROW))
{
cenX -= 0.5 * 1/scale;
redraw = true;
}
if( keyIsDown(RIGHT_ARROW))
{
cen... | true |
24651d95447437cc6d329e234443c3a37e6c1843 | JavaScript | vamgoon/LeetCode | /4.findMedianSortedArrays.js | UTF-8 | 427 | 3.21875 | 3 | [] | no_license | /**
* Created by Vamgoon on 2017/5/7.
*/
/**
* @param {number[]} nums1
* @param {number[]} nums2
* @return {number}
*/
const findMedianSortedArrays = (nums1, nums2) => {
let tempArr = nums1.concat(nums2);
let len = tempArr.length;
tempArr.sort((a, b) => a - b);
if (len % 2 === 1) {
return... | true |
62bc0614897b9a360b63239f485c2461a8e11841 | JavaScript | 2017JosePablo/Paradigmas | /content/js/anualidadJs.js | UTF-8 | 377 | 2.640625 | 3 | [] | no_license | $(document).ready(function() {
$('button').click(function() {
var id = $(this).val();
if(id.length>0){
var result = id.split('~');
if(result[0]=='seleccionar'){
document.getElementById('cedulaResponsableAnualidad').value = result[1];
}else if(result[0]=='editar'){
... | true |
3f3db0513dab87ffb3fd41fbab49b38fcdf63267 | JavaScript | feliberal/javascriptmasterclass | /examples/destructuring3.js | UTF-8 | 88 | 2.921875 | 3 | [] | no_license | let obj = {
a: 1,
b: 2,
c: 3
};
let {a: d, b: e, c: f} = obj;
console.log(d, e, f); | true |
92c581d8f3aa4fd5f920bcf1e8e2091b4516f002 | JavaScript | jacktandrew/Threes | /browser_based/app.js | UTF-8 | 6,132 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
// checks for a stored purse value, defaults to 50 if none found
leftPurse = $.jStorage.get('leftPurse', 50)
rightPurse = $.jStorage.get('rightPurse', 50)
$('#left_col .purse').html(leftPurse)
$('#right_col .purse').html(rightPurse)
function choose(){
score = parseIn... | true |
2e2c60f3459835823862e296702ac6c91df6579d | JavaScript | tomo21n/camerascm | /public/assets/js/getgaityuno.js | UTF-8 | 1,607 | 2.515625 | 3 | [
"MIT"
] | permissive | var casper = require("casper").create();
var name;
var title;
var memo;
var flug;
if (casper.cli.has(0)){
name = casper.cli.get(0);
}else{
ret = false;
}
if (casper.cli.has(1)){
title = casper.cli.get(1);
}else{
title = ' ';
}
if (casper.cli.has(2)){
flug = casper.cli.get(2);
}else{
flug = 0;
}... | true |
f9960176141a87f44bb475269576fae7845b2dd2 | JavaScript | amkong/BlackWatch | /utils/random-utils.js | UTF-8 | 630 | 2.78125 | 3 | [] | no_license | function coinFlip () {
console.log('flipping coin');
let num = Math.random();
if (num > 0.49) return 'heads';
else if (num < 0.51) return 'tails';
else return "IT LANDED ON IT'S SIDE";
}
function randomHero () {
let heros = ['Genji', 'Mccree', 'Hanzo', 'Zenyatta', 'Zarya', 'Pharah', 'Reinhardt',
'Widowma... | true |
c3e385aeb2fb7de9af6cbfde91cc538e848f485e | JavaScript | moebiusmania/webcomponents-hyperhtml | /src/other/tick-example.js | UTF-8 | 848 | 3.015625 | 3 | [
"MIT"
] | permissive | 'use strict';
import hyperHTML from 'hyperhtml';
function tick(render) {
render `
<div>
<h1>Hello, world!</h1>
<h2>It is ${new Date().toLocaleTimeString()}.</h2>
</div>
`;
}
setInterval(tick, 1000,
hyperHTML.bind(document.getElementById('root'))
);
// or a generic article update
// functio... | true |
1abd36ea7c283025d20aced5ecff0962036be5cd | JavaScript | pawel-li/Magic-calculator | /script.js | UTF-8 | 2,318 | 2.875 | 3 | [] | no_license | /*header animation*/
const headingSpans = document.querySelectorAll(".main .wrap h1 span");
const personReading = document.querySelector(".person-wrap");
const btnHeader = document.querySelector(".main .btn");
const svgBG = document.querySelector(".svg-background");
btnHeader.style.animation="opacity-animation 2... | true |
c5d6fcfdfce67a4158c4bc12db3d96a930e0d81c | JavaScript | insin/isomorph | /func.js | UTF-8 | 473 | 2.640625 | 3 | [
"MIT"
] | permissive | 'use strict';
var slice = Array.prototype.slice
/**
* Binds a function with a call context and (optionally) some partially applied
* arguments.
*/
function bind(fn, ctx) {
var partial = (arguments.length > 2 ? slice.call(arguments, 2) : null)
var f = function() {
var args = (partial ? partial.concat(slice.... | true |
79226ab8a333289d340521a3531339e88660853e | JavaScript | diegogalante3398/notas | /src/components/ListaCategorias/ListaCategorias.jsx | UTF-8 | 1,348 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
import "./style.css"
class ListaCategorias extends Component {
constructor(){
super();
this.state = {
categorias:[]
};
}
componentDidMount(){
this.props.categorias.inscrever(this._novaCategoria.bind(this));
}
... | true |