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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4e69278d3fdb3bfbf1ad3d540fbfd541fc92de46 | JavaScript | freshrap6/theater_hackathon | /src/Components/SignUp.jsx | UTF-8 | 3,537 | 2.828125 | 3 | [] | no_license | import React, { useState } from 'react';
const SignUp = () => {
const supportedTitles = ['Mr.', 'Ms.', 'Mrs.', 'Mx.', 'Dr.', 'Other'];
const supportedGenders = ['Woman', "Man", "Transgender", "Nonbinary", "Prefer not to respond"];
// Form values in state
const [title, setTitle] = useState('');
cons... | true |
6a7c0869480b10f0a94454455def61c9c6b12301 | JavaScript | adityaiiitL/ToDo-List | /todoList.js | UTF-8 | 1,963 | 3.359375 | 3 | [] | no_license | const todoForm=document.querySelector('#addTodo');
const todoInput=document.querySelector('#todos');
const list=document.querySelector('ul');
const addButton=document.querySelector('#submit');
const delForm=document.querySelector('#delTodo');
const delInput=document.querySelector('#deleteItem');
const delButton=docume... | true |
46f52f7b86990205e165b06c9b18e47e53d0623d | JavaScript | mathiuskormasela12/sport-website | /js/main.js | UTF-8 | 2,474 | 2.9375 | 3 | [] | no_license | var i = 0;
var img = [];
var times= 5000;
img[0] = 'assets/img/img-1.png';
img[1] = 'assets/img/img-2.png';
img[2] = 'assets/img/img-3.png';
// Change Image
function changeMainSlide(){
document.slide.src = img[i];
if( i < img.length - 1 ) {
i++;
}else {
i = 0;
}
setTimeout("c... | true |
6e57234a8126536fda293737f05445657857d7d8 | JavaScript | Lrelia/big-loading | /home.js | UTF-8 | 397 | 2.53125 | 3 | [] | no_license | (function(win, doc, nav) {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var lGrd = ctx.createLinearGradient(0, 0, canvas.width, canvas.height);
lGrd.addColorStop(0, '#ff0000');
lGrd.addColorStop(.5, '#00ff00');
lGrd.addColorStop(1, '#0000ff');
ctx.fillStyle = lGrd;
ctx.f... | true |
5fec80afbf4d3aa9a6e1e24e5d7793c53e9a2763 | JavaScript | shaunjacobsen/expense-tracker | /src/selectors/expenses-total.js | UTF-8 | 163 | 2.53125 | 3 | [] | no_license | export default expenses => {
return expenses
.map(expense => {
return expense.amount;
})
.reduce((a, c) => {
return a + c;
}, 0);
};
| true |
5eee35a049303d49e874065a1c5980dfa234025e | JavaScript | pvpoke/pvpoke | /src/js/training/MatchHandler.js | UTF-8 | 3,981 | 2.765625 | 3 | [
"MIT"
] | permissive | // JavaScript Document
function MatchHandler(){
var self = this;
var interface;
var battler;
var gm;
var battle = new Battle();
var players = [];
var properties;
var roundRecord = [0, 0];
var previousRoundResult = null;
var previousRoundTeams = [];
// Initialize handler
this.init = function(){
gm = G... | true |
c86b54260585bc98d70a4c5786eb630f3c9d0cf3 | JavaScript | karimould/faber-ernaehrungsberatung | /src/components/countdown/Countdown.jsx | UTF-8 | 3,331 | 2.859375 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './countdown.scss';
export default class Countdown extends Component {
millisecondsForDay = 86400000;
millisecondsForHours = 3600000;
millisecondsForMinutes = 60000;
millisecondsForSeconds = 1000;
milliSecondsToTargetDat... | true |
4164b92dbea7d5de7f0ea56f76e0fcf3f0f34850 | JavaScript | dandgerson/egghead.io-getting-started-with-redux | /src/store/reducers/todos.js | UTF-8 | 1,992 | 2.5625 | 3 | [] | no_license | import sid from 'shortid'
import { combineReducers } from 'redux'
const t = {
ADD_TODO: 'ADD_TODO',
TOGGLE_TODO: 'TOGGLE_TODO',
RECIEVE_TODOS: 'RECIEVE_TODOS',
}
const todo = (state, action) => {
switch (action.type) {
case t.ADD_TODO: {
return {
id: action.id,
text: action.text,
... | true |
4c96565b05d47d7a57b99c14062d2aa591310221 | JavaScript | priyanka19697/FSD-assignments | /1/1.js | UTF-8 | 289 | 3.359375 | 3 | [] | no_license | function validate () {
var x = document.getElementById("number").value;
// If x is Not a Number or less than one or greater than 10
if (isNaN(x) || x < 10 || x > 100 || (x%10 != 0)){
alert("Input must be a multiple of 10");
} else {
alert("SUCCESS");
}
}
| true |
81ea1b442ab1fbbcfd11efccd1e960532e675935 | JavaScript | ratchagarn/react-showcase | /src/modules/FetchJndWebApiData.js | UTF-8 | 1,405 | 2.703125 | 3 | [] | no_license | /**
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
* Module - FetchJndWebApiData
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*/
import { Component } from 'react'
import axios from 'axios'
class FetchJndWebApiData extends Component {
static defaultProps = {
delay: 0,
onSuccess: ... | true |
b23d9b1e0bd5ade7faeb856b44308a9980d1ca89 | JavaScript | blasdch18/Numerical-Analysis | /Numerico/Web/gf.js | UTF-8 | 935 | 2.640625 | 3 | [] | no_license | function OnclicGraph() {
//Clear canvas
var doc = document;
var canvas = doc.getElementById("myCanvas");
var context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);
//End clear canvas
//Value of itemselected from combo
selected = doc.getElementB... | true |
8452e343b6f5de964d5b82ac1d1fba8b46dc401c | JavaScript | Ma-cherie/Help | /miniprogram/pages/newTopic/newTopic.js | UTF-8 | 3,356 | 2.5625 | 3 | [] | no_license | // miniprogram/pages/newTopic.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
title: null,
content: null,
photoArr: [], //上传图片后的本地地址
imageUrl: [], //upload之后的fileID
},
onTitleChange: function(event) {
// console.log(event.detail);
this.data.title = event.detail;
},... | true |
454f9c0e0b93814b2785442a89435a5f46cc5480 | JavaScript | benkoontz/JavaScript-Concepts | /22_Changing Objects/ben.js | UTF-8 | 393 | 3.828125 | 4 | [] | no_license |
// changing object property
var dog = {
"name": "ben",
"legs": 4,
"tails": 1,
"friends": ["everything"],
7 : 8
};
dog.name = "hello"
console.log(dog.name) // prints hello
// changing object properties
dog.bark = "bow wow" // adds new property bark
console.log(dog.bark) // prints bow wow
// dele... | true |
116c8a07a5cc6b7acd94e76eb35f44dcc7f50527 | JavaScript | Candle-Games/pestis | /client/src/plugins/loading-progress-bar.js | UTF-8 | 3,349 | 2.578125 | 3 | [
"MIT"
] | permissive | (function(ns) {
function LoadingProgressBar(scene) {
Phaser.Scenes.ScenePlugin.call(this, scene);
this.background;
this.pctbar;
this.width = this.scene.game.canvas.width;
this.height = this.scene.game.canvas.height;
this.hmargin = width * 0.2;
this.vmargin = 50;
this.config;
}
... | true |
6344f868b49962bfa728875a3b5ef9bb3b70240c | JavaScript | mrsufgi/avro-service | /src/validateSchema.js | UTF-8 | 1,469 | 2.671875 | 3 | [] | no_license | const getSchema = require('./getSchema');
const { isInt, isFloat, isLong, isBool, isString } = require('./validators');
const validators = {
int: isInt,
float: isFloat,
long: isLong,
string: isString,
boolean: isBool,
array: (array, validator) => {
return Array.isArray(array) && array.reduce((acc, val... | true |
cf659f7dc1d272a3d8798f8abe05fe2a29db87a2 | JavaScript | ShaneSutro/tech-dry-run | /scripts/TechDryRun.js | UTF-8 | 966 | 3.578125 | 4 | [] | no_license | //Tech Dry Run
// var hrr18 = {
// name: 'Keeley Nakamoto',
// }
// const marlon = {
// name: 'Marlon Esparza',
// }
// ---------------------------------------------
// NEW FEATURES FOR PAIRING TEST
// steps:
// 1. grab the section title
// 2. grab the section image
// 3. grab the page button
... | true |
046d1b571280f38c9bcf9e2506c1bad7c9d45a46 | JavaScript | hiroshikinofu/hoihoi | /hogehoge/JavaScript/surasura/1_1/chap1_7_2.js | UTF-8 | 239 | 4.15625 | 4 | [] | no_license | // 変数を使うメリットは?
let kakaku = 100;
let urine = kakaku * 1.08;
console.log(urine);
// 数値100を変数'kakaku'に入れろ
// 変数'kakaku'*1.08した値を、変数'urine'に入れろ
// 変数'urine'を表示しろ | true |
5fe8ba3fab28d8608a85ee6120ae351cb00421a7 | JavaScript | Buk1m/delegation-assistance | /frontend/__e2e__/pageobjects/page.js | UTF-8 | 1,634 | 2.53125 | 3 | [] | no_license | import { baseUrl, callTimeout } from "../constants";
export default class Page {
constructor() {
const _username = () => browser.$("input[name='login']");
const _password = () => browser.$("input[name='password']");
const _submitBtn = () => browser.$("form button[type='submit']");
this.login =... | true |
1cc0d09b13fd6129acdaf9d8c24f3c0d2d62fb72 | JavaScript | neurotrack/configur8 | /dist/value-injector/replacement-value-injector.js | UTF-8 | 3,515 | 2.546875 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const value_injector_1 = require("./value-injector");
/**
* Matches on any word chunks that have a semi colon, and is wrapped within
* braces ( ).
*/
exports.REPLACEMENT_VALUE_PATTERN = new RegExp(/([A-Za-z0-9-_])+?(:){1}([A-Za-z0-9_/:()@])... | true |
3015de62bdb059d771709d638c9f9c8a562fe984 | JavaScript | johanlindberg/a-go-go | /goban.js | UTF-8 | 3,953 | 2.84375 | 3 | [] | no_license | agogo.goban.init = function() {
agogo.goban.initBoardSizes();
var defaultSize = agogo.conf.game.availableBoardSizes[0];
agogo.game.boardsize = defaultSize;
agogo.goban.makeBoard(defaultSize);
var canvas = document.getElementById('goban');
canvas.onclick = agogo.goban.handleClick;
agogo.gam... | true |
22807b8bc9d74a304f1ac63a61d82f826d379eb8 | JavaScript | BaxLi/wude_app | /client/src/hooks/http.hook.js | UTF-8 | 1,111 | 2.6875 | 3 | [] | no_license | import { useState, useCallback, } from 'react'
export const useHttp = () => {
const [loading, setloading] = useState(false)
const [err, seterr] = useState(null)
const request = useCallback(async (url, method = 'GET', body = null, headers = {}) => {
// console.log("front - http.hook - url=", url);
setload... | true |
de6106fd92180894963c73a2253e126b8df6a22b | JavaScript | soulsniper155/JS_Assignment3 | /assignmet3_PIAIC81612/Task2.js | UTF-8 | 348 | 3.34375 | 3 | [] | no_license | var name_array = ["Michael","John","Tony"];
var score_array = [320,230,480];
var Total_Marks = 500;
var percentage;
for(var i=0; i < name_array.length;i++){
percentage =Math.floor(((score_array[i]) * 100) / Total_Marks);
document.writeln("<h3>Score of "+name_array[i] +" is "+score_array[i]+". Percentage: "+perc... | true |
7d6ad52b10feb55cc37f8c97fc425825fa017646 | JavaScript | daksh-vaishnav/learn-JS | /script/maps.js | UTF-8 | 3,885 | 3.671875 | 4 | [] | no_license | "use strict";
// ================== Map =====================
// store(nested) key -value data of any kind and length any key and value allowed
// u can use array,obj as key as well
// iterable, also many sp method are avil, not array's method diffrent methods for maps
// Order is guaranteed,duplicate key not-allowed ... | true |
82de17c0b5ab24b99b8c0e9de09e0141ac9537b4 | JavaScript | danielcahy/iced-latte-bot | /app.js | UTF-8 | 1,745 | 2.96875 | 3 | [] | no_license | /* DISCORD */
require('dotenv').config()
const Discord = require('discord.js')
const route = require('./commands/routes.js')
const client = new Discord.Client();
client.on('ready', () => {
console.log('Discord ready');
client.user.setPresence({ game: { name: 'Type .help' }, status: 'online' })
});
client.on('mes... | true |
4f21f8512e7cb2f22d9602c9784040c63d4e322a | JavaScript | iwasrobbed/language-journal-js | /src/app.js | UTF-8 | 1,301 | 2.703125 | 3 | [
"MIT"
] | permissive | // Setup jQuery $ first
import './helpers/include_jquery.js';
// TODO: Turn these into scoped modules and just call their functions within here
// Break translated text into sentences and words
import { Parser } from './parsing/parser.js';
// Show the context menu in all input fields across the app
import './helpers... | true |
c3c52c4a366aefff3bbdf29f4edeb20c2a9ce6ee | JavaScript | Runnable/error-cat | /lib/errors/base-error.js | UTF-8 | 1,375 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict'
const ExtendableError = require('es6-error')
const isObject = require('101/is-object')
const pick = require('101/pick')
/**
* Extendable base class that includes additional information that effects the
* way errors are reported to rollbar.
* @class
* @author Ryan Sandor Richards
* @extends es6-error... | true |
d36e609b88284b93ab4890c3d8bde9c18269b313 | JavaScript | cameronperry/factorial-calculator | /factorial.js | UTF-8 | 1,776 | 3.359375 | 3 | [] | no_license | //FUNCTION USED TO BINDING TO DOM NODES
const getDomNodes = (parentElement) => {
return [
parentElement.querySelector('.Factorial-Result-Metric-Value'),
parentElement.querySelector('.Factorial-Result-Metric-Time'),
parentElement.querySelector('.Factorial-Result-Output'),
parentElement.querySelec... | true |
b9c119287e2f0da42c0fe5105f7fef67b8de43cc | JavaScript | SmartAQnet/dashboard | /content/js/vendor/openlayers-ext/dist/extra/ExportMap.js | UTF-8 | 3,271 | 2.859375 | 3 | [
"MIT"
] | permissive | //TODO: Rewrite pdf
/** Function to
*
* Export PDF :
* @uses jspdf
* by gingerik
* https://github.com/gingerik/ol3/blob/gh-pages/examples/export-pdf.html
* http://gingerik.github.io/ol3/examples/export-pdf.html
*
* @param: {Array<HTMLElement>} elements an array of <A> elements with a download attribute
* @pa... | true |
6d97b1b684668fbc11ddb395f624aa7f97af6029 | JavaScript | ArtemisIncarnate/ArtemisIncarnate.github.io | /map/webmap-assignment-03.js | UTF-8 | 974 | 2.65625 | 3 | [] | no_license | let newmap = L.map('drawNewMap').setView([51.507, -0.096], 13)
let newbasemapUrl = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'
L.tileLayer(newbasemapUrl).addTo(newmap)
let myFlagIcon = L.icon({
iconUrl: 'https://www.surfingengland.org/wp-content/uploads/leaflet-ma... | true |
14904f05e9567088955efb65102e69541e64f066 | JavaScript | yibojiang/Niceboat | /Assets/Scripts/Event/OpeningEvent.js | UTF-8 | 2,472 | 2.671875 | 3 | [] | no_license | #pragma strict
class OpeningEvent extends GameEvent{
private var soldier:Character;
private var captain:Character;
override function EventStart(){
super.EventStart();
StartCoroutine(DoEventStart());
}
function DoEventStart(){
var pc:PlayerController= PlayerController.Instance();
soldier=pc.characters[Ch... | true |
694accc19e189c5b6548ca092e496df972f81aa6 | JavaScript | sheldon2015/reading | /nodejs_learn/code/day06.process/04.js | UTF-8 | 610 | 2.984375 | 3 | [] | no_license | /**
* *进程间通讯(IPC)
* *在父进程中保持有子进程的句柄
*/
const child_process = require("child_process");
const path = require("path");
const child = child_process.fork(path.join(__dirname, "04.1.js"));
child.on("message", msg => {
console.log("superabc ", msg);
});
child.on("error", console.log);
child.send("from super " + 11);
... | true |
a35a56e919ec28b4ffc5df45d95bb60d0abe2414 | JavaScript | 2dearsue/git-sue | /JS/1121_ES6_Theory_Classes/ES6_Theory.js | UTF-8 | 1,731 | 3.515625 | 4 | [] | no_license | // ECMA Script 6
class Company {
constructor(yearFounded, nameCeo, typeOfCompany, nation) {
this.yearFounded = yearFounded;
this.nameCeo = nameCeo;
this.typeOfCompany = typeOfCompany;
this.nation = nation;
}
};
class CarProducers extends Company {
constructor(yearFounded, nameCeo, typeOfCompany, na... | true |
a05cf77430c37408958446bbf8ab42dd47f79ddb | JavaScript | VSADX/with-statement-for-modules | /3-html-events-use-like-with.js | UTF-8 | 874 | 3.0625 | 3 | [] | no_license | // concept
async function withly(obj, func) {
return new Promise((resolve, reject) => {
const element = Object.defineProperties(document.createElement("div"), {
...Object.getOwnPropertyDescriptors(obj),
resolve: { enumerable: true, value: resolve },
reject: { enumerable: true, value: reject }
... | true |
7e9baa18cc15406186c3682f3ea6ac979b267649 | JavaScript | nchathu2014/JavaScript-Best-Practices | /src/Syntax/6 - functions/script.js | UTF-8 | 448 | 3.890625 | 4 | [] | no_license | /**
* Created by UCHATNU on 7/10/2016.
*/
function declarationFunc(){
console.log("I am a declaration functions");
}
var expressionFunc = function(){
console.log("I am a expressive functions");
}
expressionFunc();
declarationFunc();
//best practice is that 1-declare the variables and second declare the... | true |
8e6a8574e3dd6a2384d265d89dd7a57da4397560 | JavaScript | liriliri/licia | /src/$insert.js | UTF-8 | 2,544 | 3.328125 | 3 | [
"MIT"
] | permissive | /* Insert html on different position.
*
* ### before
*
* Insert content before elements.
*
* ### after
*
* Insert content after elements.
*
* ### prepend
*
* Insert content to the beginning of elements.
*
* ### append
*
* Insert content to the end of elements.
*
* |Name |Desc |
* ... | true |
35da514adfb8ece638620c5662d23ef656c8a674 | JavaScript | wannabemrrobot/panda101-todoapp | /backend/src/firebase/authMiddleware/authMiddleware.js | UTF-8 | 782 | 2.875 | 3 | [] | no_license | const firebase = require("../firebase");
// check if the token is present in the request
function authMiddleware(request, response, next) {
const headerToken = request.headers.authorization;
if (!headerToken) {
return response.send({ message: "Authorization bearer not found" }).status(401);
}
... | true |
094a0f9262a3fb0422f3fc8ca49863243936d289 | JavaScript | asadsanto10/chat-application | /middlewares/users/userValidator.js | UTF-8 | 2,567 | 2.53125 | 3 | [] | no_license | const { check, validationResult } = require('express-validator');
const { unlink } = require('fs');
const createError = require('http-errors');
const path = require('path');
const User = require('../../model/People');
// user validator
const userValidator = [
check('name')
.isLength({ min: 1 })
.withMessage('... | true |
837f02a08fb7b05aa4c113fd7745349bd6ba9ebf | JavaScript | Atif-Hasan/js-google-login-page | /app.js | UTF-8 | 1,558 | 3.0625 | 3 | [] | no_license | var email = document.forms['form']['email'];
var password = document.forms['form']['password'];
var email_error = document.getElementById('email_error');
var user_email = "atifhasan@gmail.com";
var user_password = "Pakistan123@";
var input_field = document.querySelector("input").value;
function emailV... | true |
7232861277c4640f61071e11481ea182fc6257cf | JavaScript | js13kGames/glowbougs | /src/scripts/map/Sheet.js | UTF-8 | 367 | 2.75 | 3 | [] | no_license | (function () {
"use strict";
function makeSheet(img, w, h) {
return {
w: w,
h: h,
cellW: Math.ceil(img.width / w),
cellH: Math.ceil(img.height / h),
render: function (c, col, row, x, y) {
c.drawImage(
img,
col * w,
row * h,
w,
h,
x,
y,
w,
h);
}
... | true |
204f9996a0388431de8139bd7b14b20717751e24 | JavaScript | carlosdh1985/katas | /productArray.js | UTF-8 | 281 | 3.375 | 3 | [] | no_license | function productArray(numbers){
let p = 1;
let newArr = [];
for(let i = 0; i < numbers.length; i++){
let x = numbers[i];
p = numbers.reduce(function (x, num){
return x * num;
})
newArr.push(p/x);
}
return newArr
}
| true |
b046e421a4ea755b0d7f3e233527931ececd2234 | JavaScript | micah-akpan/questioner-api | /server/middlewares/misc/index.js | UTF-8 | 1,354 | 2.84375 | 3 | [
"MIT"
] | permissive | export default {
trimBody(req, res, next) {
const keys = Object.keys(req.body);
const newRequestBody = {};
keys.forEach((k) => {
if (typeof req.body[k] === 'string') {
newRequestBody[k] = req.body[k].trim();
} else if (Array.isArray(req.body[k])) {
const array = req.body[k];
... | true |
4e096bb7f992b3c02da0bebfc02abb5b66a09e82 | JavaScript | hu120051/cms | /public/static/js/StartAdmin.js | UTF-8 | 14,738 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | var CODE_SUCCESS = 200;
var username = getCookie("username");
var PostBase = {
};
//写cookies
function setCookie(name, value) {
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
/... | true |
67f559918c85a27199c77c5b7cafd8ecd2ee955e | JavaScript | jfliapp/koa_socket | /test/utils/model_fn.js | UTF-8 | 1,703 | 2.546875 | 3 | [] | no_license | const Sequelize = require("sequelize")
console.log('init sequelize...');
var sequelize = new Sequelize('test', 'root', '0414jian', {
dialect: 'mysql',
host: 'localhost',
port: 3306,
pool: {
max: 5,
min: 0,
idle: 10000
}
})
sequelize.authenticate().then(() => {
console.log("Connection has been es... | true |
74eda8c1dcc9bd3bf1e210467621152e2d2a7df2 | JavaScript | Gideon877/bootcamp-test | /test/isWeekday.test.js | UTF-8 | 202 | 2.65625 | 3 | [] | no_license | describe('isWeekday function', function(){
it('check if its a weekday', function(){
assert.equal(isWeekday('Saturday'), false);
assert.equal(isWeekday('Monday'), true);
});
});
| true |
c4ad4b3b8a5b79999c4f5bc39e2d228523563856 | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/b00955b9c219dd70b43d7639a4171d83.js | UTF-8 | 773 | 3.328125 | 3 | [
"MIT"
] | permissive | load("201224b0d1c296b45befd2285e95dd42.js");
function a() {
return "a";
}
function b() {
return "b";
}
function c() {
return "c";
}
var names = ["a","b","c"];
function foo(name) {
return eval(name + "()");
}
for (var i = 0; i < names.length; i++)
assertEq(foo(names[i]), names[i]);
// Test bailout due to b... | true |
ba5bf9bced27b06e5495a36446cfd950abf52ebe | JavaScript | JohnGinger/aoc | /2017/js/10.js | UTF-8 | 1,909 | 3.125 | 3 | [
"MIT"
] | permissive | const { readFileSync } = require("fs");
const input = readFileSync("./input.txt", { encoding: "utf8" });
let inputLengths = Array.from(input.split(","), Number);
const hash = ({ inputLengths, position = 0, skip = 0 }) => {
let indexes = Array(256)
.fill(0)
.map((_, i) => i);
for (length of inputLengths) {
... | true |
156f69756bc7c6cc4d6a10e2dd8da2cf989a91c6 | JavaScript | outrunJ/project | /node-socket.io/old/public/js/chart.js | UTF-8 | 4,514 | 2.515625 | 3 | [] | no_license | /**
* Created by outrun on 24/08/14.
*/
(function () {
$body = $(document.body);
Chart = function (selector, context) {
return new Chart();
};
Chart.appear = function () {
// $(selector).append('<h1>hello</h1>');
i_thic = 30;
loc_x = document.body.scrollWidth;
... | true |
2a1873434076d2bfccd3e1b50857119576ac8aa8 | JavaScript | BlaqPeppa/iTease | /env/system/startup.js | UTF-8 | 2,250 | 2.78125 | 3 | [] | no_license | /** iTease System Startup Script **/
/**
* This is the entry point of the iTease EMCAScript (or 'JavaScript') Engine
* It's only job is to run our main module called 'app' (found alongside this one)
*
* These core iTease scripts are commented excessively with explanations of the basic
* EMCAscript practises in use... | true |
e9240dab82fe4c208a12658cec7f11976124ea1f | JavaScript | mschenyu/Algorithm-By-JavaScript | /数组/扁平化数组.js | UTF-8 | 224 | 3.375 | 3 | [] | no_license | // const res = []
function fn(arr, res){
arr.forEach(item => {
if(Array.isArray(item)){
fn(item, res)
}else{
res.push(item)
}
})
return res
}
const res =fn([1,2,[3,[4]],5], [])
console.log(res) | true |
3bfd3575d095d8bf03eb4efab5c69c9a4f6fc27c | JavaScript | albertchanged/grocery-list-clean-hrsf86 | /client/src/index.jsx | UTF-8 | 1,273 | 2.65625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import GroceryList from './components/GroceryList.jsx';
import AddGrocery from './components/AddGrocery.jsx';
import { groceryList } from '../../database/data.js';
class App extends React.Component {
constructor(props) {
super(props);
this.state = ... | true |
245381f34ac0f6f42e01875bb7e8a003af1c7d92 | JavaScript | FernandoChavez/DrinksSeeker | /src/components/Formulario.js | UTF-8 | 3,363 | 2.875 | 3 | [] | no_license | //En este componente se consumen los datos de CategoraContext y mostrarlos
//El useContext es el hook
import React, {useContext, useState} from 'react'
//Tenemos que pasar el valor o variable que retorne createContext()
import {CategoriasContext} from '../context/CategoriaContext'
import {RecetasContext} from '../conte... | true |
1cf6b5752ae7907ab8dc944b7a42bcb345e5b015 | JavaScript | Hyoniii/dreamCoding-JS | /array.js | UTF-8 | 4,415 | 4.46875 | 4 | [] | no_license | //note!! shift,unshift are slower than pop,push
//splice: remove an item by index position
//concat: combine two arrays
//5.Searching
//indexOf: find the index
const fruits = ["🍎", "🍊", "🍑", "🍓"];
console.log(fruits.indexOf("🍎")); //0
console.log(fruits.indexOf("🥨")); //-1
//includes: boolean
console.log(fruit... | true |
569f47f8c07b969ee7bb599437dd90181a1a8cd5 | JavaScript | mbharrat/javascriptTutorial | /ES6&Beyond/ES6.js | UTF-8 | 2,801 | 4.375 | 4 | [] | no_license | //===================================================================================
// ES6 AND BEYOND
//===================================================================================
//===================================================================================
// Array.prototype
//=====... | true |
e70581769d7ed462b5d21014fc8aaa17eac5c1f8 | JavaScript | nilsegger/ipa | /realisieren/frontend/assets/js/script.js | UTF-8 | 5,305 | 2.71875 | 3 | [] | no_license | const endpoint = "http://localhost:8000/";
const self = "http://localhost:4000/";
const login = self;
const adminDashboard = self + "dashboard.html";
const personalDashboard = self + "dashboard_personal.html";
class Auth {
static saveTokens(access, refresh) {
/*
Speichert Access und Refresh To... | true |
04f189fac11d1aec7246ba61af5d8d69545fd128 | JavaScript | crabbly/pdfmake | /tests/unit/ElementWriter.spec.js | UTF-8 | 5,565 | 2.890625 | 3 | [
"MIT"
] | permissive | 'use strict';
var assert = require('assert');
var ElementWriter = require('../../js/ElementWriter').default;
describe('ElementWriter', function () {
var ew, ctx, page, fakePosition;
beforeEach(function () {
fakePosition = { fake: 'position' };
page = { items: [] };
ctx = {
x: 10,
y: 20,
availableWi... | true |
b9f44e5ebe1e05df5a83ba850131393f8e0a13ed | JavaScript | bhavesh-pepcoding/pp9 | /cheerio/rough/birthday.js | UTF-8 | 1,182 | 2.609375 | 3 | [] | no_license | const request = require("request");
const cheerio = require("cheerio");
const fs = require("fs");
request("https://www.espncricinfo.com/series/the-marsh-cup-2020-21-1244113/victoria-vs-south-australia-14th-match-1244137/full-scorecard",callback);
let batsmenColumns;
let finalData = [];
function callback(err,res,html) ... | true |
082e426a2fcf8f2505d6f208d697623f708a8104 | JavaScript | andrewting112/w1 | /lotide/practice.js | UTF-8 | 498 | 3.71875 | 4 | [] | no_license | let middle = function (array) {
if (array.length <= 2) {
return []
} else if (array.length % 2 === 0) {
var even = [array[(array.length) / 2 - 1], array[(array.length / 2)]]
return even
} else {
var oddMiddle = [Math.floor((array.length) / 2) + 1];
return oddMiddle;
}
}
console.log(middle([... | true |
e048071bcdff856b2382aece9f290b01d61c6bda | JavaScript | gabbo-dam/challenge | /map.js | UTF-8 | 604 | 3.890625 | 4 | [] | no_license | const amiguis = [
{
name: 'Valentino',
age: 19,
},
{
name: 'Gabriel',
age: 20,
},
{
name: 'Simón',
age: 23,
},
]
let agePersonas = []
for (let i = 0; i < amiguis.length; i++) {
agePersonas.push(amiguis[i].age)
}
console.log(agePersonas)
const ageAmiguisMap = amiguis.map((amigui... | true |
c302532a11230b13089d63663fda476b1b824c9d | JavaScript | asishraz/todolist | /src/components/TodoItem.js | UTF-8 | 1,546 | 2.890625 | 3 | [] | no_license | import React from 'react';
// First we will write as a class based component
// class TodoItem extends React.Component {
// render() {
// return (
// <li className="todo-item">
// <input type="checkbox"
// checked={this.props.todo.completed}
/... | true |
1216e06196c58e356e34b510125cdee6c56c53c5 | JavaScript | Niloy25/MyNote-Website | /myNoteApp-backend/routes/auth.js | UTF-8 | 4,260 | 2.546875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const User = require('../models/User');
const { body, validationResult } = require('express-validator');
const bcrypt = require('bcryptjs');
// const { create } = require('../models/User');
const jwt = require('jsonwebtoken');
const fetchuser = requir... | true |
6261aa8fd77e4d317b7d10a7f53da1f318ef41b1 | JavaScript | Zuiluj/lottery-smart-contract | /lottery-react/src/App.js | UTF-8 | 2,548 | 2.875 | 3 | [] | no_license | import logo from './logo.svg';
import './App.css';
import { useEffect, useState } from 'react';
import web3 from './web3';
import lottery from './lottery';
function App() {
const [manager, setManager] = useState('');
const [players, setPlayers] = useState('');
const [balance, setBalance] = useState('');
... | true |
59e1cc1c6100c1506ccc6cc6e33c709fc0fb99e4 | JavaScript | MALICK96/online_coding_challenges | /expandForm.js | UTF-8 | 574 | 4.21875 | 4 | [] | no_license | /* Declere new array that will hold the computed values
Convert the num into a string then split into an array of chars
i loop counter start at last index of the num array and mult
variable start at 1 in each iteration the previous value of mult
is multiply by 10 and i is decrease by one */
function expandedF... | true |
05a6a95d2d8a236feae6ad2bd84f490ec7f0261e | JavaScript | brandonscottcox/LibraryProject | /Project_Local_Library_1/public/src/accounts.js | UTF-8 | 1,059 | 3 | 3 | [] | no_license | function findAccountById(accounts, id) {
return accounts.find(account => account.id === id)
}
function sortAccountsByLastName(accounts) {
return accounts.sort((letter1,letter2)=>letter1.name.last.toLowerCase() > letter2.name.last.toLowerCase() ? 1:-1)
}
function getTotalNumberOfBorrows(account, ... | true |
222b3185a498f5442f1d75bd71efb9da6d09a12e | JavaScript | jetbalagtas/jQuery-photo-albums | /app.js | UTF-8 | 6,119 | 2.609375 | 3 | [] | no_license | $(document).ready(function () {
photoAlbumPage.init ();
});
var photoAlbumPage = {
init: function() {
photoAlbumPage.styling();
photoAlbumPage.events();
},
events: function() {
$('nav').on('click', 'a', function(event) {
event.preventDefault();
var element = $('this').attr('rel');
... | true |
f9844fa1cb388fc66ccdff90a06a2dc51601c1b6 | JavaScript | SeanMombo/webTemplate | /src/js/index.js | UTF-8 | 1,008 | 2.96875 | 3 | [] | no_license | import { elements } from './base';
console.log('Fetching items');
async function getDragon() {
const url = "http://ddragon.leagueoflegends.com/cdn/9.24.2/data/en_US/item.json";
const itemKeyList = new Array();
try {
const res = await fetch(url);
const myJson = await res.json();
... | true |
8d3bd1f695afa6e93f0e62496e478ad9eed28d0f | JavaScript | 35359595/win_bot | /public/retired/5_12.js | UTF-8 | 3,062 | 2.953125 | 3 | [] | no_license | //
// Aggresive strategy "run-and-kick"- all players run to ball and kick it if possible to any direction
//
'use strict';
function getDirectionTo(startPoint, endPoint) {
return Math.atan2(endPoint.y - startPoint.y, endPoint.x - startPoint.x);
}
function getDistance(point1, point2) {
return Math.hypot(point1.x-po... | true |
b614c507d9b22ce5f37ad86191fbc28277c8c7d2 | JavaScript | Jasorza/Javascript | /Clases Febrero/28_02/js/eventos2.js | UTF-8 | 1,891 | 2.6875 | 3 | [] | no_license | let caja = document.querySelector('.cja');
let btnAdd = document.querySelector('#btnAdd');
let btnAddano = document.querySelector('#btnAddano');
let btnAnimar2 = document.querySelector('btnAnimar2');
let btnAddOnMouseOver = document.querySelector('#btnAddOnMouseOver');
//** --------------------------------------------... | true |
771c53a2f7d5433b7514eb619239766de487d86c | JavaScript | fcairello/Coder-House | /function elMayor.js | UTF-8 | 220 | 3.34375 | 3 | [] | no_license | function elMayor (a,b){
if(a>b){
console.log("El mayor es %s", a);
}
else if(b>a){
console.log("El mayor es %s", b);
}
else{
console.log("Los dos números son iguales");
}
}
elMayor (25,3); | true |
382fd662b0f21ffe310c289c0af481cac2ad3a58 | JavaScript | burend/ASFA | /Javascripts/Source/Places/place432.js | UTF-8 | 3,439 | 2.546875 | 3 | [] | no_license | // Melanie's House
function ShowPlace432()
{
var md = WritePlaceHeader();
var perMelanie = findPerson("Melanie");
var clvM = perMelanie.getCharmedLevel();
if (clvM === 0) perMelanie.showPerson("mel1.jpg");
else if (!isDay()) perMelanie.showPerson("mel9-" + perMelanie.getSuffix() + "-night.jpg");
else perMelan... | true |
9078bd893a01ddd4b699c72850a03ea089067ef3 | JavaScript | rvalim/mlk-udc-react-proj3 | /src/utils/api.js | UTF-8 | 1,230 | 2.703125 | 3 | [] | no_license | import * as db from './_DATA'
import { generateUID } from './helper'
export function getInitialData() {
return Promise.all(
[getDecks()]
).then(
([decks]) => {
return {
decks,
}
}
)
}
export function saveDeck(key, title) {
let deck = formatDeck(key, title, 'verify')
return db... | true |
0dd189ddfee439e146801ba28bc52b26e97cb600 | JavaScript | fengyw1989/digitalSilkRoadPC | /js/index/index.js | UTF-8 | 3,509 | 2.609375 | 3 | [] | no_license | /**
* Created by admin on 2017/11/15.
*/
addMenuLeftEventListener();
function addMenuLeftEventListener(){
var menuArr = document.getElementsByClassName('menu-item');
for(var i=0;i<menuArr.length;i++){
menuArr[i].addEventListener('click',function (event) {
selectMenu(menuArr,event.target);
});
}
... | true |
fb50a14979d0d74c6c7041d3f0f2fb695ee8b526 | JavaScript | ndrisso/game-of-life | /src/map.js | UTF-8 | 400 | 2.765625 | 3 | [] | no_license | const map = ({ rows, cols, ctx }) => {
const drawMap = matrix => {
for(let j = 0; j < rows; j++) {
for(let i = 0; i < cols; i++) {
ctx.fillStyle = matrix[j][i] === 1 ? "gray" : "white"
ctx.fillRect(j * 10, i * 10, 10, 10)
ctx.strokeStyle = "black"
ctx.strokeRect(j * 10, i * ... | true |
2f223844ac6af15065a7ed81b9a0b5aba2d008a8 | JavaScript | taijeronv/WargameSimJs | /js/wargame/phases/priority.js | UTF-8 | 1,038 | 2.5625 | 3 | [] | no_license | var WarGame = WarGame || {};
WarGame.Phases = WarGame.Phases || {};
WarGame.Phases.Priority = {
start: function () {
// roll dice for each team
// TODO: handle more than two teams
var one = WarGame.Utils.diceRoll()[0];
var two = WarGame.Utils.diceRoll()[0];
if (one === two) {... | true |
2b986d798ecb4ff14090567bdcf6a7372d20d516 | JavaScript | clevara-dev-id/edu-plus | /src/views/redux/actions/favoritedetail.js | UTF-8 | 4,790 | 2.578125 | 3 | [] | no_license | import axios from 'axios';
export function favoriteDetailHaveError(bool) {
return {
type: 'FAVORITE_DETAIL_HAVE_ERROR',
hasError: bool
};
}
export function favoriteDetailAreLoading(bool) {
return {
type: 'FAVORITE_DETAIL_ARE_LOADING',
isLoading: bool
};
}
export functi... | true |
e3a30fc827f438d84cbfba2001ca7db75f03b7e1 | JavaScript | NyaGarcia/parameterized-jasmine | /spec/regexp.service.spec.mjs | UTF-8 | 909 | 2.640625 | 3 | [] | no_license | import { RegExpService } from '../src/regExp.service';
const regExpService = new RegExpService();
describe('Test valid name input:', () => {
const parameters = [
{
description: 'Should pass with 3 to 50 characters',
input: 'Nya',
output: true,
},
{
description: 'Should fail with ... | true |
812b57d784894dc2cd3340801ce3a468342be143 | JavaScript | yanaSelin/algorithms | /test/missing.test.js | UTF-8 | 602 | 2.671875 | 3 | [] | no_license | const assert = require('assert');
const missing = require('../src/missing');
describe('missing', () => {
it('should return null without arguments', () => {
assert.equal(missing(), null);
});
it('should return null with empty array', () => {
assert.equal(missing([]), null);
});
it('should return mis... | true |
b787edef4bc28ad3019ca258a18e27de02dc0237 | JavaScript | faog/example-cors | /src/api.js | UTF-8 | 568 | 2.796875 | 3 | [] | no_license | const express = require("express");
const cors = require("cors");
const app = express();
app.use(cors());
//Enable CORS for a Single Route
let corsOptions = {
origin: 'http://localhost:3000',
optionsSuccessStatus: 200,
method: "POST"
}
app.post('/', cors(corsOptions), (req, res) =>{
res.json({
message... | true |
212c421a9a9a265f1f33dadf3f144a62a2f22fa7 | JavaScript | wizzenalum/alarm-clock | /scripts/clockTime.js | UTF-8 | 4,979 | 3.421875 | 3 | [] | no_license | /* this clock class is clock object which has
properties
time differance:- to set the time for the clock if needed
angle differece:- to give angel for clock by ofseting this angle if you time hands(min,sec,hour) are not align at 12
alarm list:- to store all the alrm that set by user.
behaviours
getTim... | true |
201619258a7b2ddd6cef5a12ae9678a295dc2355 | JavaScript | Issho-lin/mini-vue | /src/compile.js | UTF-8 | 5,225 | 3.171875 | 3 | [] | no_license | /**
* 定义一个专门用于解析模板内容的类
*/
class Compile {
constructor (vm) {
// console.log(vm)
// new的Vue实例
this.vm = vm
// new Vue传递的选择器
this.el = typeof vm.$el === 'string' ? document.querySelector(vm.$el) : vm.$el
// 编译模板
if (this.el) {
// 1.el中所有的子节点都放入到内存... | true |
569880b07e922c7de68bcdcbd90439addcd3f8f3 | JavaScript | THE-GREAT-CODERS/THE-FUN | /sketch.js | UTF-8 | 1,873 | 2.828125 | 3 | [] | no_license | const Engine = Matter.Engine;
const World= Matter.World;
const Bodies = Matter.Bodies;
var engine, world;
var box1,box2,box3,box4,box5,box6,box7,box8,box9,box10,box11,box12;
var g1,pig1,pig2,log1,log2,log3,log4,pig3,pig4,log5,log6,log7,log8;
var bird1;
function setup(){
var canvas = createCanvas(12000,800);
en... | true |
68822b6316ca798d5ec0d044a9c3c8e01b56a37c | JavaScript | ndev1991/simple-react | /src/reducers/postsReducer.js | UTF-8 | 1,242 | 3.09375 | 3 | [
"MIT"
] | permissive | import { FETCH_POSTS, CHANGE_SEARCH_KEYWORD } from '../constants/actionTypes';
import objectAssign from 'object-assign';
import initialState from './initialState';
// IMPORTANT: Note that with Redux, state should NEVER be changed.
// State is considered immutable. Instead,
// create a copy of the state passed an... | true |
93c7a568ae3838f5227d3a072f047e4d2af9f42c | JavaScript | shaunstanislaus/jimp | /test/create.js | UTF-8 | 738 | 2.890625 | 3 | [
"MIT"
] | permissive | var Jimp = require("../jimp.js");
var bars = new Jimp(256, 256, function(err, image) {
this.scan(0, 0, image.bitmap.width, image.bitmap.height, function (x, y, idx) {
var p = Math.floor(x / (this.bitmap.width / 5));
this.bitmap.data[idx] = (p % 5 == 0 || p % 5 == 4) ? 255 : 0;
this.bitmap.d... | true |
29f93bdd74fa8c635cd42fec8762bd5ebe1f6aaf | JavaScript | jagan-copilot/upskill-guru | /UIApp/src/components/WordCloud/WordCloudComponent.js | UTF-8 | 2,493 | 2.65625 | 3 | [] | no_license | import React from "react";
import * as d3 from "d3";
import * as cloud from "d3-cloud";
class WordCloudComponent extends React.Component {
componentDidMount() {
this.drawChart();
}
drawChart() {
const allSkills = this.props.data;
console.log("allSkills", allSkills[0]);
var margin = { top: 10, ri... | true |
50ceafb1287193977e21416e2f341455149580d7 | JavaScript | MAYANK5634/project_34_newton-s_cradle | /rope.js | UTF-8 | 425 | 2.671875 | 3 | [] | no_license | class ROPE {
constructor(bodyA,pointB){
var options = {
bodyA:bodyA,
pointB:pointB,
}
this.pointB = pointB;
this.rope= Matter.Constraint.create(options);
World.add(world,this.rope);
}
display(){
var point1 = this.rope.bodyA.position;
... | true |
394380c756588d38672a15e673d88b85eeea9e47 | JavaScript | hiteshmishra708/chatbot-data | /hackr.js | UTF-8 | 726 | 3.5 | 4 | [] | no_license | function getAnswer(children, count) {
answer = []
for (i=count+1; i<children.length; i++) {
child = children[i]
if (child.nodeName == "H4") break;
else answer.push(child.innerText)
}
return answer.join("\n")
}
content = document.getElementsByClassName("content")[0]
questions = []
for (let i=8; i<content.chil... | true |
fc8c20b4fd1d9917424e823887ac2c866357f4a0 | JavaScript | paulmakl/CS315-Final | /cs315_hwk5_webgl/gameJS/GameEngine.js | UTF-8 | 10,559 | 2.6875 | 3 | [] | no_license | "use strict";
// engine global
var engine;
function GameEngine(canvasNode) {
var self = this; // hang on to a reference to 'this' in case javascript steps on it
this.debug = true;
this.ratio = 680 / 1350; // screen aspect ratio (h / w)
this.mPositionDataSize = 3;
this.mNormalDataSize = 3;
//CORE VARIABLES
... | true |
822d8468bebc74b8f6387d51882e99ca0c93959c | JavaScript | ShugKnight24/next_shopping_cart | /pages/cart.js | UTF-8 | 4,767 | 2.53125 | 3 | [] | no_license | import { useContext, useState } from 'react';
import Head from 'next/head';
import Link from 'next/link';
import { CartContext } from '../context/CartProvider';
import { ModalContext } from '../context/ModalProvider';
import { Modal } from '../Components/Modal';
import { formatCurrency, totalQuantity, totalPrice } from... | true |
87132e1ef575c4968abab38481be01bb895b4083 | JavaScript | dooremont/Loodle | /app/controllers/schedule.js | UTF-8 | 2,322 | 2.6875 | 3 | [] | no_license | var async = require('async');
var bcrypt = require('bcrypt-nodejs');
var Schedule = require('../models/schedule.model');
var Vote = require('../controllers/vote');
var moment = require('moment');
var ScheduleController = {};
// Create the schedule and bind it to the loodle
ScheduleController.createSchedul... | true |
8520ed35fac8e22bca18ae93493cba26c18516f4 | JavaScript | VanVDC/rendering | /renderNametags.js | UTF-8 | 623 | 3.296875 | 3 | [] | no_license |
function renderNametags(nametags) {
var whole=nametags.map(function(i){
return `
<div class=" border text-center w-50 text-center mx-auto p-3 mt-2">
<p style='color: white; background-color: blue;'>Hello, my name is:</p>
${i}
</div>
`
... | true |
ad2ede621fe17c46241e7bfe6fb286e5731e1611 | JavaScript | cruzgerman216/vanilla-javascript-craigslist-clone | /src/components/Navbar.js | UTF-8 | 1,492 | 2.734375 | 3 | [] | no_license | class Navbar {
constructor(){
this.render();
this.addEventListener();
}
render(){
document.body.innerHTML = "";
if(state.userstate.islogin()){
document.body.innerHTML = `
<div class="navigator" id="home" >
<span id="homenav" class="nav... | true |
425f354016f9617b37fb4e6c162d2eac37dca196 | JavaScript | zyfzhang/test | /test.js | UTF-8 | 69 | 2.59375 | 3 | [] | no_license | var a = 1;
var b = 2;
var add = function(a,b){return a+b;}
add(a,b); | true |
0837f6297475baadb6a221f5b7e9bf2cc6ef08f8 | JavaScript | DronAce/Whatit-front-end | /src/components/Post.js | UTF-8 | 4,210 | 2.625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import {useHistory} from 'react-router-dom';
function Post({post, currentUser, setComment, setUser}) {
const history = useHistory();
const [user, setUser1] = useState()
const [editForm, setEditForm] = useState()
const [text, setText] = useState()
con... | true |
345ab4f74a4bc4fcd2d029a7ce9316b589b99af1 | JavaScript | kongnyc/codewars_two | /simple-fun-176/main.js | UTF-8 | 684 | 4.1875 | 4 | [] | no_license | // Task
// Given a string str, reverse it omitting all non-alphabetic characters.
// Example
// For str = "krishan", the output should be "nahsirk".
// For str = "ultr53o?n", the output should be "nortlu".
// Input/Output
// [input] string str
// A string consists of lowercase latin letters, digits and symbols.
//... | true |
046bb23acc3523d95a2838c09086acf90bb4901b | JavaScript | MatthewShawkat/2028-Simulation | /src/animation.js | UTF-8 | 2,475 | 2.921875 | 3 | [] | no_license | /*
* 2024Sim
*
*
* Copyright (c) 2014
* Licensed under the MIT license.
*/
(function ($) {
function Square(value, location) {
this.value = value;
this.block = false;
this.original = location;
this.location = location;
}
Square.prototype.toString = function abc() {
return th... | true |
16418c6881529617cb877991e5fb1af324765637 | JavaScript | sjwalter/TranscripChain | /transcripchain.js | UTF-8 | 2,834 | 2.796875 | 3 | [] | no_license | var config = require('./config'),
twilio = require('twilio'),
express = require('express'),
app = express.createServer(),
io = require('socket.io').listen(app),
redis = require('redis').createClient();
// Create a new instance of the client object.
var c = new twilio.Client(config.MY_ACCOUNT_SID, c... | true |
7491e7891808e79e0cfba6153cb1b396a54bd2c6 | JavaScript | jphilipstevens/tic-tac-toe-solver | /src/solve.js | UTF-8 | 1,574 | 3.59375 | 4 | [] | no_license | import transpose from "./transpose";
/**
* get the winner for some set (a set is an array of size three)
*
* @param set an array of columns (either row or column)
*
* @return the winner of the set or null if no winner is in the set
*/
const getWinner = (set = []) => set.every(element => set[0] === element && !!... | true |
02adeea1a472b40739f657e74fc956092cbc7e6d | JavaScript | bpolo15/XploreSpace | /launches.js | UTF-8 | 2,084 | 2.890625 | 3 | [] | no_license | $(document).ready(function () {
getLaunches();
})
function getLaunches() {
var queryURL = "https://launchlibrary.net/1.3/launch/next/5"
$.ajax({
url: queryURL,
method: "GET"
}).then(function (response) {
console.log(response)
for (i = 0; i < response.launches.length;... | true |
52a48595ee58a2f658ad56f4a598d618faf4b043 | JavaScript | jueskeli/Full-stack-open-2018 | /Section_2/maiden_tiedot/src/components/Maa.js | UTF-8 | 923 | 2.5625 | 3 | [] | no_license | import React from 'react';
const Maa = (props) => {
console.log(props)
if(props.props.length > 10) {
return (
<ul>
Liikaa tuloksia, kokeile uudestaan
</ul>
)
}
else if(props.props.length > 1 && props.props.length < 10) {
return (
<ul>
{pr... | true |
7a3007a0c67ef82e592cb37f14082aeb0bbe3a31 | JavaScript | DayanMonteiro/Javascript-TypeScript | /JS-FD/aula26/percorrer-DOM-p02.js | UTF-8 | 3,160 | 3.375 | 3 | [] | no_license | (function(){
'user strict';
var $main = document.querySelector('.main');
// children - essa propriedade não é padronizada pelo orgão que padroniza a DOM, porém ela é suportada nos navegadores
// vamos comparar o childNodes com o children
console.log($main.childNodes); /*
NodeList(7) [text, h... | true |
ced679e0d4e4825fca940c8436e3937735efb941 | JavaScript | mayeonnaise/ralph | /anku/src/providers/BlockchainMiner.js | UTF-8 | 825 | 2.859375 | 3 | [] | no_license | export default class BlockchainMiner {
static instance = null;
constructor(blockchain) {
this.blockchain = blockchain;
this.mining_status = true;
}
static getInstance(blockchain) {
if (this.instance === null) {
this.instance = new BlockchainMiner(blockchain);
}
return this.instance;
... | true |