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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3d7b81f92fd1860cef4121118ed30b119f007b2e | JavaScript | guonl/html-cartoon | /html5制作3d立体粒子动画特效/js/demo-8/system.js | UTF-8 | 6,172 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | /* DaTouWang URL: www.datouwang.com */
const SystemBase = require('../system-base');
const Osc = require('../utils/osc');
class System extends SystemBase {
constructor(loader) {
super(loader);
this.duration = 9300;
this.simplex = new FastSimplexNoise();
this.color = new THREE.Color();
this.texture = this... | true |
8ed3d9e2ddea1837d00de7b780604dd62197763c | JavaScript | adyang/etch-a-sketch | /scripts/sketch.js | UTF-8 | 3,564 | 2.828125 | 3 | [] | no_license | $(document).ready(function() {
var getCssValueFromStyleSheet = function(selectorClass, cssPropertyName) {
var tempDiv = $('<div class="' + selectorClass + '"></div>').hide().appendTo("body");
var cssValue = tempDiv.css(cssPropertyName);
tempDiv.remove();
return cssValue;
}
var getSquareBorderLength = funct... | true |
ec03f835b3e9e210d45583924f6e7394d7f1c0b0 | JavaScript | cryingnavi/x-ui | /src/ui/x-ui-progressbar.js | UTF-8 | 2,663 | 2.96875 | 3 | [] | no_license | /**
* @class
* @classdesc 프로그레스 바를 생성한다.
* @property {Number} max 최고값을 지정한다.
* @property {Number} defaultValue 기본값을 지정한다.
* @example
* var progress = new X.ui.Progressbar({
* max: 100,
* defaultValue: 0
* });
* progress.render();
*
* <pre><code>
* <div data-ui="progress" data-max="100" data... | true |
f485cc7de00bbd5ed737e01c9fa0a8b130d8d6e9 | JavaScript | jonashw/AngularTetris | /app/scripts/services/piece.spec.js | UTF-8 | 4,640 | 2.75 | 3 | [] | no_license | 'use strict';
describe('Service: Piece', function () {
// load the service's module
beforeEach(module('angularTetrisApp'));
// instantiate service
var Piece;
beforeEach(inject(function (_Piece_) {
Piece = _Piece_;
}));
describe('Z piece',function(){
var p;
beforeEach(function(){
p = Piece.Z();
});... | true |
47be9b4115e0425164d5c6bc0d6450b003cc099d | JavaScript | appletxm/grunt-project | /src/js/dev/my-info-change-hospital-area.js | UTF-8 | 2,008 | 2.625 | 3 | [] | no_license | var cityListData = {
code: 0,
"msg": "success",
"data":[
{
id: 123123,
name: "广州"
},
{
id: 123124,
name: "佛山"
}
]
};
var myInfoChangeHospitalArea = {
ajax: null,
messageBox: null,
init: function(){
this.ajax = new Ajax();
this.messageBox = new MessageBox();
this.attachEvent();
this... | true |
606ddb7e159466db80d9d58862558d6a7a8b2f54 | JavaScript | isralopez/sliderJS | /static/js/areas.js | UTF-8 | 1,474 | 2.6875 | 3 | [] | no_license | (function() {
// turn on the single layer that is clicked on
$('#radios').click(function(e) {
var target = e.target;
var layerName = target.getAttribute('data-radio');
if (!layerName) {
// user clicked in area but not on radio
return;
}
var div = document.getElementById('map')... | true |
350d2ccf68531d5e17cd8164c9d1714a0d5989f7 | JavaScript | nguyencong17/DemoReactJs | /src/features/Todo/index.jsx | UTF-8 | 2,565 | 2.96875 | 3 | [] | no_license | import React, { useState } from 'react';
import PropTypes from 'prop-types';
import TodoList from './components/TodoList';
import TodoForm from './components/TodoForm';
TodoFeatures.propTypes = {
};
function TodoFeatures(props) {
const initTodoList = [
{
id:1,
title: 'Eat',
... | true |
728a53f07957d73d1b98ee87d85c7775b258f472 | JavaScript | ejawhary/weather_app | /js/ui.js | UTF-8 | 2,090 | 2.96875 | 3 | [] | no_license | import { clearSearchInput } from "./functions.js"
export class UI {
constructor(weatherData) {
this.loc = document.getElementById("loc");
// this.weatherImg = document.getElementById("weather-img");
this.date = document.getElementById("date");
this.temp = document.getElementById("temp");
this... | true |
43dd975fa09fc46146819b1f3e4e0e6e05d1733e | JavaScript | alanleard/ACS-Sample | /Resources/modules/animation.js | UTF-8 | 4,919 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | /**
* Animation module
*/
/**
* Puff an element in
* @param {Object} tiObject
* @param {Object} params
* @example {
* scale: 1.1 // default
* duration: 250 // default
* callback: function // optional
* fade: float // What this should fade out to before entire thing fades out
* defau... | true |
ecd8b268469322e36496d91d11ff3318759f4496 | JavaScript | AndrewGrachov/mongomock | /test/collection.spec.js | UTF-8 | 4,042 | 2.59375 | 3 | [] | no_license | var MongoMock = require('../MongoMock');
describe('Collection test', function () {
var mongo, result;
before(function () {
var db = {
fruits: [
{name: 'Banana', price: 20},
{name: 'Apple', price: 10, tags: ['Africa', 'Turkey'], dueDate:new Date("2020-01-15T00:00:00.000Z")},
{name: 'Orange', price: ... | true |
2a614f2b4009296044d0a506e5e6753d46f1965c | JavaScript | yungwifi/Beer-Reviews | /controllers/beerController.js | UTF-8 | 3,591 | 2.609375 | 3 | [] | no_license | const express = require('express')
const router = express.Router({ mergeParams: true })
const userModel = require("../models/user")
const barModel = require("../models/bar")
const beerModel = require("../models/beer")
// POST New Beer
router.post('/', (req, res) => {
const userId = req.params.id
const barId =... | true |
718794a044e23b2470e4479ab5e6792ba82b6089 | JavaScript | Digald/Constructor-Hangman | /word.js | UTF-8 | 1,559 | 3.4375 | 3 | [] | no_license | // Require Letter.js to check if word guess have matched chosen word
var Letter = require("./letter.js");
function Word() {
this.wordList = [
"central crocessing unit",
"motherboard",
"random access memory",
"power supply",
"video card",
"case",
"hard drive",
"solid state drive"
];
... | true |
d2cb53fe204df6742ca484923288968bd61fe690 | JavaScript | bethanylindberg/guessinggame | /assets/javascript/game.js | UTF-8 | 3,446 | 2.90625 | 3 | [] | no_license | wordList = ["arctic", "balaclava", "blanket", "blizzard", "boots", "chill", "chimney", "eggnog", "evergreen", "fireplace", "firewood", "flannel",
"fleece", "flu", "flurries", "fog", "freezing", "frigid", "frostbite", "frostbitten", "frosty", "frozen", "fruitcake", "furnace", "gale", "gingerbread", "glacial", "glacier"... | true |
07d6f669d12dea44c73a8d8a7c86a09358b43459 | JavaScript | Aborigenius/Softuni | /JS/Objects And JSON/Lab.js | UTF-8 | 596 | 3.109375 | 3 | [] | no_license | "use strict";
function parseToObject(arr) {
let obj = {};
// let keys = arr.shift().split(/\s*\|\s*/).filter(a => a !== "");
arr.shift();
for (var index = 0; index < arr.length; index++) {
let values = arr[index].split(/\s*\|\s*/).filter(a => a !== "");
arr[index] = {
Tow... | true |
b8c95f4a048e2a9b1ceaa0b90b270dd8a9da0c0a | JavaScript | triadiprabowo/mpSocketApp | /server.js | UTF-8 | 2,840 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
** Socket Server for Semen Merah Putih Application
** Dep Node.js
** @author: Triadi Prabowo
*/
// Require dependencies
var express = require('express'),
app = express(),
bodyParser = require('body-parser'),
http = require('http').Server(app),
io = require('socket.io')(http),
gcm = require('node-gcm'),
parseJ... | true |
97e4b0a81bb740e16bd49becae642cbbe7c17ddc | JavaScript | devashishkumar/react-corona-tracker-app-india | /src/components/HomePage.js | UTF-8 | 3,909 | 2.75 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { Link, useHistory } from 'react-router-dom'
import { browserHistory } from 'react-router';
import Navigation from './Navigation';
const DATA_URL = 'https://api.covid19india.org/state_district_wise.json';
export default function HomePageComponent() {
con... | true |
90831b540e879b4137d094f5df7437020d32fd85 | JavaScript | amh32/user-list-react-app | /src/components/User/User.js | UTF-8 | 348 | 2.625 | 3 | [] | no_license | import './User.css'
const User = props => {
// const id = props.id;
const name = props.name;
const age = props.age;
return (
<div className='user-entry'>
<label className='user-name'> Name: {name}</label>
<label className='user-age'> Age: {age}</label>
</div>
... | true |
df2d998643c5ba7f37514111fcdbd4b2571da194 | JavaScript | lukaszkaczor/KluczEX---Java-JSP | /build/web/JS/maxInputNumberLength.js | UTF-8 | 175 | 2.78125 | 3 | [] | no_license | var myInput = document.querySelector('.addToCartNumber');
myInput.oninput = function () {
if (this.value.length > 4) {
this.value = this.value.slice(0,4);
}
} | true |
5432b677c03f7ffd8c8f18455033645d84833872 | JavaScript | mafideju/MetodosArranjoJavaScript | /src/older/Find/Find.test.js | UTF-8 | 1,687 | 2.90625 | 3 | [] | no_license | import { Find } from './Find';
import { FindRecursive } from './Find';
import { expect as expectChai } from 'chai';
describe('FIND SESSIONS', () => {
it('FIND SHOULD BE A FUNCTION', () => {
expectChai(Find).to.be.a('function')
});
it('FIND SHOULD RETURN ONE', () => {
expectChai(Find([1, 2, 3], (item) =>... | true |
16c3a123c0eb8d6814de976a1ee1164170e57f5d | JavaScript | doodlewind/zlayer | /src/utils/shader.js | UTF-8 | 1,842 | 2.765625 | 3 | [
"MIT"
] | permissive | const loadShader = (gl, type, source) => {
const shader = gl.createShader(type)
gl.shaderSource(shader, source)
gl.compileShader(shader)
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
console.warn('Error compiling shaders', gl.getShaderInfoLog(shader))
gl.deleteShader(shader)
return null
... | true |
9305f0f37efae6dce092463b294ee828c551ca27 | JavaScript | Souljavan/upgrade-es6 | /Iteracion4.js | UTF-8 | 902 | 3.78125 | 4 | [] | no_license | //4.1
const users = [
{id: 1, name: 'Abel'},
{id:2, name: 'Julia'},
{id:3, name: 'Pedro'},
{id:4, name: 'Amanda'}
];
const usernames=users.map(function(x){return(x.name)});
console.log(usernames)
//4.2
const users = [
{id: 1, name: 'Abel'},
{id:2, name: 'Julia'},
{id:3, name: 'Pedro'},
{id:4, name: 'Amanda'}
... | true |
4b25d4e430f60e84dcc228cfc27b9af42a8aac51 | JavaScript | jojo3420/m-player-app | /web-v1/src/modules/loading.js | UTF-8 | 672 | 2.765625 | 3 | [] | no_license |
// Action
const PREFIX = 'loading';
const START_LOADING = `${PREFIX}/START_LOADING`;
const END_LOADING = `${PREFIX}/END_LOADING`;
// Action Creator
export const startLoading = actionType => ({ type: START_LOADING, actionType });
export const endLoading = actionType => ({ type: END_LOADING, actionType });
// initi... | true |
2f1c8702fc20e4b92cd943661fe70777f81c40f3 | JavaScript | rayhatfield/weasel-seats | /data/generator.js | UTF-8 | 1,754 | 2.875 | 3 | [] | no_license | // just generating some sample product data here.
const fs = require('fs');
const brands = [
"Chicco",
"Cybex",
"Evenflo",
"Goodbaby",
"Maxi Rosa",
"Nuno",
];
const types = [
"Booster",
"Carrier Base",
"Convertible",
"Combination",
"Infant Carrier",
"Travel System",
];
... | true |
4d593c6a9cf54bef7f09a937ac23be388295388a | JavaScript | Reinmar/geno | /app/c/ga.js | UTF-8 | 2,739 | 2.546875 | 3 | [] | no_license | 'use strict';
/*
* Genetic algorithm
*/
app.Class('app.c.GA', app.c.Object,
function () {
app.c.Object.apply(this);
this._m = new app.m.GA();
},
{
_m: null,
_population: null,
hasNextCreature: function () {
return this._m.hasNextCreature();
},
getNextCreature: function () {
if (!this._m.has... | true |
62f90f55adc48702932ac6143a0a768eb57df48a | JavaScript | AlexMercedCoder/SolidJSTodosExpressMongo | /src/components/Form.jsx | UTF-8 | 1,219 | 2.703125 | 3 | [] | no_license | import { createSignal } from "solid-js"
export default function Form(props){
const [form, setForm] = createSignal(props.initialTodo)
const handleChange = (event) => {
const newForm = {...form()}
if (event.target.getAttribute("type") === "checkbox"){
newForm[event.target.na... | true |
74c858102186e070cb75435a0f16508a91f592b2 | JavaScript | qwop/userscript | /monolith/109/72356.user.js | UTF-8 | 2,382 | 2.875 | 3 | [] | no_license | // ==UserScript==
// @name goear.com - MP3 Downloader (New Version of Goear/Nueva version de Goear)
// @description Simply modded script to clarify "Download MP3" button. Creates a toolbar button to download the MP3 from the song that you are listening./ Script de Andre Gil modificado para que el boton "Descargar ... | true |
ac5f093b0e66cb02a190352058f5f0ac3083ed86 | JavaScript | tsvetelinastef/ctci | /ch1-arraysAndStrings/saramic_javascript/eg_1_2_checkPermutation.spec.js | UTF-8 | 909 | 3.578125 | 4 | [] | no_license | const { checkPermutation } = require("./eg_1_2_checkPermutation");
// 1.2 - Check Permutation
// Given two strings, write a method to decide if one is a permutation of the
// other.
describe("checkPermutation", () => {
it("asdf is a permutation of fdsa", () => {
expect(checkPermutation("asdf", "fdsa")).toBeTruth... | true |
8b7232070f51aaa0d8d38767382c3a90586e8dd5 | JavaScript | alermar69/Stairs | /Stairs/JavaScript/manufacturing/metal/drawPrimitives3D.js | UTF-8 | 6,639 | 2.609375 | 3 | [] | no_license | /**функция отрисовывает панель
var panelParams = {
width: 1000,
len: 1000,
thk: 8,
dxfBasePoint: //не обязательный. Если не указан, в dxf не выводится
material: railingMaterial, //не обязательный
dxfArr: dxfPrimitivesArr, //не обязательный
holes: [], //массив параметров отверстий - не обазятельный
p... | true |
c5ef8e9e0727e90cb7d6ef59115b0e8e155be5b5 | JavaScript | Selina0824/sudoku-js | /src/js/core/check.js | UTF-8 | 3,358 | 3.671875 | 4 | [] | no_license | //检查数独解决方案
//1.sort()-->join()---->对比
//2.使用生成标记的方法
function checkArray(array){
const length = array.length;
const marks = new Array(length);
marks.fill(true);
for(let i=0; i<length-1; i++){
if(!marks[i]){
continue; //continue 跳出循环
}
const v= array[i];
... | true |
5ee8e6286da69db4172b008ca5b62730d3cc7158 | JavaScript | Mavai/tasklist | /server/controllers/status.js | UTF-8 | 709 | 2.578125 | 3 | [] | no_license | const statusRouter = require('express').Router();
const Status = require('../models/Status');
const initialStatuses = [
{
name: 'Not started',
color: 'gray'
},
{
name: 'Started',
color: 'red'
},
{
name: 'In review',
color: 'cyan'
},
{ name: 'Ready', color: 'lightGreen' }
];
statu... | true |
dc43e0714929aab93e1f4a1db511ceda9d3ffee1 | JavaScript | IgorZhurbenko/Teachers-goals | /old and unused/OldScript.js | WINDOWS-1251 | 3,422 | 2.515625 | 3 | [] | no_license | function switchPages(pageNumber) {
document.getElementById('page' + String(pageNumber)).hidden = false;
this.hidden = true;
var i = 0;
while (document.getElementById('page' + String(i))) {
if (i != pageNumber) {
document.getElementById('page' + String(i)).hidden = true;
... | true |
6fb9d0a89d801e017df03caa7c150e00dc342a90 | JavaScript | yangxin1994/farvekonfigurator | /color-modular/colora53.js | UTF-8 | 119 | 2.515625 | 3 | [] | no_license | (function() {
// Make the color #a53
HTMLElement.prototype.colora53 = function() { this.style.color = '#a53' }
})() | true |
79c82de5dff5c626c18577098266431b359200f5 | JavaScript | dhruvpateldp96/1973426_DhruvPatel_TCSMEANStackTraining | /Phase1/Section6/1.11IIFEsAndFunctions/IIFEsAndFunctions.js | UTF-8 | 884 | 4.75 | 5 | [] | no_license | //Function as an argument
console.log("\n Functions as an argument demo");
const add = (a, b) => a + b;
const subtract = (a, b) => a - b;
const data = (func) => {
// get data from user or other external source
var num1 = 10;
var num2 = 20;
return func(num1, num2);
};
console.log(data(add));
console.log(data(... | true |
7b193c3ebe25dc43d164bd86c6f111336227f113 | JavaScript | AnastasiyaYS/project-lvl2-s475 | /src/formatters/renderPlain.js | UTF-8 | 996 | 2.796875 | 3 | [] | no_license | import _ from 'lodash/fp';
const getProcessedValue = (value) => {
if (_.isObject(value)) {
return '[complex value]';
}
if (typeof value === 'string') {
return `'${value}'`;
}
return value;
};
export default (ast) => {
const iter = (arr, parent) => arr.map((node) => {
switch (node.type) {
... | true |
89e8905b73bc501156d8051821b380074ddd2688 | JavaScript | UniversalRemote/VoiceController-Server | /Services/channelService.js | UTF-8 | 1,071 | 2.890625 | 3 | [] | no_license | let RaspberryPiHelper = require("../Helpers/raspberryPiHelper");
let RaspberryPiService = require("../Services/raspberryPiService");
let DialogResponseHelper = require("../Helpers/dialogResponseHelper");
class ChannelService{
static changeChannel(request){
let channel = request.result.parameters.channel;
... | true |
9784a136bf060648b6856ce88c17d18d8c2377c7 | JavaScript | mariorb547/rick-morty | /src/reducers/personajesReducer.js | UTF-8 | 872 | 2.515625 | 3 | [] | no_license | import {
TRAER_TODOS_PERSONAJES,
TRAER_PERSONAJE,
CARGANDO_PERSONAJES,
ERROR_PERSONAJES
} from "../types/personajeTypes";
const INITIAL_STATE = {
personajes: [],
personaje: "",
cargando: false,
error: ""
};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case TRAER_TOD... | true |
e0990f3e17bf3cdcef6b275e8fbc06329e969f47 | JavaScript | jalbaiulia/socket.io-chat-room | /requestHandlers.js | UTF-8 | 1,152 | 2.59375 | 3 | [] | no_license | var fs = require("fs"),
http = require("http")
function js(response, filename) {
fs.readFile(__dirname + filename, function(error, script){
if (error) {
response.writeHead(404)
response.write("oops, can't load file ", filename)
response.end()
}
else {
response.writeHead(200, {"Content-Type": "app... | true |
2ad29fdc4e4a967f6e28363085b053c567cc3ec1 | JavaScript | fluxor-platform/divergence | /src/dataScanner.js | UTF-8 | 1,323 | 2.671875 | 3 | [] | no_license | 'use strict';
const rsi = require('./functions/rsi');
const createColumns = require('./functions/createColumns.js');
const dbSet = require('./functions/dbSet.js');
/**
* Scan all pairs from bitfinex
* @param {array} bitfinexData
*/
module.exports = function scan(bitfinexData) {
new Promise((resolve, reject) => {... | true |
edc1c38527c368c7a0af13a5a7adf0a5e010dac7 | JavaScript | Gelean/deldbot | /src/commands/destroy.js | UTF-8 | 3,481 | 2.734375 | 3 | [
"MIT"
] | permissive | const config = require('../../.env/config.json')
const destroy = require('../data/destroy.json')
const destroyTargets = require('../data/destroy_targets.json')
module.exports = {
name: 'destroy',
description: 'Destroys other users with a chance of a backfire or miss',
args: true,
usage: '[target]',
guildOnly... | true |
e00561dfaad3f16a5e8884a0e06f95d519e155c8 | JavaScript | syagawa/js-performance-test | /lib/jQueryDomBrother.js | UTF-8 | 810 | 2.71875 | 3 | [] | no_license | (function(global){
var APP = global.APP;
var title ="jQuery dom brother";
var jQueryDomBrother = function(){
var max = 1000;
var code1 = {
code: function(){
for(var i = 0; i < max; i++){
$($("#playground").children()[0]).next();
}
},
message: title + " jQuer... | true |
ea7f7383391e42c377990d99f0a3053c8cb1fcc4 | JavaScript | paozi528/Frogger | /js/app.js | UTF-8 | 5,527 | 3.3125 | 3 | [] | no_license | //画布宽度
var GLOBAL_CANVAS_WIDTH = 505;
//玩家初始位置X
var GLOBAL_PLAYER_INIT_X = 202;
//玩家初始位置Y
var GLOBAL_PLAYER_INIT_Y = 390;
//第一排道路
var GLOBAL_FIRST_WAY = 58;
//第二排道路
var GLOBAL_SECOND_WAY = 141;
//第三排道路
var GLOBAL_THREE_WAY = 224;
//设定速度区间
var GLOBAL_SPEEDS = [4,1,5,3,2,3,2,3,2,3];
var GLOBAL_ALL_WAYS = [GLOBAL_FIRST_W... | true |
3fcacb5c11bc2ebe20f8fa3b73b562c1c66b7bcf | JavaScript | crowdedjs/crowded | /src/recast/RecastRasterization.js | UTF-8 | 9,407 | 2.546875 | 3 | [
"Zlib",
"MIT"
] | permissive | /*
Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
Recast4J Copyright (c) 2015 Piotr Piastucki piotr@jtilia.org
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to... | true |
c60623e98e49ae160e0b14f7559d89eed9d2c99c | JavaScript | draganabogicevic/BIT-PP | /Loops/arraySort.js | UTF-8 | 334 | 3.59375 | 4 | [] | no_license | var array = [2, 5, 9, 4, -8, 32, 7, 8,];
var done = false;
while(!done) {
done = true;
for(var i = 1; i < array.length; i+=1) {
if(array[i-1] > array[i]) {
done = false;
var tmp = array[i-1];
array [i-1] = array[i];
array[i] = tmp;
}
}
}
cons... | true |
011a7e286b5ec25af32b072d94191bbef1601b37 | JavaScript | adri994/Javascript_Dorian | /Clase 6 API html/11 API ONLINE OFFLINE/scripts.js | UTF-8 | 636 | 3.375 | 3 | [] | no_license | const alerta = document.getElementById('alert');
window.addEventListener('online',(e)=>{
setAlert(1);
})
window.addEventListener('offline',(e)=>{
setAlert(0);
})
const setAlert = (status) =>{
alerta.classList.remove('alert--online');
alerta.classList.remove('alert--offline');
status === 0 ?
... | true |
ccc0c27a48303e5bddbffc630e274ac366f66c20 | JavaScript | AndersonAlvesCoelho/B2MConcursos | /back-end/src/index.js | UTF-8 | 1,145 | 2.84375 | 3 | [] | no_license | const fs = require('fs')
const pdf = require('pdf-parse')
const pdfFile = fs.readFileSync('src/PDF/TG MG teste 1 questao.pdf')
var methods = {};
methods.timestamp = function() {
var string = "A) Casa com a palavra exemplo. B) DSSD ";
// regex = /a\)/;
var regex = /(01)(.*)(A\))/;
pattern = ne... | true |
c210438dd16e7b0cb6051361cd57df6245de3234 | JavaScript | Fik-shun/ecommerceWebApp | /server/index.js | UTF-8 | 2,001 | 2.640625 | 3 | [] | no_license |
const mongoose = require('mongoose');
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const db = require('./db')
const userRouter = require('./routes/user-router')
const app = express()
const apiPort = 8080
const myUserRouter = require('./routes/user-router... | true |
f7077f8b76700777a2c8771d0d2e1d5ff54ab55c | JavaScript | guardian/membership-frontend | /frontend/assets/javascripts/src/modules/events/cta.js | UTF-8 | 1,375 | 2.515625 | 3 | [] | no_license | define([
'$',
'src/utils/user'
], function($, userUtil) {
'use strict';
var CTA_ELEM = '.js-ticket-cta';
var CTA_ACTIONS = {
buy: {},
join: {
id: 'join'
},
upgrade: {
id: 'upgrade',
label: 'Upgrade membership'
},
un... | true |
b1e2a4728bffc7168ae9b0056f5f3dba463aaa7b | JavaScript | blaadje/getthenotes | /src/components/Stave/index.js | UTF-8 | 2,788 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import Vex from 'vexflow'
import notesArray from './notes'
import './style.scss'
const VF = Vex.Flow
class Stave extends Component {
constructor (args) {
super(args)
this.state = {
notes: [],
currentIndex: 0
}
this.renderer = {}
this.contex... | true |
0b86d9d3eb682d7ad2377d5fcca9c8365052fccd | JavaScript | ddimitrov899/JS-Basic-Homework | /examsPreparation/exams/03GoshkoTheRabbit/app.js | UTF-8 | 2,245 | 3.25 | 3 | [] | no_license | function solve(arr) {
var directions = arr[0].split(', ');
var garden = [];
for (var index = 1; index < arr.length; index++) {
garden.push(arr[index].split(', '));
}
var row = 0, col = 0, wallNumberHit = 0;
var carrots = 0, cabbage = 0, lettuce = 0, turnip = 0;
var passed = [];
for (var direction... | true |
09e01330cffb59ddcefa3685d71da4d70cee7f98 | JavaScript | shermanawilson/codeup-web-exercises | /js/break_and_continue.js | UTF-8 | 794 | 4.03125 | 4 | [] | no_license | //alert("Hello");
var addNumber;
// while (true) {
// addNumber = parseInt("Enter a number between 1 and 50");
// if (addNumber % 2 != 0) {
// break;
// }
// }
//addNumber = prompt("What number do you have?");
addNumber = prompt("What is your number?");
//console.log("Number to skip is " + ... | true |
b8018f532afc86044195960f15c9a5b4c01f84df | JavaScript | umberto123/priceComparer | /lib/config/index.js | UTF-8 | 2,116 | 2.609375 | 3 | [] | no_license | var path = require('path');
var _ = require('lodash');
var nconf = require('nconf');
var appDir = path.dirname(require.main.filename);
module.exports = (function configWrapper() {
var config = {};
var configDirectory;
var configFilename;
/**
* Public functions
*/
/**
* Initialize c... | true |
a2208cd0719677c499659fb5790d7a9ade16d0b8 | JavaScript | CrisSugar/barrio | /client/src/components/home/Home.js | UTF-8 | 2,474 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import { Link } from "react-router-dom";
import Service from "../../services/Service";
import AllShops from "../allShops/AllShops";
import AllOffers from "../allOffers/AllOffers";
import "./Home.css"
export default class Home extends React.Component {
constructor(props) {
... | true |
46c079947f413de1a943f710cb24323ad45c2078 | JavaScript | cga3798/cga3798.github.io | /main.js | UTF-8 | 17,766 | 2.703125 | 3 | [] | no_license | var AM = new AssetManager();
function Animation(spriteSheet, startX, startY, frameWidth, frameHeight, sheetWidth, frameDuration, frames, loop) {
this.spriteSheet = spriteSheet;
this.startX = startX;
this.startY = startY;
this.frameWidth = frameWidth;
this.frameDuration = frameDuration;
... | true |
0068e242d12b2a48d6e8c374db5688b367fc492c | JavaScript | RajuShetty/Manna-Ministry | /qz-kn/books/Josh20.js | UTF-8 | 5,462 | 2.9375 | 3 | [] | no_license | var quiztitle = " Joshua ಅಧ್ಯಾಯ 20";
var quiz = [
{
"question" : " 1. Who was speaking? ",
"image" : "",
"choices" : [
" a. The Lord ",
" b. Joshua ",
" c. Eleazar ",
" d. An angel "
],
"correct" : " a. The Lord ",
"explanation" : " The LORD also spake unto Joshua, saying, Josh 20:1 ",... | true |
e237e3f461ccfc570d35bf0dcb69e891d63b1493 | JavaScript | kinant/frontend-nanodegree-resume | /js/resumeBuilder.js | UTF-8 | 8,275 | 2.859375 | 3 | [] | no_license | var bio = {
"name" : "Kinan Turjman",
"role" : "Web Developer",
"contacts" :
{
"mobile" : "111-111-1111",
"email" : "kinan.t@gmail.com",
"github" : "kinant",
"twitter" : "@kinant87",
"blog" : "kinant.com/blog",
"location" : "Guatemala"
},
"welcomeMsg" : "Welcome to my resume!",
"skills" : ["pilot","p... | true |
3703d6a8562b017dabfe7eeaaf1a2ea49c3ebc78 | JavaScript | Shaharafat/javascript-definitive-guide | /argumentType(page-174).js | UTF-8 | 1,422 | 3.984375 | 4 | [] | no_license | function isArrayLike(o) {
if (o &&
typeof o === "object" &&
isFinite(o.length) &&
o.length >= 0 &&
o.length === Math.floor(o.length) &&
o.length < 4294967296)
return true;
else
return false;
}
/*
* Return the sum of the elements of array (or array=like object) a.
* The elements of a ... | true |
c41b8dadfc35f991203d4944c58af5dd743e47ad | JavaScript | KevinMichaelCamp/CodingDojo-Algorithms | /CodingDojo/Ch04_Strings_and_Associative_Arrays/06_String_Reverse.js | UTF-8 | 394 | 4.4375 | 4 | [] | no_license | /* Implement reverseString(str) that, given a string, returns that string with characterss reversed . Given "creature", return "erutaerc". Tempting as it seems, do not use the built-in reverse()! */
function reverseString(str) {
var newStr = "";
for (var i = str.length - 1; i >= 0; i--) {
newStr += s... | true |
94c8bb25dd3bdc565ca9ed011bfbee6192f6de0c | JavaScript | mbswenson/mbswenson.github.io | /fourthweek/textsketch.js | UTF-8 | 1,094 | 3.34375 | 3 | [] | no_license | var buttbutt;
var textLocale;
var rememberedText;
function setup(){
noCanvas();
textLocale = createElement('textArea', 'write how you feel');
textLocale.size(200,200);
createElement('br');
createElement('br');
buttbutt = createButton ('dissociate from how you feel');
buttbutt.mousePressed(saveText);
}
function... | true |
e7a76f8dff747dce2524bb784eab8434d58082c8 | JavaScript | DevYojan/TODO | /script.js | UTF-8 | 2,822 | 3.234375 | 3 | [] | no_license | const addButton = document.querySelector("#add");
const inputText = document.querySelector("#text");
let todos = document.querySelector(".todos");
let allTodos;
if(localStorage.getItem('allTodos')){
allTodos = JSON.parse(localStorage.getItem('allTodos'));
} else {
allTodos = [];
}
function displayTodos() {
lo... | true |
bea1e55113495cac46155dd07471ab301f53820c | JavaScript | xiilienaya/nodeJS-Lesson | /NodeJS/(2)NodeJS全局API/bufferAndModule/circleModule2.js | UTF-8 | 339 | 2.828125 | 3 | [] | no_license | function cicleFun(r) {
function circumference() {
var a= 2 * Math.PI * r;
return a;
}
function area() {
var b = Math.PI * r * r;
return b;
}
var circle= {circumference: circumference, area: area}
console.log(circle);
return circle;
}
module.exports = {
c... | true |
24f5ac6a6333bfe994f6715e2f8145249c9650ea | JavaScript | SNtGog/ScreepsAI | /src/core.role.js | UTF-8 | 1,275 | 2.796875 | 3 | [] | no_license | /*
* Module code goes here. Use 'module.exports' to export things:
* module.exports.thing = 'a thing';
*
* You can import it from another modules like this:
* var mod = require('core.role');
* mod.thing == 'a thing'; // true
*/
var CoreObject = require('core.object');
var _ = require('lodash');
var CoreRole =... | true |
daebc1eaecf0e139eab5bfdac9bbb29c1496c777 | JavaScript | tarana31/Code_Challenge_Workshop | /main.js | UTF-8 | 2,449 | 4.15625 | 4 | [] | no_license | // Problem: 1
// write a function named stringy that takes a size and returns a string of alternating '1s' and '0s'. the string should
// start with a 1. a string with size 6 should return :'101010'. with size 4 should return : '1010'. with size 12 should
// return : '101010101010'. The size will always be positive a... | true |
218b020d64e76b3f8fd82218456edf4a719799dc | JavaScript | everwake/hello-express-web-server | /app.js | UTF-8 | 998 | 2.59375 | 3 | [] | no_license | const express = require('express');
const hbs = require('hbs');
const app = express();
let port = process.env.PORT || 3000;
hbs.registerPartials(__dirname + '/views/partial');
hbs.registerHelper('getCurrentYear', ()=> {
return new Date().getFullYear()
});
app.use(express.static(__dirname + '/public'));
app.use((r... | true |
39a4b0d78fa3acb2fbdec85eea15c8948fdd3882 | JavaScript | ryry0/serpens | /flask_electron/src/renderer.js | UTF-8 | 3,156 | 2.8125 | 3 | [] | no_license | let input = document.querySelector('#input')
let pythonspan = document.querySelector('#pythonspan')
let socket_pythonspan = document.querySelector('#socket_pythonspan')
let btn = document.querySelector('#btn')
let socketiobtn = document.querySelector('#socketiobtn')
/**** START PYTHON SERVER ***********/
//function s... | true |
dd139af658bc5bf5ce2da628ee2a11554d3e6f9b | JavaScript | Traful/credenciales | /src/components/dashboard/ShootBorrar.js | UTF-8 | 1,763 | 2.703125 | 3 | [] | no_license | import React, { useRef, useEffect } from "react";
import { jsPDF } from "jspdf";
import img from "./imgs/JubiladosPensionados.png";
const Shoot = () => {
const refCanvas = useRef(null);
const refCanvasCapture = useRef(null);
const refPlayer = useRef(null);
const constraints = {
video: true,
};
useEffect(() =... | true |
f758fc11ef907bb29bca8d4d264c7012bd253efb | JavaScript | yuyuvn/noble | /lib/characteristic.js | UTF-8 | 3,555 | 2.578125 | 3 | [
"MIT"
] | permissive | const events = require('events');
const characteristics = require('./characteristics.json');
class Characteristic extends events.EventEmitter {
constructor(noble, peripheralId, serviceUuid, uuid, properties) {
super();
this._noble = noble;
this._peripheralId = peripheralId;
this._serviceUuid = servi... | true |
15ddf349b1232122286b8978982ea6ad494d2226 | JavaScript | CamilaDiniz2/controle-academia-v2 | /controllers/members.js | UTF-8 | 2,772 | 2.953125 | 3 | [] | no_license | const fs = require('fs');
const data = require('../data.json');
const { date } = require('../utils');
// create
exports.create = (req, res) => {
return res.render('members/create');
};
// mostra todos os instrutores na tela
exports.index = (req, res) => {
return res.render('members/index', { members: data.members... | true |
7d84c72eb156ccf574f4f89d47af4dc5c5dc606e | JavaScript | muhammadmadnihaider/natours | /app.js | UTF-8 | 2,297 | 2.796875 | 3 | [] | no_license | const fs = require('fs');
const express = require('express');
const { get } = require('http');
const app = express();
app.use(express.json());
const tours = JSON.parse(
fs.readFileSync(`${__dirname}/dev-data/data/tours-simple.json`)
);
const getAlltours = (req, res) => {
res.status(200).json({
status: 'succes... | true |
9a31e05825bd8ca81ac6b418ec7916ed9ae3c480 | JavaScript | PeterGottesman/pitt2018 | /frontend/user/popup.js | UTF-8 | 2,582 | 3 | 3 | [] | no_license | // Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function getAuthor() {
var author = "";
var info = document.getElementsByTagName('META');
for (var i=0;i<info.length;i++) {
if (info[i].g... | true |
cf70805b02f11cef1f7fc020f5e723fdf8fface6 | JavaScript | alexfov/task_manager_native | /components/Tasks/index.js | UTF-8 | 1,482 | 2.625 | 3 | [] | no_license | import React, { useRef, useState } from "react";
import { Text, View, StyleSheet, Animated } from "react-native";
// function Tasks(props) {
// return (
// <View>
// <Text>Tasks</Text>
// </View>
// );
// }
// export default Tasks;
const styles = StyleSheet.create({});
const Fade... | true |
fc5a097722e61247938d8fa14b30b80a49fdea2a | JavaScript | VictorH04/programming-topics | /Fundamentals/Arrays/app2.js | UTF-8 | 282 | 3.359375 | 3 | [] | no_license | let friend1 = 'John';
let friend2 = 'Peter';
let friend3 = 'Bob';
let friend4 = 'Will';
let friends = new Array('John', 'Peter', 'Bob', 'Will');
let oldFriends = [ 'Peter', 45, true, null, undefined ];
oldFriends[0] = 'Bob';
let bestFriend = oldFriends[0];
console.log(bestFriend);
| true |
0e2d682e272ef7eeeab8d0f85d455f0aadd31699 | JavaScript | guyo/n-puzzle | /test/e2e/pages/SizeInput.js | UTF-8 | 633 | 2.78125 | 3 | [
"MIT"
] | permissive | const { Key } = require('selenium-webdriver');
class SizeInput {
constructor(input) {
this.input = input;
}
clear() {
return this.input.getAttribute('value')
.then(v => v && v.length > 0 ?
this.input.sendKeys.apply(this.input, new Array(v.length).fill(Key.BACK_S... | true |
32fa60c93dc40bab43b146725aea60bb0bcf3ee6 | JavaScript | NonglakS/iTunes-Store | /music-hub/src/App.js | UTF-8 | 1,195 | 2.796875 | 3 | [] | no_license | import "./App.css";
import Artist from "./Components/Artist";
import axios from "axios";
import { useState, useEffect } from "react";
function App() {
const [albums, setAlbums] = useState([]);
const [artist, setArtist] = useState("selena gomez");
const [searchTerm, setSearchTerm] = useState("");
function sear... | true |
7ff597d712d15908784fa7ea76fd0643cda847f3 | JavaScript | Enforc3rr/RestfulApi-Template-Creator | /ControllerCodeGenerator/ControllerGenerator.js | UTF-8 | 1,094 | 2.71875 | 3 | [] | no_license | const fs = require("fs");
const path = require("path");
class ControllerGenerator {
getController = (funcName,controllerPath)=>{
fs.appendFile(path.join(controllerPath,"controller.js"),
controllerData(funcName,"GET"),err => {if(err) throw err});
};
postController =(funcName,controllerP... | true |
2e5d1334de8ba033ae60efe7a99626178526b1f5 | JavaScript | AcquireDevs/javascript-tutorial-3 | /script.js | UTF-8 | 657 | 3.8125 | 4 | [] | no_license | // ignore all other operators only focus on value properties
let A=Math.pow(3,1000) // Math.pow is 3^1000
let B=Math.pow(2,1000)// Math.pow is 2^1000
if(A===Infinity){
document.body.innerHTML+='3^1000 is maximum value in javascript <br>'
}//ignore if else it is just if A equal toi infinity print 3^1000 is maximu... | true |
ab4aed3dba1e9af1df5a9c3166bc45f13c1623e2 | JavaScript | deaxmachina/react_routing | /src/Shop.js | UTF-8 | 582 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import './App.css';
import { Link } from "react-router-dom";
function Shop() {
const items = [
'cat', 'dog', 'red panda', 'lizzard', 'kitten'
]
// Adding dynamic routing - just need to include the name of the route in the to attr of the Link, and this can... | true |
96045e283504d6f989634eea674ab0106f1ff21a | JavaScript | mvhs-apps/daily-logs-simplifier | /src/nguyen_student_view.js | UTF-8 | 1,965 | 2.734375 | 3 | [] | no_license | function getCompletionByDate(completion, day, name, user_data) {
completion.doc(day).get().then((doc) => {
if (doc.exists) {
console.log(`${name}'s doc data:`, user_data);
console.log(`${name}'s completion:`, doc.data());
console.log('\n');
dict[name] = doc.da... | true |
8a8aa6f9ce25bccaba29262a6080d15e9d44b161 | JavaScript | StevieSiren/SimpleLinkedIn | /server/routes/api/posts.js | UTF-8 | 5,848 | 2.59375 | 3 | [] | no_license | const express = require('express'),
router = express.Router(),
mongoose = require('mongoose'),
passport = require('passport');
const Post = require('../../models/Post'),
Profile = require('../../models/Profile');
const validatePostInput = require('../../validation/post');
// === @route G... | true |
41675e5c8c2871105e3dd57b2bc9ed02a92472c3 | JavaScript | hypothetical-andrei/test3-partial | /main/app.js | UTF-8 | 382 | 3.265625 | 3 | [] | no_license | function bowdlerize(input, dictionary){
let items = input.split(' ')
for (let i = 0; i < items.length; i++){
if (dictionary.indexOf(items[i].toLowerCase()) !== -1){
items[i] = items[i][0] + "*".repeat(items[i].length - 2) + items[i][items[i].length - 1]
}
}
return items.join(... | true |
65f4285d79e86149159306b1f2f355ab96b28578 | JavaScript | zougui1/dynamic-redux | /examples/dynamic-redux/advanced-usage/store/states/example.js | UTF-8 | 4,068 | 3.09375 | 3 | [] | no_license | import { DynamicState, Middleware } from 'dynamic-redux';
const exampleState = new DynamicState('example', {
myProperty: 'default value',
myArray: [],
myObject: {},
myNumber: 0
});
// there is several kinds of actions
exampleState.createActions({
// the basic one is 'set', which only replace the value in t... | true |
9f953cf5024f941f27efeeaca429997bc6e2b9ed | JavaScript | cjlozanoDev/webpack-concepts | /js/index.js | UTF-8 | 264 | 2.609375 | 3 | [] | no_license | // console.log('Hello world')
import test1 from '../test1'
import test2 from '../test2'
console.log(`${ test1 } ${ test2 }`)
import blackcat from '../img/black-cat.jpg'
const img = document.createElement('img')
img.src = blackcat
document.body.appendChild(img) | true |
09b7aa69497457faff8082092a01b32d81fb9cda | JavaScript | plorena82/react-expensify-app | /src/playground/hoc.js | UTF-8 | 1,183 | 2.921875 | 3 | [] | no_license | //Higher order components (HOC) It is a component (hoc) that renders another component
//advantages
//reuse code
//render hijacking
//props manipulation
//abstract state
import React from 'react';
import ReactDOM from 'react-dom';
const Info = (props) =>(
<div>
<h1>Info</h1>
<p>The info is {prop... | true |
94cf24cffd487c4ed14626591bc74af1daeb5505 | JavaScript | wannabegopher/guilttrip-watch | /server/lib/totalDistance.js | UTF-8 | 1,798 | 3.109375 | 3 | [] | no_license |
import validImage from './validImage'
import haversine from 'haversine-distance'
import haversineFormatInstagramCoords from '../../lib/haversineFormatInstagramCoords'
import moment from 'moment'
import debug from '../debug'
import {dateFromImage} from '../../lib/timefunctions'
function calculateDistanceInKm(image1, i... | true |
f1ad03b66393d6608bf365248409003bf5eac2bb | JavaScript | Eng-SalmaSalah/Servlets_labs | /day3/loginDBApp/web/login.js | UTF-8 | 185 | 2.53125 | 3 | [] | no_license |
var checkValid = location.search;
if (checkValid === "?invalid")
{
document.getElementById("errorMessage").innerHTML = "<b>invalid login<b>";
}
| true |
e0564f66255f77089bc085a43dbfd1f59d77fbd1 | JavaScript | HaashimB/frontend | /src/Bubble.js | UTF-8 | 3,039 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react'
import './App.css'
import { scaleLinear } from 'd3-scale'
import { max } from 'd3-array'
import { select } from 'd3-selection'
class Bubble extends Component {
constructor(props){
super(props);
this.createBubble = this.createBubble.bind(this)
}
compo... | true |
23624364c1916b67f05f0f11dd18b3dc0b85ffe8 | JavaScript | dharbinjaep/Minesweeper | /frontend/src/components/GameTimer/GameTimer.js | UTF-8 | 1,559 | 2.75 | 3 | [] | no_license | import React from 'react';
import './GameTimer.css';
import clock from '../../assets/images/clock.png';
import IconCounter from '../IconCounter/IconCounter';
const MAX_TIME_ELAPSED = 999;
class GameTimer extends React.Component {
constructor(props) {
super(props);
this.state = {
secondsElapsed: 0
... | true |
5b6c9dd944f4d08bddb8b89e7c53cd6d846ab98a | JavaScript | Jurrieb/jurrieb.github.io | /assets/js/lists.js | UTF-8 | 3,430 | 2.53125 | 3 | [] | no_license | $(function() {
$('section').on('click', 'article', function(){
var $element = $(this);
var items = JSON.parse(localStorage.getItem('list_items'));
var id = $element.data('id');
$.each(items.items, function(key, article ) {
if (article.id !== id) {
... | true |
c35bd4ba55f4e7637624786812f69288176ee93e | JavaScript | brentwhittaker/react-redux-portfolio | /src/projects/reaction/reducers/reactions.js | UTF-8 | 551 | 2.59375 | 3 | [
"MIT"
] | permissive | import { REACTION_OBJECTS } from "../actions/types";
const REACTION_TYPES = REACTION_OBJECTS.map(
REACTION_OBJECT => REACTION_OBJECT.type
);
const reactionsReducer = (state = {}, action) => {
if (REACTION_TYPES.includes(action.type)) {
const { messageId } = action.item;
const messageReactions = state[mess... | true |
d042f121aa49ff1786c5a6f2376754c81ffc223f | JavaScript | Lidemy/mentor-program-4th-YongChenSu | /homeworks/week2/hw1.js | UTF-8 | 119 | 3.515625 | 4 | [] | no_license | function printStars(n) {
let star = '*'
for (let i = 1; i <= n; i++) {
console.log(star)
}
}
printStars(5);
| true |
8254e3f521655646b87839bd3e0e7a379bf566da | JavaScript | prathvi-shetty/react-codes-sentiment | /react_learning/tic_tac_toe/src/App.js | UTF-8 | 1,607 | 2.671875 | 3 | [] | no_license | import React , { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Navbar from './components/navbar'
import Counters from './components/counters'
import Counter from './components/counter';
class App extends Component {
state = {
counters : [
{id: 1 , value: 4},
... | true |
8448468f92bc88811c85996bfc654578670101ef | JavaScript | reyboo/egg-console | /lib/validate.js | UTF-8 | 563 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
const colors = require('colors');
module.exports = options => {
const invalid = [];
if (!colors[options.success]) {
invalid.push('success');
options.success = 'green';
}
if (!colors[options.error]) {
invalid.push('error');
options.success = 'red';
}
if (!colors[options.debu... | true |
832f1e4132c82a6491047dccf925adffd51eb295 | JavaScript | inbar-cohen/babble | /client/scripts/main.js | UTF-8 | 12,165 | 2.515625 | 3 | [] | no_license | window.Babble = {
counter: 0,
register: function register(userInfo) {
localStorage.setItem('babble', JSON.stringify({ currentMessage: '', userInfo: { name: userInfo.name, email: userInfo.email } }));
if (typeof (Storage) !== "undefined") {
request({
method: 'POST',
... | true |
8605c9fd25b317ed7a59b5304f332de1b7021851 | JavaScript | AleemAlam/ds-masai | /ds/DSA_Practice/GoodPermutation.js | UTF-8 | 1,087 | 3.078125 | 3 | [] | no_license | function runProgram(input) {
input = +input.trim();
let count = 0;
const arr = [];
for (let i = 1; i <= input; i++) {
arr.push(i);
}
function goodPermutations(index) {
if (index == arr.length) {
count++;
}
for (let i = index; i < arr.length; i++) {
swap(arr, i, index);
if (... | true |
ec99d0e126c959ba4f7ade1e4f1b0e1e3bc3029b | JavaScript | AAI-USZ/FixJS | /input/50-100/after/cff9575f24d1b436b88ce6feb001517a141b8a55_4_7.js | UTF-8 | 286 | 2.640625 | 3 | [
"MIT"
] | permissive | function setHandlePosition(){
if( _scrollWidth - _elementWidth > 0 ) {
_handle.style.left = ( _elementWidth - _handleWidth ) *
( outerElement.scrollLeft / ( _scrollWidth - _elementWidth ) ) + "px";
} else {
_handle.style.left = "0px";
}
} | true |
c958da98c3fa909bfb9f2b87c5c138f17c16f693 | JavaScript | nickstanley574/freeCodeCampProjects | /JavaScriptAlgorithmsDataStructures/CaesarsCipher.js | UTF-8 | 1,319 | 3.875 | 4 | [] | no_license | // JavaScript Algorithms and Data Structures Projects: Caesars Cipher
//
// One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher.
// In a shift cipher the meanings of the letters are shifted by some set amount.
//
// A common modern use is the ROT13 cipher, where the values... | true |
d62a0ea112b00f8e31ab3dbb093453d4d9d7b11e | JavaScript | atonkoshkurov/ArticlesEditor | /scripts/artlist.js | UTF-8 | 2,644 | 2.890625 | 3 | [] | no_license | var clickHandler = function markArticle(event)
{
var artRow = event.currentTarget;
var idNumber = getArticleIdNumber(artRow);
if (idNumber != currentArtId)
{
var artTable = document.getElementById('tablerows');
var articleRows = artTable.getElementsByTagName('tr');
for (var cnt = 0; cnt < articleRo... | true |
2a61e2e9359b9988659cf98a623f3f37c402eec2 | JavaScript | sandboxdigital/zephyr-core-old | /js/extjs/tree.serializer.js | UTF-8 | 6,234 | 2.609375 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /*global Ext*/
/**
* @class Ext.tree.TreeSerializer
* A base class for implementations which provide serialization of an
* {@link Ext.tree.TreePanel}.
* <p>
* Implementations must provide a toString method which returns the serialized
* representation of the tree.
*
* @constructor
* @param {TreePanel} tree... | true |
4a5494a05aa1b3752ad61ffad6120ac04fe32faa | JavaScript | AndreaBLS/exercises | /41-PB-datastructure-spread/41-andrea.js | UTF-8 | 972 | 3.984375 | 4 | [] | no_license | "use strict";
// Task 1 Combining Arrays
let euroCountries = ["Italy", "France", "Germany"];
let asianCountries = ["China", "Japan", "India"];
euroCountries.push(...asianCountries);
console.log("Task 1 Combining Arrays ", euroCountries);
let euroCountriesTwo = ["Italy", "France", "Germany"];
let asianCountriesTwo =... | true |
d7fc5a04f24db68c275b8be9dba9d928a0d222ff | JavaScript | itsjustdanger/chessJS | /specs/pieces/pawn_specs.js | UTF-8 | 1,706 | 3.140625 | 3 | [] | no_license | var test = require('tape');
var Board = require('../../src/js/Board');
test('Get array of possible legal moves for selected white Pawn', (t) => {
var board = new Board();
var pawn = board.getPiece('e2');
t.plan(1);
t.deepEqual(pawn.moves(), ['e3', 'e4']);
});
test('Get array of possible legal moves for sele... | true |
f009756ef4f9f7190e047be3ecb9d5f8130fefa3 | JavaScript | pythonwang/php-samll-code | /shop/Public/Member/js/regCheck.js | UTF-8 | 3,022 | 2.578125 | 3 | [
"MIT"
] | permissive |
var checkForm = {
'email':{
preg:/^[a-z0-9\.]+@[a-z0-9]+\.[a-z]+$/i,
focus:'请填写你的邮箱!',
empty:'邮箱不能为空',
error:'邮箱格式错误'
},
'username':{
preg:/^[a-z]\w{5,15}$/i,
focus:'请填写你的用户名!',
empty:'用户名不能为空',
error:'用户名格式错误'
},
'password':{
preg:/^\S{6,32}$/,
focus:'请填写你的密码!',
empty:'... | true |