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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a0f1aaef1781f55a067d0a3ed82202990d00cff7 | JavaScript | kofzx/zp | /src/utils/strategy/strategies/validates.js | UTF-8 | 665 | 2.578125 | 3 | [] | no_license | var validates = {
isNonEmpty: function (value, errMsg) {
if (value === '') {
return errMsg;
}
},
minLength: function (value, length, errMsg) {
if (value.length < length) {
return errMsg;
}
},
isPhoneNumber: function (value, errMsg) {
if (!/(^1[3|5|8][0-9]{9}$)/.test(value)) {
return errMsg;
}... | true |
06c0106547620bb3ee5e24e74bffc13a7d3daeda | JavaScript | HyeonjeongHa/week2_server | /week2/routes/index.js | UTF-8 | 6,065 | 2.65625 | 3 | [] | no_license | const router = require('express').Router();
const User = require('../models/list');
const mongoose = require('mongoose');
module.exports = function(app) {
router.post('/register', (req, res) => {
const content_id = 0;
const username = req.body.username;
const password= req.body.password;
... | true |
b23b1fa0c97327bd78fb1d953b400cd58be1587f | JavaScript | domnelkin/OOP-tasks | /task2.js | UTF-8 | 698 | 3.640625 | 4 | [] | no_license | class Person {
constructor(name, surname) {
this._name = name;
this._surname = surname;
}
showFullName() {
return `${this._name} ${this._surname}`;
}
}
class Student extends Person {
constructor(name, surname, year) {
super(name, surname);
this._year = year;... | true |
e127f928c0cd20aae6e99e547dd061079884538e | JavaScript | anhhnt/my-sld | /src/hooks/idgen.js | UTF-8 | 390 | 2.65625 | 3 | [
"MIT"
] | permissive | // Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/api/hooks.html
module.exports = function () { // eslint-disable-line no-unused-vars
return context => {
context.data.eventCode = Math.random().toString(36).substring(7);
// Best practis... | true |
a4fa3ec535d94442080efb32ca3f24f6dfd3a4ef | JavaScript | rheehot/algorithm-56 | /boj-codeplus/basic/401-dynamic1-practice/1309.js | UTF-8 | 614 | 3.34375 | 3 | [] | no_license | let input = `5`.trim();
// input = require('fs').readFileSync('/dev/stdin').toString().trim()
input = +input;
const dp = [0, 3, 7];
for (let i = 3; i <= input; i++) {
dp[i] = (dp[i - 1] * 2 + dp[i - 2]) % 9901;
}
console.log(dp[input]);
/*
const dp = [
[0, 0],
[1, 0],
[1, 2],
];
const result = [0, 3, 7];
... | true |
d1e337ead5faeca475f475f71f4fce544c1f9e31 | JavaScript | SedwardCode/l2broker | /site/server/api/items/items.controller.js | UTF-8 | 1,541 | 2.9375 | 3 | [
"MIT"
] | permissive | /**
* Using Rails-like standard naming convention for endpoints.
* GET /api/things -> index
* POST /api/things -> create
* GET /api/things/:id -> show
* PUT /api/things/:id -> update
* DELETE /api/things/:id -> destroy
*/
'use strict';
v... | true |
11988208ad1dc1130422583610adfac23f873ca7 | JavaScript | citation-file-format/cff-initializer-javascript-v1 | /src/KeywordHandlers.js | UTF-8 | 1,290 | 2.9375 | 3 | [
"Apache-2.0",
"JSON",
"MIT"
] | permissive | export function add() {
this.keywords.push({
id: this.keyword_id += 1,
text: ''
})
}
export function move_down(keyword_id) {
let position = this.keywords.findIndex(function (keyword) {
return keyword.id == keyword_id;
});
if (position < this.keywords.length - 1) {
th... | true |
80018c01b34a50bbd6a3839cc9d41bc0ba53f34e | JavaScript | zhaoxiaoru/gulp | /app/dist/script.js | UTF-8 | 271 | 2.953125 | 3 | [] | no_license | function Animate(name,type){
this.name = name;
this.type = type;
}
Animate.prototype.say = function(){
alert("我是"+this.name);
}
Animate.prototype.sport = function(){
alert("hello");
}
var cat = new Animate("kitty","猫");
var dog = new Animate("gougou","狗"); | true |
fe91393c328d66d8c9aec8706a02e847e44bcc9a | JavaScript | zhaojinghua/forpurchasingagents | /simCalc.js | UTF-8 | 2,057 | 3.015625 | 3 | [] | no_license | var taxObject = document.getElementById("sacTax");
var oPriceObject = document.getElementById("oPrice");
var taxRateObject = document.getElementById("taxRate");
var totalObject = document.getElementById("totalPrice");
var usdcnyObject = document.getElementById("usdTocny");
var inRMBObject = document.getElementById("tot... | true |
1d865b31c62a5edc9e3137f1aee33b14a8b49a0b | JavaScript | pjaws/keto-up-css-cleaner | /index.js | UTF-8 | 2,215 | 2.75 | 3 | [] | no_license | /* Shopify CSS Cleaner
*
* Statically analyzes files in `/templates`, `/snippets`, `/layout`, and `/sections`
* to find unused CSS rules from the given CSS file.
* Outputs "purified" and optionally minified (use the --min flag) CSS files to
* <CSS filename>.<template filename>.purified.css
*
* USAGE: node ... | true |
ee02881ba0cb35acafbca6403600b68cbebc6de6 | JavaScript | vevanonarain/Myowngame | /sketch.js | UTF-8 | 4,022 | 2.671875 | 3 | [] | no_license | var canvas;
var wall1, wall2, wall3, wall4, wall5, wall6, wall7, wall8, wall9, wall10,
wall11, wall12, wall13, wall14, wall15, wall16, wall17, wall18, wall19, wall20, wall21;
var back, plyer, wll;
function preload(){
back = loadImage("images/backg.jpg");
plyer = loadImage("images/player.jpg");
wll = loadI... | true |
345846e292521bdd0dfa487cca17847533920515 | JavaScript | JmAlCubo/asincronismo | /src/promise/index.js | UTF-8 | 469 | 3.109375 | 3 | [] | no_license | const fetchData = require("../fetshData");
const API = 'https://rickandmortyapi.com/api/character/';
var character = [];
for(let i=0; i<10; i++ ){
fetchData(API)
.then(data => {
return fetchData(API + data.results[i].id);
})
.then(data => {
character[i] = data.name
return fetchData(da... | true |
de44797929d3e55ea749f5d8c7ab3968abb60722 | JavaScript | Sanchitarastogi/WebProgramming-CS_554 | /lab6/client/src/components/Users.js | UTF-8 | 3,631 | 2.671875 | 3 | [] | no_license | import React, {Component} from 'react';
//Import Query from react-apollo
import {Query} from 'react-apollo';
//Import the Todos for Adding and Updating Employee
import AddTodo from './Todos/AddTodos';
//Import the file where my query constants are defined
import queries from '../queries';
/* The React Apollo package... | true |
382ab9556af2d4d99dd25fbbe4d55c68130b48c1 | JavaScript | xidoWeb/uxui1810 | /b_example/c_normal/js/src/jquery/resize_test_01.js | UTF-8 | 2,938 | 2.8125 | 3 | [] | no_license | // resize_test_01.js
(function($) {
var full = $('.full');
var fullDt = full.find('dt');
// console.log( fullDt.contents() );
// console.log( fullDt.children() );
// var wr = fullDt.contents().contents().unwrap().wrap('<span></span>');
var wr = fullDt.contents().contents().unwrap();
// 자식요소를 확인 childre... | true |
b5fd212a5def336961e46a0246f158ea29004fd6 | JavaScript | kronxblue/1stg | /views/mynetwork/js/index.js | UTF-8 | 1,268 | 2.640625 | 3 | [] | no_license | $(document).ready(function() {
// USER IMAGE FUNCTION DOWNLINE LIST
$(".userImage").click(function() {
return false;
});
$("#downlineList").on("mouseover", ".userImage", function() {
var userImage = $(this).attr('data-image');
$(this).append("<div id='userImage'><img src='" + u... | true |
31bbfc4f87e3d2f11a5aeeca4b974447dc1f0971 | JavaScript | vandalin10/CreativeCoding_VL | /Midterm_Project/sketch.js | UTF-8 | 4,532 | 2.96875 | 3 | [] | no_license | //position of main ball
var x = 100;
var y = 450;
var sceneIndex = 1;
var actions = 0
//help from TA Che Yu Wu
function keyPressed(){
if (sceneIndex == 1){
if (keyCode == 32){
actions++
}
}
if (actions == 2 && sceneIndex == 1){
actions = 0
sceneIndex++
}
}
function setup() {
createCanvas(1200,... | true |
693284d98ef766bc9f60565fd2e25230599ed338 | JavaScript | TomCahill/EncheJS | /app_client/src/js/input.js | UTF-8 | 1,222 | 3.03125 | 3 | [] | no_license | 'use strict';
/** Class Input */
class Input { // eslint-disable-line no-unused-vars
/**
* Input constructor
*/
constructor() {
this.UP = 0;
this.DOWN = 0;
this.LEFT = 0;
this.RIGHT = 0;
this.SPRINT = 0;
this._init();
}
/**
*
* @private
*/
_init() {
document.addE... | true |
7f77d13e741dbdcf17f81e6bc874117f0a8623d8 | JavaScript | A35G/JSRobot | /jsrobot.js | UTF-8 | 1,664 | 2.796875 | 3 | [] | no_license | function empty(mixed_var) {
return ( mixed_var === '' || mixed_var === 0 || mixed_var === '0' ||
mixed_var === null || mixed_var === false || mixed_var === undefined ||
mixed_var.length === 0 );
}
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
va... | true |
00ac4a41fde68fb3bae837cd42f719f7dd0b0a52 | JavaScript | feelic/nimrod | /index.js | UTF-8 | 478 | 2.625 | 3 | [] | no_license | const Language = require('./lib/language');
const french = require('./languages/french');
let lang = new Language();
//lang.printPhonologyDescription();
let a = () => french.makeSyllable();
let b = () => lang.makeSyllable();
//console.log(french.transliterate(`${a()} ${a()}${a()} ${a()} ${a()}${a()}${a()}`));
consol... | true |
8485eb20d43c35643708acdc5771f5c751baf230 | JavaScript | AZbang/Markus.js | /src/elements/App.js | UTF-8 | 2,089 | 2.515625 | 3 | [
"MIT"
] | permissive | import Element from '../mixins/Element';
/**
* Main class for the entire visible tree of elements.
* @example
* app
* @w 1280
* @h 720
* @color 0xFFFFFF
* @smooth off
*
* // activate children presets
* mark.get('app').init();
*
* @class
* @mixes markus.mixins.Element
* @memberof marku... | true |
584e90c7433c52d029936f741624212fa0f27e29 | JavaScript | lphquy/restAPI-nodejs | /nodejs-express-mysql-redis/test/asyncawait.js | UTF-8 | 894 | 3.390625 | 3 | [] | no_license | let fn_1 = (callback) => {
setTimeout(() => {
return callback(null, '123');
}, 1e3);
}
let fn_2 = (callback) => {
setTimeout(() => {
return callback(null, '456');
}, 1e3);
}
let fn_3 = (callback) => {
setTimeout(() => {
return callback(null, '789');
}, 1e3);
}
function... | true |
146ca177cf855ae035d70d1be1a302c69c02d60a | JavaScript | piotryfon/js-class-ES6 | /main.js | UTF-8 | 944 | 3.546875 | 4 | [] | no_license | class Osoba{
constructor(firstName,lastName,gender,age){
this.firstName = firstName;
this.lastName = lastName;
this.gender = gender;
this.age = age;
this.addToList = function(){
$(".lista").append($(`<li>Cześć ${this.firstName} ${lastName},
ma... | true |
f6b116cc5aa35deac49e0e892343b419b90614a4 | JavaScript | fontesrp/delawe | /app/app/lib/api.js | UTF-8 | 1,251 | 2.625 | 3 | [
"MIT"
] | permissive | class Api {
static headers(jwt) {
return {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": jwt
};
}
static get(route, session = {}) {
return this.xhr(route, null, session, "GET");
}
static patch(route, ... | true |
e9783c99b91ceadebb06ac9c214e0e403a6b391c | JavaScript | RutviShah2008/NumberGuessingGame | /main.js | UTF-8 | 5,099 | 4.40625 | 4 | [] | no_license | // Step 1: Write a random number function that returns a value between 1 and 100. Call this function: randomNumber
function randomNumber()
{
// Begin randomNumber
return Math.floor(Math.random() * 100) + 1;
} // End randomNumber
// Step 2: Store the following 5 elements using the correct visibility scope and sele... | true |
267ffbee3bfc38a57a8dca6397dbc6109a90b91e | JavaScript | zkk741993807/music | /src/assets/util/storage.js | UTF-8 | 366 | 2.90625 | 3 | [] | no_license | function Storage(){
}
Storage.prototype.setStorage=function(key,value){
console.log(key,value)
if(typeof value =="object"){
value=JSON.stringify(value);
}
localStorage.setItem(key,value)
}
Storage.prototype.getStorage= function(key){
var value=localStorage.getItem(key);
return JSON.... | true |
6331294a94e82a85c634824170bde66e0bba3100 | JavaScript | ctam4/csc667-hw3-mocha | /frontend/src/redux/reducers/reducers.js | UTF-8 | 641 | 2.609375 | 3 | [] | no_license | import {
USER_SET_LOGIN,
USER_SET_PASSWORD,
USER_SET_EMAIL,
} from "../actions/actions";
const DEFAULT_STATE = {
notes: [],
email: "",
password: "",
isLoggedIn: false,
};
function rootReducer(state = DEFAULT_STATE, action) {
switch (action.type) {
case USER_SET_EMAIL:
return {
...sta... | true |
b7460bb5aacfc5a85765983b873ea6fa246d40bb | JavaScript | serchavalos/sudoku-js | /vanilla-js/spec/DuplicationDetectorSpec.js | UTF-8 | 1,692 | 2.671875 | 3 | [] | no_license | var DuplicationDetector = require('../src/js/DuplicationDetector.js');
var PubSub = require('../src/js/vendor/PubSub.js');
describe('A DuplicationDetector', function() {
var detector, completeBoardMock, incompleteBoardMock, uniqueValues;
beforeEach(function() {
document.write('<html><body><div class="o... | true |
62a7ad9918084bc2a8b24e251b6253f9764378fc | JavaScript | Guterfps/git-good-3 | /AJAX & Intro to APIs/main.js | UTF-8 | 1,326 | 2.984375 | 3 | [] | no_license | /*$.get("https://www.googleapis.com/books/v1/volumes?q=title:Name of the Wind", function(result){
console.log(result.items[0].volumeInfo.description)
})
const useData= function(data) {
console.log(data);
}
$.ajax({
method: "GET",
url: 'https://www.googleapis.com/books/v1/volumes?q=isbn:0439023521',
success... | true |
85dadd6fc1eab64eb094d4b9c60df030728e0943 | JavaScript | zkske121/zkske121.github.com | /w_helper/src/reducers/userListReducer.js | UTF-8 | 975 | 2.71875 | 3 | [] | no_license | import { SELECT_USER, UNSELECT_USER, USER_SELECT_ROLE, CLEAR_SELECT_USER } from '../actions/constant';
const _state = [
{
userId: 0,
roleId: 0,
userName: '',
isSelected: false
}
];
export default function (state = _state, action) {
switch(action.type) {
case SELECT_... | true |
555ab78ec5a3563ff0da876ebbe6a05c3b463786 | JavaScript | desvan/1142143-code-and-magick-19 | /js/setup.js | UTF-8 | 7,561 | 2.828125 | 3 | [] | no_license | 'use strict';
(function () {
var COAT_COLORS = [
'rgb(101, 137, 164)', 'rgb(241, 43, 107)', 'rgb(146, 100, 161)',
'rgb(56, 159, 117)', 'rgb(215, 210, 55)', 'rgb(0, 0, 0)'
];
var EYES_COLORS = ['black', 'red', 'blue', 'yellow', 'green'];
var FIREBALL_COLORS = ['#ee4830', '#30a8ee', '#5ce6c0', '#e848d5',... | true |
8e956d8fab72a344b90061df5f28d0fd882a35f1 | JavaScript | maetl/rung | /test/seed.test.js | UTF-8 | 618 | 2.96875 | 3 | [
"MIT"
] | permissive | import test from "ava";
import { seed, seeds } from "../src/rung.js";
test("returns number by default", t => {
const seed1 = seed();
t.true(Number.isInteger(seed1));
t.true(0 < seed1 && seed1 < Number.MAX_VALUE);
});
test("returns consistent value with given key", t => {
const seed1 = seed("ABCDEFGHIJKLMNOPQ... | true |
a0802005f5f3841825b2e31f5085d27b23721983 | JavaScript | sebastiantbd/AjedrezM | /src/controllers/Online/educativeOnlineController.js | UTF-8 | 4,914 | 2.515625 | 3 | [] | no_license | // Esta es la función creada en el allTemplate.js que nos redirige automáticamente al main si se va la internet
changeInternetState();
// Aquí creamos el elemento de audio para el sonido de la carrera de caballos
var HorseRaceAudio = document.createElement('audio');
// Aquí le asignamos el audio con la ruta
HorseRac... | true |
45a32e078888d963f3f726e579d69d623fd7b1da | JavaScript | JoCoKo/WebLab2 | /src/utils/saveToLocalStorage.js | UTF-8 | 309 | 2.90625 | 3 | [] | no_license | const saveToLocalStorage = (cities) => {
if(cities instanceof Array) {
const citiesList = cities.filter((city) => (city.city)).map(( city ) => (city.city));
localStorage.setItem('state', JSON.stringify({cities: citiesList}));
}
return cities;
};
export default saveToLocalStorage; | true |
467c7e582e0187767ea9536a2b4757f0ab921aca | JavaScript | arijitlaik/sedist | /src/norms.js | UTF-8 | 3,555 | 2.578125 | 3 | [] | no_license | // @ts-check
var NormalDistibuton = function (mean, std) {
var std = std == undefined ? 1 : std;
var mean = mean == undefined ? 0 : mean;
function erf(x) {
var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2, -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4... | true |
a56ed03079bdff017459dd191b114776f3bdd449 | JavaScript | Jpecina/node-2-afternoon | /server/products.js | UTF-8 | 1,303 | 2.515625 | 3 | [] | no_license | module.exports = {
create:(req,res,next) => {
const dbInstance = req.app.get('db');
dbInstance.create_product([req.body.name,req.body.description,req.body.price,req.body.imageurl])
.then ( (product) => res.status(200).json(product) )
.catch ( (error) => res.status(500).json() )
},
getOne... | true |
e4fda51b69883f452482d8975a8a28067cc19e5a | JavaScript | JBanuelos00/employeeMgmtSys | /Develop/app.js | UTF-8 | 5,303 | 3.59375 | 4 | [] | no_license | const Manager = require("./lib/Manager");
const Engineer = require("./lib/Engineer");
const Intern = require("./lib/Intern");
const inquirer = require("inquirer");
const path = require("path");
const fs = require("fs");
const OUTPUT_DIR = path.resolve(__dirname, "output");
const outputPath = path.join(OUTPUT_DIR, "te... | true |
5ba81869847ed9d4e7e5dc4629e9c13ab24651ff | JavaScript | clairemation/game-framework | /app/events/event-emitter.js | UTF-8 | 607 | 2.5625 | 3 | [] | no_license | var EventEmitter = {
registry: {},
sub: function(senderId, eventId, callback){
if (!this.registry.hasOwnProperty(senderId)){
this.registry[senderId] = {};
}
this.registry[senderId][eventId] = [];
return this.registry[senderId][eventId].push(callback);
},
pub: function(senderId, eventId, in... | true |
71b6bddcdd22f2409fc972e0171f0f35f67a4c11 | JavaScript | artha6391/tictactoe | /tictaccode.js | UTF-8 | 4,361 | 3.265625 | 3 | [] | no_license | let counter = 1;
let flag = 0;
let tic = [0, 0, 0];
for (let x = 0; x < 3; x++) {
tic[x] = [0, 0, 0];
}
let arr = {row1: {i: 0, j: 0}, row2: {i: 0, j: 1}, row3: {i: 0, j: 2}, row4: {i: 1, j: 0},
row5: {i: 1, j: 1}, row6: {i: 1, j: 2}, row7: {i: 2, j: 0}, row8: {i: 2, j: 1}, row9: {i: 2, j: 2}
};
function play (t... | true |
8c8b6535ebda3adce03d30e945401d5e872b652f | JavaScript | godnotaha/godnotaha | /js/main.js | UTF-8 | 330 | 2.875 | 3 | [] | no_license | let menu_clicked = false
function myFirstFunction(){
if (menu_clicked == false){
document.getElementById("elements-menu").style.display = "flex";
menu_clicked = true
}
else if (menu_clicked == true){
document.getElementById("elements-menu").style.display = "none";
menu_clicked = fals... | true |
7eee1333985768f450fd1254425d7689c86eaa1d | JavaScript | srips1990/yobichain | /yobichain-web/js/assets.js | UTF-8 | 601 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive |
function getUserAssetBalance(assetNameElement, output) {
var xmlhttp = new XMLHttpRequest();
try {
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
output.innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("POST", "user_asset_balance_processor.p... | true |
a8cc8eb3d9cfb5dbb390558590f63fd0d2c32318 | JavaScript | TitouanMorvan/Project-3-OpenClassrooms | /js/ready.js | UTF-8 | 1,168 | 2.515625 | 3 | [
"MIT"
] | permissive | // GARDE LA RESERVATION AU RECHARGEMENT DE LA PAGE
$( document ).ready(function() {
console.log( "ready!" );
var date = new Date(sessionStorage.saveDate);
var dateActuel = new Date();
var minutes = dateActuel.getMinutes() - date.getMinutes();
var secondes = dateActuel.getSeconds() - da... | true |
4d02d24a12337068f94df1a79a1f33418834e209 | JavaScript | Kitware/itk-vtk-viewer | /bin/network.js | UTF-8 | 829 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | var os = require('os');
var ifaces = os.networkInterfaces();
var networkInterfaces = [];
var alias = 0;
var currentName = '';
function netInterface(iface) {
if (iface.family !== 'IPv4' || iface.internal !== false) {
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
return;
}
if (alias >= 1)... | true |
ebfff6488d7527b0e74e74eec633ea3ba6e88af7 | JavaScript | avishekkumar0204/nodejs | /1.Flie system sync/index.js | UTF-8 | 364 | 2.828125 | 3 | [] | no_license | const fs = require("fs");
fs.writeFileSync("read.txt", "Hello World");
fs.writeFileSync("read.txt", "All fine!!");
// fs.appendFileSync("read2.txt","Hello");
// fs.appendFileSync("read2.txt","World");
let bufData = fs.readFileSync("read2.txt");
console.log(bufData);
let orgData=bufData.toString();
console.log(orgDa... | true |
98c69da672678bdc344b3c3be89c91b90e4cc194 | JavaScript | abnerfc01/abnerfc01 | /aula05/index.js | UTF-8 | 928 | 3.625 | 4 | [] | no_license | // Desafios dessa aula!
// Substituir o pôster de cada filme pelo trailer. Dica: pesquisem pela opção embed no menu de compartilhamento do YouTube;
// Estudar o innerHTML e a função que está criando a lista de pôsters. Como o código funciona para adicionar filmes sem utilizar array?
// Criar a função validaFilme() que ... | true |
f24390c27d5720a8b7fe135c08c2fb452109b41d | JavaScript | Gokulreact/React-Basics-learn | /src/Condition/condition.jsx | UTF-8 | 1,388 | 3.125 | 3 | [] | no_license | import React, { Component } from 'react';
class Conditional extends Component{
condition =1;
isValue=true;
functionRender = () =>{
var conditionalElement1 = null;
if(this.condition === 1){
conditionalElement1 = <span>Conditional element is 0</span>;
... | true |
df2d1fed4d9e8884926431080616a1018186feaa | JavaScript | Yaro96/tsac-asdjs | /homework_05.js | UTF-8 | 2,993 | 3.359375 | 3 | [] | no_license | function PriorityQueue()
{
this.prQueue=[];
}
function QueueItem(i, p)
{
this.item=i;
this.priority=p;
}
PriorityQueue.prototype.enqueue=function(queueItem){
var placed=false;
var tail=this.prQueue.length;
var a;
var b;
var i=0;
while(!placed && i<tail && tail>1)
{
a=t... | true |
6b1633786f56adebf3377e274801e39e145c2b19 | JavaScript | Kayjim/tts-js-app-dev-2018b | /2018-06-12/functions/01-returns.js | UTF-8 | 132 | 3.328125 | 3 | [] | no_license | function add(number1, number2) {
return number1 + number2;
console.log("NEVER RUNS")
}
var sum = add(1,2);
console.log(sum); // 3 | true |
5270bb0d8db5eb4788c502e7098a3295ff43771b | JavaScript | housna99/GitTest2 | /app.js | UTF-8 | 144 | 3.125 | 3 | [] | no_license | const names= require("./globals");
const sayHi= (name) => {
console.log(`hi my name is ${name}`);
};
console.log(names);
sayHi(names.john) | true |
c8ab50f9bf174d56f56379b1c096cb99ebc4d50d | JavaScript | yurkagon/self-education | /legacy/lessons/First Yotube channel/18_assoc_arrays/1.js | UTF-8 | 589 | 3.671875 | 4 | [] | no_license | var human = {
"name" : "Yura",
"age" : 21,
"id" : 1488,
"sex" : "male",
"year" : function () {
return 2017 - this.age;
}
}
//console.log(human);
//console.log(human.name);
//console.log(human['age']);
var a = 'id';
//console.log(human[a]);
//console.log(human.year());
//console.log("SECOND... | true |
9839b27da6093a7d9d8787b200572d0276c6c255 | JavaScript | gixerr/iis-web-manager-react-client | /src/components/AddApplicationPool/AddApplicationPool.js | UTF-8 | 3,323 | 2.609375 | 3 | [] | no_license | import React, {useState} from 'react';
import classes from './AddApplicationPool.module.css';
const AddApplicationPool = (props) => {
const [newName, setNewName] = useState('');
const [newManagedRunTimeVersion, setNewManagedRunTimeVersion] = useState('v4.0');
const [newManagedPipelineMode, setManagedPipel... | true |
c7111828322581c76723dae5b02e3f15ca1b27fa | JavaScript | yaximi/learning | /NodeJs/lessons/lesson-09/server.js | UTF-8 | 2,774 | 2.703125 | 3 | [] | no_license | /**
* get/post请求、接口请求、文件请求
*/
const http = require('http');
const fs = require('fs');
const url = require('url');
const path = require('path');
const queryString = require('querystring');
let users = {}; // 存储用户信息,服务关闭会清空数据。key-用户名,value-密码。
const server = http.createServer();
server.on('request', (req, res) => {... | true |
5e6c1005b4f598c0d842121ee2aa5a60823813f8 | JavaScript | Daviad0/cselectron | /cselectron/apcsp_responses/procedure_call.js | UTF-8 | 2,399 | 3.0625 | 3 | [] | no_license | /*
NOTICE: This code segment omits other parts of code that are not necessary for the answering of question 3D. Please refer to the entire PDF document for the correctly formatted code that is runnable!
*/
/*
QUESTION SPECIFIC NOTICE: This is used in an HTML file, however, the <script> tag is completely Javascript... | true |
85f5ecd40d46ae2ab85bea2ad1c5eda04e72dce7 | JavaScript | subnik/socialmedia-scraper | /src/instagram-v1/lib/lib/array-utils.js | UTF-8 | 252 | 2.71875 | 3 | [] | no_license |
const getAvgNumber = (numbersList) =>
numbersList.reduce((tot, value) => tot + value, 0) / numbersList.length
const getAvgInteger = (numbersList) => Math.round(getAvgNumber(numbersList))
module.exports = {
getAvgInteger,
getAvgNumber,
}
| true |
9bb9f4ebba9032beb65b1ca25ae9fb7449dea746 | JavaScript | tobe/FELK01 | /src/components/pages/Home.jsx | UTF-8 | 8,298 | 2.953125 | 3 | [
"MIT"
] | permissive | import React from 'react'
import Popup from 'components/basic/Popup.jsx'
import GameFilter from 'components/basic/Home/GameFilter.jsx'
import Checkbox from 'components/basic/Home/Checkbox.jsx'
import Sort from 'components/basic/Home/Sort.jsx'
import {arrayContains, firstLetterUppercase} from 'helpers.jsx'
import 'sty... | true |
5c5d25f5190969ef4a679391387f81a563435112 | JavaScript | lrobert4/abc-online-school | /client/src/components/SubjectList.jsx | UTF-8 | 1,391 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Container, Row, Col } from 'react-bootstrap';
import axios from 'axios';
class SubjectList extends Component {
state = {
error: '',
subjects: []
}
componentDidMount(){
this.fetchSubjects();
... | true |
b2b10505adba21a4cc6870b757b26cc6e68e9cbb | JavaScript | Jadon17/Realtime-Filter-App | /main.js | UTF-8 | 932 | 2.53125 | 3 | [] | no_license | left_x = 0;
right_x = 0;
function preload(){
mask = loadImage("https://i.postimg.cc/jS6dP6bj/gogles.png");
}
function take_snap(){
save("myfilteredselfie.png");
}
function setup(){
canvas = createCanvas(300,300);
canvas.center()
video= createCapture(VIDEO)
video.size(30... | true |
5af482fcc99091974dcba3231ca07034d92e93a3 | JavaScript | zocky/things | /core/Pins.js | UTF-8 | 2,812 | 2.671875 | 3 | [] | no_license | ///////////////////////
// H E L P E R S
//////////////////////
var arrayAddItem = function (array,item) {
var i = array.indexOf(item);
if (i==-1) {
array.push(item);
return array.length-1;
} else return i;
};
var arrayRemoveItem = function (array,item) {
var pos = array.indexOf(item);
... | true |
e0408c8c721ef7c8791c85979cd6351b5cb99b9b | JavaScript | wuilliam321/trello-board | /src/lib/discography_processor.test.js | UTF-8 | 5,121 | 2.515625 | 3 | [] | no_license | import DiscographyProcessor from './discography_processor';
describe('Discography Processor', () => {
let dp;
beforeAll(() => {
dp = new DiscographyProcessor();
dp.artistName = 'Test Artist';
});
describe('when processing discography', () => {
let albumsMock;
beforeAll(async done => {
a... | true |
e49ca033e6dd902801abb0d38a109aa2958b79ff | JavaScript | AmitSheth9/lab-04-tcpip | /lib/app.js | UTF-8 | 2,361 | 2.828125 | 3 | [] | no_license | const net = require('net');
const parseRequest = require('./utils/parseRequest');
const createResponse = require('./utils/createResponse');
const app = net.createServer(socket => {
socket.on('data', data => {
console.log('data', data.toString());
const request = parseRequest(data.toString());
console.log... | true |
8b9a0dd6d7843d7ebcbf23dc5018d20aad7996ff | JavaScript | valentineezeh/heroku-more-recipe | /components/TodoFolder/TodoInput.jsx | UTF-8 | 2,041 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
class TodoInput extends Component {
constructor(props, context) {
super(props, context)
this.state = {
inputText: ''
}
}
deleteLetter(){
this.setState({
inputText: this.state.inputText.substring(0, this.st... | true |
906c906c8f83c9f9a564a4fa85cbe754891480f4 | JavaScript | strawsir/tarins-repository | /src/Components/AnimalView/MainAnimal.js | UTF-8 | 429 | 2.53125 | 3 | [] | no_license | import React, {Component} from 'react';
export default class MainAnimal extends Component{
constructor(props){
super(props)
this.state={
selected: false
}
}
propsLog(){
console.log(this.props)
}
render(){
return(
<div>
Main Anima... | true |
f2adaae8130018491f6eb23d065589c16af9e15f | JavaScript | nwiegand1/HackCalTech | /background.js | UTF-8 | 374 | 2.75 | 3 | [
"MIT"
] | permissive | chrome.browserAction.onClicked.addListener(function(tab)
{
checkIfNameAlready();
});
function checkIfNameAlready()
{
var nameSaved;
chrome.storage.local.get('submitted', function(item) {
nameSaved = item.submitted;
if (nameSaved != null)
{
document.getElementById('displa... | true |
47ab9dc51072294bbdf7ffafc93e3512838250a8 | JavaScript | dingeins/hackapp | /routes/analyze.js | UTF-8 | 1,652 | 2.53125 | 3 | [] | no_license | var express = require('express');
var https = require('https');
var router = express.Router();
router.post('/', function (req, res) {
var binaryData = '';
req.on('data', function (chunk) {
binaryData = binaryData.concat(chunk);
});
req.on('end', function () {
var buf = new Buffer(binaryData, 'binary');... | true |
3564d93507b34ce1e528edac5d526ab7ec17433f | JavaScript | lucho1021/Taller1y2 | /punto2t.js | UTF-8 | 249 | 3 | 3 | [] | no_license | /*function obtenerNombre(codigoNave) {
return codigoNave.split(":");
}
console.log(obtenerNombre("ARQ255:JUAN")[1]);*/
//Funcion de flechas
let obtenerNombre = (codigoNave) => codigoNave.split(":");
console.log(obtenerNombre("ARQ255:JUAN")[1]); | true |
fc3b901d5a9b2e7ca3ca85da30f8b6f53cb62307 | JavaScript | oneweekbootcamp/homework2-hmjfinal | /evil-extension/page.js | UTF-8 | 1,181 | 3.140625 | 3 | [] | no_license | const MATCH_LIST = {
'there': 'their',
'their': 'there',
'they\'re': 'there',
'There': 'Their',
'Their': 'There',
'They\'re': 'There',
'THERE': 'THEIR',
'THEIR': 'THERE',
'THEY\'RE': 'THERE'
};
function transformTextNodes(node) {
// TODO(you): Implement this function! See HW spec for details.
//对... | true |
8bc601b75fa249659022430cce6e7e01672e0c10 | JavaScript | kaduHonorato/addRubyAndRt | /Add Ruby/_javascript/script.js | UTF-8 | 5,716 | 3.296875 | 3 | [] | no_license | // Variáveis Criadas a partir de Tags HTML
var tagInputRecebeTxt = document.querySelector("#tagInputRecebeTxt"); // Recebe o texto que será tratado e formatado;
var tagInputRecebeTraducaoTxt = document.querySelector("#tagInputRecebeTraducaoTxt"); // Recebe a tradução do texto que será tratado e formatado;
var tagInput... | true |
2812f1c9ba4fd1449e821fc990054f5a985a056a | JavaScript | Zinggi/elm-pages | /generator/src/seo-renderer.js | UTF-8 | 1,881 | 3.125 | 3 | [] | no_license | const elmPagesVersion = "TODO";
module.exports = { toString };
function toString(/** @type { SeoTag[] } */ tags) {
// appendTag({
// type: "head",
// name: "meta",
// attributes: [
// ["name", "generator"],
// ["content", `elm-pages v${elmPagesVersion}`],
// ],
// });
... | true |
7a8392907435f064c96b81a5a101e79c0db0bbc7 | JavaScript | VladSamodin/JavaScript | /Carousel/Carousel.js | UTF-8 | 5,847 | 2.734375 | 3 | [] | no_license | var getItmes = function() {
return [
{
"img_src" : "img/DSCN0027.jpg",
"description" : "Text 1"
},
{
"img_src" : "img/DSCN0036.jpg",
"description" : "Text 2"
},
{
"img_src" : "... | true |
bc9ba89bef958b29ad9c2a23ba74451d6fee4a4a | JavaScript | DwightGappa/bd_cov_cbe_podcast | /gbcf-v3/files/focus.js | UTF-8 | 1,191 | 2.71875 | 3 | [
"MIT"
] | permissive | window.onload = function() {
// GBCF-V3 PHP CONTACT FORM IE6 FORM ELEMENT FOCUS FILE
// Author: Mike Cherim - http://green-beast.com
var objEvt = {
input : ["hover", "focus"],
select : ["hover", "focus"],
textarea: ["hover", "focus"]
};
// spare use variables
var temp, tempLen = 0;
// hover/focus ... | true |
b9adfe3aa8ff7d0ed1a70583147581e72acd2a22 | JavaScript | jhester/gradientbtn-titanium | /GradientButton.js | UTF-8 | 2,222 | 2.75 | 3 | [
"MIT"
] | permissive | var shadeColor = function(color, percent) {
var num = parseInt(color.slice(1), 16), amt = Math.round(2.55 * percent), R = (num >> 16) + amt, B = (num >> 8 & 0x00FF) + amt, G = (num & 0x0000FF) + amt;
return "#" + (0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 + (B < 255 ? B < 1 ? 0 : B : 255) * 0x100 + ... | true |
8267d66d1b5f619ce6722fb0beca7d1604cb0ab3 | JavaScript | KonstaL/COMP.SE.200-project | /tests/toNumber.test.js | UTF-8 | 1,234 | 3.15625 | 3 | [
"MIT"
] | permissive | import toNumber from '../comp.se.200-lib/src/toNumber';
describe("toNumber function", () => {
test("toNumber should return a number when input is a string", () => {
const argument = '5.5';
const expectedResult = 5.5;
const result = toNumber(argument);
expect(result).toEqual(expected... | true |
b0e54682758f185f4b577b15c090ee32b8cf1044 | JavaScript | thekevinscott/emojisalad | /integration-tests/test/suite/score.js | UTF-8 | 4,888 | 2.6875 | 3 | [] | no_license | 'use strict';
/*
* Tests that passing during a round works
*
*/
/*
const Game = require('../../../models/game');
//const Player = require('../../../models/player');
const getPlayers = require('../lib/getPlayers');
//const startGame = require('../flows/startGame');
const playGame = require('../flows/playGame');
//co... | true |
5ec93c34ad07498dc7752d0b0040bcfb386d9c04 | JavaScript | bhavsingh2017/Laura-s-Work | /additionalFunctions.js | UTF-8 | 4,495 | 2.515625 | 3 | [] | no_license | //Definition of textInput component
import { Keyboard, Button, Animated, Easing, TextInput, AppRegistry, Image, ImageBackground, StyleSheet, Text, View } from 'react-native';
import React, {Component} from 'react';
import { Divider } from 'react-native-elements';
class MakeTextInputBox extends Component{
construc... | true |
055db6f9c2ace2e17eb14a3aa39da0d290f1f37f | JavaScript | UNIZAR-30226-2018-01/Web | /js_sin_optimizar/changeImage.js | UTF-8 | 683 | 2.90625 | 3 | [
"MIT"
] | permissive | /*Función para verificar si el fichero a subir es del formato adecuado*/
function changeImage(){
document.getElementById("simbolo_menu_imagen").src="img/simbolomenublanco.png"
}
function changeImageAntes(){
document.getElementById("simbolo_menu_imagen").src="img/simbolomenu.png"
}
function changeUser(){
... | true |
aae4e831a621d553766dbc6dcdbe79d908e72a94 | JavaScript | ericwastaken/rw_trelloreport | /lib/PathHelper.js | UTF-8 | 1,793 | 2.71875 | 3 | [
"MIT"
] | permissive | const path = require('path');
class PathHelper {
/**
* This method takes in the config, inspects various properties expected to have
* paths, then makes them ABSOLUTE paths based on the base directory passed in.
*
* This method expects to receive an object in configToModify and therefore
* changes the... | true |
a9c8fe1501df935433000cbb0a9d7e240788058e | JavaScript | CooperatieveVennootschapCVbvbv/proton-shared | /lib/filters/sieve.js | UTF-8 | 2,196 | 2.59375 | 3 | [] | no_license | import Sieve from 'sieve.js';
import isDeepEqual from '../helpers/isDeepEqual';
/**
* Template for Sieve scripts.
* @type {{'2': String, '1': String=}} map between specific version and template.
*/
export const templates = {
2: `require ["include", "environment", "variables", "relational", "comparator-i;ascii-n... | true |
7d51b7dbef7ddd322480df4872b9692b0a5f28af | JavaScript | dangoyears/Database-CourseDesign | /src/base/data.js | UTF-8 | 1,610 | 2.921875 | 3 | [] | no_license | // 返回一个 1-7 楼,每楼有 03-22 教室的数组
function getOptions(val) {
let res = [];
for(let i=1; i<=7; i++) {
let floor = Object.create(null);
floor.value = val + "+" + i;
floor.label = i;
floor.children = [];
for(let j=3; j<=22; j++) {
let obj = Object.create(null);
obj.value = j < 10 ? `${val}+... | true |
a6560e36d2d1e86bbddaf0dc92313ce80f35c1da | JavaScript | CruzerBL/Skripsi-Musikita | /static/vendor2/scripts/quickSearch.js | UTF-8 | 1,941 | 2.8125 | 3 | [] | no_license | const url = window.location.href
const searchForm = document.getElementById('search-form')
const searchInput = document.getElementById('search-input')
const resultBox = document.getElementById('result-box')
const csrf = document.getElementsByName('csrfmiddlewaretoken')
const sendSearchData = (product) =>{
$.ajax(... | true |
e043e753ee89823c50f5fa68c0a60b8b24e4e40e | JavaScript | martinop/guru | /app/utils/CoursesNoUniquesWorker.js | UTF-8 | 6,583 | 2.515625 | 3 | [] | no_license | module.exports = function worker(self) {
self.addEventListener('message', (event) => {
let tempSchedule = event.data;
const { multiples, baseSchedule, coursesName } = event.data;
const schedulesCombinations = [];
const combinations = getCombinations(multiples, 0, [], {});
console.log(`COMBINATIONS: ${combina... | true |
eecfdf3904cbb0e6c2a7b176850a387f329584e4 | JavaScript | stellaliao01/Webpack-React-Express-Boilerplate | /client/App.jsx | UTF-8 | 3,000 | 2.546875 | 3 | [] | no_license | import React, { useState } from "react";
import BTCAClient from "btca-client";
// Story 1085272158
// Channel 362738
// User 318954
let BTCA = new BTCAClient({
handle: "MY_BTCA", // unqiue handle to identify BTCA
cache: true, // caches requests (useful for debugging)
disableEvents: true, // disables default ev... | true |
1d9d893b094fc6a6b66e294ce97103d19b729bd1 | JavaScript | senoldogann/Users-List-App | /src/forms/AddUser.js | UTF-8 | 4,957 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import posed from 'react-pose';
import UserConsumer from '../contex';
import axios from "axios";
const Animation = posed.div({
visible : {
opacity: 1,
// apply leri yazma sebebimiz form gizleniyordu fakat kapladığı yer hala kalıyordu bu yüzden display ... | true |
f6e75986cb1e175fd0c426cb71940015531bd661 | JavaScript | allybrannon/redux | /src/index.js | UTF-8 | 871 | 2.9375 | 3 | [] | no_license | import { store } from "./store";
import { actionDeposit, actionWithdraw } from "./actions";
console.log("Hello, Redux!");
/* To transform my counter into a banking app:
-increment/decremtn by specific amounts
-change actions to "withdraw" and "deposit"
-be able to specif the amounts to withdraw or deposit
-manag... | true |
d5e09e42695fa50c1c10e643c7ac658cad1b103f | JavaScript | pscohn/juke | /index.js | UTF-8 | 4,611 | 2.546875 | 3 | [] | no_license | require('pixi.js');
require('p2');
require('phaser');
import { constants, KEYS } from './constants';
import {
degreesToRadians,
isCollidingX,
isColliding,
} from './utils';
let cursors;
let player;
let killer;
let currentSpeed;
let land;
let rock;
let killerGroup;
let weapon;
let spaceRecentlyPressed = false;
... | true |
8c00deadb0df6820c7ea69327123048dd54d98b4 | JavaScript | AAYamoldin/TrainingPrograms | /learn.JavaScript.ru/intl/сортировка массива с буквой Ё.js | UTF-8 | 966 | 3.8125 | 4 | [] | no_license | // Отсортируйте массив с буквой ё
// важность: 5
// Используя Intl.Collator, отсортируйте массив:
let animals = ["тигр", "ёж", "енот", "ехидна", "АИСТ", "ЯК"];
let collator = new Intl.Collator();
animals.sort(collator.compare);
console.log(animals); // АИСТ,ёж,енот,ехидна,тигр,ЯК
// В этом примере порядок сортировки ... | true |
b8a85a1668e63dcae6ddc9cf6bfd1a809f425184 | JavaScript | kevindai777/AverageOfLevelsInBinaryTree-Leetcode-637 | /averageoflevelsinbinarytree.js | UTF-8 | 1,223 | 4.34375 | 4 | [] | no_license | //Objective is to find the average in each level of a binary tree
class Node {
constructor(left = null, right = null, val) {
this.val = val
this.left = left
this.right = right
}
}
class Tree {
constructor(root) {
this.root = null
}
createRoot(val) {
this.root = n... | true |
2b3819f918ece7498dd37a41c5d980b1586c1d85 | JavaScript | SQTWeb-Solutions/iborrow-server | /config/lib/logger.js | UTF-8 | 1,920 | 2.53125 | 3 | [] | no_license | 'use strict';
const _ = require('lodash'),
config = require('../config'),
chalk = require('chalk'),
fs = require('fs'),
winston = require('winston'),
path = require('path');
// list of valid formats for the logging
const validFormats = ['combined', 'common', 'dev', 'short', 'tiny'];
// Instantiating the de... | true |
a54d74687d15d72d3e3138c03fe98fd7442b11fb | JavaScript | jyothirmayee24/java-script | /func_geometrizer.js | UTF-8 | 264 | 3.8125 | 4 | [] | no_license | const pi=3.1414;
function calcCircumference(r){
var circumference;
circumference=2*pi*r;
console.log("The circumference is "+circumference);
}
function calcArea(r){
var area;
area=pi*r*r;
console.log("The area is "+area);
}
calcCircumference(2.5);
calcArea(2.5); | true |
7d8fffdae51386206e9455f92eb3d0c46ce40c6c | JavaScript | nico-casas/CFL2020 | /JavaScript/areatriangulo.js | UTF-8 | 280 | 3.28125 | 3 | [] | no_license | //let readline = require ("readline-sync");
//let base = readline.questionInt ("Ingrese la base: ");
//let altura = readline.questionInt ("Ingrese la altura: ");
let calcularAreaTriangulo = (base,altura) =>{
return base*altura/2
}
console.log (calcularAreaTriangulo(7,14));
| true |
32854d87d01fa3d9964a1dd021acb179a3f55988 | JavaScript | san-coding/LinkFree | /cypress/integration/common/actions.js | UTF-8 | 1,004 | 2.71875 | 3 | [
"MIT"
] | permissive | import { Given } from 'cypress-cucumber-preprocessor/steps'
Given('I open {string} page', (uri) => {
const baseUrl = 'http://localhost:3000'
let path = ''
switch (uri) {
case 'home':
path = '/'
break
default:
path = uri
}
cy.visit(baseUrl + path)
})
When(`I click on {string}`, (tex... | true |
9456ab8aaa392301c98c48435e3c1cd4fe47ff0b | JavaScript | Ishmael-Yoko/javascript-utils | /common/object.js | UTF-8 | 2,640 | 4.125 | 4 | [] | no_license | // 1. `dayOfYear`:当前日期天数
const dayOfYear = (date) =>
Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24);
dayOfYear(new Date()); // 285
// 2. `forOwn`:迭代属性并执行回调
const forOwn = (obj, fn) =>
Object.keys(obj).forEach((key) => fn(obj[key], key, obj));
forOwn({ foo: 'bar', a: 1 }, (v) => conso... | true |
accd4fc462511b892996e03bde62ec30650210aa | JavaScript | Sjbrimley26/sjb-geometry | /datastructures/RTree.js | UTF-8 | 9,888 | 2.953125 | 3 | [] | no_license | import Rectangle from "../polygons/Rectangle.js";
import Line from "../Line.js";
import { compose } from "sjb-utils/Functions.js";
import { head, sort, compact } from "sjb-utils/Arrays.js";
/**
* @typedef Node
* @type {object}
* @property {Rectangle} box
*/
/**
* Represents a group of Nodes.
* @param {Rectangl... | true |
2c9b9c3e3f81515bbfef968c474181ea31ebfd1d | JavaScript | iwijetunge/burgers | /public/assets/js/burger2.js | UTF-8 | 731 | 2.765625 | 3 | [] | no_license | $(document).on("click", ".devour", function() {
const burgerId = $(this)[0].id;
console.log("burgerId: ", burgerId);
const putURL = "/burgers/" + burgerId;
console.log("putURL: ", putURL);
$.ajax({
method: "PUT",
url: putURL
}).then(data => {
console.log("data: ", ... | true |
fb197341b5df4d0cb775c54fec0a602c347ca756 | JavaScript | chen735623058/Front-end-development-study | /study-js/other/9_1_webgl学习/4-3-动画1.js | UTF-8 | 2,732 | 2.9375 | 3 | [
"MIT"
] | permissive | // 顶点着色器
var VSHANER_SOURCE =
`
attribute vec4 a_Position;
uniform mat4 u_ModelMatrix;
void main() {
gl_Position = u_ModelMatrix * a_Position;
}`;
// 片元着色器程序
var FSHADER_SOURCE =
`void main() {
gl_FragColor = vec4(1.0,0.0,0.0,1.0); // 设置颜色
}`;
// 旋转速度
var ANGLE_STEP = 45... | true |
fbae098d6c42940f027ae10ce25e6d47c7132a9d | JavaScript | gowrieswaran/flight-surety | /src/dapp/index.js | UTF-8 | 2,849 | 2.78125 | 3 | [
"MIT"
] | permissive | import DOM from "./dom";
import Contract from "./contract";
import "./flightsurety.css";
(async () => {
let result = null;
let contract = new Contract("localhost", () => {
console.log("Contract", contract);
// Read transaction
contract.isOperational((error, result) => {
display("Operational Stat... | true |
72c763c0c92054aa004d0ca3697e96e46893f8cf | JavaScript | AbdullahiAden/webb20-be | /code/22 - enctype/index.js | UTF-8 | 3,395 | 2.734375 | 3 | [] | no_license | const express = require('express');
const fileUpload = require('express-fileupload');
const cors = require('cors');
const bodyParser = require('body-parser');
const morgan = require('morgan');
const _ = require('lodash');
const app = express();
/*
* Here is what each of these packages do:
*
* express - Popular we... | true |
423336bd9de3f4d7a428371938acb121efe282e7 | JavaScript | nicoleandrea23/witches-vs-zombies | /src/scripts/Verde.js | UTF-8 | 573 | 2.59375 | 3 | [] | no_license | class Verde {
constructor(app,imgBalas,img, x, y) {
this.app = app;
this.img = img;
this.x = x;
this.y = y;
this.imgBalas=imgBalas;
this.disparar=this.disparar.bind(this);
setInterval(this.disparar,3000);
}
pintar(){
this.app.image(this.img,this.x,th... | true |
99f93c435a76586705555ebc98179e540ae9f916 | JavaScript | arangodb/arangodb | /3rdParty/V8/v7.9.317/test/mjsunit/regexp-static.js | UTF-8 | 6,016 | 2.921875 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"BSL-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // Copyright 2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of ... | true |
2b5f90d77bc21e7e02aad2cea229daa9eed6b6e5 | JavaScript | RobinRaphael/interview-prep | /day-4(promises).js | UTF-8 | 498 | 3.78125 | 4 | [] | no_license | const emitRandomNumbers = (val) => (
new Promise((resolve, reject) => {
setTimeout(() => {
console.log(val);
resolve();
}, Math.floor(Math.random() * 10));
})
);
const printNumbersRandomly = () => {
let i = 1;
while(i <= 10) {
emitRandomNumbers(i);
i += 1;
}
}
// printNumbersRand... | true |
d8edb9e3cf3f337c5d2ca04eb97e8a123aecb0b4 | JavaScript | chibisuki/primeirobot | /index.js | UTF-8 | 35,512 | 2.703125 | 3 | [] | no_license | const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'NjkwOTE4MDk1MzAwMTk4NDkw.XnZtHg.SgFZCayR_1TrFQI37GQ5K3CvHME';
var dragosfuria = 10
var selenefuria = 10
var ethanfuria = 10
var dragosgnose = 6
var selenegnose = 3
var ethangnose = 6
bot.login(token)
bot.on ('rea... | true |
73e81a670aa2851f322e547bc98ffbcd968d39a4 | JavaScript | Shumnijkot/Async | /src/dirwatcher/DirWatcher.js | UTF-8 | 1,698 | 2.875 | 3 | [] | no_license | import EventEmiter from 'events';
import fs from 'fs';
class DirWatcher extends EventEmiter {
constructor(){
super();
this.__fileList = {
// path: { lastChanged: Date }
}
}
readDir(folderPath){
fs.readdir(folderPath, (err, files) => {
if(err) {
... | true |