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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
536a2e2cd4f65fa1fe7726e2b02a636394e25704 | JavaScript | mako-taco/noderocket-rocket | /altitude-timer.js | UTF-8 | 820 | 3.046875 | 3 | [] | no_license | function AltitudeTimer(threshold) {
this.previousAltitude = 0;
this.previousTime = 0;
this.altitude = 0;
this.time = 0;
this.velocity = 0;
this.threshold = threshold || 0;
this.firstTime = true;
this.deploy = false;
}
AltitudeTimer.prototype.mark = function(data) {
this.previousTime = this.time;
this.time ... | true |
095473b244fad264489929194ace3b76e2b007d7 | JavaScript | 1394/array-convolver | /convert.js | UTF-8 | 1,700 | 2.625 | 3 | [
"MIT"
] | permissive | const getComparator = (key) => {
if (key === '>') {
return (a,b) => a > b ? 1 : (a === b ? 0 : -1)
}
if (key === '<') {
return (a,b) => a < b ? 1 : (a === b ? 0 : -1)
}
}
const convert = (data, rule, {parent} = {}) => {
console.log('before convert')
console.dir(data, {depth: 4})
const result = {}... | true |
0a1f434c226e6ec137b62d7d13c4af97eabf050b | JavaScript | Bealonzo/bloccit | /src/db/queries.users.js | UTF-8 | 802 | 3.03125 | 3 | [] | no_license | // #1 - require user model and bcrypt library.
const User = require("./models").User;
const bcrypt = require("bcryptjs");
module.exports = {
// #2 - createUser takes an object with email, password, and passwordConfirmation properties, and a callback.
createUser(newUser, callback){
// #3 - Use bcray to generate salt... | true |
12d4fcf587b60270b7c6f0f21c842060f0f28b9c | JavaScript | Masoud-Yari/Online-ecommerce-Store | /routes/api/user.js | UTF-8 | 2,182 | 2.53125 | 3 | [] | no_license | const express = require('express');
const bcrypt = require('bcryptjs');
const User = require('../../models/User');
const {getToken} = require('../../token');
const router = express.Router();
router.post('/signin', async (req, res) => {
try {
const user = await User.findOne({ email: req.body.email... | true |
fe3f40ff6f62e874aefc4af816f4ce633cefe224 | JavaScript | anamartins/timer | /src/components/date/index.js | UTF-8 | 1,753 | 2.8125 | 3 | [
"MIT"
] | permissive | import React from "react";
import PropTypes from "prop-types";
import "./style.scss";
const CURRENT_DATE = new Date();
class DateInput extends React.Component {
constructor(props) {
super(props);
this.state = {
value: ""
};
this.onChange = this.onChange.bind(this);
}
componentDidUpdate(p... | true |
e90215ae5084afa3c28b3acfb361fa8e0a7bdcac | JavaScript | kozyulka/ba-chatbot-docker | /client/index.js | UTF-8 | 8,104 | 2.9375 | 3 | [] | no_license | 'use strict';
const messagesContainer = document.getElementById('chatMessages');
const usersContainer = document.getElementById('users');
const typingUsersContainer = document.getElementById('typingUsers');
const messageInput = document.getElementById('myMessage');
const userNameInput = document.getElementById('userNa... | true |
237e1f0f59bb4bc9d8306adab8780597a4955671 | JavaScript | ascsouza/cine_house | /cinema.js | UTF-8 | 1,201 | 3.25 | 3 | [] | no_license | const catalogo = require("./catalogo");
function adicionarFilme(codigo, titulo, duracao, atores, anoDeLancamento, emCartaz){
const novoFilme = {
codigo,
titulo,
duracao,
atores,
anoDeLancamento,
emCartaz,
};
catalogo.push(novoFilme);
}
adicionarFilme(5, "The 100", 2.20, ["Tico", "Teco"],... | true |
66e765d443445acd855a055685b227ffcb197e48 | JavaScript | JuanDAC/holbertonschool-higher_level_programming | /0x12-javascript-warm_up/8-square.js | UTF-8 | 239 | 2.609375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/node
const argv = require('process').argv;
const number = parseInt(Number(argv[2]));
if (isNaN(number)) {
console.log('Missing size');
} else {
for (let i = 0; i < number; i++) {
console.log('X'.repeat(number));
}
}
| true |
ad9b860c83bbc581e769e6ad6ba498dfb2531b79 | JavaScript | HaeKang/FinTech_practice | /201117_practice/gram_pratice.js | UTF-8 | 1,360 | 3.625 | 4 | [] | no_license |
// let은 재할당 가능, const는 재할당 불가능
const div_es6 = (p1, p2) => {
return p1/p2;
}
console.log(div_es6(1,2));
// class
var car = {
name : "car_test",
ph : "500ph",
start : function(){
console.log("car start");
},
end : function(){
console.log("car end");
}
}
console.log(ca... | true |
9b6f58385ff0008f79950964a9de7fd33b350939 | JavaScript | NicCronin/cl-mobile-js-fever | /script.js | UTF-8 | 226 | 4.03125 | 4 | [] | no_license | var tempString = prompt("What is your temperature?");
var tempNum = Number(tempString);
if (tempNum == 98) {
alert("Just right!");
}
if (tempNum < 98) {
alert("Too low!");
}
if(tempNum > 98) {
alert("Too high!");
}
| true |
7dc3f71c662e035ac065f633d0dcf5b263ccfe53 | JavaScript | danielbala/mdmnky_com | /wabs/js/lib.js | UTF-8 | 13,948 | 3.359375 | 3 | [] | no_license | // CUT ///////////////////////////////////////////////////////////////////
/* This license and copyright apply to all code until the next "CUT"
http://github.com/jherdman/javascript-relative-time-helpers/
The MIT License
Copyright (c) 2009 James F. Herdman
Permission is hereby granted, free of charge, to any person... | true |
105f5ad16f93b25be366f057703286bb72859e62 | JavaScript | oyeibrahim/react-tutorial | /src/components/event_handling/ClickEventFunc.js | UTF-8 | 655 | 3.234375 | 3 | [] | no_license | // import React from 'react'
//######################
// Click Event Handler Implementation Example in Functional Component
//######################
function clickHandler() {
console.log("Click Detected");
}
function ClickEventFunc() {
return (
<div>
<p>Click Event Handling With FUNCTIONA... | true |
c7ca45709df1f3fe7e46a8b5dd34a967bd859745 | JavaScript | kgrgreer/3dprints | /axesheath/border.js | UTF-8 | 625 | 3.078125 | 3 | [] | no_license |
const W = 132;
const D = 70;
const H = 1.6;
const T = 5;
function hole(x, y) {
return cylinder({h: 2*H, r: 0.7}).translate([x,y,0]);
}
function main() {
var s = cube({size:[W,D,H]});
s = s.subtract(cube({size:[W-T*2,D-T,H]}).translate([T,0,0]));
var c = cylinder({h:W, r: H/2});
c = c.rotateY(90).scale(... | true |
fd7256c0f1111fb4b7f584a43d3b4139bfd3eefe | JavaScript | L0TU5/BubbleQuoteGenerator | /js/index.js | UTF-8 | 3,104 | 3.25 | 3 | [
"MIT"
] | permissive | // Created by Danielle Monroe for her Free Code Camp project on 3-6-2018
var getQuoteBtn = document.getElementById("moar-quotes"); //get more quotes button
var shareTweetBtn = document.getElementById("tweet-this"); // share to twitter button
function introLoad() { // loads first quote, by me!
document.getElementByI... | true |
676069d23929cadb2f49f63a044a63626f4dc183 | JavaScript | thewinners/project_fifa | /root/public/javascript/clock.js | UTF-8 | 4,211 | 2.578125 | 3 | [] | no_license | var time;
var myTimer;
var timer2 = 0;
var timer = timer2;
var game_id = $(".page-title h2").attr("match-id");
var match_time = 1200;
var extra_time1 = 0;
var extra_time = extra_time1;
$(document).ready(function () {
var start = document.getElementById("start");
var pause = document.getElementById... | true |
46a0b4bdc05f2f2f376809b0d2735684ba99f9ec | JavaScript | handou123/sg-wap | /js/index.js | UTF-8 | 249 | 2.609375 | 3 | [] | no_license | $(function(){
$(".p3-enter li").click(function(){
$(".p3-content").hide();
$(".p3-enter li").removeClass("color")
$(".p3-content").eq($(this).index()).show()
$(this).addClass("color")
})
}) | true |
554da46206467e7b427a908c841541e102af2575 | JavaScript | rodrigo-morais/web-worker-indexeddb-es6 | /dist/javascript/indexedDB.js | UTF-8 | 3,566 | 2.546875 | 3 | [] | no_license | define(["exports"], function (exports) {
"use strict";
var localDB = (function () {
var db, state = "close", containsData = false, items;
var _isOpen = function () {
if (state === "open") {
return true;
} else {
return false;
}
};
var _init = function () {
... | true |
e03eea24b4b15faa33d643814545f8be2229337e | JavaScript | aurelie-boomer/AurelieBeghin_5_16062021 | /front-end/js/index.js | UTF-8 | 1,304 | 2.9375 | 3 | [] | no_license | import { getCart } from "./utils/cart.js";
//Récupération des données avec l'API fetch.
main();
function main() {
fetch("http://localhost:3000/api/cameras")
.then((resultat) => {
return resultat.json();
})
.then((cameras) => {
for (const camera of cameras) {
//ajouter la caméra à la p... | true |
fc2978096b3a5d9002b1d98ceb93db0aa7f1eb04 | JavaScript | drwhorx/drwhorx.github.io | /wordle/main.js | UTF-8 | 3,560 | 3.078125 | 3 | [] | no_license | document.addEventListener('keydown', keydown);
function select(element) {
//let element = document.querySelector();
if (element.classList.contains("selected")) {
let state = element.getAttribute("state");
if (state === null) state = 0;
element.setAttribute("state", (state + 1) % ... | true |
d7d7f1da7d3c74aeb8be1c1f6f1ef8b947e85f3f | JavaScript | ktduck/travel-frontend | /test/JS/start-5.js | UTF-8 | 1,227 | 3.21875 | 3 | [] | no_license | const phoneNum = document.getElementById("answer");
const zero = document.getElementById("zero");
const one = document.getElementById("one");
const two = document.getElementById("two");
const three = document.getElementById("three");
const four = document.getElementById("four");
const five = document.getElementById("fi... | true |
5690f443bc12f130f056f8171d2b260ac2d0f988 | JavaScript | UPstartDeveloper/expressCrashCourse | /routes/api/members.js | UTF-8 | 2,862 | 3.140625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const router = express.Router();
const uuid = require('uuid');
// fake database of users
const members = require('../../Members');
// Make a simple RESTful API, that GETS all members
router.get('/', (req, res) => res.json(members));
// GET One member
router.get('/:id', (req, res) =... | true |
34c93d46fc1f4b26f773d516d277e09b37519a78 | JavaScript | sshrik/baemin-11 | /assets/utils/throttle.js | UTF-8 | 203 | 2.8125 | 3 | [] | no_license | export const throttle = (ms, fn) => {
let timeoutId = null;
return function(e){
if(timeoutId) return;
timeoutId = setTimeout(() => {
timeoutId = null;
fn(e);
}, ms);
};
}
| true |
8d1003c8a7300b46ec13c7afdb2fef17baeae9d2 | JavaScript | shubhamjoshi84/assignment2 | /main.js | UTF-8 | 771 | 3.203125 | 3 | [] | no_license |
function addRec(){
var name = document.getElementById("fname").value;
var mjr = document.getElementById("major").value;
var stdyr = document.getElementById("year").value;
if (stdyr >= 2000){
var table = document.getElementById("tName");
var x = table.rows.length;
var row = table.insertRow(x);
v... | true |
f471b35629c0fce9fe8bb9336f411d80b2b3fbbc | JavaScript | burentop/celebrity | /js/scripts.js | UTF-8 | 872 | 3 | 3 | [] | no_license | $(document).ready(function () {
$(".profile form").submit(function (event) {
event.preventDefault();
var gender = parseInt($("#gender").val());
var age = parseInt($("#age").val());
var color = parseInt($("#color").val());
if (age < 18) {
$("#celeb-name").text("Homework");
$("#cele... | true |
adaec63adc96ac714d3519f2c610eced98be83dd | JavaScript | Mario-Jelinski/rock-paper-scissors | /js/player.js | UTF-8 | 354 | 3.0625 | 3 | [] | no_license | var Player = function () {
this.score = 0;
this.name = "Player";
};
Player.prototype = {
setScore: function (score) {
this.score = score;
},
getScore: function () {
return this.score;
},
setName: function (name) {
this.name = name;
},
getName: function () {
... | true |
d128030bd98076761fbe2918d8fb42346d7eca4a | JavaScript | darman12/cash-adder | /src/js/cash_counter.js | UTF-8 | 1,742 | 2.984375 | 3 | [] | no_license | var CounterModule = (function() {
let total = 0;
let denominationQuantities = [];
function updateTotal(event, denominationValue) {
let originalDenominationQuantity = denominationQuantities[event.target.id];
let updatedQuantity = event.target.value;
if (updatedQ... | true |
5b29cb7e5df8b9a73e788982bb66b1acc0663a99 | JavaScript | wjxalexander/node-command-todo | /index.js | UTF-8 | 3,623 | 3.140625 | 3 | [] | no_license | const db = require("./db.js")
const inquirer = require("inquirer")
async function add(...tasks) {
const list = await db.read()
const extractTasks = tasks.length > 1 ? [...tasks].pop() : []
const newList = list.concat(extractTasks.map(item => ({
title: item,
done: false
})))
await db... | true |
39db6312e0304dfffc905867715d1f1f84429b6a | JavaScript | CAkoaramama/30-days-of-JavaScript | /7_day/excise.js | UTF-8 | 5,264 | 4.5 | 4 | [] | no_license | 'use strict'
// FUNCTIONS
// Level 1 ;
// =========== 1 ==========
// function printFullName (){
// let firstName = 'Motomi'
// let lastName = 'Yamagata'
// let space = ' '
// let fullName = firstName + space + lastName
// console.log (fullName)
// }
// printFullName ()
// // ========= 2 ==========
// fun... | true |
fa9d5334cb76885e143914a2da43b2bc9ed7bdc3 | JavaScript | augustofrade/theater | /src/server/controllers/dataController.js | UTF-8 | 695 | 2.609375 | 3 | [] | no_license | const router = require("express").Router();
const Movie = require("../models/Movie");
router.get("/movies", async (req, res) => {
res.send(await Movie.find({}));
})
router.get("/movie/:id", async (req, res) => {
const { id } = req.params;
const movie = await Movie.find({ id });
if(movie)
return res.send(movie)... | true |
264f1e7d2ec559c63fca124db308b104bab868e1 | JavaScript | 423KidKing/Saturn-Client | /commands/Search/weather.js | UTF-8 | 1,996 | 2.765625 | 3 | [] | no_license | const config = require("../../config.json")
const Discord = require("discord.js")
const weather = require("weather-js");
exports.run = async (client, message, args) => {
let messageArray = message.content.split(" ")
let args1 = messageArray.slice(1);
let args2 = message.content.substring(message.content.in... | true |
042765b714d85d2baac98a0191c9dfe08d390516 | JavaScript | SHRaymondJ/Base-Notes | /interview-2021/interview-questions/draft.js | UTF-8 | 111 | 2.890625 | 3 | [] | no_license | let a = 100;
function test(){
console.log(a);
let a = 10;
console.log(a);
}
test();
console.log(a); | true |
96052b1fbf378f210c872458fda89ab873b6b5f7 | JavaScript | blue2525989/AngularJS-notes | /chapter02/controller/click-message-controller.js | UTF-8 | 243 | 2.59375 | 3 | [] | no_license | angular.module('notesApp', []).controller('MainCtrl', [function () {
var self = this;
self.message = 'Hello ';
/* can define functions when declaring variables in JS */
self.changeMessage = function () {
self.message = 'Goodbye ';
}
}]) | true |
dc4efb1eb8a92eadbccdef7fa3f6daeac1e85d78 | JavaScript | BrendaMichelle/greglist-lab | /src/components/ListingsContainer.js | UTF-8 | 1,065 | 2.828125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import ListingCard from "./ListingCard";
// import ListingCard from "./ListingCard";
function ListingsContainer({ searchQuery }) {
const [listings, setListings] = useState([])
console.log(searchQuery)
useEffect(() => {
fetch(`http://localhost:6001/listings... | true |
ea7aaab833be918dc2dca1bd89dec2677622fa6f | JavaScript | wztech0192/SPBLXS-Game | /js/models/Block.js | UTF-8 | 346 | 2.921875 | 3 | [] | no_license | //data in each block
function Block(stObj, p, background) {
this.p = {
x: p.x,
y: p.y
};
//entity objs on the block (eg. player, enemy ...)
this.objs = [];
//static object on the block (eg. dirt, rock ...)
this.stObj = stObj;
//background on the block (eg. flowers)
this.b... | true |
8cf892f39239f5359849ba8fad85f0da223daed9 | JavaScript | MiaXIA/LeetCodeJSSolutions | /401 - 500/475. Heaters.js | UTF-8 | 2,456 | 3.84375 | 4 | [] | no_license | // Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.
// Now, you are given positions of houses and heaters on a horizontal line, find out minimum radius of heaters so that all houses could be covered by those heaters.
// So, your input will... | true |
49c692d2c5f6dc6f82c5ce3f97a41b357600b720 | JavaScript | StephenJonker/freeCodeCamp2019 | /javascript-algorithms-and-data-structures-certification/basic-javascript/accessing-object-properties-with-dot-notation/index.js | UTF-8 | 1,177 | 4.5625 | 5 | [] | no_license | /*
Javascript file
Written by: Stephen Jonker
Written on: Fri 19 Feb 2021
Copyright (c) 2021 - Stephen Jonker - www.stephenjonker.com
Project: freeCodeCamp - Javascript and Algorithms - basic javascript
- This code is based on a template created by me to provide basic HTML structure
- Additional template... | true |
2fb85103462a633d074ae543bf619f7f1ea04f92 | JavaScript | OhMeadhbh/peril | /bin/peril | UTF-8 | 2,491 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env node
var peril = require( '../peril.js' );
var rootindex, root, args, target, command, method;
// First, let's find if we specified a different root
rootindex = 1 + Number(
process.argv._$fold( function( b, e, i ) {if('--root'===e){return i;}return b;}, -1 )
);
if( rootindex == 0 ) {
root = '/';
... | true |
465c4ab0ca567caaeca7c5ad704492df8452e7f7 | JavaScript | kirito47-cn/- | /js/throttle.js | UTF-8 | 1,010 | 2.796875 | 3 | [] | no_license | "use strict";
function throttle(fn, time) {
if (time === void 0) { time = 300; }
var pre = 0;
return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var now = new Date().getTime();
if (now ... | true |
fdb8912b8474db2f1c944a546817cd66b2e9cca6 | JavaScript | dmoszkowski/test-technique-mail-crawler | /src/class/TestBrowser.mjs | UTF-8 | 705 | 2.734375 | 3 | [] | no_license | import IWebBrowser from './interfaces/IWebBrowser.mjs';
export default class extends IWebBrowser {
/**
* Crée un navigateur virtuel pour réaliser les tests
* @param {Object} virtualPages - Objet associant un ensemble d'URL virtuelles à du contenu HTML
*/
constructor(virtualPages) {
super();
thi... | true |
7481f50e8036cbc5c897ba0cba2f214ae71f0f81 | JavaScript | countingSta/koa-test | /controllers/account/account.mongo.js | UTF-8 | 2,992 | 2.5625 | 3 | [] | no_license | "use strict";
import {User,Contacts} from "../../models/contacts.mongo.js";
import utils from "../../utils/basement.js";
import jwt from "jsonwebtoken";
import bcrypt from "bcryptjs";
class Account {
constructor() {
this.doLogin = this.doLogin.bind(this);
this.doRegister = this.doRegister.bind(this);
this.enc... | true |
78537da6b449479783b577427554ec9a26f4e758 | JavaScript | paulequilibrio/litelement_wallaby | /src/app-child.js | UTF-8 | 1,065 | 2.546875 | 3 | [] | no_license | import { html, LitElement } from 'lit-element/lit-element.js'
import '@polymer/paper-input/paper-input.js'
export class AppChild extends LitElement {
static get properties () {
return {
name: { type: String },
message: { type: String },
initialMessage: { type: String }
}
}
constructor ... | true |
e617626b2d4acc65f2262a7490a1ce15672e91e6 | JavaScript | Pheo-Player/Pheo | /public/app/library/library-service.js | UTF-8 | 2,510 | 2.625 | 3 | [] | no_license | angular.module('pheoApp')
.factory('LibrarySvc', ['$q', '$http', function($q, $http) {
var library;
return {
getLibrary: getLibrary,
getAlbums: getAlbums
};
function getLibrary() {
var deferred = $q.defer();
// If library has been fetched before, resolve with cached object
if(library) {
deferred.res... | true |
96bc900459745cbdfa4b1ea0cc6f55d3a0fb9cd4 | JavaScript | jlyon/testing | /tests/kitchen-sink/in-kitchen-sink-ftp.js | UTF-8 | 881 | 2.609375 | 3 | [] | no_license | const Mesa = require('./vendor/Mesa1.js');
/**
* A Mesa Script exports a class with a script() method.
*/
module.exports = new class {
/**
* Mesa Script
*
* @param {object} payload The payload data
* @param {object} context Additional context about this task
*/
script = (payload, con... | true |
42bae0be668d31c7c96644db682e0e030d3dd991 | JavaScript | liorgefen86/mathgarden | /js/drawing.js | UTF-8 | 3,133 | 3.203125 | 3 | [] | no_license | const BACKGROUND_COLOR = '#1b2536';
const LINE_COLOR = '#ffffff';
const LINE_WIDTH = 10;
var isEmpty;
var currentX = 0;
var currentY = 0;
var previousX = 0;
var previousY = 0;
var btn_pressed = false;
var canvas;
var context;
var CANVAS_WIDTH;
var CANVAS_HEIGHT;
function prepareCanvas() {
//console.log('Preparin... | true |
9d9c34d5baf38b188469a77a1b3b7e4421388e1e | JavaScript | xuxubin/Movies_React-Native | /getStyleFromScore.js | UTF-8 | 690 | 2.75 | 3 | [] | no_license | 'use strict';
// return the text style according to the score
var React = require('react-native');
var {
StyleSheet,
} = React;
var styles = StyleSheet.create({
noScore: {
color: '#999999',
},
});
var MAX_VALUE = 200;
//引入新数据类型,在node_modules/react-native/Libraries里面
import type { StyleObj } from 'StyleSh... | true |
e8763429a10c4a3d2982d2b5c5f35975b262932f | JavaScript | Chen-Yu-Xiang/Chen-Yu-Xiang.github.io | /js/write.js | UTF-8 | 935 | 2.5625 | 3 | [] | no_license |
he=function (){
var firebase= require("./firebase");
var db = firebase.firestore();
var start = new Date('2017-01-01 21:12:19');
var cityRef = db.collection('test').doc('test');
var getDoc = cityRef.get()
.then(doc => {
console.log(doc.data()['date'].isEqual(start));
console.log(doc.data()['da... | true |
eeada19ff594595093e3f0fe3812b79320a2e303 | JavaScript | jiniusahmed/slide | /script.js | UTF-8 | 669 | 3.15625 | 3 | [] | no_license |
let photos = ["slider1.jpg","slider2.jpg","slider3.jpg","slider4.jpg","slider5.jpg"];
let imgTag = document.querySelector("img");
let prev = document.querySelector('#prev')
let next = document.querySelector('#next')
count = 0;
prev.addEventListener('click', function(){
count++;
if(count>=phot... | true |
5335ef54052a9c603644e968b639768aae861d16 | JavaScript | dhchow/b-b-blackjack | /spec/PlayerSpec.js | UTF-8 | 1,366 | 3.078125 | 3 | [] | no_license | describe("Player", function(){
var player
beforeEach(function(){
player = new Player()
})
it("starts with no cards in hand", function(){
expect(player.get("hand").length).toBe(0)
})
it("starts with 500 credit", function(){
expect(player.get("credit")).toBe(500)
})
it("starts with... | true |
0ea3a26dfa2eaedc5993cc082783993e626ee069 | JavaScript | Ankitamenpara/mongoDBMovie | /moviedata.js | UTF-8 | 1,078 | 2.59375 | 3 | [] | no_license | var mongo = require('mongodb').MongoClient
var fs = require('fs');
var url = 'mongodb://localhost:27017/moviemongo'
mongo.connect(url, function(err, db) {
if (err) throw err
// var collection = db.collection('docs')
//collection.insert(doc, function(err, data) {
//if (err) throw err
... | true |
f8c20aba6c3951ff0d8d43f746d47cafbd41fde8 | JavaScript | vitortomic/code-bucket | /javascripts/angular/angular web worker service/scoringService.js | UTF-8 | 654 | 2.53125 | 3 | [] | no_license | function scoringService($q) {
var scoreItems = function (items, weights) {
var deferred = $q.defer();
var worker = new Worker('/worker-demo/scoring.worker.js');
var orders = {
items: items,
weights: weights
};
worker.postMessage(orders);
worker.onmessage = function (e) {
i... | true |
2db0835e161eeb2dfc122ee4ada61a3eb1093d84 | JavaScript | tigran000/taskintent | /Task1/contains.js | UTF-8 | 333 | 2.65625 | 3 | [] | no_license | import flattenObject from "./flattenObject";
function contains(Store, target) {
const allObjectValues = Object.values(flattenObject(Store));
return allObjectValues.some(el => {
if (typeof el === "function") {
return el.toString() === target.toString();
}
return el === target;
});
}
export defau... | true |
ed3ae2bb62a9250e6cd55ca4d249e800f04fa195 | JavaScript | nfteam/Movie | /cinema_system/web/system/backstage/js/fy.js | UTF-8 | 7,280 | 2.984375 | 3 | [] | no_license | /**
* Created by 熊显付 on 2017/3/22.
*/
function pageNum(url,size) {
var pageSize = size; //每页显示的记录条数
var curPage=0; //当前页
var lastPage; //最后页
var direct=0; //方向
var len; //总行数
var page; //总页数
var begin;
var end;
$(document).ready(function display(){
len =$(url+" tr").... | true |
f218ba2225b16cb461374f499eae5be530fab236 | JavaScript | zakariyah/two_game_combined | /controller/agent.js | UTF-8 | 1,968 | 3.125 | 3 | [] | no_license | // This class creates the called agent and supply it with it needed characters. It also helps store the
// state of the game for the agent. It is what defines the agent next move.
var agent = function(nombre, playerIndex, payOffMatrix, lambda, isRandom) // nombre, _me, _A[2], _M, _lambda, _game[1024]
{
this.payO... | true |
38b6934592d17b73f97f5c2d3dcc0990a02cf60b | JavaScript | Bradwave/turingpattern | /js/src/plots-manager.js | UTF-8 | 12,546 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* Manages plots, sort of...
*/
let plotsManager = new function () {
/**
* Number of milliseconds to wait after resizing.
* @type {Number}
*/
const waitTime = 200;
let resizeTimeout;
/**
* Spinning loaders
*/
let loaders = [...document.getElementsByClassName("plot lo... | true |
1fd47f40c5509af03b3fd82745f8662ade44387f | JavaScript | apiumtech/force-front | /test/src/modules/saleAnalytics/eventBus/UserTreeListEventBusTestSpec.js | UTF-8 | 2,128 | 2.5625 | 3 | [] | no_license | define([
'modules/saleAnalytics/eventBus/UserTreeListEventBus'
], function(UserTreeListEventBus) {
'use strict';
describe('UserTreeListEventBus', function() {
describe("getInstance", function () {
it("should get only one instance of UserTreeListEventBus", function () {
var currentDateTime = new Date().getT... | true |
30d01a37fdecf558a27ef7f00b5069253c0878ab | JavaScript | Zubint/bid | /server/controllers/products.js | UTF-8 | 1,807 | 2.609375 | 3 | [] | no_license | var Product = mongoose.model("Product");
var User = mongoose.model("User");
module.exports=(function(){
return{
getProducts: function(req, res){
Product.find({}, function(err, products){
if(products.length>0){
console.log("found something")
//if you get here, you can check fo... | true |
5f5ffd5f5bb16dea1af4e5f5958836899b169179 | JavaScript | eveepi/jfd | /includes/functions.js | UTF-8 | 11,121 | 2.65625 | 3 | [] | no_license | function setNeedToConfirm()
{
needToConfirm = true;
}
function releaseNeedToConfirm()
{
needToConfirm = false;
}
function confirmExit()
{
if (needToConfirm){
return "Wenn Sie die Seite verlassen gehen alle Angaben verloren.";
}
}
window.onload = function(){
// das formular vom arzt eintragen erst mal verste... | true |
7a6cd901f3610fe4c3de4dfd4d6e1d4a5e110000 | JavaScript | yuxinxiao/yuxinxiao | /练习/jason/twoweek/myapp1/routes/user.validation.js | UTF-8 | 435 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* Created by jason on 16/3/14.
*/
module.exports = {
isGoodPassword : function (input)
{
// at least one number, one lowercase and one uppercase letter
// at least six characters
if(input.length >= 6){
return true;
}
return false;
},
checkTelphon... | true |
3f850a7a76be8dd9f3c20a12281105f30be9c6b7 | JavaScript | camyyssa/TicTacToad | /src/Reducers/Board.test.js | UTF-8 | 8,492 | 2.8125 | 3 | [] | no_license | import * as Actions from '../Actions';
import { copyState } from './Common';
import { boardReducers } from './Board';
describe('Board markers in non final conditions', () => {
it('Ignores cell change request when cell is occupied by 1', () => {
const prevState = {
board: [1, -1, -1, -1, -1, -1, -1, -1, -1]... | true |
fec750a9be0426bb97031ee0f5ef9e8fc87de2b3 | JavaScript | abubeck/dotfiles | /wunder/wunder.js | UTF-8 | 1,972 | 2.890625 | 3 | [] | no_license | // Get credentials from file
fs = require('fs')
if(fs.existsSync(process.env['HOME']+'/.wunderlist_login')){
var array = fs.readFileSync(process.env['HOME']+'/.wunderlist_login', 'utf8').toString().split("\n");
getTasks(array[0],array[1]);
}
else
{
var readline = require('readline');
var rl = readline.createIn... | true |
5f9f6214cad0c7842ebca427e7d41cf1e186a3c3 | JavaScript | hardfist/JSTricks | /ch1/tree.js | UTF-8 | 1,264 | 2.859375 | 3 | [] | no_license | class Tree{
constructor(val,left=null,right=null){
this.val = val;
this.left = left;
this.right = right;
}
}
function insert(root,val){
return root == null ? new Tree(val)
: val < root.val ? (root.left = insert(root.left,val),root)
: (root.right = insert(root.right,... | true |
875bc75938a665e3bca6acea37f0ca72f98505c0 | JavaScript | apnex/path | /cli/make.single.js | UTF-8 | 895 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env node
var grid = [
[2,1,1,2],
[1,0,0,1],
[1,0,0,1],
[2,1,1,2]
];
var routes = [
[0,3,11,8,0]
];
function compilePath(paths) {
let hops = [];
paths.forEach((path) => {
let hopPair = [];
path.forEach((hop) => {
hopPair.push(hop);
if(hopPair.length == 2) {
hops.push([hopPair[0], hopPai... | true |
51373c139a148d3ddb1b5babd5dd99d141d42707 | JavaScript | cevadev/node-intermedio | /network/response.js | UTF-8 | 1,476 | 3.265625 | 3 | [] | no_license | /**modulo para responder a las peticiones de forma coherente
* Response maneja todas las respuestas de red
*/
/**Objeto con los codigo de respuesta */
const statusMessages = {
'200': 'Done',
'201': 'Created',
'400': 'Invalid format',
'500': 'Internal error'
}
/**
* Funcion que prepara un response
... | true |
b0595507317a59b6ec0991fcf6a31c8592e8c6f3 | JavaScript | suzmar94/PRACTICE | /probni test/zadatak4.js | UTF-8 | 356 | 2.796875 | 3 | [] | no_license | // Исписати првих 30 преступних година (почевши од 1234, уљкучујући)
let godina =1600
let brojPrestupnih = 10;
for(let i =0; i<brojPrestupnih;){
if(godina%4===0 && (godina % 100!==0 || godina% 400===0)){
console.log(godina)
i++;
}
godina++;
}
console.log('............................');
| true |
6ce1f9b4f717d40182be367e8c33444a8a7791c4 | JavaScript | miraclehollins08/FSW_120_wwek3_Dice | /App.js | UTF-8 | 722 | 2.6875 | 3 | [] | no_license | import React, {Component} from 'react'
import './App.css'
class App extends Component {
state={
dice:1
}
throwDice=() =>{
const diceValue=Math.floor(Math.random()*6+1);
this.setState({
dice:diceValue
})
}
render() {
return(
... | true |
7b1313e6bcf4bb6ed98e0b5731e7d5994cb63a71 | JavaScript | Breucopter/datasift-stats-extractor | /lib/archive/webapp/contents/javascripts/d3.pie.js | UTF-8 | 1,131 | 2.75 | 3 | [] | no_license | (function () {
var width = 960,
height = 500,
radius = Math.min(width, height) / 2;
var color = d3.scale.ordinal()
.range(["#1093a7", "#24454c", "#def2f3", "#589ba4", "#1ad3f1", "#acd9ec", "#396faf"]);
var arc = d3.svg.arc()
.outerRadius(radius - 10)
.innerRadius(0);
var pie = d3.layout.pie()
... | true |
72a66f5375b3c302d35563dafe2d768d7b6c3dc5 | JavaScript | yazanbaker94/ASAC-Blog | /js/app.js | UTF-8 | 2,355 | 3.234375 | 3 | [
"MIT"
] | permissive | 'use strict';
function Article(author, title, subject, content, day, month, year, id) {
this.author = author,
this.title = title,
this.subject = subject,
this.content = content,
this.day = day,
this.month = month,
this.year = year;
this.likes = 0;
this.id = id;
}
Article.protot... | true |
0ab355bd1f4fcc8d17ed016306c189154dede675 | JavaScript | johnenverga/johnenverga.github.io | /src/js/christmas.js | UTF-8 | 7,562 | 3 | 3 | [
"MIT"
] | permissive | //thanks to Anatoliy of "Stack Overflow" for this "Random Color" function!
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function christmasroom(){
var canva... | true |
a46a4090c153e1d6790905a5ac3bde39b6d58af7 | JavaScript | charger88/orange-dragonfly-model | /components/model.js | UTF-8 | 9,743 | 2.6875 | 3 | [] | no_license | const ORM = require('orange-dragonfly-orm')
const validate = require('orange-dragonfly-validator')
class ValidationException extends Error {
info = {}
}
class Model extends ORM.ActiveRecord {
static get IGNORE_EXTRA_FIELDS () {
return false
}
/**
* Returns list of unique keys
* @returns Array[] Lis... | true |
07e959818cd770d213d4b6c19d85c70c101f6115 | JavaScript | shilpachawla/reactAssignment | /src/Component/Search.js | UTF-8 | 3,554 | 2.78125 | 3 | [] | no_license | import React, { Component } from "react";
import axios from 'axios';
import { withRouter } from 'react-router-dom'
class Search extends Component
{
constructor(props)
{
super(props)
this.state =
{
planetName : '',
planetdata : [],
}
this.handleLogout = this.ha... | true |
0146c21a265a45eebcb0e5c52679ffbe9b977692 | JavaScript | vhalegax/Rukmini | /public/js/city.js | UTF-8 | 7,960 | 2.53125 | 3 | [] | no_license | jQuery(document).ready(function () {
jQuery('select[name="prov"]').on('change', function () {
$('select[name="ongkirservice"]').empty();
document.getElementById("jasa").selectedIndex = "0";
var ongkir = $('#ongkir').val().replace(/[^0-9]/g, '');
var ongkirnumber = +(ongkir.replace(/... | true |
cc73e633b94d3f719fe237ecafd3e803fc8672df | JavaScript | Jjacquemin/project-exchange-rate | /src/reducers/reducer-countries.js | UTF-8 | 655 | 2.6875 | 3 | [] | no_license | import {GET_COUNTRIES} from '../actions/index'
import { supportedCurrencyCode } from '../supportedCurrencies'
const initialState = {
countries: []
}
export default function(state = initialState, action) {
switch(action.type) {
case GET_COUNTRIES : return { ...state, countries: getCountriesInfo(action... | true |
312fc55c73d986a72e5fe266ed179340d2e3bda8 | JavaScript | cadumega/cursojstp_lumi | /aula14/teste.js | UTF-8 | 1,869 | 4.0625 | 4 | [] | no_license | let num1 = 10;
let num2 = 2;
let num3 = 10.5789898594;
let num4 = 10.25; // Quero saber se o número é inteiro
let num5 = 0.7;
let num6 = 0.1;
// console.log(num5+num6); //0.7999999
// num5 +=num6 ; //0.8 num1 = num1 + num2
// num5 +=num6 ; //0.9 o correto..
// num5 +=num6 ; ... | true |
7aacab80fac616c2e68039589a81bc6b153a5a46 | JavaScript | sandesh-sinha/EDC-booking | /edc-booking/src/component/Application.js | UTF-8 | 1,902 | 2.546875 | 3 | [] | no_license | import React , {useState} from 'react'
import {useHistory} from 'react-router-dom';
import Button from '@material-ui/core/Button'
import axios from '../axios';
function Application(props) {
const history = useHistory();
const [value, setvalue] = useState("pending")
const handleAccept = (e) =>{
e.pre... | true |
1caee7909ecc3ed7893b817d1f88d46d2f4a10ad | JavaScript | laceymwes/js | /FunctionHoisting.js | UTF-8 | 347 | 2.890625 | 3 | [] | no_license |
function outerMostFunc() {
innerMostFunc(); // will not compile
secondOuterMostFunc();
function secondOuterMostFunc() {
innerMostFunc(); // will compile since function declaration is hoisted to
// top of enclosing function scope.
function innerMostFunc() {
console.log("inner most function.")
... | true |
cbd7dd4c5fd162fc20a640e9f6a5fdb080561e48 | JavaScript | joylty94/node_tutorial | /app.js | UTF-8 | 664 | 2.703125 | 3 | [] | no_license | const http = require('http'); // 1
// http.createServer((request, response) => { // 2
// response.statusCode = 200;
// response.setHeader('Content-Type', 'text/plain');
// response.end(`${circle.area(4)}`);
// }).listen(8000); // 3
//var server = http.createServer();
// server.listen(8888);
//console.log('... | true |
d3afaada8c6a6e3cc6b818693931ab63c0bfa94e | JavaScript | moumen-soliman/booking-react-redux | /src/components/Navbar.js | UTF-8 | 2,632 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import uuidv4 from 'uuid/v4';
class Navbar extends Component {
constructor(props) {
super(props);
this.state = {
id: uuidv4(),
editMode: false,
... | true |
1c132899766f3b83462a51d1e71b1036ee018f3f | JavaScript | jignacioa/Coding-Dojo | /MERN/express/express-demo/server.js | UTF-8 | 1,423 | 3.234375 | 3 | [] | no_license | const express = require('express');
const app = express();
//(express middleware) - invoked json function and use
app.use(express.json()) // takes incoming req and adds any json to req.body we're referencing so we can access the data
app.get('/', (req, res) => {
res.json({message: 'Hello from Express'});
})
//... | true |
08a36e247356f0105f7b4779581ec940d397b114 | JavaScript | janineteeneightynine/portfolio | /src/components/helpers.js | UTF-8 | 4,872 | 3.03125 | 3 | [] | no_license | import React from 'react';
import parse from 'html-react-parser';
import _ from 'lodash'
import ArticlesCard from './ArticlesCard';
export function flatten(object) {
var check = _.isPlainObject(object) && _.size(object) === 1;
return check ? flatten(_.values(object)[0]) : object;
}
export function parseXML(xml) ... | true |
611e0cadc21744e456e2d414473c44f2a3ec7938 | JavaScript | prevwong/craft.js | /site/src/components/API.js | UTF-8 | 1,459 | 2.609375 | 3 | [
"MIT"
] | permissive | import React from 'react';
const Item = ({ item }) => {
const title = item[0];
const type = item.length > 1 && typeof item[1] == 'string' && item[1];
const description =
item.length == 3
? typeof item[2] == 'string' && item[2]
: item.length == 4 && typeof item[3] == 'string' && item[3];
const c... | true |
ca8270145a43d1099bc91f94a83be586b7e91a72 | JavaScript | aakifalbayrak/MovieBackend | /app.js | UTF-8 | 1,892 | 2.796875 | 3 | [] | no_license | var Uuid = require("uuid");
var Cors = require("cors");
var Express = require("express");
var Couchbase = require("couchbase");
var BodyParser = require("body-parser");
// Express.js connection
var app = Express();
//Database object
var DB = Couchbase.N1qlQuery;
//Port for back-end server, localhost:3000
const port ... | true |
384513560e102554d62c5ba04f8e5925a52252fd | JavaScript | dohliam/dohliam.github.io | /regex/portregex.js | UTF-8 | 3,540 | 2.9375 | 3 | [] | no_license | function replaceText() {
var textInput = document.getElementById("text_input");
var regexInput = document.getElementById("regex_input");
var replaceText = document.getElementById("replace_text");
var re = new RegExp(regexInput.value, "g");
var Result = document.getElementById("result");
Result.innerHTML = t... | true |
cb458e368648bbe9688468bfb1444dfcdccfb166 | JavaScript | taryegh/javascript-challenges | /extras/extractUniqueChar.js | UTF-8 | 346 | 3.6875 | 4 | [] | no_license | 'use strict';
// 12. Write a JavaScript function to extract unique characters from a string.
function extractUnique(str) {
let res = '';
for (let i = 0; i < str.length; i++) {
if (res.includes(str[i])) {
continue;
}
res += str[i];
}
return res;
}
console.log(extractUnique('thequickbrownf... | true |
06d42bc93c66dd152987e7ec21c54afdabbb9767 | JavaScript | NBeing/Portfolio | /exercism-exercises/word-count/word-count.js | UTF-8 | 333 | 2.71875 | 3 | [] | no_license | class Words {
count( text ){
const words = {};
text.toLowerCase()
.replace( /[\s\s+]/g , " ")
.split(" ")
.filter( x => x !== "")
.map( word => !words.hasOwnProperty(word)? words[word] = 1: words[word] +=1);
return words;
}
}
export de... | true |
13fbfb2ba2af8d7f732594841c8c004aff60c41a | JavaScript | surfwhenican2/Project-Euler | /p4.js | UTF-8 | 589 | 4.125 | 4 | [] | no_license | // var number;
// var length;
// var stringRep;
// var i;
// var j;
console.log("Hi");
// var isPalindrome = function(string){
// console.log("String = "+string);
// length = number.length;
// var k;
// for (k = 0; k < length/2; k++){
// if (string[k] !== string[length-k-1]){
// return false;
// }
// }
// ... | true |
9dfffc8f997d88e08d46124b55340247ac955856 | JavaScript | hferris/Good-README-Generator | /utils/generateMarkdown.js | UTF-8 | 1,242 | 3.0625 | 3 | [] | no_license | // TODO: Create a function that returns a license badge based on which license is passed in
// If there is no license, return an empty string
function renderLicenseBadge(license) {
if(license == "GNU")
return`<img src="https://img.shields.io/badge/License-GPLv3-blue.svg"></img>`
if(license == "MIT")
ret... | true |
5aa3c24026157b4ad756e2279a4e588033931c85 | JavaScript | ocedal9/algorithms | /al03/function.js | UTF-8 | 826 | 3.359375 | 3 | [] | no_license | const matrixFactory = require('./matrixFactory')
function maxRec(matrix) {
let max = 0
let heights = []
for (let row = 0; row < matrix.length; row++) {
let stack = []
for (let col = 0; col <= matrix[row].length; col++) {
if (matrix[row][col] === 1) {
heights[col] = row === 0 ? 1 : heights[c... | true |
756282ef827fffccbec1fdc2a66ea768b3642977 | JavaScript | AndreyTravkin/JS-projects | /maze/index.js | UTF-8 | 1,929 | 3 | 3 | [] | no_license | const { Engine, Render, Runner, World, Bodies } = Matter;
const cells = 3;
const width = 600;
const height = 600;
const engine = Engine.create();
const { world } = engine;
const render = Render.create({
element: document.body,
engine: engine,
options: {
wireframes: true,
width,
height
}
});
Render... | true |
1a871947254d44b90cb5d1868fd5be25c94e944b | JavaScript | DamianArs/ReactTodo | /src/components/App.js | UTF-8 | 1,654 | 2.796875 | 3 | [] | no_license | import React from 'react';
import './App.css';
import { AddTask } from './AddTask';
import { TaskList } from './TaskList';
class App extends React.Component {
state = {
tasks: [
{
id: 0,
name: 'Zadanie 1',
date: '2020-01-29',
priorytet: true,
endDate: null,
... | true |
55b1f2a1973493118fb5386454e3a59db88ead16 | JavaScript | GabeGordon94/chatbot-itc-backend | /api.js | UTF-8 | 479 | 2.84375 | 3 | [] | no_license | let list=["https://ancient-fjord-32267.herokuapp.com/message/?message=","https://boto20.herokuapp.com/message/?message="]
function getResponse() {
let question = document.getElementById('q').value
// console.log(question)
fetch(`${list[1]}${question}`).then((response) => {
return response.json();
... | true |
dba1ca72b5db7597a1aaca95fdf70d60aff75a8a | JavaScript | paulopkl/Curso-Web-Completo-JS-2020 | /ESNext/Revisao1.js | UTF-8 | 520 | 3.90625 | 4 | [] | no_license | // Let Const
{
var a = 2;
let b = 3;
console.log(b);
}
console.log(a);
// Template String
const produto = 'iPad';
console.log(`${produto} é caro`);
// Destruturing
const [l, e, ...tras] = "Cod3r";
console.log(l, e, tras);
const [x, , y] = [1, 2, 3];
console.log(x, y);
const { idade: i, nome } = { nome: ... | true |
3ed0b4ec897869e114371fa300961908c51916ce | JavaScript | jerrycode06/typescript-reference | /basics demo/sandbox.js | UTF-8 | 918 | 4.09375 | 4 | [] | no_license | "use strict";
var circles = function (radius) {
return radius * radius * Math.PI;
};
// console.log(circles("Hello"))
console.log(circles(5));
// Arrays
var names = ["Jerry", "Batman", "Flash", "Aquaman"];
names.push("Wonder Woman");
// names.push(78); error
// names[1] = 21; error
// names = "897" --> gives me err... | true |
e36a6333bf8a7057033b279fb1c0ca43183243f7 | JavaScript | jimi-k1979/ringingV2 | /public/assets/js/team.js | UTF-8 | 1,932 | 2.59375 | 3 | [] | no_license | ready(() => {
let generalFields = document.querySelectorAll('.general');
let generalBtn = document.getElementById('general-button');
let eventFields = document.querySelectorAll('.event');
let eventBtn = document.getElementById('events-button');
let leagueFields = document.querySelectorAll('.league')... | true |
bcacf7d762adda93c97a32077888d7f558ac09d4 | JavaScript | OguzhanAgca/github-api | /UI.js | UTF-8 | 5,915 | 2.6875 | 3 | [] | no_license | class UI {
constructor(){
this.searchInput = document.getElementById("searchUser");
this.secondCardBody = document.querySelectorAll(".card-body")[1];
this.usersArea = document.getElementById("users");
this.homeText = document.getElementById("homeText");
this.favoritesBadge = ... | true |
e87e92846ea8d0d01149e9f73ed702e928340604 | JavaScript | rbacquie/clickygame | /src/App.js | UTF-8 | 3,399 | 3.171875 | 3 | [] | no_license | import React, { Component } from "react";
import CarCard from "./components/CarCard";
import Nav from "./components/Nav";
import Wrapper from "./components/Wrapper";
import Title from "./components/Title";
import Container from "./Container";
import Row from "./Row";
import Column from "./Column.js";
import cars from "... | true |
c1aacacdd67d7e6db640bc5e4b5b5c5e958a98f7 | JavaScript | liuliang960206/cases | /case/Cloud-disk/云盘-版本1/js/folders/folders.js | UTF-8 | 5,978 | 2.703125 | 3 | [] | no_license | class Folders {
constructor(data, id) {
this.data = data;
console.log(data)
this.folders = document.querySelector('.folders');
this.render(id);
this.breadNav();
this.treeMenu();
this.delete();
this.move();
this.drag();
}
get... | true |
e2f85ae76cdf32ec77125e93327a72517732f57a | JavaScript | mdamyanova/SoftUni-CSharp-Web-Development | /06.JavaScript Core/07.01.JS Fundamentals/08.Strings and regular expressions/01.PrintLetters.js | UTF-8 | 111 | 2.9375 | 3 | [
"MIT"
] | permissive | function printLetters([word]) {
for(let i in word){
console.log(`str[${i}] -> ${word[i]}`);
}
} | true |
252e720f229bbeeafd8661fa0b90af0d5dda3aa5 | JavaScript | xiaofeixia-chenling/leecode | /code/array/lesson1.js | UTF-8 | 773 | 3.375 | 3 | [] | no_license | // export default(arr) => {
function porkFun(arr){
arr.sort((a, b) => a-b)
let min = Number.MAX_SAFE_INTEGER
let dst = []
let result = true
for(let i = 0, len=arr.length,tmp=[];i<len; i++){
tmp.push(arr[i])
for(let j = i+1; j<len-1; j++){
if(arr[j] === arr[i]){
tmp.push(arr[j])
}e... | true |
9666e2f869bcefc72bdc9409228cc67443b6a75f | JavaScript | royhadad/to-do-list | /src/App.js | UTF-8 | 1,912 | 2.75 | 3 | [] | no_license | import React from 'react';
import './App.css';
import TaskList from './components/TaskList';
import TaskInput from './components/TasksInput';
import Task from './entities/Task';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
tasks: [new Task('bjj')... | true |
feec1ba5cca83eef0ffa53a0d6bf3cd9031eb373 | JavaScript | Gopigovind/Flight-Booking | /src/action/filters.js | UTF-8 | 1,076 | 2.625 | 3 | [] | no_license | import axios from 'axios';
import * as data from './../reducers/data/filghtData.json';
import {
REQUEST_ALLFLIGHTDETAILS,
RECEIVE_ALLFLIGHTDETAILS
} from "./types";
export const fetchSpaceByFilter = (departureCity, arrivalCity, travelDate) => async dispatch => {
try {
dispatch({ type: REQUEST_ALLFLIGHTDETAI... | true |