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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
db67ae8f9a251de88da52d73a7fede77dfac7511 | JavaScript | H4rryR/ReactWeather | /app/components/About.jsx | UTF-8 | 899 | 2.71875 | 3 | [] | no_license | var React = require('react');
//Stateless Functional Components can be used for Presentational Components.
//ES6 Arrow Functions can be used here to make it even simpler.
var About = (props) => {
return (
<div>
<h1 className="text-center page-title">About</h1>
<p>
This is an application that ... | true |
f75dc52fc05a2a0e65af78c69fc635a3424b80d9 | JavaScript | DaiWang-Lei/React_Deep | /src/Hooks/UseMemo/ChildComponent.jsx | UTF-8 | 556 | 2.703125 | 3 | [] | no_license | import React, { useMemo } from 'react';
function ChildComponent({ name, children }) {
const changeLibai = (name) => {
console.log('看这里,看这里,李白来了');
return `${name},李白来喝酒了`
}
// useMemo 性能优化
// 给useMemo传递第二个参数,参数匹配成功,才会执行前面的函数
const actionLibai = useMemo(() => changeLibai(name), [name]... | true |
705fcf63c21f05ad6c5ab7a33ac4b391a5e57fa5 | JavaScript | aleks3012/To-do-List | /js/script.js | UTF-8 | 3,102 | 3.265625 | 3 | [] | no_license | 'use strict';
// Переменные
let formInput = document.querySelector('.form__input'),
formBtn = document.querySelector('.form__btn'),
todoList = document.querySelector('.todo-list'),
selectFilter = document.querySelector('.select__filter');
// event listeners
formBtn.addEventListener('click', add... | true |
107ddc77334aa3e0c7dbfdb4fb94ab28e5b4ce4d | JavaScript | eaeniko/nikolai_teste | /testeweb/criaMotorista.js | UTF-8 | 1,396 | 3.203125 | 3 | [] | no_license | var btnMotorista = document.querySelector("#btn-motorista");
btnMotorista.addEventListener("click",function(event){
event.preventDefault();
var form = document.querySelector("#adiciona-motorista");
var nome = form.inputNome.value;
var nascimento = form.inputData.value;
var cpf = form.inputCpf.value;
var ferias... | true |
745bb1db934eadd505236369ee463f2c6c172477 | JavaScript | jbryant4/my-team-page | /index.js | UTF-8 | 6,052 | 3.359375 | 3 | [] | no_license | //npms
const inquirer = require("inquirer");
const fs = require('fs');
//classes
const Employee = require("./lib/Employee");
const Manager = require("./lib/Manager");
const Engineer = require("./lib/Engineer");
const Intern = require("./lib/Intern");
//generate functions
const html = require('./src/generateHtml.js');
c... | true |
8d9990894d69916870250ac98ee5b29e78d23c1c | JavaScript | elishaking/django-form | /regform/static/js/custom.js | UTF-8 | 4,997 | 2.734375 | 3 | [
"MIT"
] | permissive | $(document).ready(() => {
$("#div_id_other_health_work").addClass("hide");
$("#div_id_other_other_work").addClass("hide");
$("#div_id_not_baptized").addClass("hide");
$("#id_health_work_5").change(() => {
if($("#id_health_work_5").is(":checked")){
$("#div_id_other_health_work").add... | true |
d61dfe0d496ddff75e2aafc93cb7dc898072315d | JavaScript | jlga94/tesis | /reduce.js | UTF-8 | 751 | 3.25 | 3 | [] | no_license | function reduce(key, values) {
var a = values[0]; // will reduce into here
for (var i=1/*!*/; i < values.length; i++){
var b = values[i]; // will merge 'b' into 'a'
// temp helpers
var delta = a.sum/a.count - b.sum/b.count; // a.mean - b.mean
var weight = (a.count * b.count)/(a... | true |
8efcd4d2092220a6a185b294c219c9886ffbada9 | JavaScript | aniketkumarbelieve/cs-assignments | /intro_to_comp_prog/week1_assignments/202-3-30139527-5503153/sketch.js | UTF-8 | 5,178 | 3 | 3 | [] | no_license | /*
Officer: 5503153
CaseNum: 202-3-30139527-5503153
Case 202 - The case of Bob and Daisy - stage 4
Here’s the final letter from Daisy (aka. Woz). Decode it to uncover the
final details about Woz and Job’s dastardly plan.
Discover the hidden code by commenting out all text commands except
those which produce pink fi... | true |
39f85a8e12f101348ff178b5f29115041de3a8ba | JavaScript | andrewsunglaekim/csvBar | /csvService.js | UTF-8 | 1,098 | 3.125 | 3 | [] | no_license | (function(){
angular
.module('csvBar')
.service('CsvService', ['$http', Callback])
function Callback($http){
let csvData;
let getData = () => {
// request to csv file
let request = $http.get('./random.csv').then((data)=>{
// trim, split, map data to get array of arrays
l... | true |
a8f0125e076db386d09ce19a4d56c526a8e6f3b3 | JavaScript | ryotah/cypress-and-vue-testing-library | /scripts/bulk.js | UTF-8 | 686 | 2.578125 | 3 | [] | no_license | /* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const dist = '__dummy__'
const num = 50
const targetDirctory = process.argv[2]
const targetFile = process.argv[3]
if (!targetDirctory || !targetFile) {
console.error('You need to set arguments')
return
}
// Create the dist dir... | true |
b15a7c58aebb7b0dbe7bd55b0e3523723da6a44d | JavaScript | KevinPozitive/Cert_Keys | /src/main/resources/templates/static/js/maxInputNumbersCrKeys.js | UTF-8 | 197 | 2.765625 | 3 | [] | no_license | document.getElementById('numb').oninput = function () {
if (this.value.length > 5) this.value = this.value.substr(1, 5);
} // в поле можно ввести только 5 символов | true |
cb2800b7ef7e58a1f97eaf36d198ff1cbdbcd2eb | JavaScript | AriaCundick/AriaCundick.github.io | /randomquote/main.js | UTF-8 | 1,716 | 2.875 | 3 | [] | no_license | //Auto play boolean for yt video.
playOnClick = false;
$(document).ready(function() {
//New Quote button
$("#qtBtn").on("click", function() {
if (location.protocol === 'https:')
$("#quoteText").html("Please change your URL protocol to http")
else {
//start the video only once.
if(!playOnClick)
{
... | true |
5c670d42dad348b683d28498a1a47f99c12fbc0e | JavaScript | Ubastic/lintcode | /javascript/0759.time-angle.js | UTF-8 | 316 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* @param h: hours
* @param m: minutes
* @return: angle between hour hand and minute hand at X:Y in a clock
*/
const timeAngle = function (h, m) {
if(h>11){
h -= 12;
}
const mDeg = m*6;
const hDeg = h*30+30*m/60;
const deg = Math.abs(hDeg-mDeg);
return deg>180?360-deg:deg;
}
| true |
6ae7e9de96cb2d352a6c05bed1b0d526320f661c | JavaScript | mivd7/trivia-quiz | /src/store/modules/user.js | UTF-8 | 1,015 | 2.625 | 3 | [] | no_license | const state = {
user: {
name: 'Joep Meloen',
email: 'joep.meloen@euronet.nl',
password: 'joepie!',
level: 1,
lives: 5,
coins: 1000,
loggedIn: false
},
};
const getters = {
currentUser: state => state.user
}
const actions = {
login({commit}, pay... | true |
5df7f67af2ca3c7ce3034c2a9e4fd19f6977bcf3 | JavaScript | isajjadali/js-learning | /lectures/third/includes.js | UTF-8 | 122 | 3.71875 | 4 | [] | no_license | let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
console.log(array[9]); // => 10
console.log(array.includes(9)) // => true
| true |
75fb8b5ff3e08abb51e6311da67ba86a3e0e28cd | JavaScript | sjnair/Output-Analyzer-JS | /loadFile.js | UTF-8 | 8,327 | 3.015625 | 3 | [] | no_license | document.getElementById('file-input').addEventListener('change', readSingleFile, false);
var DATA = {name:"", line:"", pattern:"", state:"", dut:"", lines:"", dutList:""};
function readSingleFile(event) {
var file = event.target.files[0];
if (!file) {
return;
}
var reader = new FileReader();
r... | true |
7c043c475f7ce5cb3ef57512a5bbc4e03e4f3d8d | JavaScript | liuman2/react-study | /dx4s/src/utils/strings.js | UTF-8 | 282 | 2.953125 | 3 | [] | no_license | /* eslint-disable import/prefer-default-export */
/**
* truncate string with '...'
* @param {Number} length
* @param {String} str
* @return {String}
*/
export function truncate(length, str) {
if (str.length <= length) return str;
return `${str.substring(0, length)}...`;
}
| true |
7d9234003c968cadc9b4f30b76f49a524243eb8f | JavaScript | Danil-Danya/Js-3-education-work | /scrips/scripts.js | UTF-8 | 769 | 3.671875 | 4 | [] | no_license | //////////////////////////////////////////////////////////
var a = +prompt("Введите число");
var b = +prompt("Введите второе чило");
var c = 1;
for(let i = 1; i <= b; i++){
c = c * a;
if(i >= b){
console.log(c);
}else if(c <= 0 || isNaN(a) || isNaN(b) || isNaN(a && b) || a == 0 || b == 0 || a &&... | true |
932a5f3d7834828cfc7518573d38efabcf3a7567 | JavaScript | Toka-Dev/book-collection | /src/components/FormValidation.js | UTF-8 | 3,384 | 3.484375 | 3 | [] | no_license | /**
* FormValidation for checking a form
*/
/**
* Useful to check the validity of an input
*
* @param {string} inputString, string to be checked
* @param {number} minLength, min length of the inputString
* @param {number} maxLength, max length of the inputString
* @returns result of the validation
*/
export ... | true |
a3846c7c6f5810abdf52e14dfb5092ebc4bc0e1c | JavaScript | RobertLudwick/InfectiousDiseaseSimulation | /graph.js | UTF-8 | 4,239 | 2.6875 | 3 | [] | no_license | // This file manages the graph displayed on the page
class Graph {
constructor(data, div_id) {
this.graph_div = document.getElementById(div_id)
this.graph_type = "line"
this.graph_line = {shape: "spline"}
this.data = data
this.range = data.sim_period * 1.1
this.domai... | true |
558795caa2a1d4ce0899991d8e9069c921d0093e | JavaScript | maxyeamans/unit-4-game | /assets/javascript/game.js | UTF-8 | 2,616 | 3.6875 | 4 | [
"MIT"
] | permissive | $(document).ready(function () {
// Global variables
var arrCrystalImages = ["assets/images/crystal-1.png", "assets/images/crystal-2.png", "assets/images/crystal-3.png", "assets/images/crystal-4.png"];
var numRandomNumber;
var numCurrentTotal = 0;
var numWins = 0;
var numLosses = 0;
// Add ... | true |
05176a71d355335e75e788fb91167c7a2d07c905 | JavaScript | AlexanderDLe/TypeScript_DataStructuresAndAlgorithms | /build/Graphs/AlienDictionary.js | UTF-8 | 4,206 | 3.34375 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 269. Alien Dictionary
*/
const alienDictionaryRef = (words) => {
const inDegrees = {};
const parents = {};
const sourceMap = new Set();
// Mistake: add all chars to sourceMap first to account for all characters
for (... | true |
5f49be8e251ff7acc9dd0eb05bc4990d13f1208a | JavaScript | nibalizer/polygerrit | /app/scripts/util.js | UTF-8 | 333 | 2.984375 | 3 | [] | no_license | 'use strict';
var util = util || {};
util.parseDate = function(dateStr) {
// Timestamps are given in UTC and have the format
// "'yyyy-mm-dd hh:mm:ss.fffffffff'" where "'ffffffffff'" represents
// nanoseconds.
// Munge the date into an ISO 8061 format and parse that.
return new Date(dateStr.replace(' ', 'T'... | true |
4d7235c57426cce785289eb250c0237864b4affb | JavaScript | Amritesh/poker | /src/utils.js | UTF-8 | 518 | 2.859375 | 3 | [] | no_license | const convertCoords = (coords)=>{
return coords.map(coord=>{
coord[1][0] -= coord[0][0]
coord[1][1] -= coord[0][1]
coord[0][0] *= 100/61;
coord[0][1] *= 100/61;
coord[1][0] *= 100/61;
coord[1][1] *= 100/61;
return { width: Math.round(coord[1][0]), height: Math.round(coord[1][1]), left: Mat... | true |
c97d4a279593e98c087f62aaffd5dbc7f9828907 | JavaScript | ryzokuken/puppeteer-xkcd | /index.js | UTF-8 | 577 | 2.625 | 3 | [
"MIT"
] | permissive | const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
headless: false,
args: [ '--start-fullscreen' ]
});
const hiddenPage = await browser.newPage();
const page = await browser.newPage();
page.setViewport({
width: 1920,
height: 1080,
});
while (tr... | true |
32a76788cfee78864bdd1daea0ef5e85d675cc69 | JavaScript | ATUL-RAJ04/module-4 | /script.js | UTF-8 | 572 | 3.421875 | 3 | [] | no_license | /*
Solution of assignment 4:
Expected output:
Hello Atul
Good Bye Raj
Good Bye Priyam
Good Bye Chhinu
Hello Gaurav
Hello Ravan
Hello Nikita
Hello Sakshi
Hello Nistha
Good Bye Rebati
*/
(function() {
var names = ["Atul", "Raj", "Priyam", "Chhinu", "Gaurav", "Ravan", "Nikita", "Sakshi", "Nistha", "Rebati"];
for ... | true |
72fa31cd20fd70d8cbe6a2cbab3240001ac913a8 | JavaScript | jawindmi/2048 | /main.js | UTF-8 | 5,881 | 3.484375 | 3 | [
"MIT"
] | permissive | // console.log("test");
var gameBoard = [[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]
// make and populate 2-2048
// var value_list = [];
// for (var i = 2; i <= 2048; i=i*2){
// value_list.push("val"+i);
// }
function sameState(array1, array2) {
if (!Array.isArray(array1) && !Array.isArray(array2)... | true |
727f216b4fe0e74d28cc5d0fd038dffda0d6d3d6 | JavaScript | estebanmedina2020/dom-ajax-repo | /js/my-github.js | UTF-8 | 799 | 3.265625 | 3 | [
"MIT"
] | permissive | // Write code here to communicate with Github
fetch("https://api.github.com/users/estebanmedina2020/repos", {
method: "get"
})
.then(function(response) {
return response.json();
})
.then(function(data) {
var reposCountNode = document.querySelector("#repos-count");
reposCountNode.innerText = data.len... | true |
ec22f898d0cca1dafa4a0c58b1825de406764b41 | JavaScript | lex-od/goit-js-hw-07 | /js/task8.js | UTF-8 | 847 | 3.140625 | 3 | [] | no_license | const createBoxes = (amount) => {
let markup = "";
for (let i = 0; i < amount; i++) {
const side = 30 + 10 * i;
markup += `<div style="width: ${side}px; height: ${side}px; background-color: rgb(${rndNum(
256
)}, ${rndNum(256)}, ${rndNum(256)});"></div>`;
}
containerRef.innerHTML = markup;
};... | true |
68676ad469b7737dcca0b56725d1c3e47ad56796 | JavaScript | kennethdnguyen/homework-front-end | /src/index.js | UTF-8 | 6,786 | 2.734375 | 3 | [
"MIT"
] | permissive | import ReactDOM from "react-dom";
import React, { Component } from "react";
import "./index.css";
import App from "./App";
import axios from "axios";
import * as serviceWorker from "./serviceWorker";
import ModalImage from "react-modal-image";
import "./appPage.css";
import "bootstrap/dist/css/bootstrap.min.css";
impor... | true |
c88b1b88992e139fcbceda4c3fcba93e3b99d710 | JavaScript | holalluis/atoms | /atom.js | UTF-8 | 11,635 | 2.875 | 3 | [] | no_license | /*
Classe Atom
depèn de:
- assert */const assert = require('assert'); /*
- Orbitals */const Orbitals = require('./orbitals.js');/*
- Punt */const Punt = require('./punt.js'); /*
*/
class Atom{
constructor(z, n, position){
//PROTONS - nombre zatòmic
this.z=z||0;
assert... | true |
d1f0f7dbbfaf75b261f15d0d780ced655081711d | JavaScript | cpplee/daao | /web/js/bookroom.js | UTF-8 | 2,724 | 2.53125 | 3 | [
"MIT"
] | permissive | $import("rpc.js");
$import("html/form.js");
var memberId;// 会员ID
var roomType;// 房型
var hotelId;// 酒店ID
var MemberBookingRoom;
var livedate;//入住时间
var leavedate;//离开时间
function pageLoad()// 以后可能还需要增加新内容
{
var args = util.getURLArgs();
memberId = args.memberId;
roomType = args.roomType;
hotelId = args.hotelId;
live... | true |
d1598344f801c27868dd6fea1cf5cdbaf74a2b30 | JavaScript | RapidAPI/httpsnippet | /src/targets/swift/nsurlsession.js | UTF-8 | 5,456 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* @description
* HTTP code snippet generator for Swift using NSURLSession.
*
* @author
* @thibaultCha
*
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
*/
'use strict'
const helpers = require('./helpers')
const CodeBuilder = require('../../he... | true |
71189f1d476fa0ea65e760a8e96a1fe0927e197d | JavaScript | Mavuks/ICD0006 | /PRO8/mycntrl.js | UTF-8 | 1,289 | 2.734375 | 3 | [] | no_license | app.controller('myCntrl', function($scope) {
$scope.foods = [{name_est:"XXX", price:"0.0", providers:{0:"daily"}}];
console.log( 'Entering: mounted()');
let req = new XMLHttpRequest( );
console.log('XMLHttpRequest created');
req.onreadystatechange = function() {
console.log( 'inside o... | true |
0da474ab8b7d2a8fba3663ae317f2b6973cf27e4 | JavaScript | abhinavverma-sf/JavaScript-TypeScript-Assignments | /jspractice/thiskeyword.js | UTF-8 | 229 | 3.296875 | 3 | [] | no_license | 'use strict'
console.log(this); // refers to global object
function sum(){
console.log(this);
}
sum();
const myself={
name: 'abhinav',
myfunction: function(){
console.log(this);
}
}
myself.myfunction(); | true |
5616d045ae0adb95c7679367560672c2be0ccba4 | JavaScript | spouk/Siberia | /static/js/spouk_uploader/spouk_uploader.js | UTF-8 | 18,639 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* Created by spouk on 27.03.15.
*/
var FILES = {};
FILES.humanFileSize = function (bytes, si) {
var thresh = si ? 1000 : 1024;
if (bytes < thresh) return bytes + ' B';
var units = si ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
va... | true |
cf31af60f601dfa4650f44a7524f4da03698d08d | JavaScript | binshen/website | /js/map_mobile.js | UTF-8 | 6,183 | 2.546875 | 3 | [] | no_license | // JavaScript Document
$(document).ready(function(){
//加载地图
var point = new BMap.Point(mapX, mapY);
initBigMap("bigmap", point, '公交');
addmapresult('tab-traffic', '公交');
});
//初始化地图
function initBigMap(div, point, condition, housetitle) {
var map = new BMap.Map(div);
window.map = map;
window.point = point;
... | true |
55cbf18ea41493d464786244db9af5e176da0456 | JavaScript | zarly/escalator | /client/src/models/tezis.js | UTF-8 | 732 | 2.640625 | 3 | [] | no_license |
var idCouter = 0;
class TezisModel {
constructor (props={text: ''}) {
this.id = ++idCouter;
this.text = props.text;
this.pos = [];
this.neg = [];
}
addPos (props) {
var newObject = new TezisModel(props);
this.pos.push(newObject);
}
addNeg (props) {
var newObject = new TezisModel(props);
this.ne... | true |
9e41b1f4ab8765e4c02ba11be1929b71120e8941 | JavaScript | umangg21/Javascript | /Problems/Task Scheduler.js | UTF-8 | 1,328 | 3.296875 | 3 | [] | no_license | (() => {
const exampleTask = (name) => new Promise((resove, reject) => {
setTimeout(() => {
try {
console.log("Running Taks " + name + " done.")
// throw RangeError;
resove()
}
catch (e) {
reject(e)
... | true |
60ee641ee123d88c37fbf2416867ee1083c97553 | JavaScript | surazregmy/reactProject | /src/App.js | UTF-8 | 773 | 2.609375 | 3 | [] | no_license | import { useState, useEffect } from "react";
import logo from "./logo.svg";
import "./App.css";
import { Button, DatePicker } from "antd";
function App() {
const [count, setCount] = useState(1);
useEffect(() => {
console.log("I am in UseEffect");
}, [count]);
const decreaseCount = () => {
setCount(pa... | true |
bc709144a495750e23822878d0e48aa3feb06fd4 | JavaScript | Fosna/cd-js-2018 | /BasicJs/025_Escape_Sequences_in_Strings.js | UTF-8 | 692 | 3.984375 | 4 | [] | no_license | // Homework
// Code Output
// \' single quote
// \" double quote
// \\ backslash
// \n newline
// \r carriage return
// \t tab
// \b backspace
// \f form feed
// Assign the following three lines of text into the single variable myStr using escape sequences.
// FirstLine
// \SecondLine\
// ThirdLine
... | true |
69c04dee92ca49b8797a0c263cefc117e9b9ce78 | JavaScript | jennikate/Elf-Adventures | /old-files-for-reference/app-unrefactored.js | UTF-8 | 37,435 | 3.09375 | 3 | [] | no_license | /* eslint-disable brace-style */
function pacnam() {
// ===== CREATE STARTING VALUES =====
const boardWidth = 10
const boardSize = boardWidth ** 2
const playerHome = Math.max(boardSize) - 1
const treasureValue = 1000
const treasureSmallValue = 500
const treasureTinyValue = 100
const treasureMaxValu... | true |
410f855138d995208973e54c55125dd85b2e423d | JavaScript | voctory/vonodosh-public | /commands/coinflip.js | UTF-8 | 512 | 2.609375 | 3 | [] | no_license | module.exports = {
docstring: `Flips a coin, for great profit!`,
usage: prefix => { return `Usage:\n\`${prefix}coinflip\``},
command: function(message) {
var options = ["heads", "tails"];
message.client.functions.message(message, {
description: `You flipped a coin... and it landed on **... | true |
10365373073e55b0b9bec3fa51c103053975aa39 | JavaScript | nicklascschmidt/movie-master | /client/js/search.js | UTF-8 | 5,803 | 3.3125 | 3 | [] | no_license | // All logic for the Search page.
// Scrape button, search input, load watchlist + user rating.
const omdbApiKey = config.OMDB_API_KEY; // for OMDB access
// ------------------------------------------------------------------
// Scrape
// ------------------------------------------------------------------... | true |
48a76b538d4010fedd9ddc77f77c74b105b7e826 | JavaScript | PrinceCEE/frontend_lessons | /first-calc/src/App.js | UTF-8 | 1,931 | 2.84375 | 3 | [] | no_license | import { useState } from 'react';
import "./App.css";
import DisplayContainer from "./components/DisplayContainer";
import Buttons from "./components/Buttons";
import StateContext from "./providers/StateProvider";
const operators = ["*", "%", "+", "/", "-"];
const Calculator = () => {
const [state, setState] = useS... | true |
f52a776ff05a3c527baed36d230ce56e4dd7ae44 | JavaScript | JunlinZhu-Tommy/Blog | /NativeJs/Promise.js | UTF-8 | 1,412 | 3.453125 | 3 | [] | no_license | Promise.prototype.myAll = function (arr) {
return new Promise(function (resolve, reject) {
let finish = 0;
let results = [];
for (let i = 0; i < arr.length; i++) {
if (arr[i] instanceof Promise) {
arr[i].then(
(val) => {
finish++;
results.push(val);
... | true |
0b2f0dad6c37e85561587776c8f2cfe83d3141ca | JavaScript | MarcL/slack-taskbot | /src/taskBot.js | UTF-8 | 3,413 | 2.6875 | 3 | [
"MIT"
] | permissive | import Bot from 'slackbots';
import smb from 'slack-message-builder';
import TaskManager from './taskManager';
const isChatMessage = message =>
message.type === 'message' && Boolean(message.text);
const isChannelConversation = message =>
typeof message.channel === 'string' && message.channel[0] === 'C';
const ... | true |
fcdccb4230910ddc51ad274ec5991914bbc88ade | JavaScript | mtib/boop-custom | /swap_eur_dkk.js | UTF-8 | 500 | 2.90625 | 3 | [] | no_license | /**
{
"api":1,
"name":"Swap EUR and DKK",
"description":"Swaps EUR and DKK values in text.",
"author":"Markus Becker",
"icon":"translation",
"tags":"currency,conversion"
}
**/
function main(state) {
state.text = state.text.replaceAll(/(\d+\.?\d+)\s?(DKK|EUR|€... | true |
1470da669e2274dcbc49c615135c3f6f9976e9bb | JavaScript | laurahailstone/Sandbox | /Javascript/server.js | UTF-8 | 115 | 2.96875 | 3 | [] | no_license | function doubleAmount (amount) {
return amount * 2;
}
const test = doubleAmount(2)
console.log('result', test) | true |
edd2cabfca072295cf0d11665acecb8c11f124f3 | JavaScript | rashadmad/frontend-nanodegree-arcade-game | /js/app.js | UTF-8 | 8,512 | 3.296875 | 3 | [] | no_license | //lane choices for bug postioning
const FIRSTLANESPAWN = 240;
const SECONDLANESPAWN = 160;
const THIRDLANESPAWN = 80;
const COLUMN_X_COORDINATES = [4, 90, 102, 160, 172, 258, 270, 310, 322, 402];
const offScreen = -60;
//bug skins
const blinkySkin = 'images/enemy-bug-blinky.png';
const clydeSkin = 'images/enemy-bug.... | true |
4983507f06d3a443f2e4ea5b68e66be7a068a7a0 | JavaScript | yokonami/remember_primes | /primes.js | UTF-8 | 1,317 | 3.125 | 3 | [] | no_license | function tryans(event) {
var ans = event.data.ans;
var collect = $("#number").data("prime");
var result = (ans && collect) || (!ans && !collect);
if(result == true){
$("#result_toast").text("collect!");
$("#result_toast").css("background-color", "#AAFFAA");
}else{
$("#result... | true |
7899b622c933878a1dab990b348acd7826e34cc9 | JavaScript | mattviy/project2-dani-paolo | /frontend-react/src/components/Shop/ShopForm.js | UTF-8 | 2,574 | 2.703125 | 3 | [] | no_license | /* eslint-disable default-case */
import React, { Component } from "react";
import FormShopDetails from "./FormShopDetails";
import FormEmployeeDetails from "./FormEmployeeDetails";
import FormRepairTypeDetails from "./FormRepairTypeDetails";
import Confirm from "./Confirm";
import Success from "./Success";
class Shop... | true |
7e3000278f40a787251384f095187078ff89b444 | JavaScript | ChenShiru/xiaomi | /es6/18_src/index.js | UTF-8 | 242 | 3.546875 | 4 | [] | no_license | let add = (x,y) =>{
return x+y;
}
console.log(add(1,2));
let xxxxx = 5;
class Person{
constructor(name,age){
this.name = name;
this.age = age;
}
say(){
console.log('我的名字是'+this.name);
}
}
| true |
62c92682f056529ebe42c98a4b915ccb89c8c51b | JavaScript | JessicaNeary/flatme | /src/server/database/index.js | UTF-8 | 7,596 | 2.765625 | 3 | [
"MIT"
] | permissive | const knex = require('./knex')
const bcrypt = require('bcrypt')
const saltRounds = 10
function comparePassword (password, hash) {
return bcrypt.compare(password, hash)
}
/**
*** USER FUNCTIONS
**/
function addUser (user) {
return bcrypt.hash(user.password, saltRounds)
.then(hash => {
return knex('user... | true |
dcfe608cb715bb48e819b0120402aa3c5dd31064 | JavaScript | Bohdan566/JS_Modul_HomeWork | /JS_HomeWork_6.js | UTF-8 | 22,687 | 4.21875 | 4 | [] | no_license |
// - создать массив с 20 числами.
// -- при помощи метода sort и колбека отсортировать массив.
// let array = [32, 12, 23, 45, 4, 5, 2, 1, 455, 67, 87, 43, 90, 54, 233, 333, 3333, 60, 989, 6767];
// let sort_array = array.sort((a, b) => {
// return a - b;
// });
// console.log(array);
// console.log(sort_array... | true |
98cf527a677e208154cfb620a885f375b8c1a700 | JavaScript | msurguy/gifloopcoder | /shapes/arcSegment.js | UTF-8 | 889 | 2.828125 | 3 | [
"MIT"
] | permissive | module.exports = function(){
return {
draw: function(context, t) {
var x = this.getNumber("x", t, 100),
y = this.getNumber("y", t, 100),
radius = this.getNumber("radius", t, 50),
startAngle = this.getNumber("startAngle", t, 0),
endAngle = this.getNumber("endAngle", t, 360);
if(startAngle > end... | true |
f6d12c32f7568c6462a31b2da693efbef5c5282a | JavaScript | patmifsud/sei33-homework | /alec_tauber/week_07/flickr/js/main.js | UTF-8 | 2,561 | 3.046875 | 3 | [] | no_license | console.log("this works");
const showImages = function (results){
console.log(results);
const generateURL = function(p){
return [
'http://farm',
p.farm,
'.static.flickr.com/',
p.server,
'/',
p.id,
'_',
p.secret,
'_q.jpg'
].join('')... | true |
d31eb2dbc0358db1b8bbcb53199bc5659089c84a | JavaScript | Alexisvt/node | /TheFileSystem/The fs Module/watchfiles.js | UTF-8 | 341 | 2.65625 | 3 | [] | no_license | var fs = require('fs');
var path = require('path');
var filePath = path.join(__dirname, 'sampleFile.txt');
fs.watch(filePath, { persistent: true }, function(event, filename) {
if (event === 'rename') {
console.log('The file was renamed/deleted.');
} else if (event === 'change') {
console.log('The file was... | true |
fe78624ae891406bcf3ec1d1e0ed5209f6de2e58 | JavaScript | yiqun/3D-Model-Customizer-App | /scripts/swatches.js | UTF-8 | 1,454 | 2.75 | 3 | [
"MIT"
] | permissive | class SwatchesInit {
createSwatch(colors) {
const TRAY = document.getElementById('js-tray-slide');
for (let [i, color] of colors.entries()) {
let swatch = document.createElement('div');
swatch.classList.add('tray__swatch');
if (color.texture) swatch.style.backgroundImage = "url(" + color.texture + ")"; ... | true |
55b66f07013a7cc7961796dfb04190fbf33ea0d7 | JavaScript | dodger451/tacticrpg | /src/interfaces/dialogs/ButtonDialog.js | UTF-8 | 1,935 | 2.5625 | 3 | [] | no_license |
ButtonDialog = BaseEntity.extend({
//ButtonDialog = MessageDialog.extend({
defaults: {
'entity': null,
'bgEntity': null,
'x':0,
'y':0,
'h':50,
'w':50,
'z':3000,
'text':'ok',
'color':'darkblue',
'font':{ type: 'italic', family: 'Arial', size: '20px', weight: 'bold'}
... | true |
802af63877409da21233e6f52c870755197f26ae | JavaScript | TSergey123/what-to-watch | /project/src/components/film/film-details.jsx | UTF-8 | 1,027 | 2.515625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
function FilmDetails(props) {
const { starring, director, score, level, count, text } = props;
return (
<>
<div className="film-rating">
<div className="film-rating__score">{score}</div>
<p className="film-rating__meta">
... | true |
9ad58088879090b178f28e80a56ede3dfab18866 | JavaScript | salEZY/Coursera-NodeJS | /Week_1/node-examples/index.js | UTF-8 | 589 | 3.5625 | 4 | [] | no_license | const rect = require("./rectangle");
const solveRect = (l, b) => {
console.log(`Solving rectangle with l = ${l} and b = ${b}`);
rect(l, b, (err, rectangle) => {
if (err) {
console.log(`ERROR: ${err.message}`);
} else {
console.log(
`The perimeter for rectangle(${l}, ${b}) is : ${rectan... | true |
2bc946b7e97447dcc81f95fe8148bb510c50a5d1 | JavaScript | megawac/irc-style-parser | /test/test.js | UTF-8 | 7,936 | 2.71875 | 3 | [
"WTFPL"
] | permissive | var $ = require("cheerio");
var _ = require("underscore");
var test = require("prova");
var ircStylize = require("..");
//@Todo add tests to make sure the result contains the same string
function colourise(msg) {
return $.parseHTML(ircStylize(msg));
}
function getText(ele) {
return _.reduce(ele, function(sofa... | true |
6479170882e6488ebd20fa41286f8261c0556f8b | JavaScript | LaraDei/react-playground | /src/state-drills/HelloWorld.js | UTF-8 | 672 | 2.609375 | 3 | [] | no_license | import React from 'react';
class HelloWorld extends React.Component {
state = {
name: 'world',
};
render() {
return (
<div className='HelloWorld'>
<p>Hello, {this.state.name}!</p>
<button onClick={() => this.setState({ name: 'friend' })}>
... | true |
8d3e4ca60c9b653c69c24fbb167bf29e5298b9e4 | JavaScript | AyoubBoudabous/dom-2 | /Dom/javascript.js | UTF-8 | 335 | 2.609375 | 3 | [] | no_license | let plus = document.getElementById("plus")
let minus = document.getElementById("minus")
let qte = document.querySelectorAll("btn btn-primary")
let price = document.getElementById("btn btn-primary")
for (let i = 0; i < plus.length; i++) {
plus[i].addEventListener("click", function() {
qte[i].in... | true |
1b75d6d3b651e2a8aca42014c23d036e2b71fc64 | JavaScript | jarzo/Javascript-Warsztaty | /Warsztaty-Json/json.js | UTF-8 | 365 | 2.859375 | 3 | [] | no_license | 'use strict';
var jsonPracownicy ={
"pracownicy": [{
"firstName": "Krystian",
"lastName": "Dziopa"
}, {
"firstName": "Anna",
"lastName": "Szapiel"
}, {
"firstName": "Piotr",
"lastName": "Żmuda"
}
]};
console.log(jsonPracownicy);
jsonPracownicy.pracownicy.forEach(function(el,i){
console.log("Imię i... | true |
02a7e5a21ace93d8b72f2c12d5f27fba7c38b8d1 | JavaScript | saksham-shah/second-chance | /public/entities/entity.js | UTF-8 | 3,097 | 2.859375 | 3 | [] | no_license | class Entity {
constructor(pos, r, type = 'player', vel = createVector(0, 0)) {
this.pos = pos;
this.vel = vel;
this.acc = null;
this.angle = 0;
this.player = false;
this.type = type;
this.r = r;
this.colour = 255;
this.maxAcc = 0.8;
... | true |
d9f2050b704d70aff66ccc86f9f4036211c01773 | JavaScript | dynamic-drako/materi | /pertemuan-11-es6-async/crud/index.js | UTF-8 | 602 | 2.90625 | 3 | [
"MIT"
] | permissive | let api = "https://5e8e9d60e0e7de001685f875.mockapi.io/todos"
let data = {
todo: "Belajar data"
}
// POST
function postTodo(data){
fetch(api, {
method: "POST",
headers: {'Content-Type' : 'application/json'},
body: JSON.stringify(data)
})
.then(result => result.json())
.then(data => console.log(d... | true |
aba0f731413f17b4bf2848be4fd41a22e33b48c8 | JavaScript | listicos/mallorca | /Template/js/registrar.js | UTF-8 | 1,131 | 2.5625 | 3 | [
"MIT"
] | permissive | var VALIDATE_REGISTER = false;
$(document).ready(function(){
/*$('#register_form').submit(function(ev){
ev.preventDefault();
$('#register_form').validationEngine('attach',{
onValidationComplete: function(form, status){
if(status)... | true |
d029932fd8d694db64ad39c48de06c004a46e46c | JavaScript | HaiBV/haibv.github.io | /gists/leetcode/56.MergeIntervals.js | UTF-8 | 618 | 3.984375 | 4 | [
"CC0-1.0"
] | permissive | /**
* 56. Merge Intervals
* Array, Sorting
*/
/**
* @param {number[][]} intervals
* @return {number[][]}
*/
function merge(intervals) {
if (!intervals.length) return intervals;
intervals.sort((a, b) => (a[0] !== b[0] ? a[0] - b[0] : a[1] - b[1]));
var prev = intervals[0];
var res = [prev];
for (var cur... | true |
3bd158588a787f7b97f6e58eef5d223e82693380 | JavaScript | react-melon/melon-svg-icon | /tools/markdown-it-class.js | UTF-8 | 852 | 2.78125 | 3 | [] | no_license | /**
* @file 给 markdown 的每个元素加上样式名
* @author leon <ludafa@outlook.com>
*/
module.exports = function (md, className) {
let renderer = md.renderer;
let renderAttrs = renderer.renderAttrs;
md.renderer.renderAttrs = function (token) {
if (token.nesting === -1) {
return '';
}
... | true |
b6c26c6b7e5cc441f7a696e0768db686b44d0e38 | JavaScript | muniasamyr/river | /service/DbUtilFunction.js | UTF-8 | 5,469 | 2.578125 | 3 | [] | no_license | var DBUtil = require('../dbUtill');
module.exports.collectionInsert = async function collectionInsert(collection, insertData, meassageNode) {
try {
var connection = new DBUtil();
var status = await connection.insertOne(collection, insertData);
if (status.name !== undefined) {
re... | true |
f50717d43d477cad9207737f75b885705dcbfcdf | JavaScript | arno1989/bargeApp | /client/views/shippingmessages.js | UTF-8 | 687 | 2.609375 | 3 | [] | no_license | Meteor.startup( function () {
getShipMessages();
});
/*******************************************/
/** Get shipping messages every 5 minutes **/
/*******************************************/
Meteor.setInterval(getShipMessages, 300000);
function getShipMessages(){
console.log('getting new ship messages');
//call me... | true |
15505c7ed4ae925a9b5fe9333dae8b8cc95a97e7 | JavaScript | psychologie-online/psm-prototype | /js/cesta.js | UTF-8 | 1,069 | 2.78125 | 3 | [] | no_license | function openMenu(){
$('.wrap, footer, header').addClass('menu-open');
setTimeout(function(){
$('aside.menu').css('z-index', 2000);
}, 300);
}
function closeMenu(){
$('aside.menu').css('z-index', -100);
$('.wrap, footer, header').removeClass('menu-open');
}
$(document).ready(function() {
// (OPEN & CLOSE) SID... | true |
f08648584d11f9f5cb0a663894597738ae217961 | JavaScript | KenFront/leecode | /js/739.js | UTF-8 | 316 | 3 | 3 | [
"MIT"
] | permissive | const dailyTemperatures = (T) => {
if (T.length > 30000 || T.length === 0) {
return []
}
const result = []
const copy = T.slice()
T.forEach((val) => {
copy.shift()
const index = copy.findIndex((t) => t > val) + 1
result.push(index)
})
return result
}
module.exports = dailyTemperatures
| true |
3a6eb61bbeded71f1d3f3dde310106f509ceb77c | JavaScript | taras131/smartHomeStore | /src/redux/alertReducer.test.js | UTF-8 | 836 | 2.53125 | 3 | [] | no_license | import alertReducer, {addAlert, deleteAlert} from "./alertReducer";
let initialState = {
isAlert: false,
alertMessage: ""
};
it(`isAlert should be true`, () => {
let action = addAlert("alert");
let newState = alertReducer(initialState, action)
expect(newState.isAlert).toBe(true);
});
it(`isAlert sh... | true |
b4b7f568b43cd1f3fd7e4632ff742515e64a85e9 | JavaScript | bkimz/js-bouncer | /bouncer.js | UTF-8 | 629 | 3.875 | 4 | [] | no_license | var age = prompt("Enter your age in years!");
if(age < 0){
alert("Error, age can't be negative");
}
else if(age < 18){
alert("You are not old enough to enter our venue!");
}
else if(age === 21){
alert("Go shawty! It's your birthday, we gon' party like It's your birthday!");
}
else if(age < 21){
a... | true |
dc0ae6267d3cfeeb518e8c7ebc1ffeddf388c0a7 | JavaScript | DrDru/rexpaintjs-fork | /index.js | UTF-8 | 16,982 | 3.03125 | 3 | [
"ISC"
] | permissive | /*
* rexpaintjs - Node.js module to load REXPaint sprites
*
* Code style:
* 2 space indents, semicolons to finish lines, camelCase, opening braces on same line
*
* Created by John Villar for the "Ganymede Gate" sci-fi multiplayer roguelike
* Twitter: @johnvillarz
* Telegram: @chiguireitor
*
* Cleaned up by Sh... | true |
1e992c5368270d8636658d5c01423941098cd414 | JavaScript | fffej/codekatas | /Klondike/klondike.js | UTF-8 | 3,024 | 3.578125 | 4 | [
"MIT"
] | permissive | "use strict";
var assert = require('assert');
var Suit = {
Spades: 1,
Diamonds: 2,
Clubs: 3,
Hearts: 4
};
var Stack = function() {
Stack.prototype._cards = [];
Stack.prototype.empty = function() {
return true;
};
Stack.prototype.add = function(card) {
this._cards.push(card);
};
Stack... | true |
67e14c1879971a05db6b68a53e8dc17b35c5a670 | JavaScript | afraefatuaki/EcoTric | /assets/js/counter.js | UTF-8 | 183 | 3.140625 | 3 | [] | no_license | const counter = document.getElementById('counter');
const text = document.getElementById('text');
text.onkeyup = function () {
counter.innerHTML = (this.value.length) + `/800`
}
| true |
a6495e6421110c5263a89aa0537b7c3afb9a7990 | JavaScript | ArturGas/js-functions-lab-bootcamp-prep-000 | /index.js | UTF-8 | 90 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // write your code below!
function sayhappyHolidays() {
console.log('Happy holidays!')
} | true |
301c96814344af65b6ce558e9ad8eb8fa92f803d | JavaScript | ShinjiTanimoto/shirasagi | /spec/fixtures/opendata/test.js | UTF-8 | 333 | 2.5625 | 3 | [
"MIT"
] | permissive | function test() {
var centerPosition = new google.maps.LatLng(35.656956, 139.695518);
var option = {
zoom : 18,
center : centerPosition,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
//地図本体描画
var testmap = new google.maps.Map(document.getElementById("test"), option);
}
test();... | true |
7c5e5f1ff01eecae6c9994794f67290ef4f49beb | JavaScript | khai-learn-electron/pepper-flash-launcher | /app/page/script/src/traverse-elements/prehandles/x-content-image.html-attribute.js | UTF-8 | 423 | 2.515625 | 3 | [
"MIT"
] | permissive |
'use strict'
const ImageElement = require(`${global.__dirname}/lib/html-image.js`)
function main(element) {
const xContentImage = element.getAttribute('x-content-image')
if (!xContentImage) {
return
}
const [src, width, height] = xContentImage.split(';').map(str => str.trim())
const im... | true |
e30ba2e03b6cb2586e121eabd2c40b1dc06da385 | JavaScript | 0r0loo/D.S-Algo | /JavaScript/js200/part2/039.js | UTF-8 | 1,211 | 4.3125 | 4 | [] | no_license | // 039 스코프 이해하기
/*
스코프는 유효 범위로써 변수와 매개변수가 어디까지 유효한지를 나타낸다 예를 들어, 코드에서 a라고 작성했을 떄 a라는 식별자가 어디를 참조할지,
실제 값이 무엇인지를 찾을 때 스코프를 활용하여 찾게 된다.
자바스크립트는 기본적으로 전역과 함수 단위로 스코프를 생성한다. 함수 안에서 선언된 변수는 함수 블록 안에서만 접근이 가능하다.
그리고 전역에 선언한 변수들은 코드 어디에서든 접근이 가능하다.
*/
var a = 10;
console.log(a);
function print() {
var ... | true |
144abdb6cc7ae867640d22a0a857c3cc8224a4cc | JavaScript | lianyuwu/Node.js | /demo1/index.js | UTF-8 | 1,415 | 2.53125 | 3 | [] | no_license | // let fs = require('fs')
// 异步
// fs.readFile('./test.text', (err, data) => {
// console.log(err ? err : data.toString())
// })
// fs.writeFile('test.text', 'good', {flags: 'b'}, (err) => {
// console.log(err)
// })
// let data = fs.readFileSync('./b.text')
// fs.unlinkSync('./a.js')
// const mode = require('./m... | true |
caf8ee8c068fbb0945897657816622ecc41c8ef0 | JavaScript | jorenbroekema/jsnation-budget-list-starter | /index.js | UTF-8 | 762 | 2.59375 | 3 | [] | no_license | import { LitElement, html } from "lit";
class FooComponent extends LitElement {
static get properties() {
return {
counter: {
type: Number,
reflect: true,
},
};
}
constructor() {
super();
this.counter = 0;
}
connectedCallback() {
super.connectedCallback();
... | true |
99e73a21fe07a1d1cb3e16b192af94565e0d9a08 | JavaScript | gunheekim90/movie-react | /src/Reducer/keywordReducer.js | UTF-8 | 470 | 2.78125 | 3 | [] | no_license | export const keywordState = {
input: "",
keyword: [],
};
export const keywordReducer = (state, action) => {
switch (action.type) {
case "CHANGE_INPUT":
return {
input: action.keyword,
keyword: state.keyword,
};
case "KEYWORD_SAVE":
return {
input: keywordState.in... | true |
aabe1a94ffe9c7f3d805ab5823bd98c35f57b262 | JavaScript | vercel/next.js | /examples/with-sentry/pages/_error.tsx | UTF-8 | 1,157 | 2.625 | 3 | [
"MIT"
] | permissive | /**
* This page is loaded by Nextjs:
* - on the server, when data-fetching methods throw or reject
* - on the client, when `getInitialProps` throws or rejects
* - on the client, when a React lifecycle method throws or rejects, and it's
* caught by the built-in Nextjs error boundary
*
* See:
* - https://n... | true |
cfb42e6b18d5d1acade6b2d20188d3b877489442 | JavaScript | DgDamis/school | /PVY/01/js/main.js | UTF-8 | 1,285 | 3.046875 | 3 | [] | no_license | console.log('Funguje to');
console.log(document.getElementById('zahlavi'));
document.getElementById('zahlavi').style.backgroundColor = 'yellow';
/*
document.getElementById('nadpis').innerText = prompt('Zadej text');
document.getElementsByTagName('img')[0].width /= 2;
*/
document.getElementById('nadpis').addEventListe... | true |
3523957edf3f2c59601873de4771895940ed6cee | JavaScript | marthakatharina/DM-GY6063A-Creative-Coding | /week_11/mapping_values/sketch.js | UTF-8 | 212 | 2.8125 | 3 | [
"MIT"
] | permissive | function setup() {
createCanvas(400,400);
textAlign(CENTER);
}
function draw(){
background(255);
var mappedMouse = map(mouseX, 0,width, 0,1);
text("mapped mouse is " + mappedMouse, width/2, height/2);
} | true |
9a45eedc4555aef3940db4aa450c6ba3b1f25c28 | JavaScript | ekalaja/rest-of-fullstack | /viikko6/redux-anecdotes-v2/src/components/AnecdoteList.js | UTF-8 | 1,302 | 2.59375 | 3 | [] | no_license | import React from 'react'
import { anecdoteVote } from './../reducers/anecdoteReducer'
import { notify } from './../reducers/notificationReducer'
import Filter from './Filter'
import { connect } from 'react-redux'
const voteClick = (props, anecdote) => {
return () => {
props.anecdoteVote(anecdote)
props.noti... | true |
88e5d37ca994241270d7b9ddaff88481fa9c367d | JavaScript | deshdeepakyadav/angular-module-controller | /controller.js | UTF-8 | 953 | 2.640625 | 3 | [] | no_license | //Controler defination
var demoApp = angular.module('myapp',[]);
/*Method-1
function myController($scope)
{
$scope.customers=[
{name:'Desh',location:'Delhi'},
{name:'Amit',location:'Pune'},
{name:'Deepak',location:'noida'}
];
};
demoApp.controller('myAppController',myController);*/
/*Method-2*/
d... | true |
26ba2787655f8e0529b955f4255a228652b64872 | JavaScript | krishcdbry/hugosetup | /themes/maglev-theme/static/js/libs/webcomponents/line3.js | UTF-8 | 1,425 | 2.59375 | 3 | [] | no_license |
const datal3 = [{
"date": "03/29/2017 10:00",
"values": [2]
}, {
"date": "03/29/2017 11:00",
"values": [6]
}, {
"date": "03/29/2017 12:00",
"values": [6]
}, {
"date": "03/29/2017 13:00",
"values": [5]
}, {
"date": "03/29/2017 14:00",
"values": [4]
}, {
"date": "03/29/2017 ... | true |
224788a57945503c272fc62a827dd0d3227e2e8c | JavaScript | dingqilong/white-list | /1/93index-SOYAINE.js | UTF-8 | 1,798 | 3.109375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"BSD-3-Clause"
] | permissive |
const inputs = document.querySelectorAll('.controls input');
function handleUpdate() {
const suffix = this.dataset.sizing || ''; // 根据 data-sizing 获取参数的后缀
document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix); // 设置页面 CSS 变量的值
document.getElementById(`code-${this.na... | true |
bdb3cf36bae342451b28132242a593ae19742894 | JavaScript | dakc/merodb | /test/delete.js | UTF-8 | 1,915 | 2.921875 | 3 | [
"MIT"
] | permissive | const assert = require("chai").assert;
const MeroDB = require("../src/merodb");
// check for delete method
describe("deleting documents on a collection", function () {
let myDb = new MeroDB();
myDb.createCollection("user", true);
// create data to be inserted
let userData = [];
userData.pu... | true |
1bac11b082ff01e2e86895e0f1b4b83517e3bc13 | JavaScript | Miyuki-dev1496/Dev20_js_03 | /kadai_03/js/mypage.js | UTF-8 | 3,172 | 2.671875 | 3 | [] | no_license |
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyDtxNslFizrxcdh0g4iTnZeyk7KJaHkN90",
authDomain: "devmypage-681ee.firebaseapp.com",
databaseURL: "https://devmypage-681ee-default-rtdb.firebaseio.com",
projectId: "devmypage-681ee",
storageBucket: "devmypage-681ee.appsp... | true |
a5b14b003d483f27ef619dd5f8d91fa86356c835 | JavaScript | TheStonedTurtle/wise-old-man | /server/src/api/modules/snapshots/snapshot.model.js | UTF-8 | 2,240 | 2.6875 | 3 | [
"MIT"
] | permissive | const { SKILLS, BOSSES, ACTIVITIES, getRankKey, getValueKey } = require('../../constants/metrics');
function buildDynamicSchema(DataTypes) {
const obj = {};
SKILLS.forEach(s => {
obj[getRankKey(s)] = {
type: DataTypes.INTEGER,
defaultValue: -1,
allowNull: false
};
obj[getValueKey(s)]... | true |
87ad43e6da0a1d1fd95413120569b4ac6747c455 | JavaScript | farzammalekzad/guvi_absolute_biginner | /Absolute Biginner/temperature in Celcius/1.js | UTF-8 | 284 | 3.3125 | 3 | [] | no_license |
function plus() {
let A;
A = document.getElementById('input1').value;
if (isNaN(A)) {
alert('your input is wrong');
return false;
}
else {
let F = Number((A * 1.8) + 32)
console.log(F);
alert('temp is ' + F);
}
}
| true |
4e311fd3e61f2a8aab51fe5cc034038c7879bf61 | JavaScript | elenafrontend/layouts | /plan_app/js/scripts.js | UTF-8 | 6,624 | 2.796875 | 3 | [] | no_license | // ----------- variables -----------
let navSublists = document.querySelectorAll(".nav__sublist");
let header = document.querySelector(".section-header");
let burgerBtn = document.querySelector(".menu-icon");
let menuLinks = document.querySelectorAll(".nav__link");
let menuLinksAnchor = document.querySelectorAll(".na... | true |
83b11977978572a8c21d1d0ba4f1a91e9c73a9f1 | JavaScript | Utibe-Ima/payaces | /Public/scripts/home.js | UTF-8 | 788 | 2.828125 | 3 | [] | no_license |
var show__form = document.querySelector('#show-form')
var pop__up = document.querySelector('#pop-up')
var close__btn = document.querySelector('#close-btn')
var hideSectionText = document.querySelector('.section-text')
var hero = document.querySelector(".section-body")
console.log(p... | true |