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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fdea0956c0064ff43335c71076e9d6c48ab94872 | JavaScript | Akiq2016/wxapp-cli | /src/commands/generate.js | UTF-8 | 6,600 | 2.578125 | 3 | [
"MIT"
] | permissive | import { join } from 'path';
import {
existsSync,
outputFileSync,
readFileSync,
writeFileSync,
} from 'fs-extra';
import inquirer from 'inquirer';
import { consoleErr, consoleCreate } from '../utils';
/**
* give params to generate a files relative path (path.*)
*
* @param {string} type default type: page / ... | true |
4d26bc93c160df8f5f2a99a7f9d54c739f43fd23 | JavaScript | jatinsohane/YelpCamp | /routes/index.js | UTF-8 | 1,966 | 2.625 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
var Campground = require("../models/campground");
var User = require("../models/user");
var passport = require("passport");
//ROOT ROUE
router.get("/",function(req, res){
res.render("landing");
});
//==========================
//AUTH ROUTES
//====... | true |
1dcc894beee168f405a0caec4aea026cbf0a63d9 | JavaScript | BO-HAI/ad-txt | /src/js/storage.js | UTF-8 | 231 | 2.578125 | 3 | [] | no_license | class storage {
static save (key, value) {
localStorage.setItem(key, value);
}
static load (key) {
let val = localStorage.getItem(key);
return val ? val : '';
}
}
module.exports = storage;
| true |
f122917f341f0abe3f482d99378c17b2e370f30f | JavaScript | dragonflypl/web-wiki | /angular-2-wiki/TeachingTaskWithIonic/LearningProcessing-p5.js/chp04_variables/exercise_04_4b_variables/sketch.js | UTF-8 | 262 | 3.046875 | 3 | [] | no_license | // Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Exercise 4-4b:
function setup() {
createCanvas(200,200);
}
function draw() {
background(255);
stroke(0);
line(100,0,100,100);
line(100,100,0,200);
line(100,100,200,200);
}
| true |
a152a1a28a0d4d625e363381cf88103858a2e836 | JavaScript | mapbox/jsxtreme-markdown | /packages/jsxtreme-markdown/vendor/remark-parse/lib/locate/break.js | UTF-8 | 253 | 3.03125 | 3 | [
"MIT"
] | permissive | 'use strict';
module.exports = locate;
function locate(value, fromIndex) {
var index = value.indexOf('\n', fromIndex);
while (index > fromIndex) {
if (value.charAt(index - 1) !== ' ') {
break;
}
index--;
}
return index;
}
| true |
de14892d1cc5fc7cf61d5baae62f5ef311e956fa | JavaScript | cl8n/project-loved | /src/helpers.js | UTF-8 | 4,142 | 2.5625 | 3 | [
"MIT"
] | permissive | const { red } = require('chalk');
const { existsSync, mkdirSync, readFileSync } = require('fs');
const { dirname, join } = require('path');
const { inspect } = require('util');
function convertToMarkdown(bbcode) {
return bbcode.toString()
.replace(/\\/g, '\\\\')
.replace(/\*/g, '\\*')
.repl... | true |
d8215b71d6151793c999e61a2710a11941a59c3c | JavaScript | rweigel/treeify | /treeify-demo.js | UTF-8 | 1,041 | 2.640625 | 3 | [] | no_license | fs = require("fs");
treeify = require(__dirname + "/treeify").treeify;
json2 = require(__dirname + "/lib/json2").json2;
var In =
[
{"delimiter": ".", "list":["A"]},
{"delimiter": ".", list:["A","B"]},
{"delimiter": ".", list:["A.B"]},
{"delimiter": ".", list:["A.B","A.C"]},
{"delimiter": ".", list:["A.B.C"]},... | true |
6af82d1b6b6d0bd4d013695f00c81e45360f9f9d | JavaScript | Zering/node | /second/stream.js | UTF-8 | 731 | 2.96875 | 3 | [] | no_license | var fs = require('fs');
var data = '';
// 创建读取流
var readerStream = fs.createReadStream('buffer.js');
readerStream.setEncoding('utf8');
readerStream.on('data',function(chunk) {
data += chunk;
});
readerStream.on('end',function(){
console.log(data);
});
readerStream.on('error',function(err){
console.log(err.stac... | true |
c432e4d26a0bb1165f7b60dd69d64c4cd601a3e2 | JavaScript | mustaphaboudouch/pfe-vegetale | /corrector/js/search.js | UTF-8 | 1,266 | 3.203125 | 3 | [] | no_license | function selectEspece(){
const selectedEspece = $('#select-espece option:selected').text().toLowerCase();
const especes = $('tbody tr td:nth-child(2)');// list of especes
especes.each(function(i) {
var allRows = $(this).parents(':eq(1)').children();
var row = $(this).parent();
... | true |
6dd96918e827dad9aed6a62cc72e47d77e81dcd8 | JavaScript | PedroBrito95/data-collection-test | /006/tagueamento.js | UTF-8 | 246 | 3.109375 | 3 | [] | no_license | var lista = new Array();
document.getElementById('botoes').addEventListener("click", function(event) {
if (event.target.nodeName == "BUTTON"){
var part = event.target.textContent.split('-');
lista.push(part[0]);
console.log(lista);
}
}); | true |
17b08cb24966e1d24c137647cd846c087eb9355d | JavaScript | Download/ulogv2 | /any-ulog.js | UTF-8 | 3,902 | 3.03125 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown"
] | permissive | module.exports = function(
dl, // the default log level
get, // gets the logging settings from the environment
){
var
m = {}, // stores log modules keyed by name
gl = get(), // global log level, init from environment
// the main anylogger factory function
any = function(n,o){
// return the existing ... | true |
b344cc7d3ebda7a6b37545102eba05665b2c4dcb | JavaScript | jumakiwaka/cheap-stocks-cli | /test/currencies.Test.js | UTF-8 | 896 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | const { expect } = require('chai');
const { getAllCurrencies } = require('../command/currencies');
// TODO => mock the api calls instead of hitting a real endpoint
describe('Getting all supported currencies', function () {
this.timeout('25s');
before(() => {
console.log = (msg) => {
// dummy stub of co... | true |
9402fc4d893d62f469726fcd4627e51dea6cf558 | JavaScript | nikhil-pivotal/Trip.ly | /app/assets/javascripts/components/AddPackingListForm.es6.jsx | UTF-8 | 1,536 | 2.609375 | 3 | [] | no_license | class AddPackingListForm extends React.Component {
constructor() {
super();
this.handleSubmit = this.handleSubmit.bind(this);
this.handleReturnClick = this.handleReturnClick.bind(this);
}
handleReturnClick() {
this.props.onResetHolder();
this.props.onHideForm();
this.props.onDisappearErro... | true |
c049147488debbb8f0f9cd5d0dcebf0077932a71 | JavaScript | dreamdata-io/script-integration-example | /react/src/Form.js | UTF-8 | 1,321 | 2.71875 | 3 | [] | no_license | import React, { useState } from "react";
const encodeId = (value) => {
return window.btoa(value);
};
const Form = () => {
const [name, setName] = useState("");
const [company, setCompany] = useState("");
const [email, setEmail] = useState("");
const handleSubmit = async () => {
const userId = encodeId(... | true |
09d1f546d93ae75dcba597058e8cdbf0b6a8032d | JavaScript | Htongbing/ToDoList | /app/utils/parameter.js | UTF-8 | 2,293 | 3.09375 | 3 | [] | no_license | function formatRule(rule) {
rule = rule || {}
if (typeof rule === 'string') {
rule = { type: rule }
} else if (Array.isArray(rule)) {
rule = { type: 'enum', values: rule }
} else if (rule instanceof RegExp) {
rule = { type: 'string', format: rule }
}
return rule
}
function defaultMessage(type, k... | true |
022030e5940ceb04808629643f62b892733b8737 | JavaScript | NiMontano/API-hack-capstone | /app.js | UTF-8 | 2,347 | 2.96875 | 3 | [] | no_license | 'use strict'
//goole info
const directionsApiKey = 'AIzaSyDL9SmrUA5cTAo0fzKulFXi-7dQ7fUY4p8';
const directionsURL = 'https://https://maps.googleapis.com/maps/api/directions/';
//yelp info
const yelpApiKey = 'Bearer fc4X_XRlPOIHhGAQdo7P2eNLkg4VBPGzI7bG_bXW7URTT7dmJQahyvZkccHCnrUMYO_aUUxFY3YPpYjoJ_VZn5jf2FRE45Aka86raL... | true |
65eaa7f04e424915baf01ed3a8bac68c0a0ae9d5 | JavaScript | MikeKuhl/201Undefined | /ghost.js | UTF-8 | 6,905 | 3.578125 | 4 | [
"MIT"
] | permissive |
let canMove = true;
let keyPress = 0;
let lives = 4;
document.onkeydown = detectKey;
function Questions(question, answers, correctAnswer){
this.question = question
this.answers = answers
this.correctAnswer = correctAnswer
}
let question1 = new Questions("The 'function' and 'var' are known as:",
["Keyw... | true |
4eed74223fbaf9aa1b61f6ffb59b940b29ddf4e4 | JavaScript | dsathyakumar/Trees | /binary-tree/traversal/level-order/recursive.js | UTF-8 | 507 | 2.890625 | 3 | [] | no_license | 'use strict';
exports.levelOrderRecursive = root => {
const result = [];
if (!root) {
return result;
}
let level = 0;
function recurse(node, lvl) {
if (!node) {
return;
}
if (lvl === 0) {
result.push(node.val);
return true;
}
const leftSubTree = recurse(node.lef... | true |
74a183d6aa317e6d6d96f2cf4cef236be9fce5cc | JavaScript | alexgm5555/test_credyty | /src/components/Planets/ItemPlanets.js | UTF-8 | 1,826 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react'
export default class ItemPlanets extends Component {
constructor(props) {
super(props);
this.state = {
dataFilter: [],
currentPage: 1,
todosPerPage: 10,
};
}
async componentWillMount(a) {
debugger
... | true |
b1238980d608eb4d1a262b58be6c94fe2c64cc88 | JavaScript | yousifAlneamy/CtCi-6th-Edition-JavaScript | /chapter1/1.5 oneWay.js | UTF-8 | 1,049 | 4.46875 | 4 | [] | no_license | /**
* 1.5
* One Away: There are three types of edits that can be performed on strings: insert a character,
* remove a character, or replace a character. Given two strings, write a function to check if they are
* one edit (or zero edits) away.
* EXAMPLE
* pale, pIe -> true
* pales. pale -> true
* pale. bale -> t... | true |
c74535103a9ccd95e624ff20f539a8981b4949c5 | JavaScript | psycho-M/Devsnest | /THAs/FrontEnd/Day9/app.js | UTF-8 | 966 | 3.515625 | 4 | [] | no_license | let seats = document.querySelectorAll(".seat");
let bookedSeatsNumber = document.querySelectorAll(".booked-seat").length;
let remainingSeatsNumber = seats.length - bookedSeatsNumber;
let bookedSeatsValue = document.querySelector(".booked-seats-value");
let remainingSeatsValue = document.querySelector(".remaining-sea... | true |
638cc1c4e88a5f99bd3b25d9f0ff41a81072db33 | JavaScript | niice/colour-widget | /lib/typeof.js | UTF-8 | 789 | 3.59375 | 4 | [
"MIT"
] | permissive | (function() {
/*
* typeOf()
*
* Improved typeOf method, more reliable than JavaScripts
*/
var typeOf = function(value) {
var Klass = Object.prototype.toString.call(value).slice(8, -1);
// Add better resiliance for harsh environments
if (value === null) { return ... | true |
85cffa4cdc35a57fac3663dea1ce6c390691cd3c | JavaScript | Shane59/splliting-money | /src/Components/Results/Results.js | UTF-8 | 745 | 2.5625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import styled from "styled-components";
const PersonResult = styled.div`
display: flex;
`;
const ResultName = styled.div`
flex: 0 0 180px;
`;
const ResultAmount = styled.div`
flex: 1 0 auto;
`;
export default function Results(props) {
let temp = [];
Object... | true |
9a193913ff9fd06f245af01d6fa3e553a14d81e9 | JavaScript | purebill/purebill.github.io | /puregoo/undo.js | UTF-8 | 1,686 | 2.765625 | 3 | [] | no_license | "use strict";
var Undo = (function () {
var actions = [];
var lastActionDone = -1;
var callbacks = [];
function add(action) {
lastActionDone++;
actions.splice(lastActionDone, actions.length, action);
try {
const result = action.do();
if (result instanceof Promise) result.then(triggerOn... | true |
997e2a2e99f9ab52c98b74875a38b668e18492ed | JavaScript | janat08/concordance | /perf/profile.js | UTF-8 | 4,147 | 2.59375 | 3 | [
"ISC"
] | permissive | /*
Copyright JS Foundation and other contributors <https://js.foundation/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see t... | true |
7174e509e1459f7d187a6dfc57d254b27891d8f0 | JavaScript | DenisDench/human-readable-number | /src/index.js | UTF-8 | 1,371 | 3.625 | 4 | [
"MIT"
] | permissive | const digits = {
0: '',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen',
17: 'seventeen',
18:... | true |
dac9a00854f1ed864b3c8966de9874d7dd9acafa | JavaScript | alephno/stock-explorer | /db_server/utils.js | UTF-8 | 938 | 3.09375 | 3 | [] | no_license | /**
* Formats one or more time series objects returned from the
* AlphaVantage API into a format used by this project.
*
* @param {Object} series The time series data from AlphaVantage
* @return {Array<Object>} An array of formatted time series data
*/
function formatAlphaVantageSeries(series) {
const formatFie... | true |
68eb648a05a155effa618e7a60c6c8d883dc0a19 | JavaScript | MariaShebeko/JS-trials | /js/module-1-2/logical-operators.js | UTF-8 | 1,033 | 3.90625 | 4 | [] | no_license | // logical operators && || !
// console.log('I Love JavaScript' && 1);
// console.log('Love' && 1 && true);
// console.log(0 && 'Love && 1');
// console.log(0 && false && 1);
// let minPrice = 100;
// let maxPrice = 200;
// let currentPrice = 150
// if (currentPrice >= minPrice && currentPrice <= maxPrice) {
// ... | true |
e88acc88aca48432797c00d8db885ddb0658260b | JavaScript | 13671735326/shop | /src/main/webapp/static/main.js | UTF-8 | 2,341 | 2.546875 | 3 | [] | no_license | // console.log("hello world");
// var div = document.getElementById('id');
//
// console.log(":childNodes:",div.childNodes);
//
// var a = document.createElement('a');
// a.innerText = 'bing';
// a.href = "http://www.bing.com";
//
// div.appendChild(a);
// var qwe = document.getElementById('parent2');
//
// var a... | true |
9b3bbddad8fdc8b8b94b7c288629e9ce3718fae5 | JavaScript | KProgrammer/ToppetExtension | /ToppetExtension/Toppet/content.js | UTF-8 | 2,050 | 3.0625 | 3 | [] | no_license | console.log("Hallou");
chrome.runtime.onMessage.addListener(handleRequest)
//key is an array of objects of type {question: "", answer: ""}
//C, response for Q1
function isMulti(elem){
if (elem.getAttribute("checkbox")){
return true;
} else {
return false;
}
}
function isQChecked(question, a){
for (opt of a){
... | true |
53c04264a66cd31d7e51d73d80f88161f7990a46 | JavaScript | intentor/moip-integration-sample | /controllers/client.js | UTF-8 | 491 | 2.53125 | 3 | [
"MIT",
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* Client controller. */
var clientDao = require('../service/dao/clientDao.js');
/**
* Get client data.
*
* @param {object} request Request parameters.
* @param {object} response Response parameters.
*/
exports.get = function(request, response) {
console.log('get', request.body);
clientDao.findByEm... | true |
a5232b53aed8b85cdb20da85799cf0f40b00a8c0 | JavaScript | johnvincentio/jquery | /lesson-1/tape/2/index.js | UTF-8 | 237 | 3.25 | 3 | [
"MIT"
] | permissive |
'use strict';
module.exports = Bear;
function Bear(type) {
this.type = type || 'any';
console.log("change something");
}
Bear.prototype.growl = function(says) {
return 'The '+this.type+' bear says '+ (says || 'grrr');
};
| true |
2938989f2c9246a89aaf717a1c9d484ee965a4a2 | JavaScript | HsiaoKang/aha-algorithms | /source/bucket_sort.js | UTF-8 | 1,026 | 3.609375 | 4 | [
"MIT"
] | permissive | // 桶排序
// 目标 8,5,5,3,2 最大值10,从大到小
// 测试数据 Array.from(new Array(1000000),(item,i)=>i)
// 十万 数据 12.4ms
// 一百万 数据 163.3ms
// 时间复杂度 O(M+N)
function bucketSort(nums, max) {
console.time("run time");
// 第一次循环 M
let buckets = Array.from(new Array(max), () => 0);
// 第二次循环 N
for (let i = 0; i < nums.length; i++) {
... | true |
2e10a6b0bd65f485111383c53e2f24c2204858c6 | JavaScript | dccyber/cyberart.io | /resources/assets/js/components/Animation/Animations/MineFlow/Items/Cell.js | UTF-8 | 1,409 | 3.0625 | 3 | [] | no_license | const EARTH = 'earth';
const WATER = 'water';
const GRASS = 'grass';
const CONTENT_COLORS = {
[EARTH]: {
r: 139,
g: 69,
b: 19
},
[WATER]: {
r: 30,
g: 144,
b: 255
},
[GRASS]: {
r: 124,
g: 252,
b: 0
}
};
class Cell {
cons... | true |
67c22c700275099531294c2bdc00535b9a69e2ee | JavaScript | hinzed1127/javascript30 | /02-Clock/script.js | UTF-8 | 1,138 | 3.59375 | 4 | [] | no_license | var start = null;
const hourHand = document.querySelector('.hour-hand');
const minuteHand = document.querySelector('.minute-hand');
const secondHand = document.querySelector('.second-hand');
function setTime() {
const date = new Date();
const refDate = new Date(date.getFullYear(),
date.getMonth(),
da... | true |
9627d1184c84f2096eedff18c89f00a0194e3c43 | JavaScript | michaelhtran120/Rock_Paper_Scissor_JS | /javascript.js | UTF-8 | 2,149 | 4.21875 | 4 | [] | no_license | //computerPlay to return random choice of rock paper or scissor
//return random value for computer choice in game of RPS.
let option = ['rock','paper','scissor'];
function computerPlay() {
return option[Math.floor(Math.random() * option.length)];
}
//how to determine winner of each game.
let computerSco... | true |
4a36776e594825aa50577068571f3215bd075b2d | JavaScript | bymayank/Moviehome | /assert/js/movies.js | UTF-8 | 3,837 | 3.0625 | 3 | [] | no_license |
const upcomingMovies = document.querySelector('#upcomingMovies');
const popularMovies = document.querySelector('#popularMovies');
const topRatedMovies = document.querySelector('#topratedMovies');
const nowPlayingMovies = document.querySelector('#nowPlayingMovies');
const details = document.querySelector('#details_cont... | true |
0fb31a90580fb67bd648f748ff14573875162e4a | JavaScript | lykamarcelino/team05_unr_react_app | /src/components/graphDisplays/FetchStaticGraph2.js | UTF-8 | 2,680 | 2.9375 | 3 | [] | no_license | /*
* Name: FetchStaticGraph2.js
* Description: This file will form a fetch request for the second latest graph created by a
* Sales Forecasting user then transfer the data to staticGraph for Display.
* Date: 04/29/2020
* Author: Liliana Pacheco
* */
import React from "react";
import StaticGraph from "./Static... | true |
610fab2caf30462537fd259a27c8a17432181b4c | JavaScript | RoyDG/JavaScript-Problem-Solving | /BasicJs.js | UTF-8 | 2,046 | 4.40625 | 4 | [] | no_license | //addition excercise1
function add(a, b){
var sum = a + b;
return sum;
}
var result = add(2, 3);
console.log(result);
//multiplication then show 3 output and totalof output
function double(number){
var result = number*2;
return result;
}
var first = double(10);
var second = double(20);
var third = doub... | true |
8a8f62f6a2d11ca3d24e8f4ceebac39816a86986 | JavaScript | phoenixzk/JavaScript | /JavaScriptbasis/06_compare.js | UTF-8 | 415 | 3.46875 | 3 | [] | no_license | //console.log(3>1);//true
//console.log(1==1);//true
//console.log(1=='1');//true
//console.log(1==='1');//false
//console.log(3>'10');//false
//console.log('3'>'10');
//'3' -> 51 '1'->49
//console.log( '1'.charCodeAt() );
//华 燕
//console.log('华'>'燕');
//'10a'转成数字 -> NaN
console.log(3>'10a');
console.log(3<'10a')... | true |
9330300aa9bfb3fe8efa6f3c535aa8704ff51bac | JavaScript | stuartcrobinson/cypresstest | /cypress/integration/trash.js | UTF-8 | 56,399 | 2.609375 | 3 | [] | no_license |
//cypress drawback:
//only able to send keys to specific elements
//can't use tab
//no xpath
//opinionated text entry
//parallel runs seems to be a nightmare, if possible at all
////running in parallel isn't just for "speeding up runs", it can be
////critical for ferreting out intermittent errors / rac... | true |
885f3dba5ebf71a094d4c6d32a77efa174f0c9ee | JavaScript | WeTheLivingG/webTip | /js/#02-JavaScript总结.js | UTF-8 | 22,667 | 3.734375 | 4 | [] | no_license | ———————————————————————————————— ————————————————————————————————
/* 简介及书写规范 */
————————————————————————————————
/* 一、#组成部分 */
/*
1、ECMAScript
2、Dom
3、Bom
*/
————————————————————————————————
/* 二、#语言类型 */
/*
1、脚本语言
2、解释性语言
3、动态语言
4、弱类型语言
5、基于对象的语言
6、非编译性语言
*/
————————————————————————————————
/* 三、#应用场... | true |
4ab2168cfb7210e02a0b50050e76500ace977357 | JavaScript | georgievMilen/thesis-express-server | /server/middleware/userAuthMddlware.js | UTF-8 | 1,094 | 2.578125 | 3 | [
"MIT"
] | permissive | const { model } = require("../models/model");
const bcrypt = require("bcrypt");
const { GET_PW_BY_EMAIL, GET_EMAIL, GET_USERNAME } = require("../constants");
const { credentialIsTaken } = require("../utils/credentialIsFree");
const ApiError = require("../error/ApiError");
async function credetialsNotTaken(req, res, ne... | true |
db80ed94819d6480f5776cda3eb54e2de4efda6c | JavaScript | ujjwalmiraje/ReactTask | /src/container/TodoList.js | UTF-8 | 2,249 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { ShowDetail } from "../Reducer/Action";
import { useDispatch } from "react-redux";
const TodoList = () => {
const dispatch = useDispatch();
const [todo, setTodo] = useState([]);
const [search, setSearch] = useState("");
useEffect(() => {
fetch("... | true |
6ddff317e5c4caf0a9d2a4cc495b760917f22623 | JavaScript | Shiny-Niu-Wu/reactive-user-interfaces | /star-wars/src/PersonDetail.js | UTF-8 | 1,035 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import {Link} from 'react-router-dom';
class PersonDetail extends Component {
constructor(props){
super(props);
this.state={
isLoading: true,
people: {}
}
}
componentDidMount(){
fetch("https://swapi.co/api/people/" + props.match.params.id + "... | true |
787cf6358698e367616a04237f62eeb71fedbb3d | JavaScript | bklopcic/GGJ_2k19 | /js/actors/actor_tools/pointdirectionmover.js | UTF-8 | 1,389 | 2.828125 | 3 | [] | no_license | class PointDirectionMover
{
constructor(actor)
{
this.actor = actor;
this.scene = this.actor.scene;
this.target = null;
}
get pathInProgress()
{
return this.target != null;
}
moveTo(x, y)
{
const size = this.actor.speed/60;
this.target = ... | true |
05cb9eb2737fafd1bb64f456a1faa97ad9730174 | JavaScript | jappelgren/movie-sagas | /src/components/MovieDetails/MovieDetails.js | UTF-8 | 1,947 | 2.84375 | 3 | [] | no_license | import { useEffect } from "react"
import { useDispatch, useSelector } from "react-redux"
import { useHistory, Redirect } from "react-router-dom"
export default function MovieDetails() {
//movieObj is an object... with all the selected movies... data.
//Optional chaining is used to make sure the object has the... | true |
a772e572c0a978cece326de19b5404273b72ca31 | JavaScript | asraraljuhani/Arcade-Game-Project | /js/app.js | UTF-8 | 5,362 | 3.890625 | 4 | [
"MIT"
] | permissive | //create a varible to save the size of the square of the grid size.
let GridSize = 100;
// Enemies our player must avoid
//var Enemy = function() {
function Enemy(x, y) {
// Variables applied to each of our instances go here,
// we've provided one for you to get started
//assign the valuse from the parameter to t... | true |
1ac333cc4ea653e2fcb5dcfdf1724aa7e582f917 | JavaScript | Andrea-Boyd/HW-10-OOP-Template-Engine-Employee-Summary | /Develop/app.js | UTF-8 | 4,363 | 3.109375 | 3 | [] | no_license | const Manager = require("./lib/Manager");
const Engineer = require("./lib/Engineer");
const Intern = require("./lib/Intern");
const inquirer = require("inquirer");
const path = require("path");
const fs = require("fs");
const OUTPUT_DIR = path.resolve(__dirname, "output");
const outputPath = path.join(OUTPUT_DIR, "tea... | true |
969f31054f0cb8fdfcba14735da4cc34c9783604 | JavaScript | tonovarela/flutter-chat-backend | /helpers/jwt.js | UTF-8 | 766 | 2.609375 | 3 | [] | no_license | const jwt = require('jsonwebtoken');
const comprobatJWT =(token='')=>{
try {
const {uid} = jwt.verify(token,process.env.JWT_KEY);
//req.uid = uid;
return [true,uid];
}catch(error){
return [false,null];
}
}
const generarJWT = (uid) => {
r... | true |
07583e1ab195d4c557bdc9e801cd0d386ce2bc0f | JavaScript | rswalm/robin-weather-app | /assets/scripts/simple.js | UTF-8 | 1,714 | 2.78125 | 3 | [] | no_license | function saveEvents9(){
var event9text = $('#eventtext9').val();
localStorage.setItem('event9text',event9text);
console.log(event9text);
}
function saveEvents10(){
var event10text = $('#eventtext10').val();
localStorage.setItem('event10text',event10text);
}
function saveEvents11(){
v... | true |
548df19abddf2de5374088c35c9dfd691c438402 | JavaScript | Slyke/encodeID | /test/basic.js | UTF-8 | 907 | 2.96875 | 3 | [] | no_license | var encodeID = require('..')();
myString = "My URL String";
console.log("Original String: ", myString);
var encodedStringUNICODE = encodeID.encode(myString);
var encodedStringASCII = encodeID.encode(myString, true);
console.log("Encoded as UNICODE: ", encodedStringUNICODE);
console.lo... | true |
95485446403f9b8aca5a485a490ac23c5241fc23 | JavaScript | vivekjain202/Data-structures-practice | /src/LinkedList/singlyLinkedList/SinglyLinkedList.js | UTF-8 | 1,910 | 3.8125 | 4 | [
"MIT"
] | permissive | // LinkedList real life usecase examples https://www.geeksforgeeks.org/applications-of-linked-list-data-structure/
// eslint-disable-next-line
export class Node {
constructor(value) {
this.value = value;
this.next = null;
}
}
export class LinkedList {
constructor() {
this.head = null;
this.tail =... | true |
2a64b26049bdefc45df5ba3501a750db9d2031ec | JavaScript | adiatomei/web_dev_projects | /object_app/index.js | UTF-8 | 1,756 | 3.21875 | 3 | [] | no_license | $(function() {
$(".submit").on("click", function() {
let nameUser = $("#name").val();
let ageUser = $("#age").val();
let profesionUser = $("#occupation").val();
let countryUser = $("#country").val();
function User(name, age, profesion, country) {
this.name = name;
this.age = ... | true |
80afbcea81efb5b9295371b5f47857bf016f1fb0 | JavaScript | Ryan-Diff/todo-fe | /src/TodoListPage.js | UTF-8 | 3,031 | 2.828125 | 3 | [] | no_license | import React from 'react';
import { fetchTodos, deleteTodo, createTodo, updateTodo } from './TodoApi.js';
class ListPage extends React.Component {
state = {
todos: []
}
componentDidMount = async () => {
if (!this.props.token) {
this.props.history.push('/login');
} else {
... | true |
169416352ba67ed766e78a7f86700df9386a6215 | JavaScript | 6omedia/mylocal | /public/js/listings/listing.js | UTF-8 | 5,300 | 2.515625 | 3 | [] | no_license | (function(YeahAutocomplete, ImageLibrary, Form, listingModel, utils){
/* VARS & FUNCS ===========================================*/
var form = new Form('/api/listings/add', listingModel.formArray);
var formUpdate = new Form('/api/listings/update', listingModel.formArray);
var msgBox = new utils.Message();
var cu... | true |
d81270f65c1ddafbe0eceb44c123bbdc2d29cb13 | JavaScript | kiransainath2163/NodeJs | /NodeJsBootInClassTraining/RestExpress1/index.js | UTF-8 | 1,124 | 2.59375 | 3 | [] | no_license | const express = require('express')
const cars = require('./store')
const app = express()
app.use(express.json())
app.listen(3000,()=>{
console.log("Server is Running")
})
app.get('/',(req,res)=>{
res.send('<h3>Rest API demo</h3>')
})
app.get('/cars',(req,res)=>{
res.json(cars)
})
app.delete('/cars/:id',... | true |
7f60528a6dbc5eab8403a13fef4eea5c24873998 | JavaScript | DrSzav/tonepoems | /subcollider-master/src/lib/histo.js | UTF-8 | 952 | 2.515625 | 3 | [
"MIT"
] | permissive | sc.define("histo", {
Array: function(steps, min, max) {
var freqs, freqIndex, lastIndex, stepSize, outliers = 0;
var i, imax;
steps = steps === void 0 ? 100 : steps;
min = min === void 0 ? this.minItem() : min;
max = max === void 0 ? this.maxItem() : max;
freqs = Array.fill(steps, 0);
... | true |
d4b864a3a7855fa1b96061a6c1ebbb1e17b0623e | JavaScript | goharabrahamyan77/hojsin-web | /assets/src/scripts/parts/fullPgaeScroll.js | UTF-8 | 4,263 | 2.8125 | 3 | [] | no_license | /* eslint-disable no-undef */
/**
* Get offset of an element
*
* @param {HTMLElement} element
*
* @returns {{top: number, left: number}}
*/
function elGetDocumentOffset(element) {
if (!element) {
return {
top: 0,
left: 0,
};
}
const elementBox = element.getBoun... | true |
c067bea58733ae4792efbbc15b35c803483ba499 | JavaScript | jeisonrengifo/todo-app-react | /todo-app/src/components/todo/TodoListComponent.jsx | UTF-8 | 3,671 | 2.59375 | 3 | [] | no_license | import React,{Component} from 'react'
import moment from 'moment'
import TodoDataService from '../../api/todo/todoDataService.js'
import './AuthenticationService.js'
import AuthenticationService from './AuthenticationService.js'
import todoDataService from '../../api/todo/todoDataService.js'
class TodoListComponent ex... | true |
4c51f3866087aac8ae7d4245db8b0448f22ba798 | JavaScript | SpitzM02/final-project | /routes/index.js | UTF-8 | 2,008 | 2.71875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const Coaster = require('../models/Coaster');
const Manufacturer = require('../models/Manufacturer');
//code for the home page
router.get('/',(req,res)=>{
//Sequelize Implementation
Coaster.findAll()
.then((coaster) => {
console.log(coaster... | true |
9f0bbff606244ecc5c1848ef9c21e3d7a31a289a | JavaScript | w12190/redux-microblog | /src/homepage/TitleList.js | UTF-8 | 1,465 | 2.921875 | 3 | [] | no_license | import React, {useEffect} from 'react'
import TitleCard from './TitleCard'
import { useSelector, useDispatch, shallowEqual } from "react-redux";
import { getTitlesFromAPI } from "../actionCreators";
/** TitleList: Displays cards containing the title and the description
* of a post.
*
* STORE:
* posts: An o... | true |
4f4ccbc6a68b868da726a57e9a3d869ab6f7bcb5 | JavaScript | PeckZeg/easy-peasy | /src/__tests__/memo.test.js | UTF-8 | 560 | 2.9375 | 3 | [
"MIT"
] | permissive | import { memo } from '../index';
it('should memoize according to the cache size limit', () => {
// arrange
let fnHit = 0;
const memoized = memo((firstName, lastName) => {
fnHit += 1;
return `${firstName} ${lastName}`;
}, 2);
// act
memoized('Bob', 'Poppins');
// assert
expect(fnHit).toBe(1);
... | true |
aaeb6c402dd72fa1025aa7f215198c7c67d4974b | JavaScript | ParisKoutsoftides/react-bootstrap | /client/src/pages/AddProperty.js | UTF-8 | 3,889 | 2.625 | 3 | [] | no_license | import React, {Component} from 'react';
import Form from 'react-bootstrap/Form';
import Button from 'react-bootstrap/Button';
import Col from 'react-bootstrap/Col';
import Row from 'react-bootstrap/Row';
class AddProperty extends Component {
constructor(props) {
super(props);
this.state = {
ti... | true |
b303b5aa5d9ec3b3772eb72267f6667cc8447758 | JavaScript | michelle0606/expense-traker-sequelize | /public/javascripts/checkInput.js | UTF-8 | 880 | 2.78125 | 3 | [] | no_license | const form = document.querySelector('.new_page')
const category = document.getElementById('category')
const categoryFeedback = document.querySelector('#category~.invalid-feedback')
const amount = document.getElementById('amount')
const amountFeedback = document.querySelector('#amount~.invalid-feedback')
form.addEventL... | true |
224a0adfd9319e6a5beb7747a835342decd73802 | JavaScript | srijan-singh/CodeChef | /Beginner/Sum Of Digits (FLOW006)/sumofdigits.js | UTF-8 | 520 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | process.stdin.resume();
process.stdin.setEncoding('utf8');
let data = "";
process.stdin.on('data', function(chunk) {
data += chunk.toString();
});
process.stdin.on('end', function() {
runTestCases();
});
function runTestCases() {
let lines = data.split("\n");
for(let i = 1; i <= lines[0]; i++) {
... | true |
bf4b499e0cc824898ea4ecc1d078da2c427e0a46 | JavaScript | AJ727/expensify-app | /src/playground/redux-101.js | UTF-8 | 1,870 | 3.734375 | 4 | [
"MIT"
] | permissive | import {createStore} from 'redux';
// Action Generators - functions that return action objects
// Implicitly returns increment (no return statement needed)
const add = ({a, b}, c) => {
return a + b +c;
}
//console.log(add({a: 1, b:12}, 100))
// incrementBy's default is 1, and if it doesn't exist set it to an empt... | true |
8010fd981dc5049460bf760ddcd4ad27f8b45d02 | JavaScript | kmulqueen/figma-to-code-project3 | /script.js | UTF-8 | 336 | 2.765625 | 3 | [] | no_license | const nav = document.querySelector("nav");
const menu = document.querySelector(".menu-button");
const backButton = document.querySelector(".back-button");
menu.addEventListener("click", () => {
nav.style.transform = "translateX(0%)";
});
backButton.addEventListener("click", () => {
nav.style.transform = "translat... | true |
98cc2356ee5dedc46ae85703df6a3261082b2274 | JavaScript | helloitjase/recast.ly | /src/components/App.jsx | UTF-8 | 2,383 | 2.78125 | 3 | [] | no_license | import exampleVideoData from '../data/exampleVideoData.js';
import VideoPlayer from '../components/VideoPlayer.js';
import Search from '../components/Search.js';
import VideoList from '../components/VideoList.js';
import YOUTUBE_API_KEY from '../config/youtube.js';
import searchYouTube from '../lib/searchYouTube.js';
... | true |
aef4b934e38116b454d4b8bb6057e11bff233987 | JavaScript | dowsun/delite | /tests/Stateful.js | UTF-8 | 8,144 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | define([
"intern!object",
"intern/chai!assert",
"../Stateful",
"dcl/dcl"
], function (registerSuite, assert, Stateful, dcl) {
registerSuite({
name: "Stateful",
"getSetWatch" : function () {
var clz = dcl(Stateful, {
foo: 3
}),
s = new clz;
assert.deepEqual(3, s.foo);
var watching = s.watc... | true |
9083e2cef6d6cbb2770647958df64a7856d87bef | JavaScript | CicyChan/sinonTest | /Sinon.Example/WebContent/05_FakeServer/FakeServeTest.js | UTF-8 | 662 | 2.609375 | 3 | [] | no_license |
var server;
QUnit.module( "Sinon.Example.05_FakeServer", {
beforeEach: function( assert ) {
server = sinon.fakeServer.create()
},
afterEach: function( assert ) {
server.restore();
}
});
QUnit.test( "calls callback with deserialized data", function( assert ) {
var callback = sinon.spy(... | true |
fcda108b1f604d8c29688ffb3e3069009a8bb8ce | JavaScript | msoelch/deep-blobby | /node/lib/Gamelogic.js | UTF-8 | 2,446 | 2.984375 | 3 | [] | no_license | /**
* @author: Daniel Knobe
* @copyright: Daniel Knobe
*/
// Ruleset Variables
var leftScore = 0;
var rightScore = 0;
var squishLeft = 0;
var squishRight = 0;
var leftHitcount = 0;
var rightHitcount = 0;
var servingPlayer = -1;
var playerwin = -1;
ballDown = false;
function resetRulevars()
{
leftScore = 0;
... | true |
5c7abfd6de9b0f7a83c73b89fae0677a912415d0 | JavaScript | NanoJoy/CaterpillarGame | /src/things/Spikes.js | UTF-8 | 2,306 | 2.9375 | 3 | [] | no_license | function Spikes(game, x, y, key, type) {
var snail = game.snail;
var spikeStates = {
ON: 1,
OFF: 2
};
var spikeTypes = {
STATIC: "STATIC",
START_ON: "START_ON",
START_OFF: "START_OFF"
};
var rate = 60;
var changeCounter = rate;
this.sprite = game.g... | true |
2948ee22bd240e162b045b754f0fd5476d9f401b | JavaScript | BrennenLowe/Flashcard-Generator | /mainBasicCard.js | UTF-8 | 711 | 3.328125 | 3 | [] | no_license | var BasicCard = require("./BasicCard.js");
// basic card
var firstPresident = new BasicCard(
"Who was the first president of the United States?", "George Washington");
var threePointersBasic = new BasicCard(
"Who holds the NBA record for most 3-pointers in a single season?", "Stephen Curry");
var winsRecordBas... | true |
51d3d0ebb47d7de0e4435fed28e578306e105d77 | JavaScript | thisistaimur/Course | /02-Programming-Basics/2020-10-28-Nesting-Datastructures/demo/live-demo-arrays.js | UTF-8 | 1,208 | 4.21875 | 4 | [] | no_license | console.log("\n*** nesting arrays ***\n");
console.log('starting from a 1-dimensional (1d) array:')
let arr1 = [10, 20, 30];
console.log(arr1);
console.log('introducing a 2d array:')
let arr2 = [
[10, 20, 30],
[11, 21, 31]
]
console.log(arr2);
console.log('and finally a 3d array:')
let arr3 = [
[
[10, 20, 30],... | true |
6a01e48a19803cbaec27de0025e71dd5091cf94f | JavaScript | JustMarriedTeam/JustMarriedClient | /src/main/core/grid.js | UTF-8 | 1,119 | 2.59375 | 3 | [] | no_license | import { transform } from 'lodash/fp/object';
export const gridTypes = ['lg', 'md', 'sm', 'xs'];
export const gridMeta = {
lg: {
minWidth: 1200 - 1,
cols: 5,
},
md: {
minWidth: 996 - 1,
cols: 4,
},
sm: {
minWidth: 768 - 1,
cols: 2,
},
xs: {
minWidth: 420 - 1,
cols: 1,
},... | true |
3c713e84cabc752499b2abd5de9c15f255c6a124 | JavaScript | 2020ChessKing/EZAddress-1 | /sketch.js | UTF-8 | 1,716 | 2.796875 | 3 | [] | no_license | var headImage;
var nextSpi;
function setup()
{
createCanvas(350, 700);
sprite1 = createSprite(175, 107, 342, 213);
SignUpSpi = createSprite(175, 300, 121.5, 62.5);
LoginSpi = createSprite(175, 400, 121.5, 62.5);
nextSpi = createSprite(1000000000, 400, 100, 30);
pointer = createSprite(mouseX, ... | true |
05a6e374939cd53c02a5f426aecd7bd214503baa | JavaScript | thrawn01/learn-lift | /src/main/webapp/static/list-view.js | UTF-8 | 1,850 | 3.171875 | 3 | [] | no_license | /*
Get the pixel 'row height' (or predefine)
Divide the viewport height by 2 to get the 'center of the viewport'
Divide the viewport height by 4 to get the scroll 'threshold'
Divide the 'row height' by the 'viewport height' plus the 'threshold' then divide by 'row height' to get the number of loadable row... | true |
3b474d8ad7f5c4cec43e956146d9904db51d0f7f | JavaScript | sivakusayan/eovis | /constants/PRECISION.js | UTF-8 | 555 | 2.734375 | 3 | [] | no_license | /**
* @fileoverview Holds the value that determines number of decimal places that we
* round coordinates to. We round the event coordinates to exchange unnecessary
* precision for performance.
*
* According to the discussion at https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longit... | true |
f39ca2fcb4fbe2ef1952df27bc8af1df8f76f815 | JavaScript | mbw3641193/node-learning | /stream--write.js | UTF-8 | 967 | 3.515625 | 4 | [] | no_license | // 流:可以解决 readFile 读取大文件,内存溢出的问题。流 是 边读边写,不会一直读
//分为 可读流 可写流
let fs = require('fs');
let ws = fs.createWriteStream('test/writeStream.txt'); //默认可写流,默认要占用16k内存。
//一共有两个方法:write end
ws.write('1'); //写数据,只能放字符串类型,或者buffer类型
ws.write('2');
let flag = ws.write('3',()=>{ //该方法是异步方法,并且有返回值:boolean类型--
console.log... | true |
a2c1454cb1f1e0c10082618e487b3a0c72083b11 | JavaScript | noormushtaq/bmi-Calculator | /src/Button.js | UTF-8 | 335 | 2.8125 | 3 | [] | no_license | import React from 'react';
function Button(props){
console.log(props);
let [clicks,setClicks]=React.useState(0);
function handle(){
setClicks(clicks+1);
}
return(
<button onClick={handle} >Clicked {clicks} {props.thing} times
</button>
)
}
export d... | true |
13d6211a46280c38e1c34bb18f15f15ad198f396 | JavaScript | huangbozhi/js_fullStack | /node/koa-template/blog.js | UTF-8 | 1,230 | 2.671875 | 3 | [] | no_license | const Koa = require('koa')
const views = require('koa-views')
const path = require('path')
const app = new Koa()
// ejs 提供了转 html 的中间件
// 模板引擎在哪个位置
app.use(
views(
path.join(__dirname, './view'), {
extension: 'ejs',
}
)
)
const user = {
name: 'asdfghjkl',
post: [
{ id: 0, tit... | true |
2af58bdf28c12ef784ea773e0d248dc8f993bdc5 | JavaScript | legend911/free-code-camp | /Bonfire/Confirm_The_Ending.js | UTF-8 | 746 | 4.0625 | 4 | [] | no_license | function end(str, target) {
// make the string into an array on a different variable
var myArray = str.split(" ");
// if the array is longer than one I will do this special section
if (myArray.length > 1) {
// if the last string in this array is equal to the target return true
if (myArray[myArray.len... | true |
56e1135151f31306dcdac7c0ec7b7a3a30585591 | JavaScript | AJ3005/AJ3005.github.io | /lesson11/js/townevent.js | UTF-8 | 789 | 3.1875 | 3 | [] | no_license | const requestURL = "https://byui-cit230.github.io/weather/data/towndata.json";
fetch(requestURL)
.then(function (response) {
return response.json();
})
.then(function (jsonObject) {
const town = jsonObject["towns"];
//Filters then Town Name from the townName variable found on the weatherapi.js file
... | true |
929bbadf0dfbe303d973d35570340e397882d454 | JavaScript | NuuDel107/Minecraft-Pixel-Art-Builder | /src/command-parser/rectangleDetect.js | UTF-8 | 2,102 | 2.953125 | 3 | [
"MIT"
] | permissive | module.exports = {
detect : function(mat) {
// CREDIT: https://stackoverflow.com/a/54762668
const W = mat[0].length;
const H = mat.length;
// get the area covered by rectangles
let totalRectArea = 0;
for (let i = 0; i < W; ++i) {
for (let j = 0... | true |
537ee23fd2480b2e4b22348955298cbf9c28661b | JavaScript | FernandaM27/Aprendiendo-JavaScript | /Leccion09/herencia.js | UTF-8 | 4,081 | 4.28125 | 4 | [] | no_license | class Persona{
// ATRIBUTOS ESTATICOS
// atributo que se asocia con la clase y no con los objetos
static contadorPersonas = 0; // atributo de la clase
// metodo estatico para leer una variable estatica / variable de solo lectura
static get MAX_OBJ(){
return 5;
}
// email = 'Valor... | true |
671ee0f657cf0bf17a9730d159a3f5ec4519ae58 | JavaScript | Gramof0n/socket.io-chat-app | /frontend/src/App.js | UTF-8 | 704 | 2.546875 | 3 | [] | no_license | import { useState } from "react";
import "./App.css";
import Chat from "./components/chat";
import Login from "./components/login";
function App() {
const [username, setUsername] = useState("");
const [room, setRoom] = useState("");
const join = (username, room) => {
setUsername(username);
setRoom(room)... | true |
396b90c2422b4b42a0205bf518ec3c86e9a9920c | JavaScript | bgoonz/UsefulResourceRepo2.0 | /_ORGS/NPM/read/test/many.js | UTF-8 | 2,460 | 2.578125 | 3 | [
"MIT"
] | permissive | var read = require('../lib/read.js')
var CLOSE = 'close'
if (process.version.match(/^v0\.6/)) {
CLOSE = 'exit'
}
if (process.argv[2] === 'child') {
return child()
}
var tap = require('tap')
var spawn = require('child_process').spawn
function child () {
read({prompt:'1'}, function (er, r1) {if (er) throw er
r... | true |
7d6439b60b66c39d98800a0c0ecfffd0ccacd3f2 | JavaScript | Efryed/AnimeDashboard | /public/js/charts.js | UTF-8 | 2,398 | 3.0625 | 3 | [
"MIT"
] | permissive |
var myChart;
var chart2;
function cargarTitulo(){
if(f1.value == '' || f2.value == ''){
getTitulos(null,updateTitulos);
}else{
getTitulos([f1.value,f2.value],updateTitulos);
}
}
const getGeneros = (loadC)=>{
fetch('http://localhost:3000/api/generos')
.then(response => response.j... | true |
1fcaf5e83f3db9f37392d4729d10f77118b23cdf | JavaScript | shsaci/actualTemplate | /server.js | UTF-8 | 646 | 2.578125 | 3 | [
"MIT"
] | permissive | // server
var express = require('express')
var hbs = require('express-handlebars')
var path = require('path')
var data = require('./views/data')
var PORT = 3000
var app = express()
// res.send method
app.get('/', function (req, res){
res.send('<h1>Hello you!</h1>')
})
// using static content
app.use(express.stat... | true |
9fc24627a6d51cc2dc7c13867204a5ab0570c434 | JavaScript | zurek-piotr/localvideoplayer | /lvplayer/UIElements/PlayerVolumeRange.js | UTF-8 | 599 | 2.625 | 3 | [] | no_license | export class PlayerVolumeRange {
constructor() {
this.DOM = this.createDOMElement();
}
createDOMElement() {
const playerVolumeRange = document.createElement('input');
playerVolumeRange.setAttribute('class', 'lvplayer__volumeRange');
playerVolumeRange.setAttribute('... | true |
aecd9d59d101a1bb356957701c91e6cea8202000 | JavaScript | erikaleon/fewd-36 | /ceremony-bar/js/navbar-contact.js | UTF-8 | 385 | 2.609375 | 3 | [
"MIT"
] | permissive |
var landing = document.querySelector("#contact-landing");
var navbar = document.querySelector(".navbar-default");
var content = document.querySelector(".contact-content");
window.addEventListener("scroll", changeNav)
function changeNav(e) {
if ($(window).scrollTop() > 570) {
navbar.classList.add("navbar-floating"... | true |
7c7de256cf731a9ba157c61caf3afce6749b583d | JavaScript | jiayiwulala/RideShare-Comparison | /fareComparison/static/js/autocomplete.js | UTF-8 | 2,538 | 2.78125 | 3 | [] | no_license | function GetDynamicTextBox(count) {
"use strict";
return '<div class="form-group"><div class="col-xs-10 col-sm-8 col-sm-offset-3"><input type="text" class="form-control" id="vialocation' + count + '" name="vialocation" placeholder="via Location" onchange="validateData(this)"></div><div class="col-xs-1"><a id="re... | true |
4164227d622ff0b757fbd5babdb40e8799500f56 | JavaScript | lucassalazar/js-esnext | /3-revisao.js | UTF-8 | 851 | 4.84375 | 5 | [] | no_license | // ES8 (2017): Object.values/Object.entries
const obj = { a: 1, b: 2, c: 3 };
console.log(Object.values(obj)); // [ 1, 2, 3 ]
console.log(Object.entries(obj)); // [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ] ]
// ES6: Melhorias na Notação Literal
const nome = 'Carla'
const pessoa = {
nome, // Não é necessário mais colocar... | true |
405e7983f1200e518683cfbb108794c89bba4f55 | JavaScript | osdiab/anki-chinese-measure-words | /index.js | UTF-8 | 7,814 | 2.984375 | 3 | [
"MIT"
] | permissive | const yargs = require("yargs");
const parseCsv = require("csv-parse/lib/sync"); // use sync for simplicity
const stringifyCsv = require("csv-stringify/lib/sync");
const process = require("process");
const fs = require("fs");
const path = require("path");
const chalk = require("chalk");
function getConsoleArgs() {
co... | true |
1ff888943bb89994cc1cd9bed82ef1ec86bad7cd | JavaScript | firstkiadityaf12/Praktikum_DasarJavascript | /Praktikum1-no3.js | UTF-8 | 529 | 3.21875 | 3 | [] | no_license | let bbadan = 90; // satuan kg
let tbadan = 1.7; // satuan meter cm => m
let hitung = bbadan / (Math.pow(tbadan,2));
//bentuk ifelse
if (hitung <= 18.5) {
console.log( "Kekurangan berat badan : ", hitung);
} else if (hitung >= 18.5 && hitung <= 24.9){
console.log("Normal(Ideal) : ", hitung);
}... | true |
eec1210cfb357f219546adca06fc6d9d81db2715 | JavaScript | yelinlins/kuayuqingqiu | /server.js | UTF-8 | 1,990 | 2.84375 | 3 | [] | no_license | var express = require("express");
var http = require("http");
express()
.use(express.static("www"))
.get("/api",function(req,res){
//console.log("接口被调用了");
//对于跨域请求,浏览器没有直接拒绝,而是发送了这个请求,
//当请求返回时,浏览器会检查本次响应中的
//Access-Control-Allow-Origin字段,确认本次响应的数据
//是否被允许跨域访问,如果允许,则会交给页面的js回调函数
//如果不允许,则报错。
//Acces... | true |
d6997641bd7ef7f4a8c5d44a8dc837714c5778fd | JavaScript | idiotyr/causact | /D3Relazation/diagram/diagram_draft.js | UTF-8 | 1,823 | 2.578125 | 3 | [
"MIT"
] | permissive | var width = 640,
height = 480,
constant = 100;
r2d3.onRender(function(graph, svg, options) {
var force = d3.layout.force()
.size([width, height])
.nodes(graph.nodes)
.links(graph.links);
force.linkDistance(width/4);
var link = svg.selectAll('.link')
.data(graph.links)
.enter().append('l... | true |
303414eaccbad485e1d134235a9aa8ece3dae844 | JavaScript | MNI1996/Visado-1-Servicios-Web | /UNQfy/main.js | UTF-8 | 12,326 | 3.0625 | 3 | [] | no_license |
const fs = require('fs'); // necesitado para guardar/cargar unqfy
const unqmod = require('./unqfy');
// Retorna una instancia de UNQfy. Si existe filename, recupera la instancia desde el archivo.
function getUNQfy(filename) {
let unqfy = new unqmod.UNQfy();
if (fs.existsSync(filename)) {
console.l... | true |
193a8ed17c3ed16047daf834e83d3001669cf7de | JavaScript | Anks1856/Training-Jan-2021 | /Modules/React/Day14-15/Ankur_chovatiya/practices/src/App.js | UTF-8 | 3,520 | 2.953125 | 3 | [] | no_license | import React , { useState , useEffect} from 'react'
import './App.css';
import {v4 as uuid} from 'uuid'
import Alert from './components/Alert'
import ExpenseForm from './components/ExpenseForm';
import ExpenseList from './components/ExpenseList';
const initialExpenses = [
{id:uuid() , charge:"car rante" , amount:15... | true |