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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e59ceae9f31f0f9286e39e509971b9647fca8e4e | JavaScript | kaustavkarmakar2/CovidTracker | /src/controller/cases/Jordan.js | UTF-8 | 884 | 2.5625 | 3 | [] | no_license | const Jordan = (dataJson) => {
// Jordan cases
const totalConfirmedJordan = dataJson[103].cases;
const totalDeathsJordan = dataJson[103].deaths;
const totalRecoveredJordan = dataJson[103].recovered;
const newConfirmedJordan = dataJson[103].population;
const newDeathsJordan = dataJson[103].todayDeaths;
co... | true |
e29c7c8f982108e74db3347d079109d5e9c04ac8 | JavaScript | ripbitz/OptimizePath | /src/public/game/create.js | UTF-8 | 1,706 | 3.046875 | 3 | [] | no_license | // Imports
import { game } from './game.js'
import { coordinate } from './components.js';
import { helpers } from './helpers.js';
import { mechanics } from './mechanics.js';
export const create = {
// Create the game matrix
matrix: () => {
let m = [];
for(let i = 0; i < helpers.NUMBER_OF_ROWS; i++) {
m[i] = ... | true |
e8e2cb3f66b8c2bbbf2f38c5ee86aa00e2e1e21b | JavaScript | marcioviegas/js-training | /alienDictionary.js | UTF-8 | 961 | 3.546875 | 4 | [] | no_license | // https://leetcode.com/problems/verifying-an-alien-dictionary/
/*
Runtime: 64 ms, faster than 24.81% of JavaScript online submissions for Verifying an Alien Dictionary.
Memory Usage: 34.8 MB, less than 50.00% of JavaScript online submissions for Verifying an Alien Dictionary.
*/
var isAlienSorted = function(words, o... | true |
7f5d123e10fd02712056969781f9d174eed733c8 | JavaScript | Sylphvo/daquy | /Labixa/Content/author/js/ShoppingCart.js | UTF-8 | 5,843 | 3.0625 | 3 | [] | no_license | //set product tag for product => set it step by step
let product = [
{
name: "Vòng Đá Thạch Anh",
tag: "vongdathachanh",
price: 420,
inCart: 0,
},
{
name: "Vòng Đá",
tag: "vongda",
price: 210,
inCart: 0,
},
{
name: "Triple Seat... | true |
635d8a319b89c88ba30f0ca67dbbea823abd8527 | JavaScript | sultanp91/restaurant-page | /src/index.js | UTF-8 | 791 | 2.6875 | 3 | [] | no_license | import {landingPage} from './landing';
import {menuPage} from './menu';
import {contactPage} from './contact';
import {nav} from './nav'
const content = document.querySelector("#content");
const main = document.querySelector("main");
content.append(nav());
content.append(landingPage());
content.addEventListener("cl... | true |
23913c36cdadf8fa93fdb7df20c3753e429b87d4 | JavaScript | gaoweiqiao/Gao.js | /src/string/string.js | UTF-8 | 3,136 | 3.390625 | 3 | [
"MIT"
] | permissive | /**
* Created by patrick on 2018/2/18.
*/
class String{
static trim(string,chars=' '){
let charList = chars.split("");
//新 实现
let sliceStart = 0;
let sliceEnd = string.length - 1;
let trimStarting = true;
let trimEnding = true;
while (trimStarting || trimEnd... | true |
9b0c0c11ea5e4f7e393b54167c56650050c00d86 | JavaScript | Anvita-S-P/project27 | /sketch.js | UTF-8 | 974 | 2.6875 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var bob;
var roof;
var rope;
function preload()
{
}
function setup() {
createCanvas(600, 500);
engine = Engine.create();
world = engine.world;
//Create the Bodies Here.
roof=new Roof(300,490,6... | true |
34aa38f0846b781a62debfdb5f0cea786f937355 | JavaScript | NONstop5/870405-keksobooking | /js/filter.js | UTF-8 | 2,887 | 2.65625 | 3 | [] | no_license | 'use strict';
(function () {
// Устанавливает доступность полей фмльтров
var setFilterDisabled = function (flag) {
window.functions.setAvailableFormFields(formFilterChildNodes, flag);
};
// Навешиваем события на фильтр выпадающих списков
/*
После этой проверки доделаю !
var addFormOptionsFilterEve... | true |
6139655fae81bd71af702421f9875181c2883e28 | JavaScript | simple7/arithmetic | /src/day09/index.js | UTF-8 | 927 | 3.578125 | 4 | [] | no_license | /**
* @param {number} m
* @param {number} n
* @param {number} k
* @return {number}
*/
// 广度优先遍历
var movingCount = function(m, n, k) {
let count = 0;
const direction = [[0, 1], [1, 0]];
const queue = [[0, 0]];
const visited = {
'0-0': true,
};
while (queue.length) {
const [x,... | true |
3b781acaba6c6438bc7c8af98743ed74ad90931f | JavaScript | Liu-Ivy/lab-javascript-all-times-movies | /src/movies.js | UTF-8 | 840 | 3.390625 | 3 | [] | no_license | /* eslint no-restricted-globals: 'off' */
// Turn duration of the movies from hours to minutes
const convertTime = movies.map( newTime => {
const newHour= newTime.duration[0]*60;
const newMinute = newTime.duration[3]+ newTime.duration[4];
return { `${newHour+newMinute}` + 'min' };
})
console.log(... | true |
ee2b78282fdcffc776d1ed95380cdcf1901f1faa | JavaScript | andridus/truste-frontend | /src/Native/Lista.js | UTF-8 | 2,606 | 2.9375 | 3 | [] | no_license | var _heldersousa$cartel$Native_Lista = function(){
var M = 32;
var E = 2;
// An empty array.
var empty = {
ctor: '_Array',
height: 0,
table: []
};
function toJSArray(a)
{
var jsArray = new Array(length(a));
toJSArray_(jsArray, 0, a);
return jsArray;
}
function toJSArray_(js... | true |
4aca8105fba8e3d39c0b92c157373308c68a59d7 | JavaScript | michaelleeallen/reducto | /test/map-schema-spec.js | UTF-8 | 1,619 | 2.71875 | 3 | [
"MIT"
] | permissive | const mapObject = require('../lib/map-schema');
const expect = require('chai').expect;
describe('map-schema', () => {
it('should map 1:1 values', () => {
const map = {
foo: 'bar.baz'
};
const data = {
bar: {baz: 'bop'}
};
const result = mapObject(map, data);
expect(result).to.deep... | true |
20dc9967218a9128037760c26cccdc6cae7c3327 | JavaScript | Palaniappan-Praveen/Angularjs_kinder_project | /assets/js/custom-script.js | UTF-8 | 677 | 2.828125 | 3 | [] | no_license | setInterval(function(){
myFun();
},5000);
function myFun() {
var x = document.getElementById('my1');
var y=document.getElementById('my2');
var z=document.getElementById('my3');
if (x.style.display === 'block') {
z.style.display='none';... | true |
33cab182af62d1c62ab182c4cf736a46322da086 | JavaScript | LeoSibiryakov/Ilinskie-Luga | /js/main.js | UTF-8 | 3,342 | 2.921875 | 3 | [] | no_license | if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function(callback, thisArg) {
thisArg = thisArg || window;
for (let i = 0; i < this.length;i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
//Фильтр на мобильных устройствах
const side... | true |
7912ff70e3e9e7973522548ffa340a19f5ab93ff | JavaScript | r1cebank/eliza.js | /src/index.js | UTF-8 | 12,031 | 2.8125 | 3 | [] | no_license | /**
* eliza.js - Eliza JS library
* Eliza is a mock psychotherapist
* Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT.
* cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language
Communication Between Man and Machine"
in: Communications of the AC... | true |
c0adff742a864d9c26e4d1a9ed7e564c2453e925 | JavaScript | anglee/howdy-web | /lib/LinkedList.js | UTF-8 | 1,505 | 3.59375 | 4 | [] | no_license |
export const ListNode = function (val) {
this.val = val;
this.next = null;
};
export const fromArray = (A) => {
let head = null;
let prev = null;
for (let a of A) {
const node = new ListNode(a);
if (!head) {
head = node;
}
if (prev) {
prev.next = node;
}
prev = node;
}
... | true |
996b699e75eb797d25b7c2be97d78a57e0a77dd8 | JavaScript | Wayne-Bai/AST-normalize | /data/mortennobel/KickJS/src/js/kick/scene/PickResult.js | UTF-8 | 7,300 | 2.515625 | 3 | [] | no_license | define(["./MeshRenderer", "kick/material/Material", "kick/core/Constants", "kick/core/EngineSingleton", "kick/core/Util", "kick/math/Vec4", "kick/math/Vec3", "kick/math/Vec2"],
function (MeshRenderer, Material, Constants, EngineSingleton, Util, vec4, vec3, vec2) {
"use strict";
/**
* Resul... | true |
be6d5a5131f2f4a6ac9530324b4b949d9236c016 | JavaScript | mtgenius/commander-banlist | /.aws/lambda/fetch-commander-banlists/parsers/mtgo.js | UTF-8 | 511 | 2.703125 | 3 | [
"MIT"
] | permissive | const missingCards = ['Chaos Orb', 'Falling Star', 'Shahrazad'];
const stripMarkup = card => card.match(/>(.+?)<$/)[1];
module.exports = function mtgoParser(html) {
// Get cards.
const cards = html.match(
/<a href="http:\/\/gatherer\.wizards\.com\/Pages\/Card\/Details\.aspx\?name=.+?".*?>(.+?)</g,
);
if (... | true |
19513623a5975e0f155a53dc5eedfac47f66291b | JavaScript | VasylMalion/what-phone | /server/controllers/filtersController.js | UTF-8 | 5,233 | 2.625 | 3 | [] | no_license | // models
import Phone from "../models/Phone";
const filters = async (req, res) => {
const {filters} = req.body
const phones = await Phone.find()
// Діагональ
let withDiagonal = phones
if (filters[0] && filters[1]) {
withDiagonal = phones.filter( phone => {
return phone.diagon... | true |
eb097730b020e7876dd6c91dc14f8ef9b85a2e8c | JavaScript | zh1314/algorithm | /0、乱七八糟.js | UTF-8 | 515 | 3.875 | 4 | [] | no_license | // let a = 3;
// let b = new Number(3);
// let c = 3;
// console.log(a == b);
// console.log(a == c);
// console.log(a === b);
// console.log(b === c);
//=========================
const a = {};
const b = { key: "b" };
const c = { key: "c" };
a[b] = 123;
a[c] = 456;
console.log(a);
console.log(a[b]);
const res = Objec... | true |
1fb08e6cc8626c23a3d4c62e9f05f9209cc53457 | JavaScript | rtemelkovski/rtemelkovski.github.io | /animations.js | UTF-8 | 796 | 3.078125 | 3 | [] | no_license | var descriptions = [
"Computer Science Graduate",
"Software Developer",
"Open Source Enthusiast",
"Musician and Songwriter",
"Caffeine Lover"
]
function loadNext(cur){
setTimeout(function(){
var elem = document.getElementById("alterable-subtitle");
elem.innerHTML = descriptions[cur];
var next = (cur + 1) ... | true |
7276794c7cc5d66ccbf09fe0716e5c891ca0bab6 | JavaScript | jayaramksm/jay | /muni/UseReducerHook.js | UTF-8 | 1,019 | 2.609375 | 3 | [] | no_license | import React,{useReducer} from 'react'
const initialState = 0
const reducer = (state,action) =>{
switch (action) {
case 'increment':
return state+1
case 'decrement':
return state-1
case 'reset':
return state*0 ... | true |
7c25fa9c5024f7dcb459efd2b12b4ada38159578 | JavaScript | babylonwanderer/NewTutorialBot | /events/guild/messageDelete.js | UTF-8 | 941 | 2.5625 | 3 | [] | no_license | const {MessageEmbed} = require('discord.js')
module.exports=async(message)=>{
try{
if(message.author.bot) return;
const snipes = message.client.snipes.get(message.channel.id) || [];
snipes.unshift({
content: message.content,
author: message.author,
image: message.attachments.firs... | true |
4442b79981ed961b0d4b96cb7aa550b4a37962a2 | JavaScript | ian-kevin126/JavaScript-Knowledges | /src/3_Data_Structures_and_Algorithms/Data_and_Algorithms_4/leetcode/merge-sorted-array.js | UTF-8 | 408 | 3.09375 | 3 | [] | no_license | /**
* 地址:https://leetcode.com/problems/merge-sorted-array/
* Question:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
* Note:
* You may assume that nums1 has enough space (size that is greater or equal to m + n)
* to hold additional elements from nums2.
* The numbe... | true |
05cbabd0c34d66dc75c1327055365d45c11b029f | JavaScript | alexandra-chivescu/HTML-CSS-JS-exercises | /exercitii/javascript/car.js | UTF-8 | 202 | 3.140625 | 3 | [] | no_license | var car = {
make: "Fiat",
model: 500,
year: 1960,
color: "red",
mileage: 2000,
drive: function(distance) {
this.mileage += distance;
}
}
car.drive(100); | true |
ccbb329028593f66acdf20b90161fffb8c7daf49 | JavaScript | nikolayvoronchikhin/LODmilla-frontend | /js/lod/layout/buffer.js | UTF-8 | 7,127 | 3.234375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /**
* Created by Attila Gyorok on 2014.07.14..
*/
//Buffer classess for faster computing with the graph.
function Vertex(id, label, weight, isVirtual, left, top, type) {
this.id = id;
this.label = label; //for debugging
this.weight = weight;
this.isVirtual = isVirtual;
this.targets = [];
this... | true |
c90f4b13569b04c4caa348c186d3181decfaccb0 | JavaScript | AlbertoDSosa/TimeZones-mobil | /app/js/main.js | UTF-8 | 11,162 | 2.625 | 3 | [] | no_license |
'use strict';
// Menus Dropdown
var $addZones = $('.addZones'),
$aboutUs = $('.aboutUs'),
$aboutModal = $('.aboutModal'),
$addModal = $('.addModal');
$addZones.on('click', function (event) {
event.preventDefault();
if($aboutModal.is(':visible')) {
$aboutModal.fadeOut();
}
$addModal.toggle('slow');... | true |
48fe54874f396c46d4a7b557348717c789dc98ba | JavaScript | apanichkina/entrance-task-2-2 | /public/app/helpers.js | UTF-8 | 4,148 | 2.6875 | 3 | [] | no_license | import RadioGroup from './components/RadioGroup/radioGroup';
function easeInOutQuad(t, b, c, d) {
let time = t / (d / 2);
let result = 0;
if (time < 1) {
result = c / 2 * time * time + b;
} else {
time -= 1;
result = -c / 2 * (time * (time - 2) - 1) + b;
}
return result;
}
export function sc... | true |
d61141ae35e016b74594c393c3840b2ba3868c49 | JavaScript | endemic/akari_madness | /src/objects/cell.js | UTF-8 | 3,802 | 3.0625 | 3 | [
"MIT"
] | permissive | /*jslint this: true, browser: true */
/*global Arcadia, window, Grid */
(function (root) {
'use strict';
var Cell;
Cell = function () {
Arcadia.Shape.apply(this, arguments);
this.size = {width: Grid.CELL_WIDTH, height: Grid.CELL_HEIGHT};
this.vertices = 4;
this.color = Ce... | true |
2be3e494ac24d5dae4fa87eb7baa5e7ac06e9815 | JavaScript | iisbigfish/quiz | /public/js/common.js | UTF-8 | 526 | 2.71875 | 3 | [] | no_license | window.onload = function(){
//do something
console.log('//do something')
let name = localStorage.getItem('username')
if (name) {
let user = document.querySelector('.username')
user.children[0].innerHTML = name
user.style.display = 'block'
let login = this.document.querySe... | true |
0169d3af270a34f4ca656466e8b31125858360e5 | JavaScript | ufjf-dcc104/dcc104-canvas-exr09-andrearchanjo | /Map.js | UTF-8 | 2,684 | 3.203125 | 3 | [] | no_license | function Map(rows, collumns) {
this.SIZE = 32;
this.victory = false;
this.tesouros = 0;
this.cells = [];
for (var r = 0; r < rows; r++) {
this.cells[r] = [];
for (var c = 0; c < collumns; c++) {
this.cells[r][c] = 0;
}
}
}
Map.prototype.desenhar = function (ctx, img) {
for (var r = 0; ... | true |
3824e684e53219a96ce5035bcc459a6c309fcee2 | JavaScript | pissang/doubi | /js/loading.js | UTF-8 | 2,721 | 2.9375 | 3 | [] | no_license | (function() {
'use strict';
var stopped = false;
window.stopLoading = function() {
if (tip) {
document.body.removeChild(tip);
document.body.removeChild(canvas);
}
stopped = true;
}
var canvas = document.createElement('canvas');
var backCanv... | true |
8283ca674695da4c84d3e4cfefa93334d9888e84 | JavaScript | daevid/QJSTalk | /SerialFs.js | UTF-8 | 669 | 2.78125 | 3 | [] | no_license | var fs = require('fs');
var _ = require('lodash');
(function compareFileLists(){
var firstList;
var secondList;
var thirdList;
fs.readFile('JsonList1.json', function (error, firstFile){
firstList = JSON.parse(firstFile);
fs.readFile('JsonList2.json', function (error, secondFile){
... | true |
91217e5f5076ec4e20e825e4c27691b66926db14 | JavaScript | alaltru1992/newGame | /src/model/sign.js | UTF-8 | 957 | 2.734375 | 3 | [] | no_license | import Actor from "./actor";
export default class Signature extends Actor {
constructor({ actor, direction = actor.direction.x }) {
super("alolo");
!direction && (direction = 1);
this.actor = actor;
this.speed.x = direction * 100;
this.speed.y = 20;
this.viewCreated... | true |
5d5e742870e2cee7793d7ece7ad896cd72f48198 | JavaScript | lulupy/web-manual | /jslib-book/react/code/src/test/demo24/index.jsx | UTF-8 | 3,456 | 3.1875 | 3 | [
"MIT"
] | permissive | function logger(store){
return function wrapDispatchToAddLogging(next){
return function dispatchAndLog(action){
console.log('dispatching', action)
let result = next(action)
console.log('next state', store.getState())
return result
}
}
}
function c... | true |
9a69ae6b9857996804a247dba522554524a8cbdb | JavaScript | sogoodidea/EFImageProject-hw4-27 | /Hw4-27EFImageProject.web/wwwroot/js/ViewImage.js | UTF-8 | 822 | 2.890625 | 3 | [] | no_license | $(() => {
$("#like-image").on('click', function () {
const id = $(this).data('image-id');
console.log(id);
$.post('/home/likeImage', { id } , function () {
//disable the button while user is here. Sessions will ensure the next time they come to page, it's also disabl... | true |
2c8ece2ab812db2c12a8b5e1709615f3c5eda7ec | JavaScript | js-path/problems-and-solutions | /reverse.js | UTF-8 | 574 | 3.5625 | 4 | [] | no_license | function testing(func) {
if ((func + "").search(".reverse") !== -1) {
console.log("dont use reverse function, dogshit");
return false
}
console.log(JSON.stringify(func([1, 2, 3, 4])) === "[4,3,2,1]" ? "1: ok" : "1: failed")
console.log(JSON.stringify(func([9, 9, 2, 3, 4])) === "[4,3,2,9,... | true |
542ddfd36fa9c50e9229b564926e1ecf000abb42 | JavaScript | EscanorII/music-player-js | /code.js | UTF-8 | 5,399 | 2.765625 | 3 | [] | no_license | const MUSIC_PLAYER = document.querySelector('.music-player')
const COVER = MUSIC_PLAYER.querySelector('.music_player__cover')
const COVER_IMG = COVER.querySelector("img")
const BTN_PLAY = MUSIC_PLAYER.querySelector('#btn_play')
const AUDIO = MUSIC_PLAYER.querySelector('.music-player__audio')
const AUDIO_NAME = MUSIC_PL... | true |
8ae4ff2b16dd57ba19c63b5eb351207cee95f58c | JavaScript | giolandicho/EvenTinder-Backend | /controllers/event.js | UTF-8 | 1,000 | 2.625 | 3 | [] | no_license | import Event from "../models/event.js";
import User from "../models/user.js";
export const addEvent = async(req, res)=>{
const event = req.body;
console.log(event);
const user = await User.findById(event.users.uid).exec();
Event.countDocuments({
eventName: event.eventName,
date: event.... | true |
94c9550072554bcd7668210800e7918f0adb7faf | JavaScript | robert00091/NCU-GPA-calculator | /content_script.js | UTF-8 | 3,183 | 3.171875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /////////////////// calculate GPA ///////////////////
var x = $('.list1').find('td:eq(1)');
// overall GPA
var total_credit = 0;
var grade_points = 0;
for(var i=0; i<x.length;i++){
var course = $('.list1').eq(i).find('td:eq(1)').text();
var score = parseInt($('.list1').eq(i).find('td:eq(4)').text());
/... | true |
9e8febd3a2ff9c13da741dc210bc2f9afe81cc29 | JavaScript | keshy/bitstarter | /grader.js | UTF-8 | 3,451 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env node
/*
Automatically grade files for the presence of specified HTML tags/attributes.
Uses commander.js and cheerio. Teaches command line application development
and basic DOM parsing.
References:
+ cheerio
- https://github.com/MatthewMueller/cheerio
- http://encosia.com/cheerio-faster-windows-f... | true |
2f5fb3b1a6cbe30f4e2012b458adf9f1b262c1d3 | JavaScript | liamoehlman/nginx-http-proxy | /lib/proxy.js | UTF-8 | 4,318 | 2.53125 | 3 | [] | no_license | var handlebars = require('handlebars'),
fs = require ('fs'),
path = require('path'),
exec = require('child_process').exec;
var Nginx = module.exports = exports = function(dir) {
this.dir = dir;
this.rules = [];
this.conf = path.join(dir, 'rules.json');
if (!fs.existsSync(this.conf)){
fs.writ... | true |
fd0e6823b41c5f49acde1b893203d50541838f3d | JavaScript | Calberk/to-do-list | /src/helpers/index.js | UTF-8 | 329 | 3.625 | 4 | [] | no_license | export function randomString(length){
const values = 'abcdefghijklmnopqrstuvwxzABCDEFGHIJKLMNOPQRSTUVWZY1234567890';
let randomStr = '';
for(let t = 0; t <length; t++){
const randIndex = Math.floor(Math.random()*values.length);
randomStr += values[randIndex]
}
return randomSt... | true |
3227c9a35289f41492840b5fd14f6ac893dbe5da | JavaScript | mihaineacsu/TweetMaps | /db.js | UTF-8 | 1,266 | 2.515625 | 3 | [] | no_license | var mongo = require('mongodb');
function setUp(host, port, db_name, callback){
db = new mongo.Db(db_name, new mongo.Server(host, port), {native_parser: true, safe: true});
db.open(function(error){
if (error)
throw error;
console.log('Connected to mongodb://' + host + ':' + port);
db.createCollection('user... | true |
82479173015ce23205516940277ff21d6d8ca24c | JavaScript | eblatt/happy-songs | /chloropleth/map.js | UTF-8 | 3,692 | 2.65625 | 3 | [] | no_license | var margin = {top: 20, right: 20, bottom: 20, left: 20};
width = 800 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom,
formatPercent = d3.format(".1%");
var svg = d3.select("#map").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.... | true |
4661c0308736477f0fcb550afe1742a732dfd29a | JavaScript | johanuribe03/resume-beta | /main.js | UTF-8 | 2,823 | 2.703125 | 3 | [] | no_license | var bodyStyle = `
font-family: 'Rubik', sans-serif;
font-size: 1em;
color: #373a3c;
`
document.getElementsByTagName('body')[0].style = bodyStyle;
// *******************define css variables and applied to sections**************//
// var css1 = `
// width:30%;
// height: 700px;
/... | true |
c5a2a4103075151aec22ee51736dd420c2c24613 | JavaScript | jrambold/JS_Classic_Games | /racing/js/car.js | UTF-8 | 2,274 | 3.21875 | 3 | [] | no_license | const FRICTION_MULT = 0.94;
const DRIVE_POWER = 0.5;
const REVERSE_POWER = 0.2;
const TURN_RATE = 0.03;
const MIN_TURN_SPEED = 0.5;
function car() {
this.carX = 100;
this.carY = 100;
this.keyHeld_Gas = false;
this.keyHeld_Reverse = false;
this.keyHeld_TurnLeft = false;
this.keyHeld_TurnRight = false;
... | true |
ab3052f8f2effd714e6dc18b477c25bec41199fa | JavaScript | Zatyri/liittymavertailu | /src/components/Valitsin.js | UTF-8 | 2,423 | 2.5625 | 3 | [
"MIT"
] | permissive | import React, { useState } from 'react'
import logo from '../logot/logot'
const Valitsin = ({ liittymat, status, valitsin }) => {
const [valittuOperaattori, setValittuOperaattori] = useState()
const distinct = (value, index, self) => {
return self.indexOf(value) === index
}
const handleOpera... | true |
0dc85fc50c6465e8da72be599937e7ec61ef6a1e | JavaScript | Joseamica/Bootcamp.github.io | /Week 14 - Intro-To-JavaScript/1/Activities/06-Stu_Movie_Scores/Unsolved/static/js/index.js | UTF-8 | 579 | 3.453125 | 3 | [] | no_license | // Array of movie ratings
var movieScores = [
4.4,
3.3,
5.9,
8.8,
1.2,
5.2,
7.4,
7.5,
7.2,
9.7,
4.2,
6.9
];
// Starting a rating count
var sum = 0;
var z = 0;
// Arrays to hold movie scores
var goodMovieScores = [];
var okMovieScores = [];
var badMovieScores = [];
for (z; z < movieScores.lengt... | true |
7f66ed292f006cf4caf11d5f611b7080bc454b1e | JavaScript | Mauri7755/JavaScript | /Basico/Archivo13.js | UTF-8 | 314 | 3.4375 | 3 | [] | no_license | 'use strict'
var numbers=[1,2,3,4,5,6];
numbers.map(function(num){
return num*2;
});
numbers.map((num)=> num*2);
numbers.map((num)=> {
return num*2;
})
var arreglo1 = numbers.map((num)=> num*2)
var arreglo2 = numbers.map((num,index,original)=> num*3)
console.log(arreglo1);
console.log(arreglo2);
| true |
8d59019a356cf1f494e84c43b3dbcbc0e7be1d4c | JavaScript | hax/async.js | /src/index.js | UTF-8 | 625 | 2.71875 | 3 | [] | no_license | export default function async(generator) {
return function (...args) {
const it = generator(...args)
return new Promise((resolve, reject) => {
it_next()
function nextStep({done, value}) {
if (done) resolve(value)
else {
try {
Promise.resolve(value).then(it_next, it_throw)
} catch (e... | true |
82a758811ebe21138572f2b204f97422492b9bad | JavaScript | huangjinjian/node-19-11-26- | /7tcp.js/3address.js | UTF-8 | 298 | 2.828125 | 3 | [] | no_license | // address 用来查看服务器监听的地址信息
const net = require("net")
const server = net.createServer(() => {
console.log('连接成功');
})
server.listen(8055, () => {
let address = server.address()
console.log("服务器监听的地址信息:" + JSON.stringify(address));
}) | true |
2076be1e8ca3a2317460887fe4763d2db9ee7e93 | JavaScript | johnny353535/behindthewall | /script.js | UTF-8 | 1,484 | 3.125 | 3 | [] | no_license | function getLocation(callback) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(callback);
} else {
document.body.innerHTML = "Geolocation is not supported by this browser.";
}
}
// https://github.com/substack/point-in-polygon/blob/master/index.js
function pointInPoly... | true |
dc000762b4a87b41708d0ebd6384d3f3a5e81d6b | JavaScript | evgenik1/codewars | /5_newFunction_CSOD.js | UTF-8 | 341 | 3.8125 | 4 | [] | no_license | function sod(n) {
var sum = 0;
for (var i = 2; i <= n / 2; i++) {
if (n % i == 0) {
sum += i;
}
}
return sum;
}
console.log(sod(4));
function newFunction(n) {
var sum = 0;
for (var i = 1; i <= n; i++) {
sum += sod(i);
}
return sum;
}
console.log... | true |
652d5bd649c550a68cfa08b46e0a26a893643930 | JavaScript | malikgit/MortgageApp | /formsPlayAppV1-0.1/public/javascripts/mortgageJs/mortgagePage11Properties.js | UTF-8 | 50,753 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /**
* for angular js using
*/
var app = angular.module("demoApp", ['ui.bootstrap']);
app.controller('DemoController', function ($scope) {
console.log("inside angular controller ");
init();
function init() {
console.log("inside init() called of controller ");
$sco... | true |
d650e6802878b145ba08a12714505ca755c9cebb | JavaScript | bacacosta/cv-consumer | /web/js/Content.js | UTF-8 | 1,649 | 2.703125 | 3 | [] | no_license | var content = {
getContent: function(page) {
$("#menu li").removeClass("highlight").addClass("normal");
$("#" + page).removeClass("normal").addClass("highlight");
$("#content").removeClass("normal").addClass("loading");
$.getJSON(app.serviceURL + "rest/" + page, function(data) {
var html = [];
con... | true |
dc21bf38faea7baae4c92d8d7ef44e76752a8720 | JavaScript | enjareyes/JavascriptPractice | /characterFrequency.js | UTF-8 | 1,293 | 4.46875 | 4 | [] | no_license | // Character Frequency
// Write a function that takes as its input a string and returns
// an array of arrays as shown below sorted in descending order
// by frequency and then by ascending order by character.
// input: "aaabbc"
// output: [ [ "a", 3 ], [ "b", 2 ], [ "c", 1 ] ]
// input: "mississippi"
// output: [ ... | true |
a0a44a02575428cd3786b25ad61f417df162f846 | JavaScript | climboid/cloudIOS | /js/startIni.js | UTF-8 | 3,257 | 2.546875 | 3 | [] | no_license | var os = {
initialize:function(){
os.makeBar();
os.makeBG();
os.bindEvents();
os.resize();
},
makeBar:function(){
var e = $('<div/>').css({
'top':window.innerHeight - 40 +'px',
'position':'absolute'
}).attr({
id:'startBar',
class:'startBar'
}).html('<span class="sprite... | true |
1f483af240cdb63b10b9f0ec53abad91614d8ba6 | JavaScript | kimtrue/verita | /17_JQUERY/수업전 배포/09_plugin/test02.js | UTF-8 | 474 | 3.234375 | 3 | [] | no_license | /*
input 창의 숫자에 3자리마다 , 찍어주기
jquery가 선택한 객체에 추가하기: $.fn.이름
*/
$.fn.comma = function () {
// console.dir(this);
//3자리를 입력할때마다 이벤트 걸어주기
this.keyup(function () {
//이벤트 함수 내에서는 this 는 걸어준 애
// console.log(this.value);
//g 전체
this.value = this.value.replace(/,/g, "").replace(/\B(?... | true |
538afd24dd2f7c06aa6e90786cc41a384afa006c | JavaScript | zc3hd/demo_node_learn | /node-007/api_server/moudles/demo_1/index.js | UTF-8 | 2,778 | 2.578125 | 3 | [] | no_license | var Data = require('../../scripts/db.js');
function JS_demo(app) {
var me = this;
me.app = app;
me.data = new Data();
}
JS_demo.prototype = {
init: function() {
var me = this;
// add
me.app.post('/api/demo_1/add.do', function(req, res) {
me._api_add(req, res);
});
// list
me.ap... | true |
1141672a1e907e912886ae76811264b126c76ed0 | JavaScript | Myrtille35/demo-organizer | /app/public/client.js | UTF-8 | 2,449 | 2.625 | 3 | [] | no_license | /**
* Created by cedric on 22/04/16.
*/
(function () {
'use strict';
var socket = io();
function Organizer() {
var self = this;
//load user from input and set it to model
self.user = ko.observable(JSON.parse($("#usrInfo").val()));
socket.emit('user connected', ko.toJS(sel... | true |
8a955fec6852600d868bf913503cb454a278884d | JavaScript | codeater7/Statistics | /build/index.js | UTF-8 | 1,161 | 2.53125 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CsvFileReader_1 = require("./CsvFileReader");
var MatchReader_1 = require("./MatchReader");
var WinsAnalysis_1 = require("./analyzers/WinsAnalysis");
var Summary_1 = require("./Summary");
var HtmlReports_1 = require("./reportTargets/HtmlRe... | true |
92d6864fac2850f726254749270c703360cfad77 | JavaScript | Govindrai024/bootcamp2020_class4 | /src/App.js | UTF-8 | 719 | 2.65625 | 3 | [] | no_license | import React, { useState } from 'react';
import { Cart } from './cart.js';
import './App.css';
// Simple counter with Using Hooks.
export default function App() {
let [Count, setCount] = useState(0);
let [ischartFull, setCharFull] = useState(true)
return (
<div className="header ">
<div>
<... | true |
42e3be0289400a47ce3453f22a756494ef3cedfa | JavaScript | mohsenshafiei/tihcp-2 | /sum-of-nodes-with-even-valued-grandparent/index.js | UTF-8 | 954 | 3.171875 | 3 | [] | no_license | const sumEvenGrandparent = (root) => {
let sum = 0;
for (let i = 0; i < root.length; i++) {
if (root[i]) {
if (i % 2 !== 0 && root[Math.floor((i - 3) / 4)] % 2 === 0)
sum += root[i];
if (i % 2 === 0 && root[Math.floor((i - 4) / 4)] % 2 === 0)
sum += root[i];
}
}
return sum;
}... | true |
ad1c402c730226d4fec0848ce618253faced71b1 | JavaScript | Debolina25/Unitconverter | /unit/src/Container/Voltage/index.js | UTF-8 | 3,506 | 2.6875 | 3 | [] | no_license | import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import Header from '../../Component/Header';
import '../style.css';
export default class Temperature extends React.Component {
constructor() {
super();
this.state={
output: '',
input: '',
f... | true |
aeb94b8d52b282e446d9d9dde0700227f8dc4b08 | JavaScript | w0dm4n/BlockchainJS | /node/srcs/transaction.js | UTF-8 | 530 | 2.625 | 3 | [] | no_license | export default class Transaction
{
constructor(raw, debug) // id, amount, sender, recipient
{
this.id = raw.id;
this.amount = Number(raw.amount);
this.sender = raw.sender;
this.recipient = raw.recipient;
this.signature = raw.signature;
this.timestamp = raw.timest... | true |
367a7caad8a3c898744d095b16f7ee601db47a3f | JavaScript | GlisseLisbeth/capitan-sass | /assets/js/list.js | UTF-8 | 465 | 2.71875 | 3 | [] | no_license | "use strict";
const render = (root)=>{
root.empty();
state.students.forEach((student,index)=> {
const list = $('<li>'+ state.students[index].name +'<input type="checkbox"> </li>');
root.append(list);
})
}
const state = {
students:null
};
$(_=>{
getJSON('http://laboratoria.cuadra.co:9339/api/v1/students/... | true |
ed5bb89aa7b406e6d3a64d3a3a155a3ae9f5427e | JavaScript | sebastienva/react-materiel | /demo/src/InputDemo/InputDemo.js | UTF-8 | 1,724 | 2.65625 | 3 | [] | no_license | // @flow
import React, { Component } from 'react';
import { Input } from '../../../src';
class InputDemo extends Component {
state: {
firstName: string,
lastName: string,
email: string,
disable: string
};
constructor(props: any) {
super(props);
this.state = {
firstName: '',
... | true |
06c557ebfedca5bbb815c9e77341cf0912db1d5e | JavaScript | qualmless/scrumlords-atm | /assets/js/main.js | UTF-8 | 4,110 | 3.328125 | 3 | [] | no_license | loginPin = () => {
let loginPin = parseInt(document.getElementById("loginPin").value);
if (isNaN(loginPin)) {
document.getElementById("displayAlerts").innerHTML = "Value must be numbers only";
setTimeout(clearErr, 3000);
} else if (loginPin == localStorage.getItem("pin")) {
//display... | true |
2034fd16cc7d13456dbd2bd733e216e467e702aa | JavaScript | NabilOukdim/campus-js-avance | /backend/async/promise.js | UTF-8 | 753 | 2.75 | 3 | [] | no_license | const fs = require('fs');
function readAlpsDir() {
const readdirPromise = fs.promises.readdir(__dirname);
const readAlpsDir = readdirPromise
.then(files => {
// files : ['file1', 'file2']
const transformed = files.map(file => ({name: file, isFolder: true}));
// trans... | true |
741beaadf377b62ee0964546f125bd122d3a9c90 | JavaScript | corentindesfarges/gom-jabbar | /caribou/back/src/logic/functional/human.js | UTF-8 | 877 | 2.625 | 3 | [] | no_license | const {getDistance} = require("../../tools");
module.exports = class HumanLogic {
constructor(MongoProvider) {
this.mongoProvider = MongoProvider;
}
register(humanData) {
return this.mongoProvider((Human) => {
const {lat, lng, excitementLevel, trashingLevel} = humanData;
const human = new Hu... | true |
75f089711be5eadb76ddc7e683acd2495c93f635 | JavaScript | raybergholm/barebell-backend | /src/stats-api-handler/index.js | UTF-8 | 1,264 | 2.671875 | 3 | [] | no_license | const AWS = require('aws-sdk')
AWS.config.update({
region: "eu-central-1"
})
const dynamoDB = new AWS.DynamoDB() // indexed storage
const s3 = new AWS.S3() // long-term storage if querying long-term trends
const LATEST_RESOURCE = "/stats/latest"
exports.handler = async (event) => {
const resource = event.reso... | true |
a82a1113661d71448931a05bc4c4f0e97a386db4 | JavaScript | raultocantins/Calculater-Reactjs | /src/main/Calculater.jsx | UTF-8 | 2,715 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react'
import './Calculater.css'
import Button from '../Components/Button'
import Display from '../Components/Display'
const initialState={
displayValue:'0',
clearDisplay:false,
operation:null,
values:[0,0],
current:0
}
export default class Calculater extends Compon... | true |
567c96b3b629b4da65272166ed504c82f08a9165 | JavaScript | devops-ng/apisecurityinaction | /natter-api/src/main/resources/public/login.js | UTF-8 | 992 | 2.90625 | 3 | [
"MIT"
] | permissive | const apiUrl = 'https://localhost:4567';
function login(username, password) {
let credentials = 'Basic ' + btoa(username + ':' + password);
fetch(apiUrl + '/sessions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': credentials
... | true |
755842017042201d03e109e4d2222efca3c77928 | JavaScript | AxelC0de/basic-js | /src/hanoi-tower.js | UTF-8 | 331 | 2.8125 | 3 | [
"MIT"
] | permissive | const CustomError = require("../extensions/custom-error");
module.exports = function calculateHanoi(disksNumber, turnsSpeed) {
const turns = 2 ** disksNumber - 1;
const speedPerSec = turnsSpeed / 3600;
const seconds = turns / speedPerSec;
const arr = {};
arr.turns = turns;
arr.seconds = Math.floor(seconds);
ret... | true |
ecf7e175a42c45a28f332f5c1acbb4900bde43de | JavaScript | arubenruben/LAIG | /TP3/Trabalho_3/primitives/MyPatch.js | UTF-8 | 2,362 | 3.234375 | 3 | [] | no_license | /**
* MyPatch NURBS
* @constructor
* @param scene Reference to the scene
* @param npointsU the number of points in the u direction
* @param npointsV the number of points in the v direction
* @param npartsU the number of parts in the u direction
* @param npartsV the number of parts in the v direction
* @param controlPo... | true |
8a9278e7456c7d6b7fa94a1038344450a8d56b22 | JavaScript | just-arun/online_banking_proto | /api/util/sendSms.js | UTF-8 | 803 | 2.53125 | 3 | [] | no_license | var http = require('http');
var urlencode = require('urlencode');
const keys = require('./../config/keys');
function sendSms(email, number, message) {
let msg = urlencode(message);
let sender = 'txtlcl';
let hash = keys.smsHASH;
// let data = `username=${email}&hash=${hash}&sender=${sender}&numbers=${... | true |
7f65dc5d2904575b21b8da27ec3784964cccc228 | JavaScript | h4hany/leetcode | /python_solutions/494.target-sum.js | UTF-8 | 2,804 | 3.875 | 4 | [] | no_license | /*
* @lc app=leetcode id=494 lang=javascript
*
* [494] Target Sum
*
* https://leetcode.com/problems/target-sum/description/
*
* algorithms
* Medium (45.21%)
* Total Accepted: 95.3K
* Total Submissions: 210.8K
* Testcase Example: '[1,1,1,1,1]\n3'
*
*
* You are given a list of non-negative integers, a1... | true |
74d03b74fec9cfe3a6a701726f79434219ace539 | JavaScript | Pratyush017/Ananya-c27-wrong | /String.js | UTF-8 | 595 | 2.890625 | 3 | [] | no_license | class String {
constructor(bodyA,bodyB,offsetX,offsetY){
this.offsetX = offsetX;
this.offsetY = offsetY;
var options = {
bodyA:bodyA,
bodyB:bodyB,
pointB:{x:this.offsetX,y:this.offsetY}
}
this.string = Constraint.create(options);
... | true |
82819fbfd3d815213f486f0f09d0203c81c1dd68 | JavaScript | kawshar798/core-javascript | /dayone/nestedFunction.js | UTF-8 | 579 | 4.03125 | 4 | [] | no_license | //nested function
function outer(){
function inner(){
console.log("Hello! I'm Inner");
}
inner();
console.log("Hello! I'm Outer");
}
outer();
//Exam two
function minicalculat(a,b){
// for sum
function sum(){
return a + b;
}
// for subtraction
function sub(){
... | true |
c23343be2627e3724d1852f3ea14667853d47a66 | JavaScript | ZITA4PDE/CoDR | /codr/assets/js/exercise/settings.js | UTF-8 | 2,693 | 2.6875 | 3 | [] | no_license | import React from 'react';
import {EditButton, ExerciseForm, HeaderButton, SaveButton} from "../objects";
import {params_to_url} from "../helpers";
import * as config from "../config";
/**
* Settings for exercise
*/
export class Settings extends React.Component {
constructor(props) {
super(props);
... | true |
8c23ee5858e75fad7ea390786b0fca74a8c7950e | JavaScript | ryanklimt/Hidden-Perception | /Assets/Scripts/FlickeringLight.js | UTF-8 | 719 | 2.875 | 3 | [] | no_license | var bgColor : Color;
var looping : boolean = true;
function Start () {
StartCoroutine(bgColorShifter());
}
function bgColorShifter(){
while (looping){
bgColor.r = Random.value;
bgColor.g = Random.value;
bgColor.b = Random.value;
bgColor.a = 1.0;
var t: float = 0f... | true |
25e553d2ee0841259b7a30b2045cbde7152ce333 | JavaScript | jieunkang-101/GrowPlant_FP | /src/plant.js | UTF-8 | 5,146 | 3.65625 | 4 | [
"MIT"
] | permissive | export const storeState = (initialState) => {
let currentState = initialState;
return (stateChangeFunction) => {
const newState = stateChangeFunction(currentState);
currentState = {...newState };
return newState;
}
}
export const changeState = (prop) => {
return (value) => {
return (state) =>... | true |
64ae10ed03f6d2d4ca47064dd16aacf17c6f5fc9 | JavaScript | Porridge34/pset-2 | /src/hourly.js | UTF-8 | 738 | 3.390625 | 3 | [] | no_license | console.log();
const input = require("readline-sync");
const hourlyWage = input.question("Hourly wage: ");
console.log();
const monday = input.question("Monday: ");
const tuesday = input.question("Tuesday: ");
const wednesday = input.question("Wednesday: ");
const thursday = input.question("Thursday: ");
const friday =... | true |
d644cbe49a39f382612910b662e4cd0d3a7d64aa | JavaScript | drinith/my-meteor-blog | /client/templates/home.js | UTF-8 | 1,074 | 3.09375 | 3 | [] | no_license | Template.home.created = function () {
console.log('Created the home template');
};
Template.home.rendered = function () {
console.log('Rendered the home template');
};
Template.home.destroyed = function () {
console.log('Destroyed the home template');
};
//To display data in the home template, we will cre... | true |
85154882531e69e7561eadcdafa45526a69248ef | JavaScript | Mrdaigithub/Mrdaigithub.github.io | /2016ife/js/task20/index.js | UTF-8 | 8,945 | 3.59375 | 4 | [] | no_license | // 任务描述
//
// 基于任务18进行升级
// 将新元素输入框从input改为textarea
// 允许一次批量输入多个内容,格式可以为数字、中文、英文等,可以通过用回车,逗号(全角半角均可),顿号,空格(全角半角、Tab等均可)等符号作为不同内容的间隔
// 增加一个查询文本输入框,和一个查询按钮,当点击查询时,将查询词在各个元素内容中做模糊匹配,将匹配到的内容进行特殊标识,如文字颜色等。举例,内容中有abcd,查询词为ab或bc,则该内容需要标识
(function (WIN, DOC) {
let form = DOC.getElementById('form'),
tex... | true |
08e5097e64c69107f22328a796f72dfeefd114c9 | JavaScript | amakaogujiofor/main-weather-app | /script.js | UTF-8 | 4,012 | 3.234375 | 3 | [] | no_license | /* SHOW DATE SETTING*/
let now = new Date();
console.log(now);
let time = now.getHours();
console.log(time);
let mins = now.getMinutes();
console.log(mins);
let date = now.getDate();
console.log(date);
let days = ["Sun", "Mon", "Tue", "Wed", "Thurs", "Fri", "Sat"];
let day = days[now.getDay()];
console.log(day);
l... | true |
1dcc684598f67ace9ac46d764b1911a4c0e106cd | JavaScript | Trasis33/fl222pw_1dv600 | /src/getWord.js | UTF-8 | 883 | 2.765625 | 3 | [] | no_license | module.exports.getWord = (difficulty) => {
if (difficulty === 'Hard') {
let hard = ['awkward', 'bagpipe', 'banjo', 'dwarfes', 'fishhook', 'haphazard', 'hyphen', 'ivory', 'jiffy', 'jinx', 'jukebox', 'kiosk', 'kayak', 'numbskull', 'oxygen', 'pixel', 'polka', 'rhythmic', 'rogue', 'sphinx', 'swivel', 'unzip', 'yacht'... | true |
c2b7d32ae9a950975bbea36d1125f5977240cd12 | JavaScript | zushenyan/redux-comparison | /client/reducer.js | UTF-8 | 1,388 | 2.53125 | 3 | [] | no_license | import _ from "lodash";
import * as actions from "./actions.js";
const INIT_STATE = {
fetchState: "start",
data: {},
error: {},
abort: () => {},
event: {}
};
const reducer = (state = INIT_STATE, action) => {
// for unknown reason it won't clone while in object merging,
// so I have ... | true |
424865f33a657c3d102e1eadd69296b6ca899247 | JavaScript | niubilityxiesong/twhomework1 | /practices/filter/grouping_count.js | UTF-8 | 406 | 2.671875 | 3 | [] | no_license | 'use strict';
function grouping_count(collection) {
//在这里写入代码
let mapResult = {};
let countNum = 1;
collection.sort();
for (let i = 0; i < collection.length - 1; i++) {
if(collection[i] === collection[i + 1]){
countNum++;
mapResult[collection[i]] = countNum;
}
else{
countNum ... | true |
f03ab94d820f70905c6e65efaff4167d042fbeef | JavaScript | marvs/firefight | /app/assets/javascripts/charts/line_troops.js | UTF-8 | 841 | 2.515625 | 3 | [] | no_license | var member = $('#member_name').text();
var parseDate = d3.time.format("%d-%m-%Y").parse;
d3.json("/members/get_troops_stats?id="+member, function(error, data) {
data.forEach(function(d) {
d.values.forEach(function(v) {
v.x = new Date(v.x).getTime();
v.y = +v.y;
})
})
var chart_data = data;
... | true |
a2269661a509c5113da39a27c6a6d28903ee906d | JavaScript | AbhishekChahar/Shloka_Assignment | /src/Level.js | UTF-8 | 981 | 2.515625 | 3 | [] | no_license | import React, { useState } from "react";
// var data = require("./data.json");
const Level = () => {
const [selectedLevelvalue, setSelectedLevelvalue] = useState("");
const getLevelvalue = (e) => {
e.preventDefault();
setSelectedLevelvalue(e.target.value);
console.log(e.target.value);
};
var Leve... | true |
a684a27bd30c290f2b94a9b3ee2b1db82c4226f8 | JavaScript | hijazi/mentoring | /app/js/truncate.js | UTF-8 | 623 | 2.515625 | 3 | [
"MIT"
] | permissive | angular.module('truncate', [])
.filter('characters', function () {
return function (text, size) {
if (isNaN(size)) return text;
if (size <= 0) return '';
if (text && text.length >= size) {
text = text.substring(0, size);
var lastspace = text.lastIndexOf(' ');
... | true |
f236c28c0ee885f2a47fe7cd1d3959b916d2d6d0 | JavaScript | dmax66/BoardGameEngine | /ui.js | UTF-8 | 9,837 | 2.78125 | 3 | [] | no_license |
function UIDrawPointAtCenterOfHex (hex) {
const thePoint = document.createElement ("DIV");
thePoint.setAttribute ("class", "center-of-hex");
thePoint.style.left = (xMapCoordFromUnitCoord (hex.x, hex.y) - 7) + "px";
thePoint.style.top = (yMapCoordFromUnitCoord (hex.x, hex.y) - 7) + "px";
document.... | true |
338dbc8c965321b241b492c6b14f9e08187210f3 | JavaScript | yashbhatia100/OnlinePlantNursery-UI | /onlineplantnursery/src/redux/getPlantByNameRequest/getPlantByNameRequestReducer.js | UTF-8 | 466 | 2.5625 | 3 | [] | no_license | import getPlantByNameRequestConstants from "./getPlantByNameRequestConstants";
const initialState={
plant:undefined,
error:''
}
function getPlantByNameRequestReducer(state=initialState, action){
if(action.type == getPlantByNameRequestConstants.success || action.type==getPlantByNameRequestConstants.fai... | true |
6e9883a1d63d14f113d6d0eb117188421a9fd352 | JavaScript | jleigh0713/Constructor-Hangman | /const-hangman.js | UTF-8 | 3,266 | 4.1875 | 4 | [] | no_license | //requiring inquirer package
const inquirer = require('inquirer');
const Word = require('./word.js');
const wordList = ['horticulture', 'garden', 'vegetables', 'flowers', 'lavender', 'hiking', 'camping', 'farming' ];
// garden
// [ 'g', 'a', 'r', 'd', 'e', 'n' ]
//setting up game constructor
let game =
{
wordList... | true |
4428bc54975eef9bd6b6475b210075f06ebcf7fb | JavaScript | onurkybsi/IntermediateAlgorithmScriptingfreeCodeCamp | /BinaryAgents.js | UTF-8 | 527 | 3.140625 | 3 | [] | no_license |
function binaryAgent(str) {
let result = "";
str = str.split(" ");
let digits = [];
str.forEach(element => {
digits.push(parseInt(element,2));
});
digits.forEach(element => {
result += String.fromCharCode(element);
});
return result;
}
... | true |
8f75936722fee07ddf602d18b3804ad7318e1b73 | JavaScript | Scerocraw/tech-test | /test/serverTest.js | UTF-8 | 10,073 | 2.90625 | 3 | [] | no_license | // This test tests the application itself
var assert = require('assert');
var should = require('should');
var request = require('supertest');
// Basic test section
describe('Basic tests', function() {
// Please change the URL when it is not 127.0.0.1:8080
var URL = '127.0.0.1:8080';
// Main tests (current... | true |
55311bac8b44dc2048058833a48b25025ac10a64 | JavaScript | Trangnguyen1997/Digicash | /src/utils/findArray.js | UTF-8 | 130 | 2.84375 | 3 | [] | no_license | export default function isFoundArray(array, index){
array.find(function(e) {
return e === index ? true : false;
})
} | true |
42ea7d8687bc74576057231cc3138b582e0886e8 | JavaScript | confiscate/secret | /grid.js | UTF-8 | 3,358 | 2.8125 | 3 | [] | no_license |
var timeBetween = 5000;
var cur = 1;
var totalSecrets = 8;
var transitionFunction = opacityTransition;
var randomNum = 0;
function opacityTransition() {
var result = advance();
var listener = function(e) {
result.prevSecret.style.display = 'none';
result.curSecret.style.opacity = '1';
result.pre... | true |