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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2e1d556763aee8971b7096c6ad14424e856a77e5 | JavaScript | sebastianrosik/rst-frontend-training-es2015 | /src/ui/cli.js | UTF-8 | 401 | 2.6875 | 3 | [] | no_license | import commands from './commands';
import program from 'commander';
let cmdValue, argsValue;
program
.version('0.0.1')
.arguments('<cmd> [arg1] [arg2]')
.action((cmd, ...args) => {
cmdValue = cmd;
argsValue = args;
});
program.parse(process.argv);
if (typeof cmdValue === 'undefined') {
console.... | true |
3a73a9f00bc459ff642c51139621eb06c3938e9d | JavaScript | jingug1004/MetalHD | /src/main/webapp/resources/js/custom/manufacture/Stock/delete.js | UTF-8 | 1,256 | 3.171875 | 3 | [
"MIT"
] | permissive | // MAP ์์ฑ
function newMap() {
var length = 0;
var map = {};
map.value = {};
map.getKey = function(id) {
return id;
};
map.put = function(id, value) {
var key = map.getKey(id);
map.value[key] = value;
length++;
};
return map;
}
//์ญ์ ๋ฒํผ
$("#input-delete").on(
'click',
function() {
var array = new ... | true |
849736d5e2d0d925c3a79d1c3bffd569b7dab5ba | JavaScript | pareshmar/assignment4 | /components/addRecipe.js | UTF-8 | 2,776 | 2.90625 | 3 | [] | no_license | import React, {Component} from 'react';
import { StyleSheet, Text, View , TextInput, Button , Alert, ScrollView} from 'react-native';
import firebase from '../firebase'
class AddRecipe extends Component {
constructor(props){
super(props)
//the current state is empty
this.state = {
name: '' ,
... | true |
6613c2973fe3089aad213c03435041e484bd2db1 | JavaScript | LeilaSchooley/tic-tac-toe | /script.js | UTF-8 | 4,757 | 3.6875 | 4 | [] | no_license | let nameButton = document.getElementById("names")
let grid = document.getElementById("grid")
let startButton = document.getElementById("start")
let playerOne = new Player("PlayerOne", "X",0)
let playerTwo = new Player("PlayerTwo","O",0)
gameBoard = [
["","",""],
["","",""],
["","",""]
]
function Pl... | true |
d592380283b50a04be3593f7374deefa65cfb5f3 | JavaScript | hernandez87v/lighthouse-js-fundamentals | /lastIndexOf.js | UTF-8 | 549 | 3.46875 | 3 | [] | no_license | function lastIndexOf(inside, outside) {
const indexList = [];
for (let i = 0; i < inside.length; i++) {
if (inside[i] === outside) {
console.log(i);
indexList.push(i);
}
}
if (indexList.length === 0) {
return -1;
} else {
return indexList.pop();
}
}
console.log(lastIndexOf([0, 1... | true |
1fb0e6f3e3b2848e19e7d4d68416b914e935c40a | JavaScript | demisquare/BookBarWebsite | /BookBarWebsite/WebContent/js/aquistaMenu.js | UTF-8 | 1,750 | 2.671875 | 3 | [] | no_license | let menu = null;
let getMenuList = () => {
$.ajax({
async: true,
crossDomain: true,
url: "http://localhost:8080/BookBarWebsite/api/menu",
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "*/*"
},
data: {}
}).done(function(response) {
let data = JSON.p... | true |
c62d2e8375baa62f48023d511a72c822561afca8 | JavaScript | radharaniraj/parking_lot_api-main | /test/test.js | UTF-8 | 4,670 | 2.59375 | 3 | [] | no_license | var supertest = require("supertest");
var should = require("should");
var server = supertest.agent("http://localhost:3000");
describe("create parking lot test",function(){
it("should return created parking lot",function(done){
server
.get("/create_parking_lot?number=3")
.expect("Content-type",/json/)
... | true |
07e8be25784875267ad6f19ff2823f02fc32e328 | JavaScript | HackMEAny/TestWeb | /Dashboard/script.js | UTF-8 | 2,802 | 2.828125 | 3 | [] | no_license | const navigation = document.getElementById("navigation");
const logo = document.getElementById("logo");
window.onscroll = function () {
scrollFunction();
};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
navigation.style.padding = "25px 10px";
lo... | true |
0ee37fd1817e4c61d7c81749d3220e02d7311d79 | JavaScript | theoners/JS-Core-May-2019 | /JS Essentials-Exams/JS Essentials Exam - 9 June 2019/03. Spaceship Crafting/scripts/app.js | UTF-8 | 4,820 | 2.625 | 3 | [
"MIT"
] | permissive | function spaceshipCrafting() {
let products = {
titanium: 25,
aluminum: 50,
magnesium: 75,
carbon: 100,
};
let spaceships = {
theUndefinedShip: {
name: "THE-UNDEFINED-SHIP",
titaniumBars: 7,
aluminumBars: 9,
magnesiumB... | true |
00c6bfef1a13b786b67ac4109df5ec3875466fa7 | JavaScript | DavidAlejandro18/cinta-roja-v2 | /cinta-roja-v2/promesas.js | UTF-8 | 439 | 3.890625 | 4 | [] | no_license | const promise = new Promise((resolve, reject) => {
const number = Math.round(Math.random() * 10);
console.log(number);
setTimeout(
() => {
if(number > 5) {
resolve(number)
} else {
reject("Menor a 5, el numero es: " + number)
}
... | true |
3606404e3a53d9a03c310ea436557dbf2540f6a6 | JavaScript | r888888888/danbooruup | /chrome/content/danbooruup/site_injection/completer.js | UTF-8 | 3,712 | 2.546875 | 3 | [] | no_license | var danbooruUpCompleter = {
result: null,
cur_tag: '',
cur_prefix: '',
cur_search_type: '',
cur_callback: null,
timer: null,
getSuggestions: function(tag, prefix, search_type, callback)
{
this.cur_callback = callback;
this.cur_tag = tag;
this.cur_prefix = prefix;
this.cur_search_type = search_type;
v... | true |
94410fced8faae67dbc58d0ddcedbe558980da83 | JavaScript | josethomazini/falling_stars | /src/stage/entities/GameOverMessage.js | UTF-8 | 1,071 | 2.90625 | 3 | [
"MIT"
] | permissive | export default class GameOverMessage {
constructor(scene) {
this.scene = scene;
this.gameOverText = this.makeGameOverText();
this.hitSpaceText = this.makeHitSpaceText();
this.gameOverText.visible = false;
this.hitSpaceText.visible = false;
}
makeHitSpaceText() {
const { width, height } ... | true |
79f5b396dbf9f0a7bdc56b88dc1886e9b9b34577 | JavaScript | davidvalenciac9/face-recognition-api | /server.js | UTF-8 | 1,556 | 2.53125 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const bcrypt = require('bcrypt-nodejs');
const cors = require('cors');
const knex = require('knex');
const register = require('./controllers/register');
const signin = require('./controllers/signin');
const profileid =... | true |
cb81d6cd6fe3e42d0d4a050c94dfb82cfe46ba5e | JavaScript | snivens/port-gamygdala | /res/test/js_tests/NewBenchmark.js | UTF-8 | 97,014 | 2.8125 | 3 | [] | no_license | function benchmark(){
//There are totla 87 test cases. Those will be run one by one!
var evaluatingChecker = false; //This variable determines if the test is running on the occChecker or not.
//These are the 9 variables that need to be set before each test!
var congruence;
var utility;
var affec... | true |
189a9ba776f3b40f1234b48fc0dcbc5feca9b760 | JavaScript | shubham-amatya/dealsforyou | /server/crawlers/adayroi/adayroi.script.js | UTF-8 | 1,625 | 2.640625 | 3 | [] | no_license | exports.script = async() => {
const config = {
protocol: 'https://',
hostname: 'www.adayroi.com',
item: '.product-item__wrapper',
link: '.product-item__thumbnail ',
coverImgageBackground: '.swiper-lazy',
originalPrice: '.product-item__info-price-original',
currentPrice: '.product-item__inf... | true |
888dedb796699877d3adb7f91a20d4b15b8f873a | JavaScript | codeforboston/bypath | /back-end/util/modules.js | UTF-8 | 692 | 2.53125 | 3 | [
"MIT"
] | permissive | ๏ปฟ/* modules.js
* this manages the modules for the system
*/
var modules = [];
module.exports = {
addModule: function (id, object) {
// Throw an error if the id has alread beed added
if (id in modules) {
console.log("id: " + id + " in ServerSytems.systems array already exists");
... | true |
1f47cdc100cd2c865311cc0fd6c3638452627882 | JavaScript | hoangnh0099/React-Blog | /client/src/pages/post-detail/index.js | UTF-8 | 694 | 2.515625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import * as axios from 'axios';
import './style.css';
const PostDetail = props => {
const {
match: {
params: { id },
},
} = props;
const [post, setPost] = useState({});
const getPostDetailAsync = async () => {
try {
const result = awa... | true |
3760d9417e4eb2a7417699695d1cdd298800ebf1 | JavaScript | Alfionitass/todo-react-redux | /src/components/List.jsx | UTF-8 | 3,445 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react'
export default function List(props) {
const {removeTodo, editTodo, doneEditTodo, completedTodo, children } = props;
const [value, setValue] = useState("");
const todos = props.todo.map((element) => (
element.isEditing ? (
<li className="collection... | true |
86c2f85ec1823799e544a49cbf2d1284e8c650e7 | JavaScript | zeyeland/Gold_or_Glory | /javascript/maps.js | UTF-8 | 5,710 | 2.609375 | 3 | [
"MIT"
] | permissive | var wool_floor = new Image(); // 1
wool_floor.src = "assets/tiles/wool_tile.png";
var stone_wall_tile = new Image(); // 9
stone_wall_tile .src = "assets/tiles/stone_Wall.png";
var sand_Tile = new Image();
sand_Tile .src = "assets/tiles/sand_Tile.png";
var lava_Tile = new Image();
lava_Tile .src = "assets/tiles/l... | true |
0023e7272076bae37c8441f8e59b4032c6174b9c | JavaScript | zhwy/cesium | /Apps/Demos/Lib/indexDbCache.js | UTF-8 | 4,799 | 2.546875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown",
"MPL-2.0",
"ISC",
"OFL-1.1",
"LicenseRef-scancode-proprietary-license",
"JSON",
"LicenseRef-scancode-warranty-disclaimer",
"CC-BY-SA-2.0",
"LicenseRef-scancode-public-domain",
"CC-BY-3.0",
"MIT",
"BSD-3-Clause",
"CC-BY-4.0",
"LicenseRef-s... | permissive | /* eslint-disable */
/**
* Indexed Dbๆไฝๅธฎๅฉ็ฑป
*/
var IndexedDbCache = /** @class */ (function () {
/**
* Indexed Db ๆไฝๅธฎๅฉ็ฑป ๆ้ ๅฝๆฐ
* @param dbName ๆฐๆฎๅบๅ็งฐ
* @param dbVersion ๆฐๆฎๅบ็ๆฌ
* @param storeName ้ป่ฎคๅญๅจ่กจๅ
*/
function IndexedDbCache(dbName, dbVersion, storeName, processKey) {
if (dbName === void 0) {
... | true |
9eba6f373104dde4211a94c6ff81253a470caf6f | JavaScript | mustafadurmaz/mustafadurmaz.github.io | /projects/javascript/share_component/script.js | UTF-8 | 613 | 2.859375 | 3 | [] | no_license | function copy(id){
document.getElementById(id).select();
document.execCommand('copy');
notification('Kopyalama Baลarฤฑlฤฑ');
}
function notification(msg){
let old_div=document.querySelector('.alert');
if(old_div){
old_div.parentNode.removeChild(old_div);
}
let div=doc... | true |
7ac03fe6bc0102e1bdaded7213f788bf57f40b6e | JavaScript | sqwezzy/javascript-fundamentals | /number.test.js | UTF-8 | 3,586 | 3.875 | 4 | [] | no_license | describe("Numbers", () => {
it("Should use remainder operator '%' ", () => {
const a = 15;
const b = 10;
expect(a % b).toBe(5);
expect(a % a).toBe(0);
});
test("Should get average of 3 numbers", () => {
function average(){
let sum = 0;
for (let i = 0 ; i < arguments.length; i++)... | true |
e4fee5fadabcf9c825021196acc247aa3a584077 | JavaScript | stould/Mu-LoT-Spot-Assigner | /libs/playerHandler.js | UTF-8 | 693 | 2.8125 | 3 | [] | no_license | var registeredPlayers;
export function setupPlayerHandler(localStorageHandler) {
registeredPlayers = localStorageHandler.getRegisteredPlayers() || [];
}
export function registerPlayer(player, localStorageHandler) {
registeredPlayers.push(player);
localStorageHandler.updateRegisteredPlayers(registeredPlaye... | true |
26626ed8819a4446039830a5fe89ecaae156b5ab | JavaScript | amitznati/Brand-IT-Back | /src/api/kit/kit.controller.js | UTF-8 | 2,906 | 2.578125 | 3 | [] | no_license | /**
* Using Rails-like standard naming convention for endpoints.
* POST /kit -> create
* GET /kit -> getAll
* GET /kit /:id -> getByID
* DELETE /kit /:id -> removeByID
* PATCH /kit /:id -> updateByID
*/
//const _ = require('lodash');
//const {ObjectID} = require('mongodb');
const GLOBAL_RESPONS... | true |
8b00880072513bc39f169a52df0d2768da9459b8 | JavaScript | GatsbyFuture/cookbook | /admin-panel/controllers/actions.js | UTF-8 | 2,460 | 2.734375 | 3 | [] | no_license | // controller file...
const { deleteAction,
updateAction,
added,
readActionId,
readActions } = require('../models/Action');
const joi = require('joi');
class crudDbController {
// Api con to bring all categories ...
async readAllActions(req, res) {
try {
const resultDb = await readActions();
if (resul... | true |
5e72985883effc2744a15b18603f434d4d761b4a | JavaScript | MateenCode/XOSoundRadio-Project | /main.js | UTF-8 | 2,068 | 3.390625 | 3 | [] | no_license | // Element im working with
let display = document.querySelector('#display');
let textValue = document.querySelector('#TextValue');
let searchLogo = document.querySelector('.searchLogo');
let token = '?client_id=095fe1dcd09eb3d0e1d3d89c76f5618f&q=';
// key down event for enter, pass down ID value
textValue.addEve... | true |
6bc1d342a28dbeedd223976266c41f083c0a1244 | JavaScript | ReactWEB/DOM | /js/main.js | UTF-8 | 1,354 | 3.625 | 4 | [] | no_license | //ะะธะฝะธ ะดะพะผะฐัะบะฐ ะฝะฐ ััะฑะฑะพัั 9.10.21
//ะะพะดะตะปะฐัั ะทะฐะดะฐะฝะธะต ะฝะฐ ะทะฐะฝััะธะธ.
/*-----------------------ะฝะต ัะฐะฑะพัะฐะตั-------------------------------*/
const btn = document.querySelectorAll('button');
const clickFunc = () => {
let z = 0;
btn.forEach((el) => {
el.addEventListener('click', function() {
z++;
});
... | true |
e46ba6db885f39b2859a3158084288f694301d77 | JavaScript | RawanAlakhras/online-shopping-template | /js/master.js | UTF-8 | 768 | 2.546875 | 3 | [] | no_license |
//add active class to navbar
$( '.navbar-nav' ).find( 'li.active' )
.removeClass( 'active' );
var url = window.location;
$('.navbar-nav a[href="'+ url +'"]').parent().addClass('active');
$('.navbar-nav a').filter(function() {
return this.href == url;
}).parent().addClass('active').siblings()... | true |
d6c4c6539086fc4f9d5d48758e83862878bf942e | JavaScript | MickeyStrike/h8-p0-w3 | /exercise8.js | UTF-8 | 483 | 3.34375 | 3 | [] | no_license | function pasanganTerbesar(num){
var strNum = ''+num;
var max=0;
var temp;
for(i=0;i<strNum.length;i++){
temp = Number(strNum[i] + strNum[i+1])
if(temp > max){
max = temp;
}
}
return max;
}
console.log(pasanganTerbesar(645173)); //73
console.log(pasanganTe... | true |
1486a4817d621c123d08e453617c7b46271e87d1 | JavaScript | m15399/Spoooky-Bullets | /public/Globals.js | UTF-8 | 616 | 2.5625 | 3 | [] | no_license |
var WIDTH = 800;
var HEIGHT = 600;
var ourName = 'defaultdefaultdefaultdefaultdefault';
var canvas = document.getElementById("canvas");
var c = canvas.getContext("2d");
c.mozImageSmoothingEnabled = false;
c.webkitImageSmoothingEnabled = false;
c.msImageSmoothingEnabled = false;
c.imageSmoothingEnabled = false;
var ... | true |
e8e85406f05f24a85ad412d5cf2f4d8d3dc3f176 | JavaScript | nearxu/websocket | /proxy/definedproperty-arr.js | UTF-8 | 972 | 3.5 | 4 | [] | no_license | /*
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-10-17 16:30:50
* @LastEditTime: 2019-10-17 16:56:25
* @LastEditors: Please set LastEditors
*/
// ่ฟๆฏ่ๅฅ่ทฏ๏ผๅฎไนไธไธชobserveๆนๆณ
function defineReactive (data, key, val) {
Object.defineProperty(data, key, {
enumerable: true,
configurable: t... | true |
be8f0b4339434148772665be4d4e9461b8f993b8 | JavaScript | dami95/es6-features-test | /4-parameters/spread.js | UTF-8 | 1,313 | 4 | 4 | [] | no_license | //http://es6-features.org/#SpreadOperator
//tested in nodeJS v8.9.4 on MacOS
// * concat arrays
var arr1 = [1,2,3];
var arr2 = [4,5,6];
var arr3 = [...arr1, ...arr2, ...arr2];
console.log(arr3); //[ 1, 2, 3, 4, 5, 6, 4, 5, 6 ]
// * string to array
var name = 'Damian';
console.log(name.split('')); // [ 'D', 'a', 'm', ... | true |
6ebc4d116cd525a205ea1187d96fd119e336533f | JavaScript | kmrigendra/ReactJS-Cms | /src/modules/article/components/metadata/Category.js | UTF-8 | 2,342 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { Link } from 'react-router';
import { getData } from './../../../categories/services';
export default React.createClass({
getInitialState(){
return {
categories:[],
data:this.props.data || {
list:[],
display:[]
},
}
},
componentWillMount(){
... | true |
114c3c51f08044db122e7836cbce145e61d4d6f2 | JavaScript | luisZavaleta/VulcanoCMS | /Sacsa/web-app/js/fileUpload/custom.js | UTF-8 | 3,264 | 2.59375 | 3 | [
"MIT"
] | permissive | $(function() {
var ul = $('#upload ul.file-name');
$('#drop a').click(function() {
// Simulate a click on the file input button
// to show the file browser dialog
$(this).parent().find('input').click();
});
// Initialize the jQuery File Upload plugin
$('#upload')
.fileupload(
{
// This elem... | true |
69f236df8fa1804f005ad26fb9d1821015cdc436 | JavaScript | ypmits/ARrrrLib | /src/Fader.js | UTF-8 | 3,802 | 2.890625 | 3 | [] | no_license | import Animation from 'Animation';
import Time from 'Time';
import Ease from './../../FARLib/src/Ease';
/**
* Fades the opacity of a material in- and out with a simple 'show' and 'hide' function
* Example:
* import 'Fader' from 'Fader';
*
* var f = new Fader(Scene.root.find("rectangle").material, 500);
* f.show... | true |
7608fc837f40658ccf04f67ec97929b35a35ed5d | JavaScript | Pinkusgregory/University | /5semestr/WEB/lr6/web/js/history.js | UTF-8 | 2,368 | 2.65625 | 3 | [] | no_license | $(function(){
$("#history-local").html(function(n){
var str = "";
for(var n=0; n<6; n++){
switch (n) {
case 0:
str += "<tr><td>ะะฝัะตัะตัั</td><td>"+localStorage.getItem("ะะฝัะตัะตัั")+"</td></tr>";
break;
case 1:
... | true |
5ccf6fbf645bd893933940a35914e9e6f13df777 | JavaScript | sanya-shch/javascript--simple-voice-recognition-app | /two/main.js | UTF-8 | 1,581 | 2.890625 | 3 | [] | no_license | const btn = document.querySelector('.talk');
const content = document.querySelector('.content');
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
const SpeechGrammarList = window.SpeechGrammarList || window.webkitSpeechGrammarList;
const grammar = '#JSGF V1.0;';
const recognitio... | true |
13454f6d0f8e1e53a915896a819e983364c749de | JavaScript | ITA-Manila-Lansaro/collection-calculate-camp | /practices/reduce/compute_chain_median.js | UTF-8 | 552 | 2.96875 | 3 | [] | no_license | 'use strict';
function compute_chain_median(collection) {
collection = collection.split('->').map(a => parseInt(a));
let collectionLen = collection.length;
return collection.sort((a, b) => a - b)
.reduce((a,b, c) => {
if (collectionLen % 2 == 0){
let median = collectionLen/2;
... | true |
34ac89ec4cabfa5a84861bf7148e35d6a7d65e4e | JavaScript | hmm29/expression-finder | /findExpression.js | UTF-8 | 3,196 | 4.09375 | 4 | [] | no_license | /**
* Finds an expression that evaluates to a value, using exactly four operands
* and up to four arithmetic operators.
* @param {Array} nums - array of operands
* @param {Array} ops - array of operators
* @param {number} value - the value of the expression result
* @returns {?string} stringExp - the expression t... | true |
857f5b57479b6334cb665ab68f0fdf1e4ac5471a | JavaScript | ashishsonone/preppo-backend | /app/routes/live/help.js | UTF-8 | 7,095 | 2.515625 | 3 | [] | no_license | 'use strict'
var express = require('express');
var router = express.Router();
var errUtils = require('../../utils/error');
router.get('/help', function(req, res){
res.json({
message : "Welcome to live api home page",
api : [
{
"endpoint" : "GET /v1/live/help",
"info" : "See this help ... | true |
cd21b772faae0bf7124da6ac620d311e498fc0ae | JavaScript | yao80/gulp-init | /src/js/modules/PageTop.js | UTF-8 | 1,371 | 2.765625 | 3 | [] | no_license | /**
* ใใผใธใใใใใฟใณ
* @param {object} $target ใฟใผใฒใใ
* @param {number} distance ใใฟใณใ่กจ็คบใใใใพใงใฎในใฏใญใผใซ้
* @param {number} speed ใใผใธใใใใพใงๆปใ็งๆฐ
* @param {string} easing ใคใผใธใณใฐ
*/
function PageTop($target,distance,speed,easing) {
this.$target = $target;
this.distance = distance || 300;
this.speed = speed || 750;
this... | true |
be3cf76db1f8e75cf175d79505328d72a47a6ea0 | JavaScript | mayureshW1234/basic-web-apps | /small-components/button-click/main.js | UTF-8 | 340 | 2.8125 | 3 | [
"MIT"
] | permissive | //JavaScript
// const button=document.querySelector('.btn');
// const sidebar=document.querySelector(".sidebar");
// button.addEventListener('click',function(){
// sidebar.classList.toggle("is-hidden");
// });
//jQuery
$(function() {
$('.btn').on('click',function() {
$('.sidebar').toggleClass('is-... | true |
5e8b03b34266bdfea99641059f1ed25ef7f150d7 | JavaScript | Avinashgurugubelli/JavaScript | /promise/promise-index.js | UTF-8 | 2,834 | 4.53125 | 5 | [] | no_license |
/**
* Promises:
* A promise in JavaScript is similar to a promise in real life.
* When we make a promise in real life, it is a guarantee that we are going to do something in the future. Because promises can only be made for the future.
* A promise has two possible outcomes: it will either be kept when the time co... | true |
44d73e9d0ff34d9d9f9c96d9869648a0da674871 | JavaScript | robertjaworzyn/basic-mern-boilerplate | /src/api.js | UTF-8 | 549 | 2.671875 | 3 | [] | no_license | import axios from 'axios';
//ajax async calls to api on backend (see ../api folder)
//fetches all todo items in database
export const fetchTodos = () => {
return axios.get(`/api/todos`)
.then(resp => resp.data.todos);
}
//post new item to database
export const addTodo = (newItem) => {
return axios.p... | true |
4b9ad3db20beeaa1ed5326fba62fb6549f9697f9 | JavaScript | wonsun2006/KWEB_Assignment | /Assignment5/index.js | UTF-8 | 2,359 | 2.953125 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
let diaryBook = [];
let id = 0;
app.use(bodyParser.urlencoded({ extended: true }));
app.get('/', (req, res) => res.send('Welcome to my diary'));
app.get('/diaries', (req, res) => {
if(diaryBo... | true |
481a99d3a0f6522f403c30c1e06aa7b98ad17646 | JavaScript | Expine/Under | /src/res/js/under/extend/stage/back/SequentialBackground.js | UTF-8 | 1,549 | 3.1875 | 3 | [
"MIT"
] | permissive | /**
* Sequential background
* - Renders and update backgrdoun image
* - ### Processes continuously
* @extends {Background}
* @classdesc Sequential background to process continuously
*/
class SequentialBackground extends Background { // eslint-disable-line no-unused-vars
/**
* Sequential background const... | true |
224ce2fdd8264c3e81f0dd31f8a45f493a42b024 | JavaScript | vijayreddyk/bchainweb2 | /WebContent/js/new_pages/newHeader.js | UTF-8 | 4,834 | 2.65625 | 3 | [
"MIT"
] | permissive |
var switchUrl = "";
function doSwitchModule(switchURL){
switchUrl = switchURL;
DWRUtil.setMenuDetails(menuDetailsCallback);
}
function menuDetailsCallback(){
window.location.href = switchUrl;
}
function getBrowser() {
if(navigator.userAgent.indexOf("Chrome") != -1)
return "chrome";
else... | true |
55383828fc7fc2e15207543b2b6d09a00210eb00 | JavaScript | pickledpotato1337/Websites | /canvasFilter/canvasstuff.js | UTF-8 | 8,439 | 2.9375 | 3 | [] | no_license | //global variable declarations
var clickX = new Array();
var clickY = new Array();
var clickDrag = new Array();
var paint;
var redDefault=1;
var greenDefault=1;
var blueDefault=1;
//end here
function invertColors(data) {
for (var i = 0; i < data.length; i += 4) {
data[i] = data[i] ^ 255; // Inver... | true |
35ebb72de96a43f85eda909a93c09562be22893b | JavaScript | surincham/unit-4-game | /assets/javascript/game.js | UTF-8 | 3,095 | 3.3125 | 3 | [] | no_license | $(document).ready(function() {
var randomNum = Math.floor(Math.random() * 101) + 11;
console.log("randomNum: " + randomNum);
$(".randomNumber").text(randomNum);
var pikachuVal = Math.floor(Math.random() * 11) + 1;
console.log("pikachu: " + pikachuVal);
$("#pikachu").text(pikachuVal);
var charmander... | true |
bc13152555a8c3fb3678b2654240a85414dedc5d | JavaScript | netassssss/d3-force-example | /src/components/mainNodeHelper/textHelper.js | UTF-8 | 1,233 | 2.671875 | 3 | [] | no_license | import TextButton from './textButtons';
import RectButton from './rectButton';
import Questions from './questionsHelper';
export class TextHelper {
constructor(features) {
this.yes = new TextButton('Yes', features);
this.yesRect = new RectButton(features);
this.no = new TextButton('No', features, false)... | true |
5cf497f80da0ad8fbe77e13229255ce88fc9795b | JavaScript | SwaraShetye0411/DoctorsOnlineApp | /pages/ThirdPage.js | UTF-8 | 3,242 | 2.78125 | 3 | [] | no_license | // React Native Navigation Drawer
// https://aboutreact.com/react-native-navigation-drawer/
import React, { useState, useEffect,useRef } from 'react';
import { Button, TextInput, Text } from 'react-native';
import firebase from "../firebase";
import { FirebaseRecaptchaVerifierModal } from 'expo-firebase-recaptcha';
e... | true |
64358d47d062a658b12aadd20bcd1fc7bb1e30ea | JavaScript | jameswburke/uf-store | /lib/js/global.js | UTF-8 | 1,175 | 2.53125 | 3 | [] | no_license | function ucwords(str,force){
str=force ? str.toLowerCase() : str;
return str.replace(/(\b)([a-zA-Z])/g,
function(firstLetter){
return firstLetter.toUpperCase();
});
}
jQuery.fn.cart_info = function(){
return{
//Update the cart total. That's it
update_cart_count: function(){
var parent = this;
jQuery... | true |
0c1229730cb7a8b066174f95932d498759386e8c | JavaScript | bitmark-inc/bitmark-mobile-health-plus | /localization/index.js | UTF-8 | 1,258 | 2.546875 | 3 | [] | no_license | let url = 'https://docs.google.com/spreadsheets/d/1dU6PllWnsLdgppzx7kOBFcW5ZgU8aS7g-vRYT-S4VF4/export?format=csv';
let axios = require('axios');
let fse = require('fs-extra');
let csv = require("csv-string");
axios.get(url).then(response => {
let lines = csv.parse(response.data);
let jsonData = {};
let componen... | true |
9c0ab9630c56a059e4ee4fc259e32b1e0cfa44ad | JavaScript | applena/data-structures-and-algorithms | /code-challenges/sort/radixSort/radix-sort.js | UTF-8 | 1,095 | 3.28125 | 3 | [
"MIT"
] | permissive | 'use strict';
function findMax(arr){
let max = 0;
for(let i = 0; i < arr.length; i++){
if(arr[i] < 0){throw 'only positive numbers allowed';}
if(arr[i].toString().length > max){
max = arr[i].toString().length;
}
}
return max;
}
function makeBuckets(int){
let results = new Array(int);
... | true |
1a953e698bf0b202bf6b6e7b0833d25dbc2eb2d0 | JavaScript | andydlindsay/mar01-2021 | /w08d01/moai-axe-tree/src/components/__tests__/Result.test.js | UTF-8 | 1,796 | 3.09375 | 3 | [] | no_license | import React from 'react';
import { render, getByTestId, fireEvent, prettyDOM } from '@testing-library/react';
import Result from '../Result';
// bring in the library to be mocked mercilessly
import axios from 'axios';
// tell jest to mock library
jest.mock('axios');
// create fake data
const data = [
{
id: 1,... | true |
bc9c16f35a8828374f7dc8098e812774327d8e7c | JavaScript | SirGooseTheNaughty/EKSO-filter | /script.js | UTF-8 | 5,078 | 2.875 | 3 | [] | no_license | const state = {
type: 'living',
price: {
from: null,
to: null
},
rooms: new Set([]),
square: {
from: null,
to: null
},
isRooms: true,
district: '',
address: '',
numVariants: 9
};
// ะพััะธัะพะฒัะธะบะธ
function redrawType() {
const { type } = state;
... | true |
0909e886f6ca9efdb7ca75406f076db69121d345 | JavaScript | lexfor/EIAZIS1 | /api/vector/vector.service/index.js | UTF-8 | 4,035 | 3.09375 | 3 | [] | no_license | export default class VectorService {
constructor(vectorRepository) {
this.vectorRepository = vectorRepository;
}
async addWordToVector(book) {
const words = await this.findWordCounts(book.content);
const indexes = await this.indexing(words);
const iterator = indexes.entries(... | true |
2597a9e1a2282f6bb74fb2bae1a08f9542cb69d6 | JavaScript | vvozibic/avia-tickets | /src/common/utils/ticket.js | UTF-8 | 391 | 3.15625 | 3 | [
"MIT"
] | permissive | export const getStopsText = number => {
if (!number) return 'ะะตะท ะฟะตัะตัะฐะดะพะบ';
const lastSymbol = +number.toString().slice(-1);
let endingWord = '';
if (lastSymbol === 1) endingWord = 'ะบa';
if (lastSymbol >= 2 && lastSymbol <= 4) endingWord = 'ะบะธ';
if (lastSymbol >= 5 && lastSymbol <= 9) endingWord = 'ะพะบ';
... | true |
f8883b95a3a56f23267528a0425825f718a04a58 | JavaScript | sniperzee2/Login-Register-API | /controller/authController.js | UTF-8 | 2,140 | 2.515625 | 3 | [] | no_license | const User = require("../models/User");
const bcrypt = require("bcrypt");
const jwt = require("jsonwebtoken");
const register = (req, res) => {
User.findOne({ email: req.body.email }).exec((err, user) => {
if(err){
return res.status(400).json({
status: "error",
message: "Some Error",
... | true |
3eee8132c3e5bd0ec4d7ffece02838aadb817957 | JavaScript | mike-sierra/gwebkit | /examples/js/mobile.js | UTF-8 | 240 | 2.703125 | 3 | [] | no_license | var tog = new Function();
tog.toggleDisplay = function(id) {
var el = document.getElementById(id);
if (el.className.match(/hidden/)) {
el.className = '';
}
else {
el.className = 'hidden';
}
}
| true |
ef0502204508f988240734a5df5e79906ae6e89f | JavaScript | Sarah-hm/cart263 | /Projects/Spectra/js/Intro.js | UTF-8 | 12,949 | 3.125 | 3 | [] | no_license | /**
1st scene:
three images of a mall animate as an introduction to the first dialog of the game
the first frame's animation speed is mapped to mouseX's position (the more to the right, the faster the animation);
the second and third have 'static' (non interactive) animations
Goes to the second scene when all animation... | true |
d55b2e7ec660f13caf16b19505c0efe198d90cd1 | JavaScript | LaneTwo/ValkyrieBattle | /GameCode/scenes/help.js | UTF-8 | 3,156 | 2.546875 | 3 | [] | no_license | var SceneHelp = new Phaser.Class({
Extends: Phaser.Scene,
initialize:
function SceneHelp ()
{
Phaser.Scene.call(this, { key: 'help' });
this.util = new Util();
},
preload: function ()
{
this.load.image('btnMainmenu', 'images/mainmenu.png');
},
create: fun... | true |
7eeaa7c2074f6eb8cfc44c4b153128512282050b | JavaScript | nellyamaylis/tpWeb2017 | /model.js | UTF-8 | 1,233 | 3.140625 | 3 | [] | no_license |
// Implรฉmenter ici les 4 classes du modรจle.
// N'oubliez pas l'hรฉritage !
// fonction gรฉrant le dessin
function Drawing() {
this.mesDessin = new Array();
this.getDessins = function () {
return this.mesDessin;
}.bind(this);
this.addForm = function (forme) {
this.mesDessin.push(forme);... | true |
9a57ffa779dc44f7461ecf2ce048460c43a5e57a | JavaScript | NolanS-OMG/entregable-4 | /src/TodoContainer.js | UTF-8 | 853 | 2.609375 | 3 | [] | no_license | import axios from 'axios';
import TodoItem from './TodoItem';
import CreateTodo from './CreateTodo';
import { useEffect, useState } from 'react';
import './index.css';
const TodoContainer = () => {
const baseURL = 'https://todos-go.herokuapp.com/api/todos';
const getTasks = () => {
const promise = ax... | true |
3aec78a05ceeea1eafe8af680eb6f4d426b109ee | JavaScript | Seraphyne/senna-app-client | /src/routes/DashboardRoute/DashboardRoute.js | UTF-8 | 1,753 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import { Link } from "react-router-dom";
import Button from "./../../components/Button/Button";
import ApiService from "./../../services/api-service";
class DashboardRoute extends Component {
state = {
error: null,
language: "",
score: 0,
wordsToPractice: "",... | true |
53983201271d14992ebe04c82102ede1ed192519 | JavaScript | DevMaster921/front-money-box | /src/components/stock/StockSearch.js | UTF-8 | 2,151 | 2.609375 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { Form, InputGroup, Button } from 'react-bootstrap';
import { fetchStockData } from './stockActions';
export default function StockSearch() {
const dispatch = useDispatch();
const { stockSymbols }... | true |
7cea88ea7c8e7555870c533ad858701cd6fee18b | JavaScript | Liannaccone/abundance | /public/assets/js/app.js | UTF-8 | 1,178 | 2.828125 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
// stores values of the corresponding item and initiates an ajax call to post the new item...
$('.add-button').on('click', function(event) {
var newProduct = {
product_id: $(this).data('id'),
product_name: $(this).data('name')
}
$.ajax("/api/useritem", {
type: ... | true |
fe6d856c7cd274a123e7244f726b034b788f8408 | JavaScript | amoltovil/Nodepop-Frontend | /js/controllers/RegisterFormController.js | UTF-8 | 4,205 | 2.96875 | 3 | [] | no_license | import BaseController from './BaseController.js';
import dataService from '../services/DataService.js';
export default class RegisterFormController extends BaseController {
constructor(element){
super(element);
this.attachEventListener(); // ponemos el manejador de eventos
}
async makePos... | true |
83e812bcc38f6901f3e6f744a4ebd83d10a840ca | JavaScript | JohnGorter/quizdemo | /yesnotemplate.js | UTF-8 | 395 | 2.6875 | 3 | [] | no_license | class YesNo extends React.Component {
render(){
return (<div>
<div>{ this.props.question }</div>
<button onClick={() => {this.props.setResult(1)}}>YES</button>
<button onClick={() => { this.props.setResult(0)}}>MAYBE</button>
<button onClick={() => {this.props... | true |
e35ed4775d8e316f0e471a7743f2a1aa48990161 | JavaScript | wangwenteng/Jpnurse | /assets/js/login/index.js | UTF-8 | 4,514 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* ๆ นๆฎๅคๆญๆฏๅฆๆฏ็ฉบไธฒ
* @param id
* @returns {Boolean}
*/
function IdVal(id) {
var str = $("#" + id).val();
if(str == "") {
return true;
} else {
return false;
}
}
//ๅจๆๆนๅๆถ้ด
function CountDown() {
if(boo == false) {
maxtime = 59;
boo = true;
}
if(maxtime > 0) {
seconds = Math.floor(max... | true |
9b9aadb6c593fd16312233bc2be4bea8e46fda72 | JavaScript | nikiatanasow/gym-track | /server/frontend/src/reducers/exercises.js | UTF-8 | 1,140 | 2.609375 | 3 | [
"MIT"
] | permissive | import {
GET_EXERCISES,
GET_EXERCISE_CATEGORIES,
GET_EXERCISE_BODY_PARTS,
DELETE_EXERCISE,
ADD_EXERCISE,
} from '../actions/types.js';
const initialState = {
exercises: [],
};
export default function (state = initialState, action) {
switch (action.type) {
case GET_EXERCISES:
... | true |
d1c59d19b47a47a6a5be9959a8a99aca761263be | JavaScript | alanaby01/Ethereum_Blockchain_Dapp | /test/Marketplace.test.js | UTF-8 | 4,610 | 2.625 | 3 | [] | no_license | const Marketplace = artifacts.require("./Marketplace.sol");
require('chai')
.use(require('chai-as-promised'))
.should()
contract('Marketplace', ([deployer,seller,buyer])=>{
let marketplace
before(async () => {
marketplace = await Marketplace.deployed()
})
describe('deployment', async ... | true |
5a10e545358572eb2d816383aade660cb36145b6 | JavaScript | damas12/travel-agency | /src/components/features/TripSummary/TripSummary.test.js | UTF-8 | 1,826 | 2.703125 | 3 | [] | no_license | import React from 'react';
import { shallow } from 'enzyme';
import TripSummary from './TripSummary';
describe('Component TripSummary', () => {
it('should throw error without required props', () => {
expect(() => shallow(<TripSummary />)).toThrow();
});
const expectedImage = 'image.jpg';
const... | true |
ef05b76417652ebb45912c881d39f8b2e2a83387 | JavaScript | mawrkus/jason-the-miner | /es/processors/NoOperationProcessor.js | UTF-8 | 1,077 | 2.75 | 3 | [
"MIT"
] | permissive | const debug = require('debug')('jason:noop');
/**
* A special kind of processor... that does nothing except returning "null" when run.
*/
class NoOperationProcessor {
/**
* @param {Object} config
* @param {Object} config.data
* @param {string} category
*/
constructor({ config = {}, category } = {}... | true |
56909ea8364a93705c6367d47748a345d9e5f644 | JavaScript | sirrah23/Pig | /sketch.js | UTF-8 | 1,206 | 3.140625 | 3 | [] | no_license | let diceArtist, gameManager, visualsManager;
let gameOver = false;
function setup() {
let rollButton,
holdButton,
buttonsDiv,
scoresDiv,
p1ScoreDiv,
p2ScoreDiv;
// Creation of HTML, view elements
createCanvas(800, 600);
scoresDiv = createDiv('');
p1ScoreDiv = createDiv('');
... | true |
1d93a390957fc1f31ba3835252b8be14f6211943 | JavaScript | BenCharbonneau/wdi-11-hw15-express-index-show-poke | /pokemon_app/server.js | UTF-8 | 513 | 2.671875 | 3 | [] | no_license | const express = require('express');
const app = express();
const PORT = 3000;
const pokemon = require('./models/pokemon.js');
app.use(express.static('public'));
app.listen(PORT,() => {
console.log("Server is listening on port "+PORT);
});
app.get('/',(req,res) => {
res.send('Welcome to the Pokemon App!');
});
a... | true |
290fc09392652efaf5cd4b1ca89bc7bf2e7b5835 | JavaScript | irpl/myIP | /myIP.js | UTF-8 | 1,409 | 2.84375 | 3 | [] | no_license | const fetch = require('isomorphic-fetch');
const fs = require('fs');
const writeToFile = (ip) => {
fs.writeFile("last", ip, function(err) {
if(err) return console.error(err);
// console.log("The file was saved!");
});
}
function readFile () {
try {
var contents = fs.readFileS... | true |
751d380ae97629251ce4d6019c73ea5523385203 | JavaScript | lenda-uefs/ForcaBRAS-web | /assets/js/Multiplayer.js | UTF-8 | 2,820 | 2.734375 | 3 | [] | no_license | ForcaBRAS.Multiplayer = function (game) {
};
var Client = {};
Client.socket = io.connect(); //conexรฃo do cliente e servidor da aplicaรงรฃo
ForcaBRAS.Multiplayer.prototype = {
create: function () {
this.add.image(0, 0, 'multiplayer');
//entrar em uma sala ja existente
this.createButton('entrar', 5... | true |
b2bace6777c2c5cf41e3c2976a187a60d0f6bcb8 | JavaScript | 2019-b-gr2-fundamentos/fund-santacruz-portilla-cesar-joel | /02-iterables/02-forrr.js | UTF-8 | 1,418 | 3.921875 | 4 | [] | no_license | /*for
1- declarar una variable
2- condicion
3- incrementar o disminuir
*/
for (let numeroEx = 7; numeroEx != 0; numeroEx--) {
console.log('ES CAN DA LO!', numeroEx);
}
for (let numeroExEs = 1; numeroExEs <= 7; numeroExEs++) {
console.log('K.O!', numeroExEs);
}
for (let numeroExDe = 0; numeroExDe <= 6; numeroE... | true |
619d8f41067963b5e0124903de219006c346ff6e | JavaScript | hatuol/test-project | /js/app.js | UTF-8 | 2,219 | 2.765625 | 3 | [] | no_license | //HEADER SLIDER//
var slideIndexHeader = 1;
showSlidesHeader(slideIndexHeader);
function plusSlidesHeader(h) {
showSlidesHeader(slideIndexHeader += h);
}
function currentSlide(h) {
showSlidesHeader(slideIndexHeader = h);
}
function showSlidesHeader(h) {
var i;
var header_slides = document.getElements... | true |
d1a69567c144dfd48bea982802d7b2fd770354f3 | JavaScript | sahinreja/nodejs | /7-os_module.js | UTF-8 | 652 | 2.984375 | 3 | [] | no_license | //BUILD-IN MODULES(YOU NEED NOT TO INSTALL THROUGH NPM)
const os = require('os');
// console.log(os);
// console.log(os.arch());
// console.log(os.type());
// console.log(os.hostname());
// console.log(os.freemem());
// console.log(os.totalmem());
// console.log(os.networkInterfaces());
//get user info
const user = os... | true |
bdffcbf68d9d9fd932d55e83288e48189af5e8a8 | JavaScript | vigneshachari/Javascript_Basics | /decimalArthimetic.js | UTF-8 | 278 | 3.359375 | 3 | [] | no_license | var decimalNumber = 1.1;
console.log("add decimal Number:" + (decimalNumber + 2.2).toFixed(3));
console.log("subtract decimal Number:" + (decimalNumber - 0.2));
console.log("multiple decimal Number:" + (decimalNumber * 3.3));
console.log("divide decimal Number:" + 4.4 / 2); | true |
e1dcc6f3ff51098824ec5ac502c604455680e150 | JavaScript | TheWarming/leetcodePractice | /11. ็ๆๅคๆฐด็ๅฎนๅจ.js | UTF-8 | 1,458 | 3.9375 | 4 | [] | no_license | /* 11. ็ๆๅคๆฐด็ๅฎนๅจ
็ปไฝ n ไธช้่ดๆดๆฐ a1๏ผa2๏ผ...๏ผan๏ผๆฏไธชๆฐไปฃ่กจๅๆ ไธญ็ไธไธช็น (i, ai) ใๅจๅๆ ๅ
็ป n ๆกๅ็ด็บฟ๏ผๅ็ด็บฟ i ็ไธคไธช็ซฏ็นๅๅซไธบ (i, ai) ๅ (i, 0) ใๆพๅบๅ
ถไธญ็ไธคๆก็บฟ๏ผไฝฟๅพๅฎไปฌไธ x ่ฝดๅ
ฑๅๆๆ็ๅฎนๅจๅฏไปฅๅฎน็บณๆๅค็ๆฐดใ
่ฏดๆ๏ผไฝ ไธ่ฝๅพๆๅฎนๅจใ */
/* ่ฟ้้ขๆ็ฒๆด็ๆนๆณๅฝ็ถๆฏO(n^2)๏ผๅฝ็ถๅฏนไบmedium้พๅบฆ็้ข็ฎๆฅ่ฏด๏ผๆพ็ถไธ่ฝ่ฟไนๅ ่ฟ้้ข่ฆ่งฃๅณ็้ฎ้ขๆฏ๏ผๆพๅฏปๆๅคง็ไธ็ป(i,j)๏ผไฝฟๅพAreaๆๅคง
Area = Max(min(height[i], height[j]) * (j-i)) {ๅ
ถไธญ0 <= i < j < height,size()}
่ฟ้... | true |
b3ab70087a280d76bd3d53f1548929cef0d4f6da | JavaScript | maury91/mean-amm | /defData.js | UTF-8 | 1,716 | 2.578125 | 3 | [] | no_license | /**
* This script insert some default data to the application
*/
var app = require('./app.js'),
mongoose = require('mongoose'),
async = require('async'),
User = mongoose.model('User'),
Event = mongoose.model('Event');
var defUser = new User({
username : "admin",
password : "123456"
}),
events = [
... | true |
118aa5e8ee257ce0d4818ba905174ac0c9d702ab | JavaScript | DavidAlphaFox/headless-chrome-crawler | /examples/priority-queue.js | UTF-8 | 527 | 2.65625 | 3 | [
"MIT"
] | permissive | const HCCrawler = require('headless-chrome-crawler');
HCCrawler.launch({
maxDepth: 3,
maxConcurrency: 1,
onSuccess: (result => {
console.log(`Requested ${result.options.url}.`);
}),
})
.then(crawler => {
crawler.queue({ url: 'https://example.com/', priority: 1 }); // First queue will be requested fir... | true |
7fafd5144106ceb8a2034065c43a105d490c63b5 | JavaScript | zengguangyi/learnAngularJS | /learnJS/06-01-fs.js | UTF-8 | 6,685 | 3.578125 | 4 | [] | no_license | /*
*2016.7.13
*ๆไปถ็ณป็ป๏ผfsๆจกๅ
*/
//ๅผๆญฅ
// var fs = require('fs');
// fs.open("06-01-text","w",function(err,fd){
// if(!err){
// console.log("open fd and close");
// fs.close(fd);
// }
// });
//ๅๆญฅ
// var fs = require('fs');
// var fd = fs.openSync("06-01-text","w");
// console.log("openSync fd and closeSync");
// fs.... | true |
b618702ce77c8648c315587350c33d98efeea388 | JavaScript | usernameminh/javascript | /Exercise1/checkNumberPerfect.js | UTF-8 | 697 | 3.71875 | 4 | [] | no_license |
/**
*
03 Sรดฬ hoaฬn haฬo laฬ sรดฬ nguyeฬn duฬoฬng bฤฬng tรดฬng caฬc uฬฦกฬc thฦฐฬฃc sฦฐฬฃ
cuฬa noฬ. Viฬ duฬฃ: 6=1+2+3. Viรชฬt chuฬoฬng triฬnh coฬ sฦฐฬ duฬฃng haฬm kiรชฬm tra n (nhแบกฬp tฦฐฬ baฬn phiฬm) coฬ phaฬi sรดฬ hoaฬn haฬo khoฬng ?
*/
isPerfectNumber = (n) => {
// Sแป hoร n hแบฃo luรดn luรดn > 2
var s = 1;
for (let i = 2; ... | true |
c35c358956dacb46a915914e553a9b0db18c122c | JavaScript | dev-jinheekim/tetris | /public/background.js | UTF-8 | 489 | 3.40625 | 3 | [] | no_license |
// ํ
ํธ๋ฆฌ์ค ๋ฐฐ๊ฒฝํ๋ฉด ์์ฑ
function createRow() {
return document.createElement('TR');
}
function createCol() {
return document.createElement('TD');
}
function createTable(target) {
let table = document.getElementById(target);
for (let i = 0; i < trCount; i++) {
let tr = createRow();
for (le... | true |
a67b80dd8789b442538aa24198f3eab19834f78b | JavaScript | martinboykov/Training_2018-2019 | /Javascript/_Node.js/The_Complete_Guide_to_Build_RESTful_APIs/5. Express- Advanced Topics/9.Templating_Engines/auth.js | UTF-8 | 334 | 2.609375 | 3 | [] | no_license | // MIDDLEWARE
// 3. Authenticating (after logging)
function auth(req, res, next) {
// next is reference to the next middleware function down the pipeline
console.log('Authentication...');
next(); // as we dont have res.end() -> we need to pass control
// to the next midleware, so we use next
}
module.ex... | true |
af9524bdf575c7cbcc1213b4893e03cadadbb4ba | JavaScript | tino2002/VuNgocMinh-C4T8 | /session21-js/marvel/app.js | UTF-8 | 2,417 | 2.984375 | 3 | [] | no_license | var url = 'https://gateway.marvel.com:443/v1/public/characters';
var publicKey = '6eeaa0d51f2cbcb8540000c895d5cfa8';
var privateKey = 'e49743448603a4e1c15b0a8306aa5f44fd6a9046';
function renderCharacters(characters) {
var content = document.getElementById("content");
content.textContent="";
for(var i = 0; i... | true |
d893102c5a00ba3cfdee6e21e13c226d500bf58b | JavaScript | RD7023/MJ4 | /views/Dean/jsD/defineHollidays.js | UTF-8 | 653 | 2.875 | 3 | [] | no_license | function weeksBetween(d1, d2) {
return Math.round((d2 - d1) / (7 * 24 * 60 * 60 * 1000));
}
var btnConfirm = document.getElementById('btnConfirm')
var lastEnd = document.getElementById('lastEnd')
var nextBeg = document.getElementById('nextBeg')
btnConfirm.addEventListener('click',function(){
var lastEndVal = Da... | true |
2f21a76ed8fbe587d5affc575e5fc5966d2728fd | JavaScript | IrisCZ/devscola | /katas/KataNumberOfDivisions/spec/numberOfDivisionsSpec.js | UTF-8 | 326 | 2.78125 | 3 | [] | no_license | describe("numberOfDivisions", function() {
beforeEach(function() {
});
it("the number of divisions of 6/2 equals 2", function() {
expect(numberOfDivisions.print(6,2)).toEqual(2);
});
it("the number of divisions of 100/2 equals 6", function() {
expect(numberOfDivisions.print(100,2)).toEqual(6);
});... | true |
76adff93555144b03c6e2cbec273bbfa1a4fce94 | JavaScript | moisesbramirez/exercism_js | /javascript/raindrops/raindrops.js | UTF-8 | 811 | 3.328125 | 3 | [] | no_license | "use strict";
module.exports = RainDrops;
function RainDrops() {}
RainDrops.prototype.convert = function convert(number){
let primeFactors = getPrimeFactors(number, 2, []);
let drops = primeFactors.reduce(
(string, value) => {
if(value === 3 && !string.includes("i")) return string += "Pling";
if... | true |
23903cecbf0e05eddcbe7533ea52952435101005 | JavaScript | eerdelyi90/domainator | /public/js/main.js | UTF-8 | 13,907 | 2.734375 | 3 | [] | no_license | /*
* AJAX begin
*/
var deleteItem = function(id, path) {
$.ajax({
url: '/'+path+'/'+id,
type: 'delete',
success: function(data){
// alert('yeahahaha');
},
error: function(a, b, c) {
console.log(a, b, c);
}
});
}
var updateDate = function(path, action, id, date) {
$.ajax(... | true |
3ae96e33d5d7b0962db307cb61e98cd3f1db3f3d | JavaScript | DeonteHorton/HTML-CSS-JS-projects | /JavaScript/review/js/review.js | UTF-8 | 10,139 | 3.71875 | 4 | [
"MIT"
] | permissive | // new things
// this script types in a string
//<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11"></script>
var foo = "hello";
var bar = "hi";
{
let bar = "world";
const yo = "yoyo";
console.log(bar);
// console.log(yo);
}
console.log(bar);
const baz = "yo";
// ... | true |
a5725b956dc2d034d996a7c31a2754e9124a2846 | JavaScript | ErickWendel/nodeconf-examples | /03-promises.js | UTF-8 | 782 | 2.921875 | 3 | [] | no_license | function usuario() {
return new Promise((resolve, reject) => {
return resolve({ 'idUsuario': '213', 'nome': 'erick' });
});
}
function endereco(usuario) {
return new Promise((resolve, reject) => {
return resolve({ 'idUsuario': usuario.idUsuario, 'rua': 'dos bobos' });
});
}
function out... | true |
dc3f06ae87b4525add8c1a56d900943048299846 | JavaScript | Pokemon1025/LeetCode-JavaScript | /algorithm/414.Third-Maximum-Number/414-Third-Maximum-Number.js | UTF-8 | 308 | 2.96875 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var thirdMax = function (nums) {
let numSet = new Set(nums);
if (numSet.size < 3) {
return Math.max(...numSet);
}
numSet.delete(Math.max(...numSet));
numSet.delete(Math.max(...numSet));
return Math.max(...numSet);
}; | true |
55fad111dc3d4bed3a018def84b14637aaecd273 | JavaScript | g1-acelera/carango-bom-base | /src/shared/models/Usuario.js | UTF-8 | 583 | 2.625 | 3 | [] | no_license | import validaObrigatoriedade from '../../shared/validators/obrigatorio/obrigatorio';
import validaEmail from "../validators/email/validaEmail";
class Usuario {
static initialValues() {
return {
email: "",
senha: "",
};
}
static validacoesEmail(valorDoCampo) {
... | true |
0198656c1aedfd02aa6aa36c2c0bd2597a47f508 | JavaScript | ShubhraJain/data-structures | /sprint-one/src/prototypal/stack.js | UTF-8 | 1,211 | 3.6875 | 4 | [] | no_license | var Stack = function() {
// Hey! Rewrite in the new style. Your code will wind up looking very similar,
// but try not not reference your old code in writing the new style.
var someInstance = Object.create(stackMethods);
someInstance.storage = {};
return someInstance;
};
var stackMethods = {
push: func... | true |
e30383c8bd656e2c7872a243a6b225e9bf985b80 | JavaScript | LInE-IME-USP/iVProg | /tests/test32.spec.js | UTF-8 | 503 | 2.78125 | 3 | [] | no_license | import { InputTest } from './../js/util/inputTest';
describe('Input test util class', () => {
const inTest = new InputTest(['0','2']);
it('should return the values given', (done) => {
const v1 = new Promise((resolve, _) => {
inTest.requestInput(resolve);
});
const v2 = new Promise((resolve, _) =... | true |