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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
aa94c3575f9a93f22667bf50fef3acc2033c5d19 | JavaScript | Shawntaria91/KINGSLAND-FULL-STACK | /JS Advanced/ADVANCED STRINGS AND REGEXP/EXERCISE 26/09. JS-Advanced-Strings-and-RegEx-Lab-Resources/02_Find-Ascii-Equivalent/solution.js | UTF-8 | 1,121 | 3.296875 | 3 | [] | no_license | function solve() {
// '<br />74 111 104 110<br />65 100 97 109 115<br />82 111 103 101 114<br />Kingsland '
let resultHTML = document.getElementById('result');
let input = document.getElementById('text').value;
let numbersToLettersArray = [];
let lettersArr = [];
let inputArr = input.split(' ');
for (i ... | true |
e361f4418ace9770dc4b1ff1f573696cc22caa9f | JavaScript | olga-kravchenko/surprise | /js/main.js | UTF-8 | 155 | 2.734375 | 3 | [] | no_license | const animItems = document.querySelector(`.header--subtitle`);
setTimeout(() => {
animItems.classList.add(`active`);
}, 1000)
console.log(animItems)
| true |
d049bb9b999df6324db148509aa69bf0eb9752bc | JavaScript | jgergel/juice-shop | /vagrant/shake.js | UTF-8 | 4,335 | 2.625 | 3 | [
"MIT",
"CC-BY-NC-ND-4.0"
] | permissive | /**
* Original Source: https://github.com/alexgibson/shake.js
* Original Author: Alex Gibson
*/
var table = $(".table");
var hacked = $("<h1 style='padding:10px;color:red;'>All juices are rotten! Go to <a href='http://www.ebay.com'>www.ebay.com</a></h1>").hide();
table.after(hacked);
if (function () {
functi... | true |
3ff21d6d9ac20fa9f64b7e50691945ec82848a3a | JavaScript | lite07/pseudo_enigma | /rotor.js | UTF-8 | 1,218 | 3.640625 | 4 | [] | no_license |
class Rotor
{
constructor(getRotatingString, initialPosition){
this.fixedString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
this.rotatingString = getRotatingString;
this.currentPosition = 0;
//Set Initial Rotor Position;
for(var i = 0; i<initialPosition; i++)
{
this.rotateRotor();
}
}
setPosition(targetPositi... | true |
d0144d4644c98874276445262e3dfac0a78c5d26 | JavaScript | hubertstrk/Zikorons | /js/language.js | UTF-8 | 1,984 | 2.921875 | 3 | [
"MIT"
] | permissive | var _Message_AllFields_De = "Alle Felder müssen ausgefüllt sein.";
var _Message_ValidMail_De = "E-Mail Adresse ungültig.";
var _Message_SuccessfullySend_De = "Ihre Nachricht wurde gesendet.";
var _Message_ErrorSend_De = "Fehler beim Versenden der Nachricht.";
var _Message_SendMessage_De = "Sende Nachrich... | true |
a83bce72ca40b51b8af731e5e737d654e9516b24 | JavaScript | arnabs542/LeetCode-19 | /expressiveWords.js | UTF-8 | 2,486 | 4.03125 | 4 | [] | no_license | /*
Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii".
In these strings like "heeellooo", we have groups of adjacent letters that are all the same: "h", "eee", "ll", "ooo".
For some given string S, a query word is stretchy if it can be made to be equal to S by... | true |
f1e067878ed49c18e0ffc990116db04b169e219c | JavaScript | SzybkiSasza/proxify-class | /examples/es6/permissions/index.js | UTF-8 | 1,452 | 3.09375 | 3 | [] | no_license | /* eslint-disable no-invalid-this */
const proxifyClass = require('../../../es6').proxifyClass;
/**
* Test class for Permissions
*/
class TestClass {
/**
* Simple method to just pass user as an argument
* @param {Object} user Some user context
* @param {Object} invokingUser Invoking u... | true |
72b46514725868e0a52c9c226555abad820272eb | JavaScript | msvalen/MyPrivateLife | /client/__tests__/spec_randompst.js | UTF-8 | 2,368 | 2.59375 | 3 | [] | no_license | /**
* @jest-environment jsdom
*/
const testData = require('./test-random-post.json');
const request = require('supertest');
global.fetch = require('jest-fetch-mock');
let funcs = require('../assets/js/index.js');
const fs = require('fs');
const path = require('path');
const JSDOMEnvironment = require('jest-... | true |
7df2db83fe059b382b85482a12d2e08316eb3b02 | JavaScript | Elylicery/LeetCode-Solutions | /1-100/0098-validate-binary-search-tree/main.js | UTF-8 | 598 | 3.28125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {boolean}
*/
const helper = (roo... | true |
599ba7fa97300d91e4481129bf06e7ff6fd50eae | JavaScript | UniversaBlockchain/U8 | /jssrc/ethereum/signature.js | UTF-8 | 1,925 | 2.734375 | 3 | [] | no_license | const common = require('common.js');
const hash = require('hash.js');
const BN = require('bn.js');
const elliptic = require("elliptic.js");
const secp256k1 = new (elliptic.ec)("secp256k1");
const signaturePrefix = '\x19Ethereum Signed Message:\n';
function splitSignature(signature) {
if (!signature.startsWith("0x... | true |
2fbb741746889d6b1479d895f7a4933c435cdabb | JavaScript | bbva-williamsaguilera/quasar-frontend | /app/scripts/directives/sparkline.js | UTF-8 | 15,109 | 2.578125 | 3 | [] | no_license | 'use strict';
/**
* @ngdoc directive
* @name quasarFrontendApp.directive:sparkline
* @description
* # sparkline
*/
angular.module('quasarFrontendApp')
.directive('sparkline', ['$window', '$timeout', 'd3Service',
function($window, $timeout, d3Service) {
return {
restrict: 'AE',
scope: {
... | true |
ea870663c0b3c118ac873a199a23d1226b38f258 | JavaScript | AnjireddyJeedipally/sagar | /Stand-upMeetingNodeApp/app.js | UTF-8 | 1,334 | 2.578125 | 3 | [] | no_license | /**
* Created by sagakulk on 7/24/2016.
*/
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var notesController = require('./controller/notesController');
mongoose.connect( 'mongodb://dev:password@ds029745.mlab.com:29745/notesdb');
//mongoose.connect( '... | true |
7f99c77bc7b4acf9da4c374ad95ffcece447b0ec | JavaScript | ianbogda/gladys-picotts | /lib/picotts.js | UTF-8 | 2,310 | 2.828125 | 3 | [] | no_license | const config = require('../config.js');
const md5 = require('md5');
const fs = require('fs-extra');
const lame = require('lame');
const wav = require('wav');
const exec = require('child_process').exec;
module.exports = function(sentence, lang){
return new Promise(function(resolve, reject){
var dest = con... | true |
292590eeea45444c9e6c34b1fc416575c92aa79c | JavaScript | miusuncle/miusuncle.github.io | /demos/gomoku/js/main.js | UTF-8 | 11,889 | 2.875 | 3 | [] | no_license | // ================================================
var PLAYERS = Object.create({ 'YOU': 0, 'NPC': 1 });
var FLAGS = Object.create({ 'YOU': 'x', 'NPC': 'o'});
var MESSAGES = Object.create({
'YOUR_FIRST_TURN': '你持黑棋先下',
'YOUR_TURN': '轮到你下了',
'YOU_WIN': '你赢了!',
'NPC_TURN': 'NPC is working out her next step...',
... | true |
c840b32ac0ca16227eb0800bd0f4e01e5fd18d3c | JavaScript | arviesan24/react-training | /src/Countries.js | UTF-8 | 1,893 | 3.078125 | 3 | [] | no_license | import React from 'react';
import CountryDetails from './CountryDetails';
class Countries extends React.Component {
state = {
items: [],
isLoaded: false
}
getAllCountries = () => {
const requestOptions = {
method: 'GET'
};
fetch('http://restcountries.eu/rest/v2/all', requestOptions)
... | true |
bf753ace6b90536f016a8ab898818ca81a3061d0 | JavaScript | reusablejs/reusable | /examples/todomvc-parcel/src/Header.js | UTF-8 | 685 | 2.515625 | 3 | [] | no_license | import React, { useState, useCallback } from "react";
import { useTodos } from './stores/todos.store';
export function Header() {
const { addTodo } = useTodos();
const [value, setValue] = useState('');
const onChange = useCallback(e => setValue(e.target.value), []);
const onKeyDown = useCallback((key) => {
... | true |
53e8de9825c06ac3e8bac20f9eb67062c2077d29 | JavaScript | chajr/RPiAS | /test/lib/bug.js | UTF-8 | 2,454 | 2.53125 | 3 | [] | no_license | let Config = require('../../lib/config');
let Iluminator = require('../../lib/iluminatorNg');
let assert = require('assert');
describe('iluminatorNg bugs', function(){
describe('time calculation', function(){
it('check time calculation when off time less than sunset', function(){
let sunset = n... | true |
b048d7ebe3d761e4df6a8e4e86dc6d1175c9034f | JavaScript | rupamsaini/jsAssignments | /Assignments/grossSalary.js | UTF-8 | 242 | 3.375 | 3 | [] | no_license |
let BS = 45000
let DA = (BS * 30)/100
let HRA = (BS * 10)/100
let tax = (BS * 5)/100
grossSalary = BS + DA + HRA
netSalary = grossSalary - tax
console.log('The Gross Salary is: '+ grossSalary)
console.log('The Net Salary is: '+ netSalary) | true |
8dbdb6ec21b4e21384e9444e752d96bf56084988 | JavaScript | huajiaohuixiang/huajiaohuixiang.github.io | /libs/jdenticon/src/common/configuration.js | UTF-8 | 4,085 | 2.828125 | 3 | [
"MIT"
] | permissive | /**
* Jdenticon
* https://github.com/dmester/jdenticon
* Copyright © Daniel Mester Pirttijärvi
*/
"use strict";
const color = require("../renderer/color");
/**
* Gets the normalized current Jdenticon color configuration. Missing fields have default values.
* @param {Object} jdenticon - The public Jdenticon API ... | true |
ae20050f7f774980df7ef75d9e5c7032c0380c24 | JavaScript | Echoece/MyJavaScriptCodes | /DOM/3 eventListeners.js | UTF-8 | 749 | 3.875 | 4 | [] | no_license | 'use strict'
// check mdn for full event reference
// we can add event listeners with the following way
const head = document.querySelector('h1');
head.addEventListener('mouseenter', e=> alert('hi') );
// another way is to access the event property of the node itself, for example,
head.onmouseenter = ev => alert('Hi... | true |
be7057104251ace08b39696dd5187c47362c873d | JavaScript | limsaehyun/Javascript-Study | /3.3.8.js | UTF-8 | 96 | 3.625 | 4 | [] | no_license | const arr = [1,2,3,4,5];
const arr2 = arr.map(i => i*i); // 배열 제곱
console.log(arr2); | true |
dc04f75d46b34403cbc77e7c25dcee41feea1a3d | JavaScript | JXFFJXIN/demo-moreEffect | /index.js | UTF-8 | 8,163 | 2.78125 | 3 | [] | no_license | //功能分析:要能够加载电影,显示到页面上
//1. 加载电影数据
//2. 把电影数据显示到页面
/**
* 得到某一页的电影数组
* @param {*} page 页码
*/
function getMovies(page, callback) { //callback: 回调函数
//真实的开发中,这里应该使用ajax请求服务器拿取数据
//模拟远程获取电影数据
setTimeout(function () {
if (page > 4) { //比方说,电影一共只有4页
//模拟:没有电影数据
var movies = [];
... | true |
876889d7055f9c23573b5b20b035c1216158d0d5 | JavaScript | CaryTanner/express-practice-members-api | /routes/api/members.js | UTF-8 | 2,150 | 2.90625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const members = require("../../Members.js");
const uuid = require("uuid");
//__ get all members__
//routes here are just / because base path /api/members is specified in app.use
router.get("/", (req, res) => {
res.json(members);
});
//___ get sing... | true |
2ddfd1f12d4fe02278e3209dc73b57b5bad1ca8e | JavaScript | Robersillo/sistemagrafico | /Extras - Realizacion/NosirvePARANADA/SCRIP-GRAF2.js | UTF-8 | 2,875 | 3.078125 | 3 | [
"MIT"
] | permissive |
var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
var barChartData = {
labels : ["SEGUNDO","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],
datasets : [
{
label: "My First dataset",
fillColor : "rgba(20,220,220,0.5)"... | true |
666ee6597e551f7625f08e7add23de4890ef3f10 | JavaScript | bhklab/ORCESTRA | /client/src/components/Documentation/DocAPI/PSetMetadata.js | UTF-8 | 1,668 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | import React, {useState, useEffect} from 'react';
import {ScrollPanel} from 'primereact/scrollpanel';
const PSetMetadata = () => {
const [data, setData] = useState([])
useEffect(() => {
const getData = async () => {
const res = await fetch('/api/pset/10.5281/zenodo.3905461')
co... | true |
c16eea1ce0e393d7087d46fcb8ab5155d8ff85e2 | JavaScript | orifjon9/ReactApp | /src/containers/App.js | UTF-8 | 3,577 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import Persons from '../components/Persons/Persons';
import Cockpit from '../components/Cockpit/Cockpit';
// @ts-ignore
import classes from './App.css';
import withClass from "../hoc/withClass";
import Aux from '../hoc/Auxiliary';
import AuthContext from '../context/auth-contex... | true |
caf721b9789f3f50231c1beefda0b844e08f9b91 | JavaScript | Jarauta1/1M13-Javascript_Bucles | /Ejercicio 12/Ejercicio 12.js | UTF-8 | 219 | 3.484375 | 3 | [] | no_license | let num = window.prompt("Escribe un número de tres dígitos");
let suma = 0
let x = num.length
let cifra
while (x > 0) {
cifra = parseInt(num.substring(x - 1, x))
suma = suma + cifra
x--
}
console.log(suma) | true |
b19df3b249d6b7c4e38b6e21b4c5a799a42f29ba | JavaScript | mohi-uddin-bff/hard-rock | /main.js | UTF-8 | 3,069 | 2.75 | 3 | [] | no_license | const searchSong = 'https://api.lyrics.ovh/suggest/';
const searchLyrics = 'https://api.lyrics.ovh/v1/'
const api = { searchSong, searchLyrics };
function search() {
const titleName = document.getElementById("search-title").value;
... | true |
73bdc7936020d37216e4e2192336f8c3011808e1 | JavaScript | vwt604/json_the_cat- | /breedFetcher.js | UTF-8 | 969 | 3.5 | 4 | [] | no_license | /*
A command line app that allows users to query the cat data dataset from the terminal.
Users can provide any breed name, causing our application to fetch the information from the API and print out a short description of that breed
*/
//Module set up
const request = require('request');
// const fs = require('fs');
... | true |
2891802d7e0d38fa0fc9ad5c9eb4f43892d505df | JavaScript | ali-asnaashari/JavaScript-Practice | /Control Flow/index.js | UTF-8 | 1,599 | 4.1875 | 4 | [] | no_license | /** section1 - If/else */
let hour = 20;
if(hour >=6 && hour < 12){
console.log("Good Morning");
}
else if (hour >= 12 && hour < 18){
console.log("Good Afternoon");
}
else{
console.log("Good Evening");
}
/** Section2 - Switch/case */
let role = 'guest'
switch (role){
case 'guest':
console.l... | true |
d1792f03e293c9e8e57e0d0e4ce5de052df64fab | JavaScript | crystaltaggart/UATReact | /intro_component_state/src/Components/LifecycleExample.jsx | UTF-8 | 1,081 | 3.140625 | 3 | [] | no_license | import React, {Component, Fragment} from "react";
class LifecycleExample extends Component {
state = {count:0};
constructor(props){
//need to call super - otherwise no properties on object are available
super(props);
console.log('constructor called');
this.handleIncrement = this... | true |
6874980b8b27e16e2225ed0d45f7767bf0f8dbbb | JavaScript | tiffhockin/core-interaction | /_archive/spring-2016/_lab/lab12/example_005_arrows_move_window/js/main.js | UTF-8 | 869 | 3.046875 | 3 | [] | no_license | function drawWorld() {
$("#world").css({
width: world_w,
height: world_h,
left: world_x,
top: world_y
});
}
var world_x = -10;
var world_y = -10;
var world_w = 500;
var world_h = 500;
var world_x_speed = 10;
var world_y_speed = 10;
$(document).ready(function() {
drawWorld();
$("#wrapper").click(function... | true |
00c0fba4f9d3854d3b61bdd84f920d21c7df900d | JavaScript | Quartzy0/WebGLSauce | /sauce/worldManager.js | UTF-8 | 6,054 | 2.828125 | 3 | [] | no_license | class World {
constructor(handler, width, height, name, spawnpoint) {
if (typeof(width) === 'number') {
this.handler = handler;
this.gl = handler.gl;
this.tiles = createArray(height, width);
this.entities = [];
this.name = name;
this.gr... | true |
480d209c8a6fb8e7b54920615b59cbfb49e5f222 | JavaScript | Jyoti3594/JavsScript | /JS folder/js querySelector.js | UTF-8 | 502 | 3.28125 | 3 | [] | no_license | //Query Selector: selectsingle
//Query selector All : selects all
//query selector - single element
const result = document.querySelector('#result');
result.style.backgroundColor = 'blue';
const items = document.querySelector('.special');
const lastlitem = document.querySelector('li:last-child');
console.log(lastl... | true |
6d0624818d6d94bc46a8af8e322c380afea5d4b2 | JavaScript | MMRijnsburger/Project-React-Lil-Playlist | /src/containers/SongInput.js | UTF-8 | 3,810 | 2.6875 | 3 | [] | no_license | import React from 'react';
import InputField from '../components/InputField';
import InputSelect from '../components/InputSelect';
import GenreData from '../data/GenreData';
import RatingData from '../data/RatingData';
class SongInput extends React.Component {
constructor(props) {
super(props)
this... | true |
e5b021a34a76d4150284adbc634f81508f5d6a37 | JavaScript | GillianGraceHorton/GTFSapplication | /src/mapScript.js | UTF-8 | 5,113 | 2.546875 | 3 | [] | no_license | var map;
var markers;
var routes;
function initMap() {
var midWest = {lat: 40.105124, lng: -91.142859};
map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: midWest,
styles: [
{elementType: 'geometry', stylers: [{color: '#242f3e'}]},
... | true |
bb41083c39da0efb72ebfe734f550f217e5eff04 | JavaScript | Khyrki/Trybe-exercises | /bloco_24_MongoDB/dia_1_Update_Simples/ex8.mjs | UTF-8 | 186 | 2.625 | 3 | [] | no_license | //Exercício 8 : Utilize o operador $min para alterar o budget para 5 do filme Home Alone .
use('class');
db.movies.update(
{ "title": "Home Alone" },
{ $min: { "budget": 5 } },
);
| true |
08404ad65b25f546960b8f3f9f015ba164d5d67e | JavaScript | Fyum/daily-gratitude | /data-storage/get_month_entries.js | UTF-8 | 2,321 | 2.96875 | 3 | [] | no_license | import { DateTime } from 'luxon';
import getMultiItems from './utils/get_multi_items';
import mapItemsToUi from './mappers/map_db_to_ui_items';
// e.g: [$day_entries_item:01/09/2019, $day_entries_item:02/09/2019, ..., $entry_item:31/09/2019]
const makeKeys = (month, year) => {
const numberOfDays = DateTime.local(par... | true |
16ee0a764d9d53b7ce547756829264af1ae55a78 | JavaScript | eridef/ComIT | /node.js/js/ej74.js | UTF-8 | 447 | 3.34375 | 3 | [] | no_license | /*var numero = 0;
var asterisco = '*';
while (numero<=10 && numero>=0){
console.log(asterisco);
numero++;
asterisco += '**';
}*/
//modo Nico: muestra solo los impares
let linea = 0;
while (linea <= 8){
var cantidadDeCaracteres = 1;
var asterisco = '';
while (cantidadDeCaracteres <= linea &&... | true |
9af7db6c9c4a75629e9bd9ecbca9df0a05d35a95 | JavaScript | imkaruna/js-beatles-loops-lab-v-000 | /beatles.js | UTF-8 | 730 | 3.6875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | 'use strict';
function theBeatlesPlay(musiciansArray, instrumentsArray){
var stringArray = [];
for(var i=0; i< musiciansArray.length; i++){
stringArray.push(musiciansArray[i]+" plays "+ instrumentsArray[i]);
}
return stringArray;
}
function johnLennonFacts() {
var facts = ["He was the last Beatle to lear... | true |
99588880c47fff14a79b2d796ab3635717983332 | JavaScript | SergLam/FirebaseCloudFunctions | /functions/auth/sign_in.js | UTF-8 | 1,649 | 2.515625 | 3 | [] | no_license | const helper = require('../helpers/helper.js');
const create_token = require('./create_token.js');
exports.handler = function(req, res, firestore, app) {
var email = "";
var password = "";
const usersRef = firestore.collection('users');
if (req.body.hasOwnProperty("email")) {
email = req.body.email;
} e... | true |
a6e1579ed36c21fc0886acfa72a1c77d6d11f265 | JavaScript | lgfahys/Bamazon | /bamazonSupervisor.js | UTF-8 | 3,154 | 3.03125 | 3 | [] | no_license | var mysql = require("mysql");
var inquirer = require("inquirer");
var Table = require('cli-table');
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: "wrigley1",
database: "bamazon"
});
connection.connect(function (err) {
if (err) throw err;
... | true |
298894485ff7adb318c0bc3978dd32a31a4aa0e7 | JavaScript | felixweinberger/barq-server | /socket.js | UTF-8 | 2,490 | 2.515625 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-console */
import jwt from 'jsonwebtoken';
import { addToQueue, updateOrderStatus, getOrderStatus } from './models/queues.model';
// key: bar, value: { key: orderNum, value: socket }
const orderBarSockets = {};
const ioConfig = (io) => {
// when anyone connects
io.on('connect', (user) => {
... | true |
3d225a37e0de8a03f820b6d64899ff9ac109d52d | JavaScript | mengbinhao/jack-note | /docs/frontend/Vue/implement/simple-vue/compile.js | UTF-8 | 1,447 | 2.984375 | 3 | [] | no_license | class Compile {
constructor(vm, el) {
this.vm = vm
this.el = document.querySelector(el)
if (this.el) {
let fragment = this.node2Fragment(this.el)
this.compile(fragment, vm)
this.el.appendChild(fragment)
}
}
node2Fragment(el) {
let fragment = document.createDocumentFragment()
let firstChild
whi... | true |
fe84c2b87984a632b0225cad66ff95f5eebe62e5 | JavaScript | gurunglaxman0/AndroidGCM | /index.js | UTF-8 | 1,341 | 2.53125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
'use strict';
var https = require('https');
function GCM(apiKey) {
console.log(apiKey)
if (apiKey) {
this.apiKey = a... | true |
e913209789ad8efd061229d48482cc741f2fda9c | JavaScript | davepagurek/PipeRender | /src/path.js | UTF-8 | 6,361 | 2.859375 | 3 | [] | no_license | class Path {
constructor() {
this.controlPoints = [];
}
push({ point, color, radius }) {
this.controlPoints.push({ point, color, radius });
}
getProjection(point, projection, width, height) {
const p = glMatrix.vec4.fromValues(point[0], point[1], point[2], 1);
glMatrix.vec4.transformMat4(p, ... | true |
1d29763718df5afed1ae0be0fadb8b25a2029102 | JavaScript | thflthdi/CodingTest | /jejucodingtest/210203_codingtest.js | UTF-8 | 1,167 | 3.203125 | 3 | [] | no_license | const goIsland = () => {
//인원 : 정시 25명 10분마다 15명
// 09:00 ~ 20:50
//14000605 // 14000606~7 무조건 같은 배
//1월 1024 2월 512 3월 256 4월 128 5월 64 6월 32 7월 16 8월 8
//9월 4 10월 2일
const standing = 14000605
// const standing = 1200202
const hour = 100
const day = 1200
const year = 2046
co... | true |
5a18a8a3dbf435509d261bd0c934d7196aa1ca8d | JavaScript | vikashupadhyay/compiler | /test/nodeTest.js | UTF-8 | 986 | 2.90625 | 3 | [] | no_license | var assert = require("assert");
var chai = require("chai");
var Node = require("../js/node.js");
describe("node", function () {
it("should create node for number", function () {
var node = Node.createNodeForNumber(2);
chai.expect(node.evaluate()).to.be.equal(2);
});
it("should represent nod... | true |
24052875be928628f8ee680d36af1def59ea9740 | JavaScript | gvozdevua/code-and-magic | /src/reviews/review.js | UTF-8 | 1,160 | 2.78125 | 3 | [] | no_license | /** @fileoverview Поведение элемента отзыва */
'use strict';
var utilities = require('../utilities');
var BaseComponent = require('../base-component');
var getReviewsElement = require('./get-review-element');
/**
* @param {Object} data
* @param {HTMLElement} container
* @constructor
*/
var Review = function(data... | true |
9aa87f2989c6d8cf0109581b3817518ed84fb6d1 | JavaScript | praheja98/household-optimize | /frontenddev/src/components/CreateHousehold.js | UTF-8 | 1,415 | 2.671875 | 3 | [] | no_license | import {Form,Button} from 'react-bootstrap';
import React,{Component} from 'react';
class CreateHousehold extends Component {
constructor(props) {
super(props);
this.state={householdName:''};
this.handleSubmit = this.handleSubmit.bind(this);
this.changeHouseholdName = this.changeHouseholdName.bind(thi... | true |
03b59c45b0368393daffc2c791fbb0dc16db7023 | JavaScript | MarkAYoder/BeagleBoard-exercises | /sensors/sensorTag/recordSensorTag.js | UTF-8 | 4,814 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env node
// This does everything all at once.
var async = require('async');
var SensorTag = require('./index');
var request = require('request');
var fs = require('fs');
var util = require('util');
var filename = "/root/exercises/sensors/sensorTag/keys_sensorTag.json";
var keys = JSON.parse(f... | true |
8c9394e23d7f893b92103c5486ab8c3b0200781a | JavaScript | mwadden/expressionify | /lib/utils.js | UTF-8 | 354 | 2.828125 | 3 | [] | no_license | 'use strict';
exports.isObject = function(object) {
var type = typeof object;
return type === 'function' || type === 'object' && !!object;
};
exports.extend = function(destanation, source) {
for (var key in source) {
destanation[key] = source[key];
}
return destanation;
};
exports.peek = function(array) {
... | true |
f4206908f081c60967a13f7b99699a08840a6577 | JavaScript | emilyjspencer/Data-Visualizations | /Oxfordintake20172019/oxfordcomparison.js | UTF-8 | 1,338 | 2.828125 | 3 | [] | no_license | function showData(data, labels) {
var context = document.getElementById("graph1").getContext('2d');
var chart = new Chart(context, {
type: 'line',
data: {
labels: labels,
datasets: [
{
label: 'Student Intake 2015',
data:... | true |
efb199aa105fdbd599226b57bd6fe65e4d2f3f81 | JavaScript | mlph-pyap/structkit | /src/function/isExact.js | UTF-8 | 1,907 | 3.296875 | 3 | [
"MIT"
] | permissive | import getTypeof from './getTypeof';
import has from './has';
import each from './each';
import indexOf from './indexOf';
import count from './count';
/**
* Is Exact
*
* @since 1.0.1
* @category Seq
* @param {string} objectValue1 The first number in an addition.
* @param {string} objectValue2 The first number in... | true |
67e305f253a3c2614cf96719f7f8a89b7a0eba83 | JavaScript | lorenzogrv/iai-oop | /index.js | UTF-8 | 8,272 | 2.953125 | 3 | [
"BSD-2-Clause"
] | permissive | //
// hardcoded utilities to avoid depending on the whole iai-is module
function isFn( o ){
return Object.prototype.toString.call(o) == "[object Function]";
}
function isObject( o ){
return Object.prototype.toString.call(o) == "[object Object]";
}
//
// Export the standard OOP API constructor bound to itself
// T... | true |
19fe7f9c044a9fc87ef711e252b198daf4cc5ee3 | JavaScript | DarrenWestwood/Coursera-Single-Page-Web-Applications-with-AngularJS | /module3-solution/scripts/app.js | UTF-8 | 2,188 | 2.609375 | 3 | [] | no_license | (function () {
'use strict';
angular.module('NarrowItDownApp', [])
.controller('NarrowItDownController', NarrowItDownController)
.service('MenuSearchService', MenuSearchService)
.directive('foundItems', foundItemsDirective)
.constant('ApiBasePath', "https://davids-restaurant.herokuapp.com");
function foundItemsDirec... | true |
94eeac355fc54cc13f9aa8c3898720a39c14bbb4 | JavaScript | joshkohane/js-beatles-loops-lab-js-apply-000 | /index.js | UTF-8 | 855 | 3.78125 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // add solution here
function theBeatlesPlay(musicians, instruments){
let myArray = []
for(let i = 0; i < musicians.length; i++) {
myArray.push(musicians[i] + ' plays ' + instruments[i])
}
return myArray
}
const facts = [
"He was the last Beatle to learn to drive",
"He was never a vegetarian",
"He wa... | true |
dcbd39ca1120fd15c9248c3096d5debcbd7f1809 | JavaScript | shaunwcolley/assignmentday16 | /orderedarray.js | UTF-8 | 673 | 3.671875 | 4 | [] | no_license | testArray = [3,4,56,7,8,1];
function ascendingSort (array) {
for(let i = 0; i < array.length; i++) {
for(let j =0; j < array.length; j++) {
if(array[i] < array[j]) {
r = array[i];
array[i] = array[j];
array[j] = r;
}
}
}
return array
}
let newArray = ascendingSort(test... | true |
671c2f8c43f89435a025be4ca610e03c23a764d7 | JavaScript | leandredb75/crud-template | /server/src/app.js | UTF-8 | 1,151 | 2.5625 | 3 | [] | no_license | // const express = require("express");
// const app = express();
// require("dotenv").config();
// //Settings
// app.set("port", process.env.PORT || 3000);
// //Middlewares
// app.use(express.json());
// app.use("/", (req, res) => {
// res.send("Hello World form NodeJS express.");
// });
// app.listen(app.get("po... | true |
5c0378fbb3e2d9d42bc5d099e0e86b34e5f50298 | JavaScript | valentine909/HTML-builder | /06-build-page/index.js | UTF-8 | 3,206 | 2.625 | 3 | [
"MIT"
] | permissive | const {createReadStream, createWriteStream} = require('fs');
const {readdir} = require('fs/promises');
const path = require('path');
const {mergeFiles} = require('../05-merge-styles/index');
const {copyFiles} = require('../04-copy-directory/index');
// helper functions
const checkImport = () => {
try {
[mergeFil... | true |
d387b758487903b62455667a32424f39eb983053 | JavaScript | scheung38/unstated-language-filter | /src/containers/SentenceContainer.js | UTF-8 | 457 | 2.71875 | 3 | [] | no_license | import { Container } from 'unstated';
class SentenceContainer extends Container {
state = {
filteredSentence: '',
};
filterSentence = wordlist => e => {
const filteredSentence = e.target.value
.trim()
.split(' ')
.map(word => {
if (wordlist.includes(word.toLowerCase())) {
return '*'.repeat(wo... | true |
7ea4037fd8c33036f77595e010d97dbd77ebb5a2 | JavaScript | misschohoh/react-final-counter | /src/reducers/counter.js | UTF-8 | 834 | 2.984375 | 3 | [] | no_license | const initialState = {
count: 0,
clicked: 0,
newValue:0
};
function counterReducer(state = initialState, action) {
switch (action.type) {
case 'INCREMENT':
return {
...state,
count: state.count + 1,
clicked: state.clicked + 1
};
case 'DECREMENT':
return {
... | true |
2b5c24ef4d78466901cb1cc28474d973dd577ec0 | JavaScript | LukeWen/5etools | /js/filter-bestiary.js | UTF-8 | 21,644 | 2.609375 | 3 | [
"MIT"
] | permissive | "use strict";
class PageFilterBestiary extends PageFilter {
// region static
static sortMonsters (a, b, o) {
if (o.sortBy === "count") return SortUtil.ascSort(a.values.count, b.values.count) || SortUtil.compareListNames(a, b);
switch (o.sortBy) {
case "name": return SortUtil.compareListNames(a, b);
case "t... | true |
c56dbc7e547c6b4fefc3709ede53540499e6610e | JavaScript | roopesh90/rollup | /rollup.js | UTF-8 | 2,172 | 2.5625 | 3 | [] | no_license | var dgram = require('dgram');
var sys = require('sys');
var Collector = require('./lib/collector').Collector;
var RRDWriter = require('./lib/rrdwriter').RRDWriter;
var config = {
udp_port : 8464, // port for UDP server to listen on
bucket_ms : 1000 * 10, // 10s : the data resolution
check_ms : 1000, // 1s : how ... | true |
68278b098f2aaf569ce6412cea2635a05208ce22 | JavaScript | theang/chaudev | /3.0/js/chaudify.js | UTF-8 | 5,464 | 2.578125 | 3 | [
"BSD-2-Clause"
] | permissive | if ("undefined" === typeof(chaudev)) {
var chaudev = {};
chaudev = {
DEFAULT: 0,
defaultDeviceId: null,
deviceIds: [],
lastSetDeviceId: 0,
filename: "chaudify.js: ",
debug: true,
log: function(str, obj) {
if (chaudev.debug) {
if (obj) {
console.l... | true |
217163d76da546bc6c6f9d93fd5c5ac2b98bac5c | JavaScript | VitaliyRakytyansky/js-practice | /lesson-01/task-01.js | UTF-8 | 182 | 3.46875 | 3 | [] | no_license | let name = "Protective Field Generator";
let price = 1000;
console.log(`${name} was chosen, the price for one ${price}`);
price = 2000;
console.log(`${name} was chosen, the price for one ${price}`);
| true |
e8de1e0475ddf0baf2e6b6d9b49378f6ea108ff8 | JavaScript | andreamatt/hackerino | /models/submissions/submissions_POST.js | UTF-8 | 2,810 | 2.515625 | 3 | [
"MIT"
] | permissive | const util = require('../utility');
const sub = require('./submissions');
const students_studentID_GET = require('../students/students_studentID_GET');
const tasks_taskID_GET = require('../tasks/tasks_taskID_GET');
const exams_examID_GET = require('../exams/exams_examID_GET');
const create_submission = sub.create_submi... | true |
6b8c2424415bc85c2a894291081f388fd95926ea | JavaScript | abhijeetiyer/keyboardCode.js | /app.js | UTF-8 | 316 | 3 | 3 | [] | no_license | let keys = document.querySelectorAll('.keys');
let input = document.querySelector('.input');
keys.forEach(function(key){
key.setAttribute('value',key.textContent);
key.addEventListener('click',function(e){
e.preventDefault();
input.value = input.value + this.getAttribute('value');
});
});
| true |
af348c117d0c3026e7819bcdc0f272e0107e4d6e | JavaScript | yashkir/project2 | /models/transaction.js | UTF-8 | 699 | 2.625 | 3 | [] | no_license | var mongoose = require('mongoose')
let entrySchema = new mongoose.Schema({
account: {
type: String,
},
amount: {
type: Number,
},
commodity: String,
});
entrySchema.methods.getFormattedAmount = function() {
if (typeof this.amount !== 'number') {
return '';
}
if (this.amount < 0) {
... | true |
6b42d3bf1659a44266e526ca3e159fdc54652ceb | JavaScript | kolovsam/intro-to-programming-p5.js | /a3-interactive-story/sketches/feed-pacman.js | UTF-8 | 1,931 | 3.90625 | 4 | [] | no_license | //Defines a variable that keeps track of the conditions.
var value = "black";
function draw() {
createCanvas(400, 400);
background(240);
noStroke();
textSize(12);
textAlign(CENTER);
fill(0);
//Instruction
text("Feed your pacman! a = eat left; b = eat right; r = restart", width / 2, 30);
//Various c... | true |
f1a1c65872e4d3bc84734eab475be283b9f1bd73 | JavaScript | foivz/RSC2016-35muskarca | /front/Mladen Tusup/Mladen Tusup/app/petGuard/registration/formDataValidationService.js | UTF-8 | 5,029 | 2.546875 | 3 | [] | no_license | angular.module('mainModule')
.service('formDataValidationService',
['checkPasswordStrengthService', 'bankAccountValidationService',
function (checkPasswordStrengthService, BankAccountValidationService) {
this.isEmailValid = function (emailAdress) {
var re, isValid;
if (!emailAdress) {
... | true |
f620f96842b95ab0a0f4e78c000d8ad90f717eaf | JavaScript | Giruta/Dp-186-Node.js | /lesson_11_CW/main.js | UTF-8 | 2,139 | 3.046875 | 3 | [] | no_license | //COOKIE
const dom = {
inp : document.querySelector('#inp-info'),
btn : document.querySelector('#btn-memo'),
};
// dom.btn.addEventListener('click', ()=>{
// Cookie.set(Date.now(), dom.inp.value, 2);
// // const coo = new Cookie();
// // coo.set(Date.now(), dom.inp.value, 2);
// dom.inp.value... | true |
b6bbd4958c15bf2637853717e6ea04d8ff101abe | JavaScript | liuwei0514/aliyun-captcha | /index.js | UTF-8 | 2,839 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
const crypto = require('crypto');
const request = require('request-promise');
const uuid = require('uuid');
const AFS_ENDPOINT = 'https://afs.aliyuncs.com';
const DEFAULTS = {
Action: 'AuthenticateSig',
Format: 'JSON',
RegionId: 'cn-hangzhou',
SignatureMethod: 'HMAC-SHA1',
SignatureVersion: '... | true |
ce8b5550aeac20fccb49a3d987c6192be6fd5b95 | JavaScript | almangr/08-react-form-validation-and-beyond | /examples/todo-app-class-components/src/App.js | UTF-8 | 1,544 | 2.828125 | 3 | [
"MIT"
] | permissive | import { Component } from 'react';
import NewTodoForm from './components/NewTodoForm';
import TodoList from './components/TodoList';
class App extends Component {
constructor() {
super();
this.state = {
todos: [],
};
}
addTodo = (newTodo) => {
this.setState({
todos: [...this.state.to... | true |
14bb821ce92abb64974ebfdb0d96bd06689f0b67 | JavaScript | Debjyoti-1999/internship | /utils/check_Id.js | UTF-8 | 308 | 2.796875 | 3 | [] | no_license | /**
*
* @param {String} str Agent Id of member
* @returns {String} filtered Agent Id
*/
function check_Id(str) {
return str
.replace(/[\/\\#,+()$~%.'@\/!" ^&:*?\\-\\<>{}]/g, '')
.replace('-', '')
.toUpperCase();
} // Filter the Id by removing special characters
module.exports = check_Id;
| true |
9768b2b52a4e7dc3180ae7dd65793d785a98076a | JavaScript | LeightonDarkins/test-driven-login | /src/components/Form.js | UTF-8 | 1,789 | 2.640625 | 3 | [] | no_license | import React from 'react'
import axios from 'axios'
import Input from './Input'
import Button from './Button'
const INITIAL_STATE = {
isLoggedIn: false,
username: '',
password: ''
}
class Form extends React.Component {
constructor(props) {
super(props)
this.state = INITIAL_STATE
this.handleSubm... | true |
85180769a150ae2cf3f5e666861f84730f1b652b | JavaScript | YobaMalik/WebServer | /src/main/resources/static/Script/Script.js | UTF-8 | 9,217 | 2.890625 | 3 | [] | no_license | /*function getGrade() {
var el = document.getElementById('specTest')
var spec = el.options[el.selectedIndex].text;
$.ajax({
url: "getCharNum",
data: { zulul: spec },
dataType: 'json',
contentType: "application/json",
success: function (data) {
var list = d... | true |
5693c2092aeae42c74261c51f5bb48f11dd4fe3f | JavaScript | Md-Soliman-Ali/JavaScript-Beginner | /User Input/js/script.js | UTF-8 | 60 | 2.625 | 3 | [] | no_license | var x;
x = prompt("Enter Your Name: ");
document.write(x); | true |
61aa3c4bc6252ae0a8b9ac5f681bca05f89bcac7 | JavaScript | nathanial/redux-reducer | /src/index.js | UTF-8 | 1,595 | 2.625 | 3 | [
"MIT"
] | permissive | import _ from 'underscore';
import esprima from 'esprima';
import Immutable from 'seamless-immutable';
export class ReduxReducer {
constructor(){
this.reducer = _.bind(this.reducer, this);
}
reducer(state, action){
state = Immutable(_.defaults({}, state || {}, this.defaults));
for(let act... | true |
038a65a0ce86a65fc7b1fb17b017e78fe43d284c | JavaScript | tsvetkovpro/js | /courses/others/laracasts/output/object.js | UTF-8 | 837 | 4.40625 | 4 | [] | no_license | 'use strict';
// object shorthand
function getPerson() {
var name = 'Yaroslav';
var age = 33;
return {
name: name,
age: age,
greet: function greet() {
return 'Привет, ' + this.name;
}
};
}
console.log(getPerson().greet());
var person = {
name: 'Владимир',
age: 30
};
var name = pe... | true |
bd444fe22875224c083b40664cc3350185e26154 | JavaScript | pranikc/Folio-frontend | /src/CreateCompanyModal.js | UTF-8 | 2,115 | 2.578125 | 3 | [] | no_license | import React from 'react';
import { Modal } from 'react-responsive-modal';
import 'react-responsive-modal/styles.css';
class CreateCompanyModal extends React.Component {
state = {
openModal: false,
name: "",
board_members: "",
year: 0,
industry: ""
}
onClickButton =... | true |
3216987160c5257998465084c81d166f07c63f13 | JavaScript | terrywh/wjcs | /rotate_logger.js | UTF-8 | 1,814 | 2.578125 | 3 | [] | no_license | "use strict";
const fs = require("fs"),
path = require("path"),
levels = ["trace", "debug", "information", "notice", "warning", "error", "critical", "fatal"]; // 与 c++ 对应
let logger = {};
logger.rotate = function() {
if(logger._fs === process.stdout) return;
if(logger._fs) logger._fs.end();
logger._f... | true |
02fbeec3a98f13d481c12f12d4fdcc453b9fe315 | JavaScript | The-Wonderful-Ones/sheerme-booking-app-backend | /utils/bookings-formatter.js | UTF-8 | 1,772 | 3.125 | 3 | [] | no_license | const bookingsFormatter = (bookings) => {
let bookingsReformatted = [];
for (let i = 0; i < bookings.length; i++) {
// destructuring properties out of the bookings[i] which are a part of the service
// the rest is spread to the variable booking
const {
booking_service_id,
duration_minutes,
... | true |
3b766a1479441079a00ee4ed4ce7f713761ba704 | JavaScript | d-turner/fullstack-app-with-react-redux | /client/src/utils/fileReader.js | UTF-8 | 1,415 | 2.796875 | 3 | [] | no_license |
const fileReader = function($q) {
const onLoad = function(reader, deferred) {
return function() {
deferred.resolve(reader.result);
};
};
const onError = function(reader, deferred) {
return function() {
deferred.reject(new Error(`An error occurred for FileReader: ${reader.result}`));
... | true |
ee39c6d2c2b82aeb9b9dd93507deafac95fe5cd9 | JavaScript | LockettPundt/codeWars | /simpleFrequencySort6kyu.js | UTF-8 | 432 | 3.953125 | 4 | [] | no_license | // In this Kata, you will sort elements in an array by
// decreasing frequency of elements. If two
// elements have the same frequency, sort them by increasing value.
function solve(arr) {
const obj = [...arr].reduce((acc, num) => {
if (!acc[num]) acc[num] = 1;
else acc[num] += 1;
return acc;
}, {});
... | true |
56b9e771b6f72a60ab70135148d8a103c535a111 | JavaScript | 6utt3rfly/eval-estree-expression | /lib/inspect.js | UTF-8 | 773 | 2.640625 | 3 | [
"MIT"
] | permissive | 'use strict';
const util = require('util');
const { define, isEmpty, isObject } = require('./utils');
const prune = obj => {
const node = {};
if (!obj) return obj;
if (Array.isArray(obj)) return obj.map(v => prune(v));
for (const [k, v] of Object.entries(obj)) {
if (isEmpty(v)) continue;
if (Array.is... | true |
03a58c803c0e52ecdf3c2ba182262d82e2e43f0f | JavaScript | msherman/AppalachianMountains | /js/nav.js | UTF-8 | 1,996 | 2.734375 | 3 | [] | no_license | var nav = {
"days": [{
"name": "Day 1",
"activities": ["Driving"],
"destination": "Horse Cave, KY"
},
{
"name": "Day 2",
"activities": ["Mammoth Caves", "Nashville"],
"destination": "Nashville, TN"
},
{
"name": "Day 3",
"activities": ["Cades Cove drive", "Abrams Falls", "Blue Ridge Parkway"],
"de... | true |
45a5c3a10796ed2ff9cec65a78ef1103fc5ebb47 | JavaScript | Mathz78/Beeper | /scripts/script.js | UTF-8 | 604 | 3.390625 | 3 | [] | no_license | // Create the sound variable using Howler
var sound = new Howl({
src: ['sound/sound.mp3'],
html5: true,
loop: true
});
// Variable volume
volume = 0.5;
function changeVolume() {
volume = parseFloat(volume);
Howler.volume(volume);
}
function playSound() {
var text = window.document.getElementB... | true |
9ef61e5c0286e1d7ab47cbc81d11e6a9c21c18c6 | JavaScript | desweemerl/fw.js | /src/source/ArraySource.js | UTF-8 | 17,234 | 2.75 | 3 | [
"MIT"
] | permissive | /**
* @module fw/source/ArraySource
* @license MIT License
* @author Ludovic Desweemer
*/
'use strict';
var ArrayElement = require('../ui/ArrayElement');
var ArrayModel = require('../ArrayModel');
var ObjectModel = require('../ObjectModel');
var Source = require('../source/Source');
var SourceError = require('../... | true |
63c6bdc72f37ff62efc328b43d0e0236cfe41ad1 | JavaScript | Manishpri/blogbackend | /api.js | UTF-8 | 4,122 | 2.546875 | 3 | [] | no_license | var express = require('express'),bodyParser = require('body-parser')
var db_create = require('./mongo_setup');
var mongoose = require('mongoose');
const cors = require('cors');
mongoose.connect('mongodb://localhost:27017/blog');
var corsOptions = {
origin: 'http://localhost:4200',
optionsSuccessStatus: 200 // some ... | true |
ea572a006216568697c0f97071c641e41e70df15 | JavaScript | cokid989/DBC | /backend/controllers/BotController.js | UTF-8 | 9,087 | 2.5625 | 3 | [] | no_license | /**
* This class defines an interface to be used whenever a component of the
* system wishes to interact with any bot configurations in the database
*/
const models = require('models');
const path = require('path');
const fs = require('fs');
const mime = require('mime');
const sequelize = require('sequelize');
co... | true |
a1121b377a3a56e6989ae82d65d6e8551848ef81 | JavaScript | fernando-bivar/ProgramacaoWeb | /Questao6.js | UTF-8 | 181 | 3.046875 | 3 | [] | no_license | var cont = 0;
setTimeout('Contador()',500);
function Contador() {
cont++;
document.getElementById("label1").innerHTML = cont;
setTimeout('Contador()',500);
}
| true |
3590c01e9387c824bfd8bdfa0ab5005518431f43 | JavaScript | rodrigo398/js101 | /12microtask.js | UTF-8 | 1,548 | 3.96875 | 4 | [] | no_license | // https://careersjs.com/magazine/javascript-job-queue-microtask/
function firstFunction() {
console.log('ENTRA firstFunction');
thirdFunction();
const firstResponse = Promise.resolve('1st Promise');
const secondResponse = Promise.resolve('2nd Promise');
setTimeout(() => {
firstResponse.then(res => {
... | true |
df55fe6133498ae9294797a28386c71eed6db633 | JavaScript | whtoo/LeetcodeJournal | /258.各位相加.js | UTF-8 | 1,255 | 3.890625 | 4 | [
"CC0-1.0"
] | permissive | /*
* @lc app=leetcode.cn id=258 lang=javascript
*
* [258] 各位相加
*
* https://leetcode-cn.com/problems/add-digits/description/
*
* algorithms
* Easy (65.49%)
* Likes: 250
* Dislikes: 0
* Total Accepted: 41.9K
* Total Submissions: 62.4K
* Testcase Example: '38'
*
* 给定一个非负整数 num,反复将各个位上的数字相加,直到结果为一位数。
... | true |
2a37498e466c592e59e579f784565b999b31a5e8 | JavaScript | OptimusCrime/tigers-kycklingstuds | /game/src/engine/objects/kyckling.js | UTF-8 | 4,187 | 2.578125 | 3 | [] | no_license | import {Position} from "../utilities";
import {Sprites} from "../sprites";
const KYCKLING_START_POSITION_X = -65;
const KYCKLING_START_POSITION_Y = 58;
const KYCKLING_DY_INITIAL_VALUE = -5;
const KYCKLING_DY_FALL_VALUE = -22;
const KYCKLING_MODE_WALK = 'walk';
const KYCKLING_MODE_FALL = 'wall';
const KY... | true |
54586eb7d099967646408b2e38f2cd4905638775 | JavaScript | Lucasilva999/API_SEADE | /controllers/dados.js | UTF-8 | 3,338 | 3.03125 | 3 | [] | no_license | //Importando Models
const Registro = require('../models/Registro');
const Indicador = require('../models/Indicador');
const Periodo = require('../models/Periodo');
//Importando Funções
const preparaRegistros = require('../functions/preparaRegistrosAPI');
const preparaIndicadores = require('../functions/preparaIndicado... | true |
6c412f49960f9dbc6f2912c2316d785692cc2a80 | JavaScript | semen82/resume.github.io | /game-pexeso/js/lib.js | UTF-8 | 1,970 | 3.40625 | 3 | [] | no_license | function duplicateArray(arrElem) {
let arrOut = [];
let count = 0;
for (let i = 0; i < 2; i++) {
for (let k = 0; k < arrElem.length; k++) {
arrOut[count] = arrElem[k];
count++;
}
}
return arrOut;
}
function mix(arrElem) {
let arrOut = [];
let len = ... | true |
e9db9234d6bd31114a684d37e635cee94fd610fb | JavaScript | Mukesh8419/todo-app | /src/components/Greeting.js | UTF-8 | 504 | 3.015625 | 3 | [] | no_license | import React from "react";
function Greeting() {
const date = new Date(2021,4,14,15);
const hours = date.getHours();
let timeofDay;
const styles = {
fontSize: 30
};
if (hours < 12) {
timeofDay = "morning";
styles.color="green";
} else if (hours >= 12 && hours < 17) {
timeofDay =... | true |
bf0f6e3318e21e12f28bb0963ce2f8d8ad34f07e | JavaScript | Escaay/nodeBase | /node/os.js | UTF-8 | 312 | 2.609375 | 3 | [] | no_license | // 系统模块(一般是运维才用)
let os = require('os')
// 获取系统cpu信息
console.log(os.cpus());
// 获取内存信息
console.log(os.totalmem());
// 查看系统架构
console.log(os.arch());
// 查看内存剩余量
console.log(os.freemem());
// 查看系统平台
console.log(os.platform()); | true |
e5fe73ce7db07508e6a327f9cb8df3ee28815134 | JavaScript | rowen2/rowen2.github.io | /Comments/theDataFort.js | UTF-8 | 2,034 | 3.53125 | 4 | [] | no_license | //step 3//this function populates any new comments on to the page
function populateComments(path, commentName){
//firstDatabase is a string that represents how to get to the next comment
var firstDatabase = firebase.database().ref('/Comments/'+path+'/Comment');
//retrieves some value from the firstDatabse ref, in... | true |