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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cbda078aec1be364b2e67e48dd23c72cdecf8e9f | JavaScript | busybigwhite/Smart_Factory_Front_End | /public/scripts/workorder/component/dropdown-type.js | UTF-8 | 1,986 | 2.546875 | 3 | [] | no_license | 'use strict';
var $ = window.jQuery = require('jquery');
require('bootstrap/js/dropdown');
var _ = require('lodash');
var userId = require('../../config/auth');
var config = require('../../config/url');
var EventEmitter = require('wolfy87-eventemitter');
var selectedType;
var emitter = new EventEmitter();
/* DOM *... | true |
83bb1393415af17fc61b9becda18f60c06bb35be | JavaScript | yyuuttoonngg/WDI_16_HOMEWORK | /Tong/wk07/1-mon/730-city-pix/main.js | UTF-8 | 1,119 | 3.15625 | 3 | [] | no_license | // https://github.com/kasun-maldeni/wdi_city_pix
console.log("citypix");
var cities =['NYC', 'SF', 'LA', 'SYD', 'ATX'];
var selectBox = document.getElementById("city-type");
cities.forEach(city =>{
var option = document.createElement("option");
option.text = city;
selectBox.add(option);
})
selectBox.addEv... | true |
df7c71ded12c812d68907fe039fbee0d35eebe5c | JavaScript | SHKnight92/Argentina-Soccer-Club-A.S.C- | /src/components/Team/Team.js | UTF-8 | 1,034 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import './Team.css';
import playerData from '../../playerData/playerData.json';
import Players from '../Players/Players';
import SelectedPlayer from '../SelectedPlayer/SelectedPlayer';
const Team = () => {
const playerInfo = playerData.slice(0,12);
const [players, se... | true |
990e21413363559ae0ff0f40c7a08b880081bbd6 | JavaScript | michaelStillwell/Personal-Project | /client/src/ducks/reducer.js | UTF-8 | 12,092 | 2.515625 | 3 | [] | no_license | import client from '../index';
import gql from 'graphql-tag';
// CONSTANTS
const
GET_ALL_PRODUCTS = 'GET_ALL_PRODUCTS',
GET_ALL_ORDERS = 'GET_ALL_ORDERS',
GET_ALL_EMPLOYEES = 'GET_ALL_EMPLOYEES',
POST_PRODUCT = 'POST_PRODUCT',
POST_ORDER = 'POST_ORDER',
POST_EMPLOYEE = 'POS... | true |
1c9d34332c37f4607b4475cd1938a547bac6a2e1 | JavaScript | rainboi/RainLib.JS | /RainLib/Generations/Algorithms/randomNumbers.js | UTF-8 | 322 | 3.171875 | 3 | [
"MIT"
] | permissive | function randomNumbers(length, minValue = -10, maxValue = 10) {
const result = [];
for (let i = 0; i < length; i++) {
let randomNumber = ((Math.random() * (maxValue - minValue + 1)) << 0) + minValue;
result.push(randomNumber);
}
return result;
}
module.exports = {
randomNumbers,
... | true |
77c1fe2858f15f6bb5b224b74aca75280473d961 | JavaScript | fusion-io/framework | /src/Http/HttpResolver.js | UTF-8 | 6,470 | 2.546875 | 3 | [] | no_license | import {container, singleton} from "@fusion.io/container";
import lodash from "lodash";
import RouteDefinitions from "./RouteDefinitions";
@singleton()
export default class HttpResolver {
/**
* Resolve to standard koa middleware functions from a given Symbol
*
* @param MiddlewareSymbol
* @retu... | true |
b3be725c060c84d9871653fb0abdd2897ed21750 | JavaScript | afang/polyterm | /app/utils/terminus.js | UTF-8 | 1,139 | 2.671875 | 3 | [
"MIT"
] | permissive | import { spawn, fork } from 'child-process-promise';
import fs from 'fs-extra';
// Terminus
// A lightweight & low level, promise-based Terminal utility
export default class Terminus {
constructor() {
this.env = process.env;
this.cwd = process.cwd;
}
send(cmd, args = []) {
// let logs = fs.openSync(... | true |
76b3ff3f496520aeb2a8f8c283a5b3d3be96af8b | JavaScript | jubeatt/minimatch-cheat-sheet | /makedoc.js | UTF-8 | 935 | 2.75 | 3 | [] | no_license | var _ = require('lodash');
var data = require('./data.json');
function codify (str) {
if (str.indexOf('|') === -1) {
return '`' + str + '`';
} else {
return '<code>' + str.replace(/\|/, '|') + '</code>';
}
}
console.log('# minimatch-cheat-sheet');
console.log('');
console.log('A cheat sheet for... | true |
8da9f0f0fa4c0a326bcc13873ed0e70f62e510f8 | JavaScript | alpheios-project/alpheios-core | /packages/components/tests/lib/queries/query.test.js | UTF-8 | 1,308 | 2.765625 | 3 | [
"ISC"
] | permissive | /* eslint-env jest */
import Query from '@/lib/queries/query'
describe('query.test.js', () => {
console.warn = function () {}
console.log = function () {}
beforeEach(() => {
jest.spyOn(console, 'warn')
})
afterEach(() => {
jest.resetModules()
})
afterAll(() => {
jest.clearAllMocks()
})
i... | true |
16c0274778f5b27803d55344e115272d846cef06 | JavaScript | Ilon0032/Shady | /script.js | UTF-8 | 803 | 2.859375 | 3 | [] | no_license | window.addEventListener("load", sidenVises);
/*siden loaded*/
function sidenVises() {
/* siden vises skrevet ud i consolen når siden er loaded*/
console.log("siden vises");
document.querySelector("#burgermenu").addEventListener("click", burger);
/*ID burgermenu lytter efter klik og når der klikkes sen... | true |
3b7ecf670250b130ba0e5a503a78aa5553d674d6 | JavaScript | thibaut-decherit/symfony4-user-manager | /assets/js/components/submit-and-button-spamming-prevention.js | UTF-8 | 2,614 | 2.765625 | 3 | [
"MIT"
] | permissive | // Disables (submit) button, prevents submit spamming and displays loading spinner.
import {body} from './helpers/jquery/selectors';
import {translations} from './twig-data/data/translations';
body.on('submit', '.disable-on-submit', function () {
/*
Listens to submit event on form instead of listening to click... | true |
35fadeca7d5c69d9a0821d157351463def00d644 | JavaScript | XimenaStahl/FullStack-notasfinales | /assets/js/main.js | UTF-8 | 3,221 | 3.078125 | 3 | [] | no_license | var nombre = prompt("Ingrese su nombre: ")
var carrera = prompt("Ingresa Carrera: ")
var ramo1 = prompt("Ingrese ramo 1: ");
var ramo1nota1 = parseInt(prompt("Ingrese Nota 1 [" + ramo1 + "]: "));
var ramo1nota2 = parseInt(prompt("Ingrese Nota 2 [" + ramo1 + "]: "));
var ramo1nota3 = parseInt(prompt("Ingrese Nota 3 [" +... | true |
028929f6cb8196b9fe93e7ed91f50a357da01e53 | JavaScript | Wulize/snabbdom-study | /src/snabbdom/h.js | UTF-8 | 1,453 | 3.234375 | 3 | [] | no_license | /*
* 本方法将节点转换为虚拟dom
* @method h
* @for 所属类名
* @param {无限制} 参数:sel, data, children 参数个数:3
* @return {返回值类型} object 本函数的返回值为虚拟dom,即js对象
*/
// 简化版的h函数只实现以下三种情况
/*
1. h('div',{},'text')
2. h('div',{},[])
3. h('div',{},h())
*/
import vnode from './vnode';
export default function(sel, data, c) {
// 检查参... | true |
503de9cca8cb471f87ccd699e440a83017d753d9 | JavaScript | IvanS1991/telerik-courses | /javascript/js-apps/homeworks/hw-1/main.js | UTF-8 | 1,685 | 3.125 | 3 | [] | no_license | let getLocation = function(selector) {
if (typeof selector !== "string") {
throw new Error("selector must be a valid CSS selector passed as a string");
}
selector = document.querySelector(selector);
selector.innerHTML = "";
let parseData = function(data) {
return {
latitude: data.coords.latitude,
lon... | true |
a0df0579aa59724f145d716f73d1f274d46a0f5c | JavaScript | yigittosun/movie-app | /src/App.js | UTF-8 | 3,620 | 2.515625 | 3 | [] | no_license | import styled from "styled-components";
import axios from "axios";
import FilmContent from "./components/FilmContent";
import React, { useEffect,useState } from "react";
import FilmInfo from "./components/FilmInfo";
export const API_KEY = "e1f9d98";
const Container =styled.div
`display: flex;
flex-direction: column`;
... | true |
06a3c62ba5f70c55660c0b0bdbd064b05194cf83 | JavaScript | Jeffrey-Cawiezell/Visual-Data-Assistant | /project/test.js | UTF-8 | 700 | 2.609375 | 3 | [
"MIT"
] | permissive | const express = require('express');
const path = require('path');
// Init App
const app = express();
//Declare static folder to be served. It contains the js, images, css, etc.
app.use(express.static('speech-test'));
// **** Routes ****
// Home Route
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname + ... | true |
aefe600679c724220300e25d08d8a52bc0765a5a | JavaScript | GiovaniHMilani/ez.devs-hero-backend | /src/controllers/hero-controller.js | UTF-8 | 931 | 2.5625 | 3 | [] | no_license | const mongoose = require("mongoose");
const Hero = mongoose.model("Hero");
exports.get = (req, res, next) => {
Hero.find({})
.then(data => {
res.status(200).send(data);
})
.catch(e => {
res.status(400).send(e);
});
};
exports.getByName = (req, res, next) => {
Hero
.find({
nam... | true |
fd77391ce0ba5537e6e73fcf67cabb31e533df45 | JavaScript | dontinhqt/nodejs.github.io | /config/validate.js | UTF-8 | 1,414 | 2.578125 | 3 | [] | no_license |
module.exports = function (body) {
var msg = "is valid";
var code = 200;
var name = body.serviceName ? body.serviceName : '';
var prices = body.price ? body.price : new Array();
var executes = body.execute ? body.execute : new Array();
var group = body.group ? body.group : '';
var type = b... | true |
46beb759f00f55400ed50216110521c8b5f962f8 | JavaScript | Desarrollo-CeSPI/WCore | /public/js/stationmodel-chart.js | UTF-8 | 3,354 | 2.875 | 3 | [] | no_license | var station = null;
var stats = 'Temperatura';
function initialize_chart(anStation, type, from, to){
if (anStation){
station = anStation;
}
if (type == ''){
type = stats;
}else{
stats = type;
}
var title = '';
var aColor = '#000000';
var StationsModel = Backbone.Model.exten... | true |
6664da01275ca998a8876a94c4a7305bddf21d64 | JavaScript | cbt1/dist-flow | /charts/waterfallchart/src/waterfallchart-tick-generator.js | UTF-8 | 2,838 | 2.84375 | 3 | [
"MIT"
] | permissive | import { scaleLinear } from 'd3-scale';
const SENSE_PICASSO_SPACING_COEFFICIENT = 100;
const tickGenerator = {
getMinorTicks({ majorTicks, minorTickCount }) {
const minor = [];
for (let i = 0; i < majorTicks.length - 1; i++) {
const start = majorTicks[i];
const end = majorTicks[i + 1];
con... | true |
55e6734479e4625f41c941bc8b0bd3141ae450bf | JavaScript | ZUCHOVICKI/HR_SystemsNODE | /HR_SYSTEM/js/Put.js | UTF-8 | 2,470 | 2.546875 | 3 | [] | no_license | window.onload = init;
var headers = {};
var url = "https://hr-system-uaq-node.herokuapp.com"
function init(){
if(localStorage.getItem("Token")){
headers = {
headers:{
'Authorization':"bearer " + localStorage.getItem("Token")
}
}
... | true |
fd98813bc4dc39ccf763e0461ddfd788157752e8 | JavaScript | shiqingyun1024/JavaScript | /others/navigationbar/navigationbar.js | UTF-8 | 1,924 | 2.765625 | 3 | [] | no_license | window.onload = function(){
var top = $("top").offsetHeight;
var top1 = $("as1").offsetTop;
var leader = 0,target = 0,timer = null;
//为了不相互干扰,我定义了两组缓动动画的公式
var lea = 0,tar = 0,tim = null;
window.onscroll = function(){
//记住scroll()这个函数只有在window.onscroll = function(){里才能应用
if(scroll().top >= ... | true |
0753739753e9c3a2e609b5da5d9bb14b8f7c3187 | JavaScript | yanhao-eng/attach.js | /attach.js | UTF-8 | 1,638 | 3.03125 | 3 | [] | no_license | // This script is intend to establish some connction between element and action
// Element and action pair is the minimum unit of the script. By default is empty unit;
// The init element is empty; the element could be jquery object, attach object or an array of Attach object
var
rootAttach,
attach = Attac... | true |
f42600fb6d967cb0ce23450869811144bd4c1ded | JavaScript | wlegolas/lock-cell-example | /server.js | UTF-8 | 514 | 2.5625 | 3 | [] | no_license | const io = require('socket.io')();
const notifyEveryone = (eventName, ...params) => {
io.emit(eventName, params);
};
const notifyOther = (client, eventName, ...params) => {
client.broadcast.emit(eventName, params);
};
io.on('connection', (client) => {
client.on('timetableselected', (cellId) => {
console.lo... | true |
314fbdc430493b9bba881e2c19536d651c7618d7 | JavaScript | thisistaimur/Course | /06-Single-Page-Applications/2021-03-08-ReactIII/content/react-bootrap.js | UTF-8 | 1,263 | 2.75 | 3 | [] | no_license | //Welcome FbW3
//Topic: React-Bootsrap (RB)
//Reference: https://react-bootstrap.github.io
//Reference 2: https://react-bootstrap.github.io/getting-started/introduction
//Reference 3: https://startbootstrap.com
//Reference 4: For integrating Startbootstrap themes/templates into your React App --> https://www.youtube.co... | true |
bba791dfd1e0a7446500add584d980458e29fc5f | JavaScript | justinjaeger/quell-react-app | /client/src/helper_functions/HelperFunctions.js | UTF-8 | 3,620 | 3.578125 | 4 | [] | no_license | /*
newList
- whatever is passed in here are the main array fields
- looks like: ['name', 'id', 'capital']
sub
- whatever is passed in here are the sub-array (cities) fields
- looks like: ['name', 'population', 'country_id']
currentResults
- comes from the state
- looks like: { QUERY: [... | true |
a89ddfc39caba2b195083716e0f8a258a4192bde | JavaScript | chernokm/react-quiz-game | /src/demos/demos-page.js | UTF-8 | 2,065 | 2.59375 | 3 | [] | no_license | import AlertButton from "./props/alert-button";
import ChatMessage from "./props/chat-message";
import SpeakButton from "./props/speak-button";
import WelcomeMessage from "./props/welcome-message";
import SocialPost from "./props/social-post";
import ClickButton from "./state/click-button";
import SpeakForm from "./sta... | true |
b0b438717200d4d1121db2989dc9868cef575235 | JavaScript | DennyTim/Referance | /Context/Call-Apply-Bind/example2.js | UTF-8 | 385 | 3.75 | 4 | [] | no_license | let user = {
name: "Ivan",
}
function sayName(surname) {
console.log(this);
console.log(this.name + surname);
}
sayName.call(user, ' Ivanov'); // насильная передача контекста
sayName.apply(user, [' Petrov']);
function count(number) {
return this * number;
}
let double = count.bind(2); // привязка контекста
c... | true |
a7802edb51e1aa8f6839fd6c65b5b017bc06a052 | JavaScript | jacksolaro/readme-generator | /index.js | UTF-8 | 739 | 3.28125 | 3 | [
"MIT"
] | permissive | const fs = require("fs");
const inquirer = require("inquirer");
const questions = require("./questions")
const mdTemplate = require("./mdTemplate")
async function generateReadMe() {
// Prompt the User for responses. Questions for Prompting can be found in questions.js
const response = await inquirer.prompt(qu... | true |
83bcafa896410cff75754c990529226705532e1e | JavaScript | mesutcan/Todo-Jasmine | /tmp/debug/staging/static/todos/en/current/tests/todos_controller_spec.js | UTF-8 | 1,951 | 2.71875 | 3 | [] | no_license | describe('Todos.todoListController', function() {
describe('#createTodo', function(){
var createTodoSpy, title;
beforeEach(function() {
title = 'title';
createTodoSpy = spyOn(Todos.store,'createRecord');
Todos.todoListController.createTodo(title);
});
it('creates a todo with the ... | true |
1dc1ac105e17ec3fdba8ab7a4d45d5cecc3cbfb6 | JavaScript | DMcCal79/Coderbyte-Solutions | /JavaScript/PowerSetCount.js | UTF-8 | 731 | 4.3125 | 4 | [] | no_license |
/*Have the function PowerSetCount(arr) take the array of integers stored in arr,
and return the length of the power set (the number of all possible sets) that can
be generated. For example: if arr is [1, 2, 3], then the following sets form the
power set:
[]
[1]
[2]
[3]
[1, 2]
[1, 3]
[2, 3]
[1, 2, 3]
You can see abov... | true |
3b1f7d2c6108a0e47dbf23bcd7b1578853a13073 | JavaScript | FoongL/teamRainDrops | /firstCanvas/assets/javascript/drawing-polygon-S.js | UTF-8 | 2,333 | 3.078125 | 3 | [] | no_license | let min = 15;
let max = 350;
class DrawingPolygon extends PaintFunction {
constructor(contextReal, contextDraft) {
super();
this.contextReal = contextReal;
this.contextDraft = contextDraft;
this.new = true;
this.coords = [];
}
onMouseDown(coord, event) {
this.contextReal.strokeStyle = ge... | true |
8f907234fd43f1144742b640ac8f4566f3a3558a | JavaScript | ThomasMDavis/codesignal-solutions | /arcade/intro/addBorder.js | UTF-8 | 344 | 2.9375 | 3 | [] | no_license | function addBorder(picture) {
const rowLen = picture[0].length;
const columnLen = picture.length;
for (i = 0; i < columnLen; i++) {
picture[i] = "*" + picture[i] + "*";
}
picture.splice(0, 0, "*".repeat(rowLen + 2));
picture.splice(columnLen + 1, 0, "*".repeat(rowLen + 2));
... | true |
cf324a75eec3df4eb0885ac1dcc0a8d6a8457d14 | JavaScript | mstange22/HackerRank | /valid-string.js | UTF-8 | 1,552 | 3.609375 | 4 | [] | no_license | const fs = require('fs');
fs.readFile('test-files/test2.txt', 'utf8', (err, data) => {
console.log(isValid(data));
});
// Complete the isValid function below.
const isValid = (s) => {
const hashMap = {};
const freqMap = {};
for (let i = 0; i < s.length; i++) {
if (hashMap[s[i]]) {
hashMap[s[i]] += 1... | true |
d688e6039265eaab83326c560378eda7c14c8e91 | JavaScript | csierra325/Peregrinate | /client/src/components/PlanATrip/Car.js | UTF-8 | 2,655 | 3 | 3 | [] | no_license | import React, { Component } from "react";
class Car extends Component {
// Setting the initial values of this.state.username and this.state.password
state = {
userID: window.id,
id: window.id
};
// componentDidMount() {
// fetch("https://api.example.com/items")
// .then(res => res.json())
... | true |
015e6f2d5a50853cc37dedd3d3c0780539c5286f | JavaScript | sahariar229/deezer-importer | /src/api/index.js | UTF-8 | 1,934 | 2.65625 | 3 | [] | no_license | const DZ = window.DZ;
export function getDeezerTrack({artist, title}) {
return new Promise((resolve, reject) => {
let allowed = false;
let track = null;
setTimeout(() => {
console.log(allowed, track);
if (track !== null) resolve(track);
else allowed = tr... | true |
17d33c646c32f2ea25e9cb8ff9b90121cf3b23ae | JavaScript | npenin/njs | /test/js/promise_s26.js | UTF-8 | 3,746 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | var inherits = (child, parent) => {
child.prototype = Object.create(parent.prototype, {
constructor: {
value: child,
enumerable: false,
writable: true,
configurable: true
}
});
Object.setPrototypeOf(child, parent);
};
var BoxedPromise = (() =... | true |
d963fcae7fd087c2a1e495a472615c6a12b6448d | JavaScript | Mishon443/react | /main.js | UTF-8 | 636 | 3.671875 | 4 | [] | no_license | //let arr = [1,2,3,4,5,6,7,8,9,10]
//arr.forEach( (item, id) => {
// console.log(item)
//})
//arr.forEach( (item, id) => {
// if (id==4){
// console.log(item)
// }
//})
//arr.forEach( (item, id) => {
// if(item%2){
// console.log(item)
// }
//});
let arr = [-5, 12,-3,-2,0,16,-89,4,... | true |
d5209b76faa9dcec5d5b43abe54830d516344649 | JavaScript | Solowyhn/fa21-cse110-lab4 | /expose/javascript/part2-question18.js | UTF-8 | 382 | 4.09375 | 4 | [] | no_license | // both function works but be sure to call one function at a time.
// function 1
function time1(){
let d = new Date();
let time = d.toLocaleTimeString();
console.log(time);
}
time1();
setInterval(time1, 1000);
// function2
function time2(){
let d = new Date();
let time = d.toLocaleTimeString();
... | true |
201865634d6f4274eebe5d47ed5e0d91856419c9 | JavaScript | 14Anthony/5 | /assets/script.js | UTF-8 | 14,254 | 3.390625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
//--------formatting of the Clock database------------
const formNine = $('#nine');
const formTen = $('#ten');
const formEleven = $('#eleven');
const formTwelve = $('#twelve');
const formOne = $('#one');
const formTwo = $('#two');
const formThree = $('#thre... | true |
793e0fac0564d35fc3f2d203a56a903479849244 | JavaScript | windldream/leetcode | /string/strToInt.js | UTF-8 | 694 | 3.578125 | 4 | [] | no_license | /**
* @param {string} str
* @return {number}
*/
var strToInt = function (str) {
str = str.trim()
if (str.length === 0) return 0
const max = 2 ** 31 - 1
const min = -(2 ** 31)
const numReg = /\d/
let num = ''
for (let i = 0; i < str.length; i++) {
if (i === 0) {
if (str[i] === '+' || str[i] =... | true |
388f65b8365afd7922e4665a7ba013387bb3e7ef | JavaScript | omcrobbie/express-fimdb | /tests/dbtests.js | UTF-8 | 2,188 | 2.609375 | 3 | [] | no_license | var expect = require('chai').expect;
var request = require('supertest');
var app = require('../app');
var db = require('../db/db');
before(function(done){
db.favs.init(function(){
done();
});
});
after(function(done){
db.favs.destroy(function(){
done();
});
});
describe('Saving favorites:', function(){... | true |
0b02160eb9f20ca4920a76e8f12dc5d83dc2703a | JavaScript | millenniallglyphs/hugo-test | /hugo/static/js/library/sequence.js | UTF-8 | 1,624 | 3 | 3 | [
"MIT"
] | permissive | function Sequence(sela, selb, selc, seld, sele, self, selg, selh, seli, select){
this.seqa = "url('" + sela + "')";
this.seqb = "url('" + selb + "')";
this.seqc = "url('" + selc + "')";
this.seqd = "url('" + seld + "')";
this.seqe = "url('" + sele + "')";
this.seqf = "url('" + self + "')";
this.seqg = "ur... | true |
c4f70b4785a4beb1c987772bf6776e9a662a7ee5 | JavaScript | shubhamjuneja11/ProductGrid | /ajaxrequesthandler.js | UTF-8 | 297 | 2.71875 | 3 | [] | no_license | function AjaxRequestHandler(requestUrl) {
this.requestUrl = requestUrl;
}
AjaxRequestHandler.prototype.fetchData = function(callback) {
var _this = this;
$.ajax({
url: this.requestUrl,
dataType: "json"
})
.done(function(response) {
callback(response);
});
};
| true |
9f62145bc72892582a184f9866165ef73f667c0f | JavaScript | FernandaMaresi/node | /valores-duplicados.js | UTF-8 | 433 | 3.15625 | 3 | [
"MIT"
] | permissive | var assert = require('assert');
var haDuplicados = function(arr) {
var i;
for(i = 0; i < arr.length; i++) {
if(arr.indexOf(arr[i]) != i) {
return true;
};
}
return false;
}
//
// Seu teste
//
try {
assert.equal(true, haDuplicados([100, 200, 300, 300, 5... | true |
b19df2ac4e77413d639d646078da42e90528c082 | JavaScript | musthu1837/CryptDonate | /libraries/createdTime.js | UTF-8 | 1,517 | 3.046875 | 3 | [] | no_license | module.exports = function timeDifference(previous) {
previous = previous*1000;
var current = new Date().getTime();
var msPerMinute = 60 * 1000;
var msPerHour = msPerMinute * 60;
var msPerDay = msPerHour * 24;
var msPerMonth = msPerDay * 30;
var msPerYear = msPerDay * 365;
var e... | true |
db42611df34a940160149b696933ef0e419ea2aa | JavaScript | jstatus1/Fortune_Cuties | /src/pages/PokeDexPage.js | UTF-8 | 2,146 | 2.53125 | 3 | [] | no_license | import React from 'react'
import axios from 'axios'
import './Css/PokeDexPage.css'
class PokeDexPage extends React.Component
{
state = {
pokemon :[]
}
componentWillMount()
{
const promises = []
for(let i = 1; i <= 898; i++)
{
promises.push(axios.request({
... | true |
39152885d0533126fdc70ba4e804081e299c5d31 | JavaScript | AiNoKame/recursion | /src/getElementsByClassName.js | UTF-8 | 739 | 3.890625 | 4 | [] | no_license | // If life was easy, we could just do things the easy way:
// var getElementsByClassName = function (className) {
// return document.getElementsByClassName(className);
// };
// But in stead we're going to implement it from scratch:
var getElementsByClassName = function (className) {
// your code here
var results... | true |
3f630fb8c2fd7e9d40ef0fde84e0fe1754a04225 | JavaScript | moranp98/Couponzy | /server/controllers/ReviewController.js | UTF-8 | 2,582 | 2.53125 | 3 | [] | no_license | const firebase = require('../config/db_adminSdk');
const admin = require("firebase-admin");
const Review = require('../models/Review');
const addReview = async (req, res, next) => {
try {
const data = req.body;
console.log(data)
data.published_date = admin.firestore.Timestamp.now();
... | true |
ed2f05d120718f2681c784cf558dc11d63c04251 | JavaScript | mhsantosp/reto_javascriptGeekBook | /trabajo-virtual-geek-parte-dos/5-eventos/exercise-6/ejercicio6.js | UTF-8 | 352 | 3.25 | 3 | [] | no_license | let fondo = document.querySelector(".body");
function bg(event) {
let x = event.keyCode;
//console.log(x);
if (x === 114) {
fondo.classList.remove("bgMorado");
fondo.classList.add("bgRojo");
}
if (x === 109) {
fondo.classList.remove("bgRojo");
fondo.classList.add("bgMorado");
}
}
fondo.ad... | true |
fae8b4cef4d2c5cca17acf5a8bb49ebcf482475a | JavaScript | seo2im/Heap_Programers | /problem2/diskController.js | UTF-8 | 593 | 3.53125 | 4 | [] | no_license | const solution = (jobs) => {
let length = jobs.length;
let answer = 0;
let time = 0;
let pq = [];
while (true) {
jobs = jobs.filter(job => {
if (job[0] > time) {
return true;
} else {
pq.push(job);
}
})
if (pq.length === 0) {
if (jobs.length === 0) {
break;
} else {
time += 1... | true |
e51722686996df83d905c95b28c152ddd201d0ae | JavaScript | dxnxxlx/EjerciciosJS | /JS/Ejercicios tipos de datos, variables y operadores/Ejercicio1 - Division de numeros/main.js | UTF-8 | 197 | 3.546875 | 4 | [] | no_license | // Escribe aquí tu codigo Javascript
function division(){
var a= parseInt(prompt("Ingresar dividendo"));
var b= parseInt(prompt("Ingresar divisor"));
alert("Resultado: " + a/b)
}
division();
| true |
344f0141501fb4b18ba935f55aac5b51e01a9962 | JavaScript | krish1000/Extension_WebBlocker | /background.js | UTF-8 | 3,233 | 2.96875 | 3 | [
"MIT"
] | permissive | // //connect to html button
// const url1 = document.getElementById("submit");
// //event listeners
// url1.addEventListener("click", function () {
// getUrl();
// });
// //fetches url
// function getUrl() {
// console.log("fetched url sucessfully");
// var urlString = document.getElementById("wlist").value;
//... | true |
32cc20454fdf63f43d495081e9cdaef502f861c6 | JavaScript | angelzbg/SoftUni | /JS Programming Basics/PB Sample Exam - 23 February 2020/05.BachelorParty.js | UTF-8 | 559 | 3.53125 | 4 | [] | no_license | (input) => {
let priceTalent = Number(input.shift()), totalPrice = 0, guests = 0;
let line = input.shift();
while(line !== 'The restaurant is full') {
let count = Number(line);
guests += count;
if(count < 5) totalPrice += count*100;
else totalPrice += count*70;
line ... | true |
8bb9b63f4713930a7d351273dbddab634ffbcb3d | JavaScript | matteoinno/Form.Examples | /Form.Examples/Scripts/example_one.js | UTF-8 | 1,829 | 3.15625 | 3 | [
"MIT"
] | permissive | //every time that the value of the Mobile Phone field is changed, do this operation
$("#MobilePhone").change(function () {
//get the value of the MobilePhone field
var mobNum = $(this).val();
//the javascript replace uses regex. The \d search for digit characters.
//the replace get:
//1. the mobile... | true |
3a623e84e2bf9663c5d6c1bb5e3044e8a506a363 | JavaScript | shailza85/html-webpage-about-me | /js/scripts.js | UTF-8 | 125 | 3.203125 | 3 | [] | no_license | //console.log("Hello, World!");
//let userInput = prompt("Please enter a number to be cubed:");
//console.log(userInput**3);
| true |
cc2dd5e6b06b764674e6b40b31fc0143a58f5029 | JavaScript | GabCh/Babbler | /static/js/babbles_and_comments.js | UTF-8 | 9,939 | 2.90625 | 3 | [] | no_license | function like(id){
var request = new XMLHttpRequest();
request.open('POST', '/like', true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.onreadystatechange = function() {
if(request.readyState == XMLHttpRequest.DONE){
document.getElementById(... | true |
bf5f7471e6d9e4032668d40e3325b312a8115cb0 | JavaScript | iac-nyc/FSJS | /basics/math.js | UTF-8 | 998 | 4.59375 | 5 | [] | no_license | // announce the program
alert("Let's do some math!");
// declare program variables
// collect numeric input
var num1;
var num2;
var message;
num1 = prompt("Please type a number");
num1 = parseFloat(num1);
num2 = prompt("Please type another number");
num2 = parseFloat(num2);
if(num2 ===0){
alert("The second n... | true |
6efa0d9bcb179b326af5ca3bf5cc7cabd5584395 | JavaScript | karlhulme/github-action-analyse-issue-comment | /src/run.test.js | UTF-8 | 1,615 | 2.59375 | 3 | [
"MIT"
] | permissive | /* eslint-env jest */
const run = require('./run')
const createComment = (author, commentBody) => ({
user: {
login: author
},
body: commentBody
})
const createInput = (authorisedLoginsCsv, author, commentBody) => ({
authorisedLoginsCsv,
commentJson: JSON.stringify(createComment(author, commentBody))
})
... | true |
7bd407db2419cc30d2ab11e5c71f2528705fb223 | JavaScript | Romuch1/TestTreeJS | /js/app.js | UTF-8 | 4,368 | 3.140625 | 3 | [] | no_license | class TreeDiagram{
constructor(data,container){
this.data = this.modifyData(data);
this.container = document.querySelector(container);
}
modifyData(arr){
let tree = [],
mappedArr = {},
arrElem,
mappedElem;
for(var i = 0, len = arr.length; i < len; i++) {
arrElem = arr... | true |
49ba39dae53e14b53b3424a45459ec9361785b91 | JavaScript | GAMESJS-TEAM-NAME/superstition | /superstition/src/InputHandler/InputHandler.js | UTF-8 | 3,076 | 2.65625 | 3 | [] | no_license | class InputHandler {
checkPraying() {
if (PoseRecognition.pose != null) {
let leftWrist = {
x: PoseRecognition.pose.keypoints[9].position.x,
y: PoseRecognition.pose.keypoints[9].position.y
}
let rightWrist = {
x: PoseRecogni... | true |
0a1c8b40785842d9756fbb6cab0de7e8cd3ea82f | JavaScript | luciano-professor/bootcamp-fullstack-igti | /spending-control/frontend/src/pages/Main/index.js | UTF-8 | 7,734 | 2.703125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import Panel from '../../components/Panel'
import Launches from '../../components/Launches'
import Modal from '../../components/Modal'
import Category from '../../components/Category'
import API from '../../helpers/api.js'
import Format from '../../helpers/format.js'... | true |
6ac9f24545c54bd7b93e5dfd081ddf0de4a40708 | JavaScript | enginsozer/sample_app | /app/assets/javascripts/custom.js | UTF-8 | 255 | 3.140625 | 3 | [] | no_license | function countCharacters(text, targetID) {
var count = 140-text.length;
var text = (count != 1) ? "You have <b>" + count + "</b> characters left" : "You have <b>" + count + "</b> character left"
document.getElementById(targetID).innerHTML = text;
} | true |
7fefd15cfbcb5b37e50e514989f536fb2e0138fc | JavaScript | VardanMangasaryan/workfront_internship | /secondHomework.js | UTF-8 | 3,267 | 4.25 | 4 | [] | no_license | // 1. Insert a number. Print ‘yes’ if the number is prime, ‘no’ otherwise.
function isNumPrime(num) {
let isPrime = "yes";
let i = 2;
num = Math.abs(num);
if (num < 3) {
isPrime = "no"
} else {
while (i <= Math.round(num / 2)) {
if (num % i === 0) {
isPr... | true |
3c5badfdf2e843bd0b0d5121bb98783d46024b98 | JavaScript | dahun428-fx/gongsa2020 | /src/main/webapp/resources/js/mypage/myperformanceDetail.js | UTF-8 | 190 | 2.515625 | 3 | [] | no_license | $(function(){
activateMenu()
})
const activateMenu = ()=>{
$("#mypagemenu li").click(function(){
const req = $(this).data('href')
$(location).attr('href', req)
})
} | true |
4da156a5305a59a01e286fbfc083472c62fd6e34 | JavaScript | vanessamazhangara/Assessment-1 | /passwords.js | UTF-8 | 225 | 3.078125 | 3 | [] | no_license |
function verifyPswrd(word) {
if (word.length >= 10){
console.log('success')
} else {
console.log('password is not accepted')
}
}
const userPswrd = 'mazhangara'
console.log(verifyPswrd(userPswrd)) | true |
31e2f79c550b7b47063e75641a6439cee909cb3a | JavaScript | hanzhao1/dataStructures | /linkedListAddition.js | UTF-8 | 2,224 | 3.875 | 4 | [] | no_license | function ListNode(val) {
this.value = val;
this.next = null;
}
var addTwoNumbers = function(l1, l2) {
var tempHolder = 0;
var node1 = l1;
var node2 = l2;
var nodeHolder = [];
var valuesOfAddedNode = [];
var newList = null;
// var recurse = function (node1, node2, addedNode) {
// }
w... | true |
bc5c9679c56737301bbd7169d16cb4345cc98074 | JavaScript | AleksanderKarmazin/FullJS | /01FundamentalCoreJS/48/app.js | UTF-8 | 549 | 3.296875 | 3 | [] | no_license | let obj1 = {
name: 'Denis',
info: {
skills: ['html', 'css'],
},
};
let obj2 = {
name: 'Ivan',
age: 20,
};
let newObj = Object.assign({}, obj2, obj1);
newObj = Object.assign({}, obj1);
newObj = JSON.parse(JSON.stringify(obj1));
// console.log(newObj.info === obj1.info);
let keys = Object.keys(obj2);
con... | true |
2fe4d06f8ccdab5db53b3f63e87dde8454efd46b | JavaScript | jaconsta/wp_pvc_pricing | /src/modules/roofCalculator.js | UTF-8 | 1,161 | 2.796875 | 3 | [] | no_license | export const calculateRoofQuantities = (width, depth, waterfalls) => {
const widthOffset = width - 0.15
const roundWidth = Math.ceil(widthOffset)
const trueDepth = depth / 5
const area = trueDepth * roundWidth
const areaOffset = area - 0.2
const ceils = Math.ceil(areaOffset)
const botons = waterfalls - ... | true |
ef0b60d9eb5a4fe362e65e8664382c8e30070cfe | JavaScript | ama85bd/crud | /src/components/videos/AddVideo.js | UTF-8 | 2,235 | 2.546875 | 3 | [] | no_license | import React, {useState} from "react";
import axios from "axios"
import {useHistory} from "react-router-dom"
const AddVideo = () => {
let history = useHistory();
const [video, setVideo] = useState({
name: "",
views: "",
likes: ""
});
const { name, views, likes} = video;
con... | true |
e17b9739ee076bce213c89047a03053c3c5d1dd6 | JavaScript | InventivetalentDev/aoc2020 | /day04.js | UTF-8 | 3,081 | 3.140625 | 3 | [
"MIT"
] | permissive | 'use strict'
const util = require("./util");
// Part 1
// ======
const requiredFields = {
"byr": function (v) {
let p = parseInt(v);
return v.length === 4 && p >= 1920 && p <= 2002;
},
"iyr": function (v) {
let p = parseInt(v);
return v.length === 4 && p >= 2010 && p <= 20... | true |
7e9e15a4cbc102df122dfb43d584425e81a654ca | JavaScript | zahidyew/react-practice | /src/components/todos/Todos.js | UTF-8 | 701 | 2.609375 | 3 | [] | no_license | import {useState, useEffect} from 'react'
import TodoItem from './TodoItem'
const Todos = ({match}) => {
const [todos, setTodos] = useState([])
useEffect(() => {
const fetchTodos = async () => {
const url = 'https://jsonplaceholder.typicode.com/todos?userId=' + match.params.userId
const ... | true |
0423d1c4931c153f93f21753c26d82adb28e5f1d | JavaScript | MateusOli21/mobile-clones | /social-app/src/firebase/api.js | UTF-8 | 1,793 | 2.65625 | 3 | [] | no_license | import { firebase, firestore, firebaseAuth } from "./config";
const FirebaseApi = {
getCurrentUser: () => {
return firebaseAuth.currentUser;
},
createUser: async (user) => {
try {
await firebaseAuth.createUserWithEmailAndPassword(
user.email,
user.password
);
const uid... | true |
2e67951bf84255dea40e66c4473aeab0b7fdb07b | JavaScript | vladberg/merimoto | /admin/js/encuestaie.js | UTF-8 | 1,447 | 2.625 | 3 | [] | no_license | // JavaScript Document
function agregar()
{
num=$("#total_reg").val();
num2=parseInt(num)+1;
document.getElementById("total_reg").value=num2;
var tabla='<div id="tabla'+num2+'" style="padding-top:3px;">'
+'<dl>'
+'<dt><input id="idrespuesta'+num2+'" name="idrespuesta'+num2+'" type="hidden" value="... | true |
a694afea1c4f04abede06e823f7c0488e6051c85 | JavaScript | CharlesDeFarias/Code-Wars | /all star 15.js | UTF-8 | 441 | 3.578125 | 4 | [] | no_license | //https://www.codewars.com/kata/586560a639c5ab3a260000f3/train/javascript
function rotate(str){
let strArray = str.split("");
let answer = strArray.reduce((acc, curr, index)=>{
let element = []
element.push(strArray.slice(index+1).join(""))
element.push(strArray.slice(0, index-strArray.length).join("")... | true |
1195f6da36ce389eb33367494cf9333f3ab67a97 | JavaScript | mubaidr/brain.js | /src/layer/transpose.js | UTF-8 | 766 | 2.78125 | 3 | [
"MIT"
] | permissive | import Base from './base';
import makeKernel from '../utilities/make-kernel';
export default class Transpose extends Base {
constructor(inputLayer) {
super();
this.inputLayer = inputLayer;
this.width = this.inputLayer.height;
this.height = this.inputLayer.width;
this.validate();
}
setupKerne... | true |
a177fe10ee8acf7933d753ef5bf36da3376d4117 | JavaScript | CarlosAngulo/javascript-spa | /app/helpers/ajax.js | UTF-8 | 534 | 2.6875 | 3 | [] | no_license | import api from './api.js';
export function getAjax(url) {
console.log(url)
return fetch(url, {
method: 'GET',
headers: api.HEADERS
})
.then( res => res.ok? res.json(): Promise.reject(res))
.catch( err => {
let message = err.statusText || 'An error occurs accessing to the A... | true |
62bf49a7ee19d4f24aa8895a201f66fe30a1a4f9 | JavaScript | sobermrz/Social_media | /DEVCONNECTOR/client/src/reducers/alert.js | UTF-8 | 594 | 2.796875 | 3 | [] | no_license | /* eslint-disable import/no-anonymous-default-export */
import {SET_ALERT, REMOVE_ALERT} from '../actions/types'
const initialState = []
//action include the new data, nad will be updated to initialState
export default function(state = initialState, action){
const {type, payload} = action//comes from action/alert.j... | true |
71f2f2c588147f7706f13ed77baa01a4e227f921 | JavaScript | adrianshep/count-to-6 | /destructuring.js | UTF-8 | 2,888 | 4.71875 | 5 | [] | no_license | let userArray = process.argv.slice(2);
// userArray here equals e.g. [1, "jdoe", "jdoe@example.com", "John", "Doe"]
let data = {};
// what goes here?
[, data.username, data.email] = userArray;
console.log(data); // {username: "jdoe", email: "john@doe.com"}
/*
Here's the official solution in case you want to compar... | true |
6ab0f9f35b9c0a9030504b1aa42f045b782b966d | JavaScript | JuliuszG/MERN-Ecommerce | /utility/errorHandlers.js | UTF-8 | 1,330 | 2.640625 | 3 | [] | no_license | exports.handleErrors = (err) => {
let error = { email: '', password: '', name: '', response: '' }
if (err.code === 11000) {
error.email = "Ten email już jest używany"
return error
}
if(err.message.includes('user validation failed')) {
Object.values(err.errors).forEach(({propert... | true |
b472b19d823997625accffe58e0122bb89962882 | JavaScript | LadybugRiders/kimisrescue | /assets/behaviours/common/trigger_move_camera.js | UTF-8 | 3,449 | 2.515625 | 3 | [] | no_license | "use strict";
//>>LREditor.Behaviour.name: TriggerMoveCamera
//>>LREditor.Behaviour.params : {"messageObject" : {}, "otherNotified":null, "activeCountLimit": 0, "targetX":0,"targetY":0,"speed":10,"yoyo":false,"relative":false}
var TriggerMoveCamera = function(_gameobject){
LR.Behaviour.Trigger.call(this,_gameobject)... | true |
7f97e09b0b342f0f5894008e5a2f3244ac326718 | JavaScript | alfonsocv12/sofeEquipo3Fase4 | /problema1.js | UTF-8 | 1,781 | 3.65625 | 4 | [] | no_license | //PROBLEMA 1
//const array = [-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20];
const array = [0, 1, 2, 4, 6, 7, 8, 11, 12, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32,
33, 35, 36, 37, 38, 39
];
//const array = [-3, -2, -1, 2, 10, 15,16 ,18,19,20];
let contado... | true |
9a6d6667b07933fd717d40da5ec6e01fa8f8cb46 | JavaScript | YuliyaMikhaleva/vueshopjs2 | /js/productComponent.js | UTF-8 | 3,146 | 2.796875 | 3 | [] | no_license | "use strict";
//Компонент для каждого продукта
const product = {
props: ['product'],//передали массив товаров и картинку с помощью атрибутов, принимаем с помощью props
template: `
<div class="main-products-product" >
<img class="main-products-product-img" :src="product.img" alt="phot... | true |
4de4a87f0c5c77a28fa6fc8f2e73b0221e08f849 | JavaScript | wilcc/foolin-with-booleans | /main.js | UTF-8 | 2,184 | 3.25 | 3 | [] | no_license | /********************
* YOUR CODE BELOW! *
********************/
const iGetTheJoke = true;
const havingFun = false;
const learning = false;
const killingIt = iGetTheJoke && havingFun;
function returnFalse(always){
return false
}
function isOpposite(yes){
return !yes
}
function both(boolean,boolean2){
return... | true |
96359b9a7b50cac28ad43a8ab18799ca9ff2f9c6 | JavaScript | syysummer/gshop-client | /src/api/ajax.js | UTF-8 | 660 | 2.84375 | 3 | [] | no_license | /*发送ajax请求*/
import axios from "axios";
export default function ajax(url,data = {} ,type = "GET") {
return new Promise(function (resolve, reject){
let promise
if(type === "GET"){
let queryStr = "";
Object.keys(data).forEach(key => {
queryStr += key + "=" + data[key] + "&";
});
... | true |
f3ea849038781e0629245c4630c400c2f201521b | JavaScript | Lopeca/Web-Image-Editor-webgl | /www/brush.js | UTF-8 | 3,975 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | var brushWidth = 20;
var eraserWidth = 30;
var isDrawing = false;
var isErasing = false;
var init;
function toolBrushInit(){
//이미지의 왼쪽 상단좌표를 영점으로 설정한다
init={
'x':$('#editor .contents ').offset().left,
'y':$('#editor .contents ').offset().top
}
//캔버스 가져오기
var context = document.ge... | true |
03991daa18b0e7bb5718654f158d608929d7814c | JavaScript | destinmoulton/rssenal | /src/server/api/controllers/Entries.controller.js | UTF-8 | 4,259 | 2.625 | 3 | [
"MIT"
] | permissive | import feedparser from "feedparser-promised";
import moment from "moment";
import logger from "../../lib/logger";
import Entries from "../models/Entries.model";
import Feeds from "../models/Feeds.model";
class EntriesController {
async get(req, res) {
try {
await this._updateFeedEntries(req.q... | true |
c81bc81e4947c75b7d76cdde8f81327a9aba7795 | JavaScript | LuisHansen/shortsighted | /popup.js | UTF-8 | 854 | 2.96875 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function () {
document.getElementById('range').addEventListener('input', function (event) {
update(event);
});
function remove() {
chrome.storage.sync.get('disabled', function(value) {
let disable = false;
if (value) {
disable = !value;
}
chrome.stora... | true |
940c607cdc36fb48068e9d5ba14d0d04a0dd0ec8 | JavaScript | tyrken/TabProject | /cext/js/Link.js | UTF-8 | 1,512 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | define(function() {
"use strict";
function Link() {
if (!(this instanceof Link)) {
throw new TypeError("Link constructor cannot be called as a function.");
}
this.title = null;
this.url = null;
this.favIconUrl = null;
this.tabId = 0;
this.tabI... | true |
0c40d85bffdf7e9654b8743faf3af7121ed2174a | JavaScript | wedding-planner-portfolio/back-end | /api/routes/postRouter.js | UTF-8 | 1,968 | 2.5625 | 3 | [] | no_license | const router = require("express").Router();
const Post = require("./postModel");
const restricted = require("../../auth/restricted-middleware");
router.get("/", async (req, res) => {
try {
const posts = await Post.getAll();
res.status(200).json(posts);
} catch (err) {
res.status(500).json({ error: "E... | true |
6a0d62c1d26b165629d0d0cd2980199950478382 | JavaScript | khorevaa/frontend | /media-server-mock/Participant.js | UTF-8 | 2,211 | 2.921875 | 3 | [] | no_license | /**
* All established connections, stored by ID as a key.
*/
const connections = {}
/**
* All connected users, stored by ID as a key and list of rooms IDs they are
* connected to.
*/
const usersRooms = {}
/**
* Checks if there is connection with provided it. If it exists, sends message
* to the client.
*
* @... | true |
e0c9845916d02db1798f59f5b941af77148284c9 | JavaScript | careabout/notifications | /workers/sendNotifications.js | UTF-8 | 1,786 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | var logger = require('logfmt')
var request = require('superagent')
if (process.env.NODE_ENV !== 'production') {
require('dotenv').config()
}
getDecisions()
function getDecisions () {
request
.get('https://care-about.herokuapp.com/v1/decisions/?processed=false')
.set('Accept', 'application/json')
.end... | true |
fa406af40b8ae9d1aaf6b7fc7a4401c50c8fd23e | JavaScript | kirangps/codemonk | /src/App.js | UTF-8 | 2,264 | 3.453125 | 3 | [] | no_license | //for displaying single name (getting correct output)
import React, { Component,useState } from 'react'
class App extends Component {
constructor(props){
super(props);
this.state ={value : " ",name:' '}
this.handleChange=this.handleChange.bind(this);
this.handleSubmit=this.handleSubmit.bind(this);
}
handl... | true |
6172ed108e15771cdd267b1ed21c2f31c1c03598 | JavaScript | alyonafomenkova/436447-kekstagram | /js/form.js | UTF-8 | 4,488 | 3.140625 | 3 | [] | no_license | 'use strict';
(function () {
var HASHTAG = {
pattern: /^#[А-Яа-яЁёA-Za-z]{1,19}$/,
// ^# - не символ #
// [А-Яа-яЁёA-Za-z] - любая буква независимо от регистра и языка
// $ - регулярными выражениями, следует искать только в конце строки
maxCount: 5
};
var ValidityMessage = {
tooManyHashta... | true |
fc9be678a8e6971bdbee864687c3e786fbdc5e13 | JavaScript | anthony-tran2/c0621-code-solutions | /the-event-loop/timeout.js | UTF-8 | 187 | 2.828125 | 3 | [] | no_license | console.log('Hello, just wait a minute...');
const thanks = () => {
clearTimeout(timeoutID);
return console.log('Thanks for waiting!');
};
var timeoutID = setTimeout(thanks, 2000);
| true |
8e419e0b29e5da66a300ff64ed7023bd9cc8ca54 | JavaScript | future4code/Micheline_Barros | /semana15/node-npm/src/exercicio1c/exe1c.js | UTF-8 | 213 | 3.390625 | 3 | [] | no_license | //c)
const nome = process.argv[2]
const idade = process.argv[3]
const idadeMaisSete = Number(process.argv[3]) + 7
console.log(`Olá, ${nome}! Você tem ${idade} anos. Daqui 7 anos você terá ${idadeMaisSete}.`) | true |
3ba17568e0513cee27ed0c162b9dbf1f8895f1d3 | JavaScript | ptgrogan/fss-ofs | /lib/groundStation.js | UTF-8 | 2,267 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015 Paul T. Grogan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | true |
eb81a14f9c7bee4aa73fa7c2127a1ecf50d559de | JavaScript | jeffwcx/bilibala | /test/unit/specs/type.test.js | UTF-8 | 2,585 | 2.984375 | 3 | [
"MIT"
] | permissive | import { Bilibala } from '../../../src'
import { expect } from 'chai'
import { createSingleContainer, transformHTMLBlank } from './common'
describe('#type()', () => {
beforeEach(() => {
createSingleContainer()
})
it('normal typing', (done) => {
const container = document.getElementById('container')
... | true |
f5fe67a04d662180c766aaef71b6ebbc207dd139 | JavaScript | happybridge14/redouble | /src/model/core/__tests__/seat-tests.js | UTF-8 | 938 | 2.59375 | 3 | [
"MIT"
] | permissive | import {Seat} from '../seat';
describe("Seat", () => {
describe("rotate", () => {
it("rotates through all the seats", () => {
let seat = Seat.South;
seat = Seat.rotate(seat, 1);
expect(seat).to.equal(Seat.West);
seat = Seat.rotate(seat, 1);
expect(seat).to.equal(Seat.North);
seat = Seat.rotate(se... | true |
f05a99261e7bc454f07935400af89de6340643d1 | JavaScript | deco52/YOLPTourApp | /south-nagano-tour.js | UTF-8 | 5,691 | 2.84375 | 3 | [] | no_license | var map, cityData;
/**
* 初期処理
*/
function initialize() {
map = new Y.Map("map");
map.drawMap(
new Y.LatLng(35.444557, 137.840175),// ツアーの中心の緯度経度
12,// ズームレベル
Y.LayerSetId.NORMAL// 通常地図を指定
);
// 行えるコントロールの種類を指定
map.setConfigure("scrollWheelZoom", true);
map.addControl(new Y.LayerSetControl());
map.addCon... | true |