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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9d6147decd6c4112abb07fd7d2e268e3a90320be | JavaScript | hyoeun93/Javascript-Technical-Interview-F- | /validateBST.js | UTF-8 | 887 | 3.859375 | 4 | [] | no_license | /*Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
Both the left and right subtrees mus... | true |
c9c69c34f40447131c55bc298f93ec73e75eaf4f | JavaScript | teamrun/deploy | /util.js | UTF-8 | 1,631 | 2.71875 | 3 | [] | no_license | var fs = require('fs');
var path = require('path');
var util = {
getCmdParam: function(){
var param = {};
process.argv.forEach(function(arg, i){
// 不去处理cmd和file
if( i>1 ){
// 去掉前两个--
var argContent = arg.substr(2);
var arr = ar... | true |
03976007e35a712d53aaa8581dd1c2ca1a66ad35 | JavaScript | molovo/boldr | /packages/core/src/shared/storage/storage.test.js | UTF-8 | 1,502 | 2.59375 | 3 | [
"MIT"
] | permissive | describe('Storage', () => {
let Storage;
describe('on the client', () => {
beforeEach(() => {
delete require.cache[require.resolve('./storage.js')];
Storage = require('./storage').default;
});
runSuite();
});
describe('on the server', () => {
let windowBckp;
beforeEach(() => {... | true |
d49992c2c0e2365d31c712e4db0ac6e3da79ca29 | JavaScript | Dromediansk/gradient_generator | /script.js | UTF-8 | 1,553 | 3.25 | 3 | [] | no_license | var css = document.querySelector("h3");
var color1 = document.querySelector(".color1");
var color2 = document.querySelector(".color2");
var body = document.getElementById("gradient");
var button = document.querySelector("button");
var gradientDirection = document.getElementById("gradientDirection");
var options = docum... | true |
454c1f8bfe169ac01496a57d8720bc88d37aad2d | JavaScript | Cord-T/lite | /js/voice_reconociment.js | UTF-8 | 3,745 | 3.078125 | 3 | [] | no_license | // crear sistema de reconocimiento de voz
// reconocimiento de voz continuo que solo reconoce el oye lite
let seEjecutoComando = false;
// reconocimiento de voz con finalidad de llamada
let CallRecognition = new webkitSpeechRecognition();
CallRecognition.lang = 'es-ES';
CallRecognition.continuous = false;
C... | true |
ba652603d2589779b4413c31a67df8ea07dca5f0 | JavaScript | atanassov-daniel/Softuni | /JS Advanced May 2020/9 Prototypes and Inheritance/Lab(all100,da probvam 01.2)/04.ClassHierarchy.js | UTF-8 | 2,628 | 3.84375 | 4 | [
"MIT"
] | permissive | function solve() {
class Figure {
constructor() {
this.unit = "cm";
}
changeUnits(unit) {
if (["m", "cm", "mm"].includes(unit)) {
this.unit = unit;
}
}
}
class Circle extends Figure {
constructor(r) {
su... | true |
ee56d9c91a76d067aaaa178ebaf2be7399077227 | JavaScript | Jzhen123/WePlan | /src/components/Login.js | UTF-8 | 3,158 | 2.71875 | 3 | [] | no_license | import React, { useReducer, useEffect } from 'react';
import { useAuth } from '../utilities/AuthContext';
import formReducer from '../utilities/reducers/formReducer';
const initialFormState = { // Initial State for my Login form
formType: "LOGIN", // Identifier for my formReducer
values: {
username: "",
p... | true |
21ddb7cc88c0c8b0015b302b8c7f9093202dfce8 | JavaScript | Lingdeqing/demos | /algorithm/lib/gcd.js | UTF-8 | 549 | 3.1875 | 3 | [] | no_license | /**
* 最大公约数
*/
export default function gcd(a, b) {
if (a < b) {
;[a, b] = [b, a];
}
return b === 0 ? a : gcd(b, a % b)
}
// 辗转相减法
function gcd(a, b) {
if (a < b) {
;[a, b] = [b, a];
}
return a === b ? a : gcd(a - b, b);
}
// 最好用迭代吧,递归容易栈溢出
function getGcd(a, b) {
while (a ... | true |
8204e42fc9eebc3dba8b71b2f25413ae26fa333e | JavaScript | Miiha/FilmBrowser | /client/js/reducers/chapterReducer.js | UTF-8 | 539 | 2.671875 | 3 | [
"MIT"
] | permissive | const idle = {
chapters: [],
fetching: false,
fetched: false,
error: null,
};
export default function reducer(state=idle, action) {
switch (action.type) {
case "FETCH_CHAPTERS": {
return {...state, fetching: true}
}
case "FETCH_CHAPTERS_REJECTED": {
return {...state, fetching: false, ... | true |
81440c3d44dbbe069f64604d9586436565a3e48f | JavaScript | cgellert/mjml_test | /src/renderer.js | UTF-8 | 1,051 | 2.53125 | 3 | [
"MIT"
] | permissive | const mjml2html = require('mjml')
const { createSSRApp } = require('vue')
const { renderToString } = require('@vue/server-renderer')
const { email } = require('./email.js')
const { body } = require('./views/body.js')
exports.renderHtml = async function renderHtml(payload) {
// Create an instance of Vue.
const ap... | true |
560691b354b4991266796ae0e652d9b0024ee485 | JavaScript | prompto/prompto-javascript | /JavaScript-Core/src/main/prompto/literal/RangeLiteral.js | UTF-8 | 1,520 | 2.53125 | 3 | [] | no_license | import { IntegerType } from '../type/index.js';
export default class RangeLiteral {
constructor(first, last) {
this.first = first;
this.last = last;
}
toString() {
return "[" + this.first.toString() + ".." + this.last.toString() + "]";
}
toDialect(writer) {
writer... | true |
8589ed3857808afa58b9ae8bc824f4a7902ffa38 | JavaScript | Darktowers/phasergamesx | /states/src/play.js | UTF-8 | 4,241 | 2.671875 | 3 | [
"MIT"
] | permissive |
var playState = {
create: function () {
melody = game.add.sound('melody');
melody.play();
game.physics.startSystem(Phaser.Physics.P2JS);
game.physics.p2.setImpactEvents(true);
game.physics.p2.gravity.y = 200;
game.world.setBounds(0, 0, 320, 1278);
var tomatecollision = game.physics.p2.createCollisionG... | true |
5c03b8ab207f5e0b7be5ab68636148cb27d22139 | JavaScript | garrettfreshwater-nss/Workforce-Data-Relationships | /scripts/customer/CustomerList.js | UTF-8 | 1,308 | 2.875 | 3 | [] | no_license |
import { useEmployees } from "../providers/EmployeeDataProvider.js";
import { useCustomers } from "../providers/CustomerDataProvider.js";
import { useEmployeeCustomers } from "../providers/EmployeeCustomerProvider.js";
import Customer from "./CustomerComponent.js";
const contentTarget = document.querySelector(".cu... | true |
82072f7815a3b7252b5e2889643a69862638c59c | JavaScript | panta82/npmstar | /bin/npmstar | UTF-8 | 2,302 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env node
const libPath = require('path');
const execSync = require('child_process').execSync;
/**
* Find the first appearance of package.json relative to the executing application.
* NOTE: This is the application that was launched, not this file.
* NOTE: This is a synchronous method and shouldn't be cal... | true |
c367c201040cfd2fbae1a052b37fe5638afbffa1 | JavaScript | Matthewmatical-99/Matthewmatical-99.github.io | /src/containers/ConnectFour/helpers.js | UTF-8 | 963 | 3.28125 | 3 | [] | no_license | export const NO_WINNER = 3;
export const makeEmptyGrid = () => Array(7).fill('column').map(() => Array(6).fill(0));
export const boardFull = grid => grid.every(gridCol => gridCol[0]);
export const isSafe = (grid, x, y) => (
x >= 0 &&
y >= 0 &&
x < grid.length &&
grid.length &&
y < grid[0].length
);
const ... | true |
4a6cfdf19fea6be9f4814d34050c9f666aaf6590 | JavaScript | pickhunter/kiq | /controllers/base.js | UTF-8 | 1,444 | 2.53125 | 3 | [] | no_license | var ActionPipeline = require('../actions/pipeline');
var Filter = require('../actions/filter');
class BaseController {
constructor() {
this._beforeActions = [];
this._afterActions = [];
this.initialize();
}
initialize() {
}
beforeAction( fn, options ) {
this._beforeActions.push(new Filter(fn, options)... | true |
6565db2f52cd926adfe4f744fe01e07eb8cde3ec | JavaScript | Willys96/Curso_Basico | /Juego/juego.js | UTF-8 | 4,131 | 3.203125 | 3 | [] | no_license |
var tablero;
var generico;
var generico2;
var teclas = {
up:38,
down:40,
left:37,
right:39
};
var imgFondo;
var imgDiana;
function fondo(url)
{
this.imagen = new Image();
this.imagen.src = url;
this.imagen.onload = dibujarFondo;
generico = this;
this.dibujar = function(){
this.imagen.src = this.url;
... | true |
f0d8bc408cd3066997d131f9d05b10329fad9cb0 | JavaScript | Carquezadar/-Experiencia2_OyarzoQuezadaReyes_003D | /js/validaciones.js | UTF-8 | 5,121 | 2.734375 | 3 | [] | no_license | function validacionContacto()
{
nom= document.getElementById('nombre').value;
ape= document.getElementById('apellido').value;
ed = document.getElementById('edad').value;
tipo = document.getElementById('opcion').selectedIndex;
f... | true |
805572fcf57003bd7b7944ba113585ada9255dd8 | JavaScript | ViktorGj/sedc6-frontend-exam | /Group I/Viktor Gjurcheski/script.js | UTF-8 | 3,812 | 2.921875 | 3 | [] | no_license | $(function(){
$.ajax({
method:"GET",
url: "https://raw.githubusercontent.com/sedc-codecademy/sedc6-frontend-exam/master/band-data.json",
dataType: "json",
success: (data) => {
bands = data;
tempBands=data;
console.log(data);
},
error: (err) => {
co... | true |
26585225588530a871fcd095ff15c4fad26b473e | JavaScript | achhetr/vegan-blog | /src/utilities/processImage/compressFile.js | UTF-8 | 603 | 2.65625 | 3 | [
"MIT"
] | permissive | import imageCompression from 'browser-image-compression';
export default async (file) => {
const options = {
maxSizeMB: 1,
maxWidthOrHeight: 1920,
useWebWorker: true,
};
try {
console.log(file, 'this is from compress');
const compressedFile = await imageCompression(file, options);
console.log(
'compr... | true |
6ed4dfbaa7181f18b8162ba5ddbfb5e0749d25f2 | JavaScript | training4developers/react_02212017 | /src/js/app.key-demo.js | UTF-8 | 1,454 | 3.140625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import ReactDOM from 'react-dom';
let itemRowCounter = 0;
class ItemRow extends React.PureComponent {
constructor(props) {
super(props);
this.itemRowIndex = itemRowCounter++;
console.log('called constructor: ', this.itemRowIndex);
}
render() {
r... | true |
24c2a74058e190a83bfac817edc5bfb9431e7c22 | JavaScript | rtoshkov/jsAdvancedSoftuni | /08. Classes-Exercise-Resources/07. Hex.js | UTF-8 | 894 | 3.625 | 4 | [] | no_license | class Hex{
constructor(value) {
this.value = value;
}
valueOf(){
return this.value;
}
toString(){
let yourNumber = this.value;
return `0x${yourNumber.toString(16).toUpperCase()}`;
}
plus(value){
if(!Number.isInteger(value)){
value = par... | true |
1a318776d43a6a1f3a1435da7e52b74176672d88 | JavaScript | mohamedlafiteh/redux-full | /server/src/server.js | UTF-8 | 2,664 | 2.53125 | 3 | [] | no_license | const express = require("express");
const app = express();
const cors = require("cors");
const bodyParser = require("body-parser");
const path = require("path");
const getTasks = require("./getTasks/getTasks.js");
const createTasks = require("./createTasks/createTasks.js");
const deleteTasks = require("./deleteTasks/d... | true |
3541599e48e8a266571703add89b319ca324cd6e | JavaScript | dankahle/testhtml | /test.js | UTF-8 | 1,065 | 3.15625 | 3 | [] | no_license | var Rx = require('rx');
var source = Rx.Observable.interval(1000);
var subscription1 = source.subscribe(
function (x) { console.log('Observer 1: onNext: ' + x); },
function (e) { console.log('Observer 1: onError: ' + e.message); },
function () { console.log('Observer 1: onCompleted'); });
setTimeout(funct... | true |
3ce6af95c6f4361862879566c00cbae4ea8246a1 | JavaScript | zollder/mean | /api/controllers/locations.js | UTF-8 | 6,894 | 3 | 3 | [] | no_license |
var mongoose = require( 'mongoose' ); // gives the controller access to DB connection
var locationDao = mongoose.model('Location');
/* Utility function to build API response with specified status and content. */
var sendJsonResponse = function(res, status, content) {
res.status(status);
res.jsonp(content);
};
/**
... | true |
80c2e08a1dfcc3a92464c06fffd99373ab747a5a | JavaScript | thomasyao15/restaurant-page | /src/appendHomeContent.js | UTF-8 | 1,089 | 2.765625 | 3 | [] | no_license | import Pizza from './pizza.jpg';
import Location from './location.png'
export default function appendHomeContent() {
const contentDiv = document.querySelector(".content")
// creating home tab content
const tabContent = document.createElement('div')
tabContent.classList.add('tab-content')
tabConte... | true |
a3ab260d99f23963d34d67635056e2c9f87f9c23 | JavaScript | BuenoDev/aapvr-clinica | /quasar/src/store/prestador/mutations.js | UTF-8 | 323 | 2.546875 | 3 | [] | no_license | export function refresh (state, data) {
state.prestadores = data
}
export function select (state, id) {
state.selected = state.prestadores.find(el => el.id === id)
}
export function removePrestador (state, id) {
state.prestadores = state.prestadores.filter(prestador => prestador.id !== id)
state.selected = null... | true |
36590c5ec984f08e3f613b474c901bae79229245 | JavaScript | prafful/node-graphql-mongodb | /reactgraphqlclient/src/component/childcomponent/DisplayFriend.js | UTF-8 | 592 | 2.625 | 3 | [] | no_license | import React from 'react';
class DisplayFriend extends React.Component {
constructor(){
super()
this.friendClicked = this.friendClicked.bind(this)
}
friendClicked(){
console.log("friend clicked " + this.props.id )
}
render() {
return (
<tr>
... | true |
f3747b908445f6d077043210c73192733f1863b9 | JavaScript | a1ip/chart.xkcd | /src/components/Tooltip.js | UTF-8 | 4,318 | 2.609375 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-underscore-dangle */
import config from '../config';
class Tooltip {
/**
*
* @param {String} parent
* @param {String} title
* @param {Array} items
* @param {Object} position
* @example
* {
* parent: {}, // a d3 selection component
* title: 'tooltip title',
* ... | true |
283e2db72f37e1bc93010157a0fd15059f1338e1 | JavaScript | DegenerateDev/userscripts | /tpb.sortbyseeds.user.js | UTF-8 | 579 | 2.765625 | 3 | [] | no_license | // ==UserScript==
// @name ThePirateBay: Sort Results by Seeds
// @namespace Violentmonkey Scripts
// @match https://thepiratebay.org/*
// @grant none
// ==/UserScript==
// nth-child needs to be 6 in single-view, 3 in double-view
let nth_child = document.querySelector('table thead tr.header').children.length === 4 ? 3... | true |
1a92977cab2a76eadfd7b0a4b0ec02a2dbc98d73 | JavaScript | anzerr/ident.icon | /index.js | UTF-8 | 1,728 | 2.640625 | 3 | [
"MIT"
] | permissive |
const Svg = require('./src/svg.js'),
{hsl} = require('color.util'),
is = require('type.util');
class Identicon {
constructor(hash, option) {
if (!is.string(hash) || hash.length < 15) {
throw new Error('A hash of at least 15 characters is required.');
}
this.option = {
background: [240, 240, 240, 255],... | true |
fae196a976c9968e7de3eaff0301f0f5745eae0a | JavaScript | aliciasiu/ECS272-Winter2021 | /Homework2/aclsiu/es6-webpack-template/node/src/js/streamgraph.js | UTF-8 | 6,654 | 2.609375 | 3 | [] | no_license | import * as d3 from "d3";
/** Reference: https://www.d3-graph-gallery.com/graph/streamgraph_basic.html **/
export function drawStreamGraph(data, id) {
const margin = { top: 30, right: 80, bottom: 80, left: 65 };
const height = 330;
const width = 530;
var keys = ["C", "C_sharpD_flat", "D", "D_sharpE_f... | true |
892f68acdd0dabd23eb80048926a97d1fbe5cf4a | JavaScript | Anmolzuck/Coding_question | /Remove_Duplicates_From_LinkedList.js | UTF-8 | 1,458 | 4.3125 | 4 | [] | no_license | /*
Ques - You're given the head of a Singly Linked List whose nodes are in sorted order
with respect to their values. Write a function that returns a modified version
of the Linked List that doesn't contain any nodes with duplicate values. The
Linked List should be modified in place (i.e., you ... | true |
46a37c46f6a0b694af5a81c9b6b40be385889b27 | JavaScript | random-cheese/mind-tool | /src/get_info.js | UTF-8 | 1,185 | 2.625 | 3 | [] | no_license | // 用 puppeteer 获取 token 和 quest_id
// 其实只有 quest_id 是每次需要拿新的,token 不需要,但是顺手就也拿了
const puppeteer = require("puppeteer");
var fs = require("fs");
async function get_info(course_url) {
// 先从文件里读取 Cookies
var cookie_file = "./home.mindvalley.com.cookies.json";
var file_content = fs.readFileSync(cookie_file, "utf8")... | true |
a4281c10444075741abe7312b84564f7111728a4 | JavaScript | j-yue/mood-palette | /src/components/utils/searchBar.js | UTF-8 | 2,686 | 2.96875 | 3 | [] | no_license | //functions for searchBar and autoComplete components
import SUGGESTIONS from "./suggestions";
//return a random index from 0 to suggestions.length-1
const randomIndex = (length = SUGGESTIONS.length) => {
return parseInt(Math.random() * length);
};
const randomIndexes = (numWords) => {
let indexes = [];
while ... | true |
370c67db19b594a3247de642dc67660fa17b850e | JavaScript | yalanyali/web-audio-engine | /src/utils/PCMEncoder.js | UTF-8 | 2,384 | 2.609375 | 3 | [
"MIT"
] | permissive | 'use strict';
import PCMArrayBufferWriter from './PCMArrayBufferWriter';
import PCMBufferWriter from './PCMBufferWriter';
const Buffer = global.Buffer;
const PCMWriter = getPCMWriter();
const alloc = getAllocFunction();
function create(length, format) {
const bitDepth = resolveBitDepth(format.bitDepth, format.floa... | true |
5b87f6e62b3cdff380b25209f2f542f7be993425 | JavaScript | Louis-ling/homework107 | /practices/map/number_map_to_word_over_26.js | UTF-8 | 374 | 2.78125 | 3 | [] | no_license | 'use strict';
var number_map_to_word_over_26 = function(collection){
var result = [];
for(var m =0;m<collection.length;m++)
{
if(collection[m]<=26)
result.push(String.fromCharCode(96+collection[m]))
if(collection[m]>26)
result.push("a"+String.fromCharCode(96+collection[m]-26))
}
return res... | true |
5e9a2fa7873c616d07542b4ecb0c6ca287c8f143 | JavaScript | Linde-Tania/Parcial2 | /js/home.js | UTF-8 | 5,861 | 2.859375 | 3 | [] | no_license | //obtiene la referencia al contenedor main
const main = document.querySelector(".mainListMovies");
const totalPelis = [];
/* consigue el listado de generos */
fetch(
genres_list_http +
new URLSearchParams({
api_key: api_key,
language: "es",
})
)
.then((res) => res.json())
.then((data) =>... | true |
07d38012342a6d4d01882a9d5124c46489acdaa5 | JavaScript | my-projects-ma46/mini-projects | /monta-time/separar.js | UTF-8 | 617 | 3.0625 | 3 | [] | no_license | // incluindo função de calcular times
var { calcularTimes } = require('./funcoes/calcularTimes');
// requisição de jogadores
var { users } = require('./funcoes/users');
// n° de pessoas por time pode vir como parâmetro da requisição
const pessoasPorTime = 3;
var {teams, reserve} = calcularTimes(users, pessoasPorTime... | true |
3f4ed8409ebf4df903b1d0a4289e8da4b97eef17 | JavaScript | MrLeungVSA/y10-p5js-criterion-a-submission-y10-albrina-chan-a | /p5jsTutorial3.2-master (Current)/hard.js | UTF-8 | 467 | 2.515625 | 3 | [] | no_license |
var buttonBack
function preloadHard()
{
buttonBack = loadImage('https://mrleungvsa.github.io/y10-p5js-criterion-a-submission-y10-albrina-chan-a/p5jsTutorial3.2-master (Current)/p5jsTutorial3.2-master (Current) /p5jsTutorial3.2-master/images/buttonBack.png')
}
function setupHard()
{
}
function drawHard()
{
b... | true |
04fa7f3fe800288f447b186a7c6ce45b64df6a54 | JavaScript | hungle/sc-sandbox | /views/edit_field.js | UTF-8 | 5,384 | 2.65625 | 3 | [] | no_license | // ==========================================================================
// Project: SalePoint
// Copyright: ©2010 Fidura, LLC
// ==========================================================================
/*globals SalePoint */
/** @class
(Document Your View Here)
@extends SC.View
*/
SandBox.EditFieldView... | true |
d177008359c15525573de10d055cafbcc7f480a8 | JavaScript | jsamuel-waters/project-1 | /assets/javascript/app.js | UTF-8 | 11,028 | 2.765625 | 3 | [] | no_license | //DB details
var config = {
apiKey: "AIzaSyDTz5XIyuo9nULZHqpuPchQL4TVNsXS32o",
authDomain: "myrcbclass.firebaseapp.com",
databaseURL: "https://myrcbclass.firebaseio.com",
projectId: "myrcbclass",
storageBucket: "myrcbclass.appspot.com",
messagingSenderId: "229680771388"
};
firebase.initializeApp(config);
v... | true |
64292480f0f2de22d2ef34f6ecb831dc18b334cf | JavaScript | asosacas/react-certification-2021 | /src/hooks/videoDetails/videoDetails.test.jsx | UTF-8 | 1,543 | 2.515625 | 3 | [] | no_license | import { act } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import api from 'api';
import useVideoDetails from './videoDetails.hook';
jest.mock('api');
const videoData = [
{
etag: '1',
snippet: {
title: 'Title',
description: 'This is the description',... | true |
1abde51f9e36c0377db0c21eb65cae74cb9b5f42 | JavaScript | HRashidi/freeCodeCamp | /Coding-Interview-Prep/Rosetta-Code/bogosort.js | UTF-8 | 342 | 3.59375 | 4 | [
"MIT"
] | permissive | 'use strict'
function bogosort(arr) {
function isSorted(arr) {
for (let i = 0; i < arr.length - 1; i++) {
if(arr[i] > arr[i + 1]) return false;
}
return true
}
function shuffle(arr) {
arr.sort(() => Math.random() - 0.5);
}
while(!isSorted(arr)) {
shuffle(arr);
}
return arr
}
console.log(bogosort... | true |
38cb0a2654b9aa44d8adaa284584e533091646f1 | JavaScript | lambda-gigapet/build-gigapet-BE | /routes/pet.test.js | UTF-8 | 1,532 | 2.765625 | 3 | [
"MIT"
] | permissive | const request = require("supertest");
const server = require("../server/server");
const { generateToken } = require("../middleware/auth");
const user = {
id: 1,
username: "bob"
};
const token = generateToken(user);
describe("Pets Endpoint", () => {
it("Requires an authorization token", async () => {
... | true |
d13bbcf63108a3f962691ede8de0baa6fb05adde | JavaScript | arturoRama/youtube-app | /js/index.js | UTF-8 | 1,974 | 2.984375 | 3 | [] | no_license | let apiKey = "AIzaSyBIC5gyjeUsLe7uwrs-hspbEGbvJkIRXEE";
let sTerm;
function buildFetch(searchTerm,callback){
$.ajax({
url:"https://www.googleapis.com/youtube/v3/search",
method: "GET",
data: {key: apiKey,
q: searchTerm,
maxResults: 10,
part: "snippet",
type: "video"
},
dataType: "json",
success: respon... | true |
ac5dd2b33d27e20743423f282d3e68492f846677 | JavaScript | SANDEEPOREYA/SANDEEPOREYA.github.io | /scripts/main.js | UTF-8 | 2,949 | 3.1875 | 3 | [] | no_license | //Rendering Map
let lat = document.getElementById('latitude').placeholder
let long = document.getElementById('longitude').placeholder
renderMap(lat, long)
document.getElementById('search').addEventListener('click', function(e) {
e.preventDefault()
// console.log('working...')
let div = document... | true |
bf66ebf43fb9e3aabd950e85fdc3d9c91f9ffd6d | JavaScript | nicolekapp/task-manager | /src/ducks/tasksReducer.js | UTF-8 | 944 | 2.984375 | 3 | [] | no_license | // Actions
const GET_TASKS = "GET_TASKS";
const TASK_RUNNING = "TASK_RUNNING";
// Action Creators
export const getTasks = () => async (dispatch) => {
await fetch("http://timetra.herokuapp.com/task/all")
.then((response) => {
return response.json();
})
.then((response) => {
dispatch({ type: GET... | true |
9b35dbeae2f5faeef11db4a6d5cc757c8ebce2fa | JavaScript | cl2112/hangman-game | /assets/javascript/game.js | UTF-8 | 7,890 | 3.34375 | 3 | [] | no_license | var charaChoices = ["AKUMA","RYU","CHUN LI","CAMMY","M. BISON","KEN","VEGA","SAGAT","GUILE","BALROG","ZANGIEF","BLANKA","DHALSIM",
"FEI LONG","E. HONDA","T. HAWK","DEE JAY"]
var moveChoices = ["SHORYUKEN","HADOUKEN","SONIC BOOM","FLASH KICK","KIKOHKEN","HUNDRED HAND SLAP","SUMO HEADBUTT","RAGING DEMON",
"SPIN... | true |
70187ef11964fa569c3b5525da2c4655378dcdbe | JavaScript | mahuntington/SED-Stack | /public/js/app.js | UTF-8 | 6,031 | 3.09375 | 3 | [] | no_license | // Initialize app
var WIDTH = 800; //width of svg
var HEIGHT = 600; //height of svg
var MAX_DISTANCE = 5; //max distance that can be run
var MIN_DISTANCE = 0; //min distance that can be run
var MIN_DATE = new Date('2016-1-1'); //min date of entry
var MAX_DATE = new Date('2017-1-1'); //max date of entry
d3.select('sv... | true |
840a316cb82a1b7326fd3d0c425f4a7425289773 | JavaScript | srad1292/EloquentJavaScriptCode | /Chapter3/main.js | UTF-8 | 3,150 | 4.5 | 4 | [] | no_license | function basicFunction(){
console.log("FUNCTION");
console.log("you're in a function");
}
function parameters(base, exp){
console.log("PARAMETERS");
var result = 1;
for(var i = 0; i < exp; i++){
result *= base;
}
console.log(base + "^" + exp + " -> " + result);
}
function functionVariable(){
console.log("FU... | true |
de84b832dbc867a7bc31be68476b0564ccfe1f82 | JavaScript | girbola/FetchFirebase | /src/components/ListStudents.jsx | UTF-8 | 1,274 | 2.9375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import ReactTable from 'react-table-v6';
import 'react-table-v6/react-table.css';
const ListStudent = props => {
const [student, setStudent] = useState({});
const [studentsArray, setStudentsArray] = useState([]);
useEffect(() => {
fetch(' https://tkareact.fireb... | true |
c795f4c35f329d1a7c600d5fc6dfec49eedec3df | JavaScript | spgdaman/js-definitions | /js/scripts.js | UTF-8 | 4,490 | 2.75 | 3 | [] | no_license | $(document).ready(function() {
$("#js").click(function() {
$("#show-js").fadeIn(50);
console.log("Hey, I faded in");
setTimeout(function() {
$("#show-js").fadeOut(1000);
},2000);
console.log("Hey, I faded out");
});
$("#operators").click(function() {
$("#show-operators").fadeIn(50);... | true |
8efb5b73c55d65949287de718517adac9c2ca53a | JavaScript | Dozen-Bees-Software/Human-Foosball-Phase1 | /modules/core/client/services/tournamentConfig.client.service.js | UTF-8 | 2,773 | 2.90625 | 3 | [
"MIT"
] | permissive | 'use strict';
angular.module('core').service('tournyService', [
function() {
var tournaments = [];
var currentTourny = '';
var submitWasClicked;
//Init tournaments is responsible for creating local storage if it does not exist, or pulling the data from it if it does.
this.initTournaments = func... | true |
bc8ee9b01d75d5ad817b680b6c28eba7e3f794ab | JavaScript | screwdriver-cd/data-schema | /config/cronExpression.js | UTF-8 | 1,192 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | 'use strict';
const cronParser = require('cron-parser');
const Joi = require('joi');
const sdCron = Joi.extend(joi => ({
type: 'string',
base: joi.string(),
rules: {
cron: {
validate(value, helpers) {
try {
const fields = value.trim().split(/\s+/);
... | true |
a96fa3d41108fbb470343018c676ee35649adfa8 | JavaScript | yangxin1994/farvekonfigurator | /color-modular/color5e0.js | UTF-8 | 119 | 2.515625 | 3 | [] | no_license | (function() {
// Make the color #5e0
HTMLElement.prototype.color5e0 = function() { this.style.color = '#5e0' }
})() | true |
9f4947ab5ab70e70d2588cedf28bb41ff1070eb8 | JavaScript | firoztyagiii/naturist-front | /src/controller/authController.js | UTF-8 | 652 | 2.59375 | 3 | [] | no_license | import { IndexView } from "../view/indexView";
import { callAPI } from "../model/model";
import { Spinner } from "../view/spinner";
import { userData } from "../model/model";
const spinner = new Spinner();
export let isLoggedIn = false;
export const checkLogin = async () => {
try {
const user = await callAPI("... | true |
0557302895d3a7a45909bbdd1d1e01d283f7a351 | JavaScript | trushilpatel/training | /css-html/pract/gallery/index.js | UTF-8 | 1,625 | 3.125 | 3 | [] | no_license | function myFunction(imgs) {
var expandImg = document.getElementById("expandedImg");
expandImg.src = imgs.src;
expandImgAnimation();
}
function expandImgAnimation(){
var expandImg = document.getElementById("expandedImg");
expandImg.style.webkitAnimation = 'none';
setTimeout(function () {
expandImg.style... | true |
4ccf1e558b7bf06193540ecc945a1e9c5ea8c162 | JavaScript | DemonDaddy22/30DaysOfJS | /Objects&Arrays/index.js | UTF-8 | 2,873 | 4.1875 | 4 | [] | no_license | // numbers, strings and booleans are passed on 'by value'
let num1 = 5;
let num2 = num1;
console.log(num1, num2);
// re-assigning one of them won't affect the other
num1 = 10;
console.log(num1, num2);
console.clear();
// same for strings too
let str1 = 'World';
let str2 = str1;
console.log(str1, str2);
str1 = 'Hello... | true |
915bdd8dcef234e1322b020c04c44a28281e42e8 | JavaScript | zodiacknights/yunobot | /index.js | UTF-8 | 1,939 | 2.625 | 3 | [] | no_license | const Discord = require('discord.js');
const localData = require('./LOCAL_DATA.json');
const yuno = require('./yuno/yuno');
// process.on('unhandledRejection', console.error);
const bot = new Discord.Client();
const token = localData.token;
bot.on('ready', () => {
console.log('I am ready!');
});
bot.on('message',... | true |
9491df41b8fe8797ab1c7022349b61ed4f1ab461 | JavaScript | greedymons/arisan | /server/helpers/encrypt.js | UTF-8 | 318 | 2.546875 | 3 | [] | no_license | const bcrypt = require('bcryptjs')
function hashPassword(text) {
const salt = bcrypt.genSaltSync(10)
const hash = bcrypt.hashSync(text, salt)
return hash
}
function comparePass(passwordLogin, passwordDb) {
return bcrypt.compareSync(passwordLogin, passwordDb)
}
module.exports = { hashPassword, comparePass } | true |
9ea7f3dc46dc87f69ea727239a084df9f6ec8baf | JavaScript | lynpotskie/NODEJS-PRAC | /index13.js | UTF-8 | 186 | 3.015625 | 3 | [] | no_license | let firstname = 'lyn';
let greeting1 = 'Welcome';
let space = ' ';
let greeting2 = 'to learning Javascript with friends';
console.log (greeting1 + space + firstname + space + greeting2); | true |
7c005264165a1011f0df287583abbb929520b98d | JavaScript | PatrikVahlen/PatrikVahlen-TEST | /kaffe.js | UTF-8 | 909 | 3.375 | 3 | [] | no_license | // Det finns ett kafé som ger 10% rabatt om man spenderar minst 1000kr på kaffe per månad.
// Kostnaden per kaffekopp är i genomsnitt 12kr.
// Programmet ska via console.log() visa om personen har rätt till rabatten.
// Programmet ska visa via console.log() hur många fler kaffekoppar personen måste köpa för
// att ... | true |
fa179ba5f8e05725e2356297fd87379ee9a50e3a | JavaScript | ilovejs/velomaze | /lib/ball.js | UTF-8 | 328 | 2.609375 | 3 | [] | no_license | var uuid = require('node-uuid');
Ball = function() {
this.id = uuid.v1();
this.player = undefined;
}
Ball.prototype.passToPlayer = function(player) {
this.player = player;
}
// Default ball properties
Ball.prototype.x = 0.5;
Ball.prototype.y = 0.5;
Ball.prototype.vx = 0;
Ball.prototype.vy = 0;
Ball.prototype.r... | true |
7f6f0344e326da12fc59149b34852f3ee57ba74e | JavaScript | darrylnu/data-structures | /sprint-two/src/tree.js | UTF-8 | 967 | 3.578125 | 4 | [] | no_license | var Tree = function(value){
var newTree = Object.create(treeMethods);
newTree.value = value;
// your code here
newTree.children = []; // fix me
newTree.count = 0;
return newTree;
};
var treeMethods = {};
treeMethods.addChild = function(value){
// if(this.addChild) {
this.children.push(Tree(value)... | true |
e64163c297dc71324600cb941484f90183efacb1 | JavaScript | sahilbalodi/learnyounode | /timeserver/time.js | UTF-8 | 343 | 3.125 | 3 | [] | no_license | module.exports = () => {
const date = new Date();
let month = date.getMonth();
if (month <= 9) {
month = `0${month + 1}`;
}
let minutes = date.getMinutes();
if (minutes <= 9) {
minutes = `0${minutes}`;
}
const data = `${date.getFullYear()}-${month}-${date.getDate()} ${date.getHours()}:${minutes}... | true |
25f58a125d6dc13a0d689a5eeb737bf9cc52a500 | JavaScript | maariasa/Curso-Node.JS | /entrega 2 (individual)/src/helpers.js | UTF-8 | 12,795 | 2.90625 | 3 | [] | no_license | /*Archivo donde se guardan los Helpers y las funciones adicionales*/
const hbs = require('hbs');
const fs = require('fs');
/*Arreglos donde se almacenan los datos de los cursos y de los usuarios*/
listaUsuarios =require('../datos_inscritos.json');
listaCursos = require('../datos_cursos.json');;
/********************... | true |
1f3dfed1502ec536f0d84724104b13601a5c3869 | JavaScript | Talisia-muniz/T9-jquery | /Aula 2 - Eventos e Efeitos/Exercicios/3_val/script.js | UTF-8 | 994 | 3.9375 | 4 | [] | no_license | /*
1. Crie uma funcionalidade que armazena o valor do input e apresenta esse valor na tela, preenchendo
o elemento <h2> do texto.
1.2. O texto replicado inicial é: "A desenvolvedora mais incrível desse ano será a...", e o valor
do input deve completar a frase.
2. Não esqueça de validar o input de forma a não replica... | true |
5620abccb1085e0740c4d22245831113a2c392bd | JavaScript | asyahubar/node-api-with-mysql | /index.js | UTF-8 | 1,364 | 2.671875 | 3 | [] | no_license | const express = require('express');
const mysql = require('mysql');
const app = express();
const port = 3010;
let students = {};
let selectorPrototype = 'SELECT * FROM students Where id=';
let selectorArgument = 0
let connection = mysql.createConnection({
host : 'localhost',
user : 'root',
passwo... | true |
56404f72e02ac529449dfb9254333de06975fbcd | JavaScript | jgolob/rome4 | /src/rome4/html/javascript/tooltip.js | UTF-8 | 791 | 2.53125 | 3 | [
"MIT"
] | permissive |
function tooltip_build() {
// This is a little tooltip div used to hover the taxon names
var tooltip = d3.select("body")
.append("div")
.attr('id','tooltip')
.style("position", "absolute")
.style("z-index", "10")
.style("visibility", "hidden")
.style("backgr... | true |
40d8bc967f1fab208182727764b69c7acd5b5a0d | JavaScript | alan-palacios/Spark | /src/event-manager.js | UTF-8 | 1,826 | 2.53125 | 3 | [] | no_license | const { ipcRenderer } = require('electron');
let EventEmitter = require('events').EventEmitter;
const itemListManager = require('./item-list-manager.js');
const clearItemData = itemListManager.clearItemData;
const updateSelectedItem = itemListManager.updateSelectedItem;
const executeItemAction = itemListManager.execut... | true |
34609cde7886d0ffad01013ca3da1f5a5a8f9d49 | JavaScript | snoopdave/usergrid-ember | /js/app.js | UTF-8 | 12,441 | 2.53125 | 3 | [] | no_license | /*
* 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 in writing, softwa... | true |
ceb8041d65133d62113dfd216b2cf1195d2c061c | JavaScript | OctavianRotari/React-datepicker-mfp | /src/composers/NumeralComposer.js | UTF-8 | 752 | 2.8125 | 3 | [] | no_license | import _ from 'lodash';
const NumeralComposer = class {
constructor(events, datapointName) {
this.events = events;
this.datapointName = datapointName;
this.child = 'NumberPicker';
this.value = 'Numeral';
this.singleton = false;
}
selectedValues() {
const index = _.findLastIndex(this.even... | true |
7f9b6abc2bd667d99b71e1e8dbe7fa227f9425b2 | JavaScript | NataliaGon/electron-typescript | /src/data/user-store.js | UTF-8 | 506 | 2.546875 | 3 | [] | no_license | 'use strict'
const Store = require('electron-store')
class UserStore extends Store {
constructor (settings) {
super(settings)
this.users= this.get('users') || []
}
saveUser () {
this.set('users', this.users)
return this
}
getUser () {
this.users = this.get('users') || []
return thi... | true |
c1ed5c1453effe0027f73a5a94d0a97ad52598c4 | JavaScript | jeremyfell/keylinks | /js/popup.js | UTF-8 | 3,469 | 2.671875 | 3 | [] | no_license | /*/////////////////////////////////
Functions controlling popup startup
*//////////////////////////////////
// Sets up the popup for the smaller toolbar view
function toolbarSetup() {
var menu = document.createElement("div");
var newDiv = document.createElement("div");
var newButton = document.createEleme... | true |
10f7298011a1d716f758b9e64e96ffc784d944a8 | JavaScript | eirikurdal/mandagstur | /mandagsturApp/js/hikes.js | UTF-8 | 2,375 | 2.703125 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const router = express.Router();
const db = require('./dbconnect').db; //database
const fileUpload = require('express-fileupload');
// ---------------------------
router.post('/upload', function (req, res) {
console.log(req.files.sample... | true |
5dba6bf6d47964198672797d142e8376d35c7aa7 | JavaScript | liuyaf/info343-in-class | /ajax/js/index.js | UTF-8 | 1,888 | 3.546875 | 4 | [] | no_license | // @ts-check
"use strict";
const LOCATION_API = "https://freegeoip.net/json/";
//replace `{latitude}` and `{longitude}`
const WEATHER_API = "http://api.openweathermap.org/data/2.5/weather?units=imperial&APPID=c2072f8cb6d9c7971cff7c662c5940c6&lat={latitude}&lon={longitude}"
//replace {icon}
const ICON_URL = "http://ope... | true |
c5d570127972ac7d854cb57b08e3c0765bcad5a0 | JavaScript | ae-freeman/card-component-react | /src/components/AddDestination.js | UTF-8 | 1,217 | 2.984375 | 3 | [] | no_license | import React from "react";
class AddDestination extends React.Component {
state = { term: ""}; //initialise state. Currently, user has not typed anything.
onFormSubmit = (event) => {
event.preventDefault(); //prevent broweser trying to submit and refresh the page
this.props.onSubmit(this.sta... | true |
9090cecfd514bdda1ab1dd39a214f1e6c2748637 | JavaScript | marloncosta29/huehueCardGame | /huehueCardGame/models/Game.js | UTF-8 | 1,228 | 2.71875 | 3 | [] | no_license | //Enter in the game
exports.enterPlayer = function (PLAYER_LIST, player)
{
PLAYER_LIST[player.id] = player;
return PLAYER_LIST;
}
//Remove from the game
exports.removePlayer = function (PLAYER_LIST, player)
{
delete PLAYER_LIST[player.id];
console.log('Player ' + player.id + ' was removed');
retur... | true |
0ec44de12465621f419602b499448b3e212ff3c8 | JavaScript | vitogit/riot-es6-chat | /app/assets/components/History.js | UTF-8 | 535 | 2.984375 | 3 | [] | no_license | 'use strict'
class History {
constructor(maxSize) {
this.list = [];
this.position = -1
this.maxSize = maxSize || 1000
this.size = 0
}
add(command, inputType) {
if (inputType === 'password') { return; }
this.list.unshift(command);
this.size++
if (this.size > this.maxSize) {
... | true |
2211c47c0b894433017670329a19b28d54e9da31 | JavaScript | jtpio/meetup-malmo-language | /public/js/main.js | UTF-8 | 2,365 | 2.546875 | 3 | [] | no_license | 'use strict';
$.getJSON('languages', function(data) {
if (!data.languages) return;
var langs = data.languages;
var unknown = data.unknown;
var total = data.total;
var bilinguals = data.bilinguals;
var htmlUnknown = '';
// format languages
var items = Object.keys(langs).map(function (l... | true |
a5773ab303b5e164a11723227d77765906f42075 | JavaScript | theborgh/theborgh.github.io | /src/sandbox/alds/hash.js | UTF-8 | 1,485 | 4.03125 | 4 | [
"MIT"
] | permissive | /* eslint-disable no-console */
// Simplified & inefficient implementation, for conceptual demonstration only
class MyHash {
constructor(size) {
// Map() or an object is better
this.data = new Array(size);
}
_hashFunction(key) {
let hash = 0;
for (let i = 0; i < key.length; i++) {
... | true |
5970f47a687b27138bf4c81c8c53a3dcddd41d96 | JavaScript | absurdmoe/js_sample_teach | /decrement_loop.js | UTF-8 | 177 | 3.625 | 4 | [] | no_license | /*
CREATE A PROGRAM WHICH DECREMENTS A COUNTER AND PRINTS ITS VALUE
*/
for(let time = 5; time > 0; time--){
console.log("you have " + time + " minutes left in the test")
}
| true |
daaed6cd98f6376ffdf2fa4b90b019536f8e6d6a | JavaScript | realLewin/JavascriptPlayground | /src/master-coding-interview-datastructures/data-structure/hash-table/implementation.js | UTF-8 | 2,646 | 4.09375 | 4 | [] | no_license | /**
* search: O(1)
* insert: O(1)
* lookup: O(1)
* delete: O(1)
*/
/**
* The simple hash table implement;
* ***** hash table in javascript is the object *****;
*/
// -------------------------------- my implementation;
/*
class HashTable {
// Init the hash table size;
constructor(size) {
this.data = new ... | true |
8a15e618248ad32a9039cedd8ffaf7f9da8a5791 | JavaScript | JohnBurke4/CollegeStuff | /3rd Year/Software Engineering/github-visualisation/src/components/LolipopChart.jsx | UTF-8 | 3,135 | 2.734375 | 3 | [] | no_license | import React, {
Component
} from 'react';
import * as d3 from "d3";
import * as collection from "d3-collection"
class LolipopChart extends Component {
constructor(props) {
super(props);
this.state = {
data: this.props.data
}
}
componentDidUpdate() {
consol... | true |
a9bf2e52cf60f70f6cbee4f91b4561eaf7f61b55 | JavaScript | derekhouck/marina-management | /client/src/components/AddBoatForm.js | UTF-8 | 771 | 2.90625 | 3 | [
"MIT"
] | permissive | const AddBoatForm = ({onBoatSubmission}) => {
// would probably refactor this to be a controlled component
let name, color, length;
const submit = e => {
e.preventDefault();
onBoatSubmission({
name: name.value,
color: color.value,
length: length.value
});
name.value = '';
c... | true |
83bf8c8150c6d5cd0043257f1f3299d2b900efef | JavaScript | Joeanca/react_basic_site | /asg1/src/containers/UserPortfolio.js | UTF-8 | 6,062 | 2.875 | 3 | [] | no_license | import React, { Component } from 'react';
import { NavLink } from 'react-router-dom'
import stockData from '../stocks.json';
import StockPortfolio from '../userStockPortfolio.json';
class UserPortfolio extends Component {
constructor(props){
super(props);
this.state = {
currentUserId: th... | true |
f144ca5da9bed95ccbdf9e2647fceacf1d6ce091 | JavaScript | JoshFahr/JoshFahr.github.io | /projects/runtime/js/level01.js | UTF-8 | 4,486 | 2.90625 | 3 | [
"CC0-1.0"
] | permissive | var level01 = function (window) {
window.opspark = window.opspark || {};
var draw = window.opspark.draw;
var createjs = window.createjs;
window.opspark.runLevelInGame = function(game) {
// some useful constants
var groundY = game.groundY;
// this data will allow us to define... | true |
37542024b4cd025b84beb451666c077361e168a2 | JavaScript | pranabkalita/speak-up | /models/User.js | UTF-8 | 1,182 | 2.59375 | 3 | [] | no_license | const bcrypt = require('bcryptjs')
const mongoose = require('mongoose')
const { Schema } = mongoose
const userSchema = new Schema(
{
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
password: { type: String, required: true, select: false },
aboutMe: Strin... | true |
e213e5fc7a2ffd1912f92d5282dc9f33f52a6556 | JavaScript | macbubb/gamer-tag-gen | /src/components/RenderSplatters.js | UTF-8 | 2,801 | 2.515625 | 3 | [] | no_license | import React from 'react';
import SplatterOne from "./Splatters/SplatterOne";
import SplatterTwo from "./Splatters/SplatterTwo";
import SplatterThree from "./Splatters/SplatterThree";
import SplatterFour from "./Splatters/SplatterFour";
import SplatterFive from "./Splatters/SplatterFive";
import SplatterSix from "./Spl... | true |
c4664cb96707ec2c8b7f48e82d36a61a2620b6c9 | JavaScript | Jimmy-You/vuesUtils | /projects/src/utils/WKTToGeoJson.js | UTF-8 | 4,272 | 3.21875 | 3 | [
"MIT"
] | permissive | export default function processPolygonString2PolygonArray(polygonString) {
var geoJson = {};
if (polygonString.startsWith("MULTIPOLYGON")) {
// 多面
geoJson["type"] = "MultiPolygon";
var firstLeftIndex = polygonString.indexOf("(");
// 去掉首尾括号
var str = polygonString.substring(
firstLeftInde... | true |
dda44168415e1fe1d79d2766659f522a36180094 | JavaScript | Mydayyy/touchbar-tasks | /lib/DurationStore.js | UTF-8 | 1,856 | 3.140625 | 3 | [
"MIT"
] | permissive | "use babel";
const storage = require('electron-json-storage');
/**
* Stores the duration of tasks on the disk. Uses the electron-json-storage package
*/
class DurationStore {
constructor() {
this.data = {};
storage.get("durationData", (error, data) => {
if(error) {
th... | true |
91265a664e49bda88dcfb9b9724f24845d56b498 | JavaScript | fengyangfifa/navigation_bar | /two_selected_and_three_selected/index.js | UTF-8 | 914 | 3.28125 | 3 | [] | no_license | var province = document.getElementById("province");
var data = { "请选择省/市": ["请选择区/县"], "河北省": ["邯郸", "廊坊"], "北京": ["海淀", "朝阳"], "陕西": ["延安", "西安"] };
function initialProvince() {
// 初始化省/市
for(var i in data){
new_province = document.createElement("option");
new_province.innerHTML = i;
p... | true |
759b64579026fa7c1d30ad19053057f635671c5e | JavaScript | kirace/InstaScraper | /jsdom-scrapers/tagScrape.js | UTF-8 | 1,968 | 3.0625 | 3 | [] | no_license | /*
This program takes in a link to an Instagram image page, finds the associated username,
then scrapes user page for the rest of details before writing results to CSV file.
*/
var jsdom = require("node-jsdom").jsdom;
var request = require("request");
const fs = require('fs');
var url = process.argv[2]; //url... | true |
5e6c0207ef2480387a4a90e36ba8cfa1ff0e119a | JavaScript | manasrajowar66/INDECISION-APP2 | /src/playground/es6-class1.js | UTF-8 | 737 | 3.703125 | 4 | [] | no_license | class Person {
constructor(name="Anonymous",age=0){
this.name=name;
this.age=age;
}
getGreeting(){
return `Hi i am ${this.name}.`;
}
getDescription(){
return `${this.name} is ${this.age} years old!`;
}
}
class Travaller extends Person{
construc... | true |
f6f744bda3fa43a21b39f302244e1ceaf18cf9fd | JavaScript | WangYouzheng1994/hyjf | /hyjf-web/src/main/webapp/js/listTimer.js | UTF-8 | 1,926 | 2.65625 | 3 | [
"MIT"
] | permissive | function initEvent(){
$(".con-title.time").each(function() {
var _self = $(this);
var timedata = _self.data("time");
var currTimmer = setInterval(function() {
var ts = timedata;
if (ts >= 0) {
timer(_self, _self.data("time"));
... | true |
8da7d16013cfd58168be51b70f863f131831c52b | JavaScript | powerseunghun/JavaScript_200_Example | /2.JavaScript_Learn_The_Basic/053.Define_Class_Static_Method,Property.js | UTF-8 | 970 | 3.28125 | 3 | [] | no_license | class Product {
static build(name, price) {
const id = Math.floor(Math.random() * 1000);
return new Product(id, name, price);
}
static getTaxPrice(product) {
return (product.price * 0.1) + product.price;
}
constructor(id, name, price) {
this.id = id;
this.na... | true |
a1ed5681b9fdbaa5d01e4751d0e1472d9e2a33d9 | JavaScript | horizon4xx/omamorichecker | /inside.js | UTF-8 | 29,433 | 2.796875 | 3 | [] | no_license | function skillcheck(skill){
switch(skill){
case "kantuu":
return "貫通強化";
case "shahou":
return "射法"
case "tuugeki":
return "痛撃"
case "ennnetu":
return "炎熱適応"
case "noutou":
return "納刀"
case "gyakujou":
... | true |
fe7a1d9da913b34a8bc30f5101f8c0a55b735db9 | JavaScript | rythomas2525/note | /routes/apiRoutes.js | UTF-8 | 1,086 | 2.609375 | 3 | [] | no_license | const path = require("path")
var db = require("../db/db.json")
module.exports = function (app) {
app.get("/api/notes", function (req, res) {
return res.json(db);
});
app.post("/api/notes", function (req, res) {
db.push(req.body)
res.json(true)
for (let i = 0; i < db.len... | true |
e1d718650b6fbf2bae8e19df0aeefeead7710e76 | JavaScript | mongoose-os-apps/imu-demo | /chrome/js/lib/MadgwickAHRS.js | UTF-8 | 9,258 | 2.671875 | 3 | [
"MIT"
] | permissive | //=====================================================================================================
// MadgwickAHRS.c
//=====================================================================================================
//
// Implementation of Madgwick's IMU and AHRS algorithms.
// See: http://www.x-io.co.uk/node... | true |