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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
20ef6103e0492368f794c524189dc1dcd4879a62 | JavaScript | jjlakin/thermostat | /spec/ThermostatSpec.js | UTF-8 | 1,728 | 3.234375 | 3 | [] | no_license | describe('Thermostat', function() {
var thermostat;
beforeEach(function() {
thermostat = new Thermostat();
});
describe('has a temperature', function() {
it('of 20 by default', function() {
expect(thermostat.temperature).toBe(20);
});
it('that increases with up input', function() {
thermostat.a... | true |
aad977a03aa33afaedd2723ecb9efe4e9e4297d5 | JavaScript | a0071421/Yi-Spaces | /js/all.js | UTF-8 | 2,142 | 2.8125 | 3 | [] | no_license | Vue.component("country-modal", {
template: "#country-component",
props: ["country"],
data() {
return {};
},
});
Vue.component("pagination", {
template: "#pagination-component",
props: ["paginationInfo"],
data() {
return {
pagination: this.paginationInfo,
};
},
methods: {
changeD... | true |
08853a71c812de4d1bf7436fac6eb49ea9f41dca | JavaScript | mb11797/Automate-Hackerrank-Challenge-Creation-Updation-And-Moderator-Addition-using-Selenium | /Fair/add_moderator.js | UTF-8 | 4,598 | 2.546875 | 3 | [] | no_license | let fs = require("fs");
require("chromedriver");
let swd = require("selenium-webdriver");
let bldr = new swd.Builder();
let driver = bldr.forBrowser("chrome").build();
let cFile = process.argv[2];
let userToAdd = process.argv[3];
//function banate hi usko call kar diya
(async function(){
try{
await login... | true |
53d9ab03eb5cd214bd4f1a12bf9f87ab1e4fb38c | JavaScript | RamonFrancisco/my-reads | /src/components/Search.js | UTF-8 | 1,824 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import * as BooksAPI from '../utils/BooksAPI';
import { findKey } from 'lodash';
import Book from './Book';
import sortBy from 'sort-by';
const Search = ({shelfs, moveShelf, books}) => {
const [ text, setText ] = useState('');
const ... | true |
9025bf03d272329be875d1d3bbddcceb0b7d2264 | JavaScript | epressmedia/ePressMedia3 | /ePressMedia/obj/Release/Package/PackageTmp/Mobile/Scripts/knn_mobile_map_helper.js | UTF-8 | 6,214 | 2.546875 | 3 | [] | no_license | $(document).ready(function () {
$("[tag='gmap']").click(
function () {
var lat2, lon2, lat1, lon1;
lat2 = document.getElementById("ctl00_lat2").value
lon2 = document.getElementById("ctl00_lon2").value
lat1 = document.getElementById("ctl00_lat1").value
... | true |
d165edc68420cc0e536d2931fd97cc92a4159626 | JavaScript | christopher-guy-rhodes/barbarian | /js/obstacles/ObstaclesBuilder.js | UTF-8 | 1,557 | 3.453125 | 3 | [
"MIT"
] | permissive | /**
* Class to build a collection of obstacles.
*/
class ObstaclesBuilder {
/**
* Create an obstacles builder.
*/
constructor() {
this.obstacles = {};
}
/**
* Set the obstacles for the screen number and direction.
* @param screenNumber the screen number
* @param dire... | true |
ad085b8931aa314f7cd18b81e611ffc66c643f17 | JavaScript | yafey/react-javascript | /webpack-demos/webpack-demo10/main.js | UTF-8 | 972 | 3.265625 | 3 | [] | no_license |
require("./a")
require.ensure([],function(require){
require("./b")
})
/*
1. require.emsure(depencies,callback,chunkname);
第一个参数是模块依赖,第二个参数是回调函数,回掉函数的参数是require,
所以可以继续在回掉里面引入模块,第三个是chunk 的名称通过提供 require.ensure() 不同执行点相同的名称,我们可以保证所有的依赖都会一起放进相同的 文件束(bundle)。
2. depencies为空,如上所示,.b.js会被单独打包(从bundle.js中分离出来)。生成一个新的bu... | true |
728dfe325a081f8f664cb60d5d6f689b959f7584 | JavaScript | tonyponyy/Pagina-personal | /proyectos/tarot/taroot.js | UTF-8 | 13,707 | 3 | 3 | [] | no_license |
var baraja = [];
// posicion de cada carta ( true --> del derecho false --> del reves )
var pos_baraja =[];
for (var i = 0; i < 22; i++) {
baraja[i]=i+1;
}
shuffle(baraja);
giracartas(pos_baraja);
function Nrandom(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function giro(){
pos = f... | true |
9a0da30cafd63f36bfc30961f4de4fa98ff7a636 | JavaScript | heycam/gaia | /test_apps/demo-keyboard/js/shiftkey.js | UTF-8 | 2,314 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /*
* This module is responsible for handling the shift key and for
* auto-capitalization.
*/
(function(exports) {
'use strict';
var lastShiftTime = 0;
var currentPageView;
// Max time bewteen taps on the shift key to go into locked mode
const CAPS_LOCK_INTERVAL = 450; // ms
KeyboardTouchHandler.addEv... | true |
332e5ae54b34de2a2c852b7b568e0d48fdafd5d5 | JavaScript | bimajanur/capsaSusun | /assets/scripts/scoringController.js | UTF-8 | 9,449 | 2.609375 | 3 | [
"MIT"
] | permissive | const CardRanking = require("./lib/cardRankingHandler");
const AutoMove = require("./lib/autoMoveHandler");
cc.Class({
extends: cc.Component,
properties: {
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
// get player card
let handoutCard = cc.sys.localStorage.getItem("handoutCard... | true |
c4055f14bec34b3ea5a49847dadfb3450d5d53b8 | JavaScript | yash2531/react-image-search | /src/Components/search.js | UTF-8 | 4,237 | 2.59375 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
const SearchPage = (props) => {
const [searchInput, setSearchInput] = useState("");
const [result, setResult] = useState([]);
const [loader, setLoader] = useState(true);
const [modalOpen, setModalOpen] = useState(false);
const [pho... | true |
9ba54e83fc65afa43ac7d37731f343266ee594d5 | JavaScript | chingu-voyage7/Bears-Team-02 | /backend/database/index.js | UTF-8 | 647 | 3.453125 | 3 | [] | no_license | const readline = require('readline')
const seedWithCSV = require('./seed1')
const seedWithSheets = require('./seed2')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
// gives the user the choice to seeding with a local csv file or using the Sheets API
function getSeedOption()... | true |
134fe0c36c904bdcf94b14e0cb8aadff849fd80f | JavaScript | vjvalentin/Matrix | /matrix.js | UTF-8 | 5,072 | 3.46875 | 3 | [] | no_license | /* matrix.js
@Author Vincent J. Valentin
@email vincentj*valentin->gmail
@Date 2/13/21
@Version 1.3.2.1.5.x.superserial.0914y2k experimental nightly build
@License I don't care v4.1 - I don't care what you do with this code. Use it, steal it,
sell it, change it, make fun of it, print it out an... | true |
64bfe6985ffddbdc82278cbf7575c053064949ca | JavaScript | rodeok/dicegame | /app.js | UTF-8 | 931 | 3.421875 | 3 | [] | no_license | function myFunction(){
document.getElementById("demo").innerHTML
//generate random numbers
const firstRandomNum = Math.floor(Math.random() * 6) + 1;
const firstDiceImage = './img/dice' + firstRandomNum +'.png';
document.querySelectorAll ('img')[0].setAttribute ('src', firstDiceImage);
//document.querySelectorAll('img'... | true |
29bd2cd10d1467dea33bef2154acf99383ef339e | JavaScript | lixt/node-pigeon-client | /lib/util/type.js | UTF-8 | 3,144 | 2.6875 | 3 | [] | no_license | 'use strict';
require('rootpath');
var _ = require('underscore');
/*
*
* Constants.
*
*/
var PRIMITIVES = [
'int',
'long',
'double',
'boolean',
'java.lang.Integer',
'java.lang.Long',
'java.lang.Double',
'java.lang.Boolean',
'java.lang.String',
'java.util.Date'
];
function check(javaObject) {... | true |
b2912f79c04b0d0401747adc24c481a091b187be | JavaScript | ajithnaruto/AICTE | /AICTE1/WebContent/forms/js/stuval.js | UTF-8 | 3,321 | 2.53125 | 3 | [] | no_license | function formValidation() {
var sname=document.student.sname;
var instid = document.student.instid;
var uidai = document.student.uidai;
var gender=document.student.gender;
var level= document.student.level;
var reg_no=document.student.reg_no;
var dob = document.student.dob;
var mail = document.student.mail;
var contac... | true |
cdc5309caaafd5a81ea2e9a747c330b443e0e3f2 | JavaScript | RaspberryJamUoA/backend | /src/routes/rootRouter.js | UTF-8 | 450 | 2.671875 | 3 | [] | no_license | const {Router} = require('express');
const router = Router();
// Homepage - GET /
router.get('/', function(req, res, next) {
res.send(`
<h1>Express API</h1>
<p>For some reason, you've managed to end up on this page.</p>
<p>You can access the back-end from here, by making API requests</p>
<p>Don't kn... | true |
9402898c10419fa533ed719ca4fa81abac5efabb | JavaScript | Melvintehu/MENtechmedia-CMS | /resources/assets/js/cms/app/inputController/timeInputController.js | UTF-8 | 772 | 2.875 | 3 | [] | no_license | import InputController from './inputController';
class TimeInputController extends InputController{
boot() {
this.hour = "";
this.minutes = "";
this.createFinalTime();
}
onChange() {
this.createFinalTime();
}
onInsert(input) {
let values =... | true |
fc85b94042c7f46a5adc3322dd79a8b421c29a95 | JavaScript | Strate/i18nlib | /js/test/address/test/testaddress_GQ.js | UTF-8 | 16,925 | 2.6875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* testaddress_GQ.js - test the address parsing and formatting routines
*
* Copyright © 2013-2015, JEDLSoft
*
* 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.apac... | true |
925ab036a2e1c30960884c83765e1027251490d9 | JavaScript | CorSar5/Web-modern-course | /04.Object/02-Revisioning_Object.js | UTF-8 | 898 | 3.4375 | 3 | [] | no_license | //Dynamic collection of key/value
const product = new Object
product.name = 'Chair'
product["product brand"] = 'Generic'
product.price = 220
console.log(product)
delete product.price
delete product['product brand']
console.log(product)
const car = {
model : 'A4',
value:89000,
owner :{
name: 'Willi... | true |
53ded9e806759511f2dfa75fcf36fee41213ac12 | JavaScript | archivist/substance | /src/document/nodes/list.js | UTF-8 | 1,566 | 2.625 | 3 | [] | no_license | 'use strict';
var _ = require('../../basics/helpers');
var DocumentNode = require('../node');
var List = DocumentNode.extend({
name: "list",
properties: {
ordered: "bool",
items: ["array", "id"]
},
getItems: function() {
var doc = this.getDocument();
return _.map(this.items, function(id) {
... | true |
45802ee0c5cc0b998a51186ca1b8483e9f642252 | JavaScript | banrenma/project | /server/js/db/dbusers.js | UTF-8 | 1,705 | 2.5625 | 3 | [] | no_license | var db = require('./dbconnect.js')
var Schema = db.Schema;
//用户信息数据库
//
// var userInfo = new Schema({
// phoneNumber:String,
// question:Array
// })
//level 用户等级 0 超级管理员 1 管理员 2 普通用户
var usersSchema = new Schema({
name: String,
email: String,
password:String,
level:Number,
// userinfo:userInfo
})
var Users... | true |
0936aba6941690f1d5a501e98ffeb9ee55a11a06 | JavaScript | apapacy/beauty-lab | /server/core/orm/range.js | UTF-8 | 897 | 2.703125 | 3 | [] | no_license | export default class Range {
constructor(Model, modelsArr, count = null) {
this.Model = Model
this.length = 0
this.count = count
Array.prototype.push.apply(this, modelsArr)
}
toJSON() {
let obj = {}
for (let key in this) {
if (key === 'Model') continue
obj[key] = this[key]
}
return obj
}
... | true |
2ae7f81de6de1c4d1a75c369153e47e17cf0ab60 | JavaScript | MGabriel97/Medication | /Medication/target/classes/static/caregiverupdate.js | UTF-8 | 789 | 2.703125 | 3 | [] | no_license | function myFunction(){
var name1 = "";
var id1 = "";
var address1 = "";
var gender1 = "";
var x = document.getElementById("frm2");
for (i = 0; i < x.length ;i++) {
if(i==0)
{
id1=x.elements[i].value;
}
if(i==1)
{
name1=x.element... | true |
fd9b76afab4a916e79d0080a2463470acc0a03c1 | JavaScript | sam33872/Web3DResit | /assignment/application/js/flickrService.js | UTF-8 | 2,208 | 3.40625 | 3 | [] | no_license | // JavaScript Gallery Generator using Flickr to source the images
$(document).ready(function () {
// Call the loadImage method , you can comment his out if you don't want it to load immediately
//loadImages("Pepsi Can");
loadImages("cokezero");
});
function loadImages(txtInput) {
// Grab th... | true |
dffcdcc27f305f7606a3cb7666175ec6fa7ca61a | JavaScript | noriaki/d3594-databook | /libs/identify.js | UTF-8 | 624 | 2.796875 | 3 | [
"MIT"
] | permissive | const { createHash } = require('crypto');
const humanizeId = ({ name, rarity, special, team, army }) => {
const nameSuffix = special !== null ? `(${special})` : '';
return `\u2605${rarity}\u30FB${name}${nameSuffix}\u30FB${team}\u30FB${army}`;
};
const identify = (identifier) => (
typeof identifier === 'string' ... | true |
cbf53de69c06c9356df53a40e6540f294b2535ee | JavaScript | toos112/html-code | /root/main.js | UTF-8 | 1,690 | 2.8125 | 3 | [] | no_license | function check(func) {
var success = false;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "auth/check.js?user=" + getCookie("user") + "&uuid=" + getCookie("UUID"), true);
xmlhttp.send();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
if (this.responseTex... | true |
f2dce1412ba1539f40fbf2ac38ae0b2bcce3370e | JavaScript | jrloom/team-builder | /team-builder/src/Components/Form.js | UTF-8 | 1,971 | 2.75 | 3 | [] | no_license | import React, { useState } from "react";
import { teamMemberRoles } from "../data";
const Form = props => {
const [teamMember, setTeamMember] = useState({
name: "",
email: ""
});
const handleChange = event => setTeamMember({ ...teamMember, [event.target.name]: event.target.value });
const handleSubm... | true |
25f08a006072bf54de2e8c883c7168e825274623 | JavaScript | mamyh/baper-hotel | /js/login.js | UTF-8 | 850 | 2.953125 | 3 | [] | no_license | const submitButton = document.getElementById('login-submit');
submitButton.addEventListener('click', function (e) {
e.preventDefault();
const emailInput = document.getElementById('email-input');
const passwordInput = document.getElementById('password-input');
const error = document.getElementById("error... | true |
1d49c3ba9231e40379d4b0b40413cafce1c25df1 | JavaScript | kyawthura-gg/covid19burma-vue | /src/assets/js/cluster.js | UTF-8 | 5,575 | 2.53125 | 3 | [] | no_license | var width = 1000,
height = 900;
var color = d3.scale.category20();
var force = d3.layout
.force()
.charge(-120)
.linkDistance(100)
.size([width, height]);
var svg = d3
.select(".cluster")
.append("svg")
.attr("width", width)
.attr("viewBox", "10 100 1000 750")
.attr("height", ... | true |
1cb285f763cdb6d05fe49393e1f467391eaa52e8 | JavaScript | djirotechno/raspi-sensors | /assets/js/jquery.gNotifier2.js | UTF-8 | 6,050 | 2.671875 | 3 | [] | no_license | /**
* jQuery plugin for simple notifications
*
* @author ShevAbam <shevarezo.fr>
*
* [ Usage ]
*
<script>
function run(type)
{
$('body').gNotifier2({
'title' : 'Hello World!',
'text' : 'Lorem ipsum in dolor sit amet',
'type' : type,
... | true |
cbb20149c4d8bca9b3f9f856bdb47e163af69bfb | JavaScript | genew70665/WeatherApp | /app.js | UTF-8 | 395 | 3.140625 | 3 | [] | no_license | /* Read api info */
window.addEventListener('load',() =>{
let long;
let lat;
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(position =>{
long=position.coords.longitude;
lat=position.coords.latitude;
alert("The longitude is " + long + " and t... | true |
884b766a3b95fcc610375d86a3e135cd4e7a9a10 | JavaScript | Ranisans/fancy-weather | /fancy-weather/src/logic/BlocksHandler.js | UTF-8 | 1,333 | 2.640625 | 3 | [] | no_license | import { blocksName, weatherBlocksClasses } from '../gui/constants';
class BlocksHandler {
constructor(blocks) {
this.blocks = blocks;
}
translate(language) {
blocksName.forEach((blockName, i) => {
// if not futureWeatherBlock
if (i !== blocksName.length - 1) {
this.blocks[blockName]... | true |
a4ac4a97188318cc548518764f47a5ffdb2c7103 | JavaScript | gurpreet29/iselect | /src/filters/decimalVal.js | UTF-8 | 285 | 2.5625 | 3 | [] | no_license | /**
* decimalVal */
export default function decimalVal() {
return item => {
if (item != null) {
let val = item.split('.');
if (val.length > 0) {
return val[1].substr(0, 2);
} else {
return val;
}
} else {
return 0;
}
}
}
| true |
ffae86d3b26688d187bac87dd248239eb7fbe2d4 | JavaScript | pac117/proyecto2 | /js/main.js | UTF-8 | 4,548 | 2.859375 | 3 | [] | no_license | let buscarFormulario = document.getElementById("form_buscar");
let entradaDatos = document.getElementById("input");
var contenido = document.querySelector("#contenido");
//Listeners
buscarFormulario.addEventListener("submit", function(e) {
console.log('listener de submit');
e.preventDefault();
let query = entra... | true |
9065b12190b764db990202e238be1baab5ff2f11 | JavaScript | goldsamantha/RCworkshopMultiPlayerGame | /public/js/app.js | UTF-8 | 1,684 | 3.125 | 3 | [] | no_license | function init(){
var socket = io();
var gameArea = document.getElementById('game_area');
var initialScreen = document.getElementById('initial_screen').innerHTML;
gameArea.innerHTML = initialScreen;
var startButton = document.getElementById('start_button');
startButton.addEventListener('click', function(){
... | true |
26b07af30996bdc739b9bfe82514db209c7fd3b3 | JavaScript | nagarajugali/rock-paper-scissors | /app.js | UTF-8 | 2,629 | 3.828125 | 4 | [] | no_license | var user=0;
var computer=0;
const userscore_span=document.getElementById("userscore");
const computerscore_span=document.getElementById("computerscore");
const scoreboard_div=document.querySelector(".score-board");
const result_div=document.querySelector(".result");
const rock_div=document.getElementById('r');
c... | true |
39aba5dfec0723b2f6e3539e69a6c10ce99aaaa2 | JavaScript | jcorpus/Repositorio_escuela | /html/javascript/datos_usuario.js | UTF-8 | 3,593 | 2.75 | 3 | [] | no_license |
function validar_email_alumno(){
var email = $("#email_alumno");
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (email.val() == '' || !re.test(email.val()))
{
$("#email_alumno"... | true |
a8ea21cf204b53b75f59ff9b18c1685a753577d4 | JavaScript | PommedeR/Frontend-website | /basiswebsite/scripts/script.js | UTF-8 | 673 | 2.78125 | 3 | [] | no_license | // JavaScript Document
console.log('script');
var menuButton = document.querySelector ('#menu');
var menuLijst = document.querySelector ('.menu1');
var kruisButton = document.querySelector ('.kruisje');
var achtergrondTransparant =document.querySelector ('.backgroundmenu')
//menuButton.onclick = function(){
//docu... | true |
dc45ea41d5effeb0407444bbd0dde039c7d9227e | JavaScript | Luis-Felipe-N/blog | /src/utils/formatCreatedAt.js | UTF-8 | 866 | 3.296875 | 3 | [
"MIT"
] | permissive | export default function formatCreatedAt(data) {
const dataAtual = new Date()
const dataEmSegundos = Date.parse(dataAtual)
const tempoPublicado = dataEmSegundos - data
const tresHoras = 60 * 60 * 3 * 1000
const dataDaPublicação = new Date(tempoPublicado + tresHoras)
if ( dataDaPublicação.getMont... | true |
74bb12640f5b33e2bdfdfc87be3b43f0d824cccd | JavaScript | ElenaKsh/fullstack-web-app | /src/js/app.js | UTF-8 | 3,875 | 2.78125 | 3 | [] | no_license | import productsTemplate from '../template/template.handlebars';
import {
getAllProducts, addProduct, deleteProduct, editProduct
} from './API';
import { calculationTotalAmount, calculationPriceProduct } from './products-methods';
window.onload = function load() {
async function refresh() {
let productElements... | true |
bf60b5325186a5559f64fe178652e15fa5787b8d | JavaScript | emileond/terra-application | /src/terra-dev-site/test/tabs-prototypes/TabContentTemplate.jsx | UTF-8 | 24,045 | 2.84375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | import React from "react";
const textMapping = {
continents: `<p>What actually is a continent, and how many are there?</p>
<h2>What does the dictionary say?</h2>
<p>
Continent, noun, [ˈkɒn.tɪ.nənt] one of the seven large landmasses on the
Earth's surface, surrounded, or mainly surrounded, by sea and usua... | true |
05540b515e7a75fa07db1c47eff1681793fc2cd9 | JavaScript | kumar045/drawing-board-web-application | /sketch_171123b.js | UTF-8 | 381 | 2.921875 | 3 | [] | no_license | var x=mouseX;
var x=250;
var y=mouseY;
var y=250;
var imag=[20];
function setup()
{
createCanvas(1500,800)
background(0)
img=loadImage("unnamed.jpg")
}
function draw() {
if( mouseIsPressed)
{
stroke(random(100),random(200),mouseX)
fill(random(200),random(150),random(100))
ellipse... | true |
c0352318b4525c2976a98fbbca6e3c38a77c4f11 | JavaScript | sc268/Bling | /src/new.js | UTF-8 | 611 | 2.625 | 3 | [
"MIT"
] | permissive |
var url = `https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=30&mkt`;
xhttp = new XMLHttpRequest();
xhttp.open("GET", url, true);
xhttp.onload = function(){
var res = JSON.parse(xhttp.responseText);
var max = Object.keys(res.images).length;
var i = Math.floor(Math.... | true |
dc4bf3256a68b9bef7ed4ce6ea2b42ddc66603d6 | JavaScript | xingdu1991/Full-Stack-Projects | /week06-codelab1/bind/arrow.js | UTF-8 | 608 | 3.5625 | 4 | [] | no_license | var a = 123;
// without arrow
var obj_without_arrow = {
a: 10,
foo: function() {
var a = 234;
console.log(a);
console.log("/obj_without_arrow/foo:", this.a);
var fn = function() {
console.log("/obj_without_arrow/foo/fo:", this.a);
return 10 - this.a; // this point to window or undfined
}
return ... | true |
16f44aaed606c896eafb1c181ed3387658275c49 | JavaScript | evgeniyaezhova/middleware_exercises | /queue.js | UTF-8 | 433 | 2.875 | 3 | [] | no_license | const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send("port 1234 is working")
})
let nameArr = ['xavier', 'michelle', 'corey', 'reed']
let myObj = {
status: "success", data: "reed"
}
const handleQueue = (req, res, next) => {
}
app.get('/queue/:command', handleQueue, (... | true |
7e2cc40e22695ea3e55ab06a6499e8a00a1c457b | JavaScript | ojung/IIFYMTrackerApp | /app/scripts/reducers/meal-creation.js | UTF-8 | 1,599 | 2.640625 | 3 | [] | no_license | import Immutable from 'immutable';
import moment from 'moment';
import {
ADD_ITEM,
RECEIVE_SEARCH_RESULTS,
REMOVE_ITEM,
SET_IS_FETCHING,
STORE_CONSUMPTION_EVENT,
UPDATE_SEARCHTEXT,
} from '../actions/meal-creation';
export function searchText(state = '', action) {
if (action.type === UPDATE_SEARCHTEXT) ... | true |
1392c1faab00a4ffeb3e17e38773412ead01f886 | JavaScript | DjStonie/Simpl | /IDE/Compiler/parserTools.js | UTF-8 | 4,804 | 3.359375 | 3 | [] | no_license | ///Report an error to console
//error = error-json to be written to console
function reportError(error){
const textArea2 = document.getElementById("console");
textArea2.value = textArea2.value + "You made a mistake on line " + (error.line + 1) + ": " + error.error + "\n";
};
//Write to console in Simpl IDE
//st... | true |
fb0b86e0b5c56e6f7c2573e2e171f2415e817f78 | JavaScript | eballerini/finance-ui | /src/components/Transactions.js | UTF-8 | 12,419 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState, Fragment } from 'react';
import { formatAmount, formatDate, convertToString } from '../utils';
import axiosInstance from '../axiosApi';
function TransactionList(props) {
const transactionList = props.transactions;
const accountId = props.accountId;
const defaultDateAdded ... | true |
96e2b0da452f057b3b0bd0da5fd148c820d7ddf8 | JavaScript | HermanHWEN/jumpChess | /js/common.js | UTF-8 | 4,426 | 3.171875 | 3 | [] | no_license | //深度复制对象
function deepCopy(oldObject){
var newObject = JSON.parse(JSON.stringify(oldObject));
return newObject;
}
//判断特定位置是否有棋子
function hasChess(x,y){
return MC[x]!=undefined && MC[x][y]!=undefined;
}
/**
* 检查是否在棋盘内
*/
function inChessBoard(x,y){
try{
var v=MB[x][y];
return v;
}... | true |
6fbddfc58903ddce809f09bf5990fdee1b793b8d | JavaScript | akashkmr27089/Atlan-BackEnd-Project | /Routes/SurveyDataCollector.js | UTF-8 | 2,440 | 2.53125 | 3 | [] | no_license | var express = require('express');
const logger = require('../src/Logger');
const SurveyDataCollector = require('../Controller/SurveyDataCollectorController');
var router = express.Router();
//Adding Questions and Answers
//This will be used for updating, Adding and storying questions and Answers
router.post('/Update... | true |
08a3c99da1960916d3ef0aab5626021f26755c95 | JavaScript | klcysn/c-projects | /sprint-evaluation/sprint/sprint2/myScript.js | UTF-8 | 633 | 3.328125 | 3 | [] | no_license | function screen(){
let times = new Date();
let hour = times.getHours();
let minute = times.getMinutes();
let second = times.getSeconds();
let timeList = [hour, minute, second];
let timeList_2 = timeList.map((p) =>{
if(p < 10){return "0" + p
}else {return p}
})
timeList_2.push("AM");
if(timeList_2[0] > 12){
t... | true |
67fecf30305e47ec148257ed098160bce3e5718a | JavaScript | webtools-server/common-lib | /packages/lib-tips/src/util.js | UTF-8 | 371 | 2.59375 | 3 | [] | no_license | export const createElement = (function () {
const container = document.createElement('div');
return function (html) {
container.innerHTML = html;
return container.children[0];
};
}());
export const isAndroid = function () {
return /android/i.test(window.navigator ? window.navigator.userAgent : '');
};
... | true |
d3400eeb080dcb6fdc2a509472ea65799edaaae8 | JavaScript | brianr482/coding-interview-problems | /recursion/fibonacci-with-dp.js | UTF-8 | 352 | 3.328125 | 3 | [] | no_license | /**
* This is the solution of Fibonnaci using DP
*/
/**
*
* @param {number} n
* @param {number[]} dp
* @return {number}
*/
function fibonacciDp(n) {
const dp = [0, 1];
if (n < 2) {
return dp[n + 1];
}
if (n === 1) {
return 1
}
for (let i = 2; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i... | true |
de91fcc94d0665ad1b9159ba7716bd9ae05123fe | JavaScript | xiaoyue001/newstart | /src/js/common.js | UTF-8 | 217 | 2.53125 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded",function(){
var designWidth=320;
var radio=document.documentElement.clientWidth/designWidth*100;
document.documentElement.style.fontSize=radio+"px"
},false) | true |
2de1be5a27c1f8f1f5178394df68700b6e42f930 | JavaScript | YvCodeHong/codewars.js- | /8kyu /enoughSpace.js | UTF-8 | 181 | 3.28125 | 3 | [] | no_license | //If there is enough space, return 0, and if there isn't
//return the number of passengers he can't take.
function enough(cap, on, wait){
return Math.max(on + wait + -cap, 0)
} | true |
7fc67b51ea7822d0df94aca29f7bc6ca968b7ab3 | JavaScript | kdchurch1994/work-day-scheduler | /assets/js/script.js | UTF-8 | 4,978 | 3.78125 | 4 | [] | no_license | // Function that loads all other functions when the web page is first loaded.
window.onload = function(){
timeColorCoding(); //runs the timeColorCoding function
saveBtn(); //runs the saveBtn function
}
// Using Moment JS to Display the current date and update the current date
var todaysDate = null; //sets the... | true |
f532152d0cf452f2ff1f2f69263612c46118ff18 | JavaScript | AndrewSouthpaw/recursion-joy | /solutions/11 - binary_search/index.js | UTF-8 | 364 | 3.265625 | 3 | [
"MIT"
] | permissive | function binary_search(array, start, end, value) {
if (start > end) return -1
const mid = Math.floor((start + end) * 0.5)
if (array[mid] === value) return mid
if (array[mid] > value) {
return binary_search(array, start, mid - 1, value)
} else {
return binary_search(array, mid + 1, end, value)
}
... | true |
9613a5c5377561adf3b9281426b8f7847376e730 | JavaScript | chuckb1789/sandbox | /Oct2016 Notes/week7/breakouts/main.js | UTF-8 | 1,238 | 4.28125 | 4 | [] | no_license | // Problem set #4
var string = "djfhh376 sdhks12 j78 1 jh2"+ "x";
var currString = "";
var wholeNumbers = [];
for(var i = 0; i < string.length; i++) {
// we've found a digit
if(!isNaN(parseInt(string[i]))) {
// "f" = NaN
// "5" = 5
currString += string[i];
}
/... | true |
9f0e889958729734051a5799c188c777ebaf199c | JavaScript | powietrze/api | /src/app.js | UTF-8 | 715 | 2.515625 | 3 | [
"MIT"
] | permissive | import {parseEnvironmentVariables} from './envs';
import {createConnection, disconnect} from './db';
import {createServer} from './server';
const params = parseEnvironmentVariables();
async function main() {
const connection = await createConnection(params.dbHost, params.dbPort);
const server = createServer(conn... | true |
7d671ed47d580968ef860a4419e2c511f49b14a3 | JavaScript | markorf1/FOODAR-APP | /calcTotal.js | UTF-8 | 864 | 3.46875 | 3 | [] | no_license | var form = document.getElementById("foodForm");
form.addEventListener("change", calculateTotal);
function calculateTotal(){
var result = 0;
console.log("Calculating...");
//get style
var foodStyle = document.getElementsByClassName("food-style");
for(i=0; i < foodStyle.length; i++){
if(foodSt... | true |
6910925eb29680e63109880591811f9143ebe234 | JavaScript | berheg/hyf-homework | /react/week2/my-app/src/App.js | UTF-8 | 2,895 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Header from './components/layout/Header';
import Todos from './components/Todo';
import AddTodo from './components/AddTodo';
import About from './components/pages/About';
import HeaderH1 from './component... | true |
e061f5221fce6a1d550174e4657125ec324d09be | JavaScript | laura-caldaronello/js-jq-carousel | /js/main.js | UTF-8 | 2,060 | 3 | 3 | [] | no_license | // cerco di generalizzare, così se voglio aggiungere immagini devo semplicemente farlo nell'html
var imgs = $('.img-container > *');
imgs.first().addClass(['first','active']);
imgs.last().addClass('last');
// predispongo le function prima generali e poi, basandomi su di esse, quelle per la tastiera
function go... | true |
482623cc5256655d11e3eb5f07daec8dd97a5c11 | JavaScript | ShubhamThakre/game-of-thrones-battle-info | /client/src/components/main.js | UTF-8 | 3,044 | 2.546875 | 3 | [] | no_license | import React from 'react'
import { Row,Col } from 'react-bootstrap'
import MyDropDown from './mydropdown'
import BattleInfoSection from "./battleinfosection";
class Main extends React.Component{
constructor(props){
super(props);
this.state ={
msg:{},
battleListArr :[],
... | true |
9e8af2890ead60fa81a6d6341cc752baf5d991bd | JavaScript | AliceKindheart/tto-marketinglog | /app/controllers/contacts.js | UTF-8 | 7,011 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* Module dependencies.
*/
var StandardError = require('standard-error');
var db = require('../../config/sequelize');
/**
* Find contact by id
* Note: This is called every time that the parameter :id is used in a URL.
* Its purpose is to preload the contact on the req object then call the next ... | true |
be47f647af15c6eaebd1a89a00e7bb91f95802ef | JavaScript | robertene1994/drawing-back-end | /src/models/user.js | UTF-8 | 738 | 2.734375 | 3 | [
"MIT"
] | permissive | module.exports = class User {
constructor(firstName = undefined, lastName = undefined,
email = undefined, password = undefined) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.password = password;
}
fromJson(obj) {
this.firstN... | true |
dad1bd6e69200c8ec5382330e3a77530b20ede8d | JavaScript | coolworld2015/ui-budget | /app/src/projects/projectsLocalStorage.js | UTF-8 | 2,439 | 2.53125 | 3 | [] | no_license | (function () {
'use strict';
angular
.module('app')
.factory('ProjectsLocalStorage', ProjectsLocalStorage);
function ProjectsLocalStorage() {
return {
projects: [],
numPerPage: 10,
getProjects: getProjects,
addItem: addItem,
... | true |
ee3189ce6a6fa6f44bd09488dca566e9d05ffa30 | JavaScript | nemesek/Javascript | /ScratchPad/Reactor.js | UTF-8 | 1,357 | 3.296875 | 3 | [] | no_license | function Event(name){
this.name = name;
this.callbacks = [];
}
Event.prototype.registerCallback = function(callback){
this.callbacks.push(callback);
}
function Reactor(){
this.events = {};
this.dispatchedEvents = [];
}
Reactor.prototype.registerEvent = function(eventName){
// we will need to check for un... | true |
3e12eeb603fbbe3028e9a1ce7c5b2451cc135401 | JavaScript | raskolnikova/infomaps | /client/components/chart/index.js | UTF-8 | 4,431 | 2.59375 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
var Chart = require('react-d3-core').Chart;
var LineChart = require('react-d3-basic').LineChart;
var BarChart = require('react-d3-basic').BarChart;
var PieChart = require('react-d3-basic').PieChart;
var
margins = {
left: 70,
right: 0,
top: 10,
... | true |
667bae677a31dd2ca44679a27e7e1c30a1f8ca37 | JavaScript | rdaley321/GameRoom | /backend/controllers/playerController.js | UTF-8 | 1,631 | 2.59375 | 3 | [] | no_license | const Player = require('../models/Player');
const Room = require('../models/Room')
exports.player_create = function (req, res, next) {
let player = new Player(
{
handle: req.body.handle,
nickname: req.body.nickname,
stats: req.body.stats
}
);
Room.findBy... | true |
670dd44e98fe114ff9398a71faaf9f89ef8fcb85 | JavaScript | OnloadTeam/stage2 | /task27/Adapter.js | UTF-8 | 1,850 | 2.75 | 3 | [] | no_license | /**
* Created by bairong on 2016/4/16.
*/
var Adapter = {
encoder: function (message) {
var code = "";
switch (message.id) {
case 1:
code += "0001";
break;
case 2:
code += "0010";
break;
case 3:
... | true |
7611e1a0759bd09579d1cb346adae2a4937c0466 | JavaScript | fannyj0/DigitalSignage | /src/modules/lunch/show-module.js | UTF-8 | 381 | 2.609375 | 3 | [] | no_license | 'use strict';
const showLunchMenu = async (menu) => {
for (let i in menu) {
document.querySelector('.lunch-menu').innerHTML += (`<ul class="lunch-row">
<li class="menu-title">${menu[i].title}</li>
<li class="menu-price">${menu[i].price}</li>
<li class="menu-properties">${menu[i].properties}... | true |
c46f3476ef6986f6772ffddd4b3dfcdd45b80fab | JavaScript | Zhu-Ze-Yu/CG4002_dashboard | /client/src/redux/reducers.js | UTF-8 | 1,459 | 2.546875 | 3 | [] | no_license |
import {combineReducers} from 'redux'
import {
AUTH_SUCCESS,
ERROR_MSG,
RECEIVE_USER,
RESET_USER,
RECEIVE_SESSION,
REPEAT_SESSION,
RECEIVE_SESSION_LIST
} from './action-types'
import {getRedirectTo} from '../utils'
const initUser = {
username: '',
msg: '', // error msg
redirec... | true |
ca17fc6f53bb9e51e21311574918353f99d13248 | JavaScript | brightcove/perception | /attachments/scripts/site.js | UTF-8 | 14,767 | 2.59375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /**
* site.js
* main application logic appears here
*/
(function(window, document, $, Handlebars){
var
/**
* database object, used to communicate with couchdb.
* principle methods include:
* - openDoc() to read an existing document
* - saveDoc() to save a new or existing document
* - view() to r... | true |
8b73f5c5a5838f28a17658271690d1d09d5c2a4b | JavaScript | atencionciudadanand/charly | /www/js/mapaGPS.js | UTF-8 | 2,443 | 2.84375 | 3 | [] | no_license | //var coordenadasg;
$( document ).on( "pageinit", "#paginaMapa", function(e,data) {
var defaultPos = new google.maps.LatLng(19.289168, -99.653440);
if (navigator.geolocation) {
function exito(pos) {
MuestraMapa(new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude));
}
function falla... | true |
3333ae63a293fa0bc94acc1f2c6789c6cf7520af | JavaScript | onephrase/observable | /src/Event.js | UTF-8 | 1,733 | 2.875 | 3 | [
"MIT"
] | permissive |
/**
* @imports
*/
import _each from '@onephrase/commons/obj/each.js';
/**
* ---------------------------
* The Event class
* ---------------------------
*/
const Event = class {
/**
* Initializes an Event instance.
*
* @param object params
*
* @return void
*/
constructor(params) {
this.$ = {
... | true |
15c18a7e82bd980a0518d5cb2ff4ea4ee0326467 | JavaScript | hi-yuna/JavaScript | /11.Review/03.function/function12.js | UTF-8 | 232 | 3.453125 | 3 | [] | no_license | const sum = (a) => {
let s = 0;
for (let i = 0; i < a.length; i++) {
if (a[i] % 2 == 0) {
s += a[i];
}
}
return s;
};
const arr = [1, 2, 3, 4, 5];
const even = sum(arr);
console.log("짝수합계 : " + even);
| true |
a3680fd8dab338a512d1681ca92e0776c95e2a75 | JavaScript | insang1102/cookingcoder | /21.04.20/wordchain.js | UTF-8 | 1,153 | 3.515625 | 4 | [] | no_license | var boody = document.body;
var word = document.createElement('div');
word.textContent = 'Insang';
document.body.append(word);
var foorm = document.createElement('form')
document.body.append(foorm)
var textinput = document.createElement('input');
foorm.append(textinput);
var enrollment = document.createElement('... | true |
a2cc57884d62e3bd5459341c6999dfd62e49e8fa | JavaScript | louisvno/voice-mopidy | /service/speechResolve.js | UTF-8 | 898 | 2.65625 | 3 | [] | no_license | const mediaClient = require('../client/mediaClient');
exports.resolveCommandLine= async (commandLine,mopidy)=>{
let trackNumber = extractFirstNum(commandLine);
let pause = checkPause(commandLine);
if(trackNumber){
let res = await mediaClient.getMediaByListPos(trackNumber);
playMedia(res.r... | true |
88e2b6aa95f53364b4c6236680db35203decb326 | JavaScript | aaronrs/ContactOrders | /src/main/resources/static/js/base.js | UTF-8 | 4,817 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | function buildTable(name, values, titles) {
var header = document.getElementById(name).tHead;
createHeader(header, titles);
var bodyFragment = document.createDocumentFragment(), tr;
for (var index in values) {
tr = document.createElement('tr');
tr.setAttribute("data-index", index);
... | true |
1313d89ea9a9ce243352b5bf92761733269f7e4a | JavaScript | Jefferson1994/PatioGb | /static/js/demo/chart-area-demo.js | UTF-8 | 7,622 | 2.875 | 3 | [] | no_license | Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#858796';
var endpoint=`/get_reportes_id/`
$.ajax({
method:"GET",
url: endpoint,
dataType: 'json',
success: function (... | true |
3e4de1e895eb3506f485b57ded641b715b2358a8 | JavaScript | nbhatt3/FirstNodeJsExpressApp | /controllers/todoController.js | UTF-8 | 1,136 | 2.65625 | 3 | [] | no_license |
//connect to the database
//mongoose.connect('mongodb+srv://nbhatt3:nbhatt3@nbhatt3cluster-fddvu.mongodb.net/test?retryWrites=true');
// create a DB Schema
/*
var todoSchema = new mongoose.Schema({
item: String
});
//create a model or Collection - stored as collection on DB
var Todo = mongoose.model('Todo');
... | true |
a94ab21cdac300d0eae55f3879a50e7abf556a0c | JavaScript | yhya38/calculator | /query.js | UTF-8 | 690 | 2.953125 | 3 | [] | no_license | $(document).keypress(function (event) {
if (event.key === "Enter") {
var currentValue = $(".calc-display").val();
$(".calc-display").val(eval(currentValue));
} else {
$(".calc-display").val($(".calc-display").val() + event.key);
}
});
function insert(num) {
var currentValue = $(".calc-disp... | true |
85df24ef0794913e1bfca9711b12c12f6fae347d | JavaScript | BradyASC4/Brady | /Battleship/Walker-Battleship.js | UTF-8 | 855 | 3.28125 | 3 | [] | no_license | function setup(){
createCanvas(600,600);
background(50,50,225);
for (i=0;i<=600;i+=75){
line(i,0,i,600);
}
for(i=0;i<=600;i+=75){
line(0,i,600,i);
}
}
var row1 = ["su", "nu", "nu", "nu"];
var row2 = ["su", "nu", "nu", "nu"];
var row3 = ["su", "nu", "nu", "nu"];
var row4 = ["su",... | true |
a591cc97d100331930e6268357faeea317696f6c | JavaScript | vailong/react-demo | /src/pages/index.jsx | UTF-8 | 1,763 | 2.578125 | 3 | [] | no_license | //母版页
//一个组件:表现任务、数据任务(和redux相关的数据任务),如果是和redux相关的数据任务就要放在pages
// 文件夹中;如果没有和redux相关的数据任务就要放在components文件夹中。
import React from 'react'
import { bindActionCreators } from 'redux'//批量绑定creator
import { USERINFO_CITYNAME } from '../config/localStoreKey.js'
import { getItem } from '../util/localStore.js'
import { connect }... | true |
f18cf5131ab68ef40edcc092b8e0e77dbb6c4463 | JavaScript | traviskaufman/current_time.js | /current_time.js | UTF-8 | 7,312 | 3.046875 | 3 | [
"MIT"
] | permissive | /**
* CurrentTime.js - A javascript module that will take care of all of your
* current time needs.
*
* @todo DOCUMENT!!
*/
/*jshint browser:true, node:true */
/*global define:true */
(function() {
'use strict';
var _global = this || {};
var _hasProp = Object.prototype.hasOwnProperty;
var _bind = func... | true |
1929ea4e9d47803496f3af277a2d375fabd7f042 | JavaScript | assunta09/PartnerClient | /src/Components/BubbleSegment/bubble_helpers.js | UTF-8 | 1,566 | 3.1875 | 3 | [
"MIT"
] | permissive |
var bubbleHelper = {
var myBubbleChart = bubbleChart();
/*
* Function called once data is loaded from CSV.
* Calls bubble chart function to display inside #vis div.
*/
display: function(error, data) {
if (error) {
console.log(error);
}
myBubbleChart('#vis', data);
}
/*
*... | true |
db301ae657a4626f0ba512b9b3bb6e224de9ed51 | JavaScript | injhinuity/numix | /commands/shuffle.js | UTF-8 | 3,147 | 2.5625 | 3 | [] | no_license | /* eslint linebreak-style: 0 */
const Command = require('../util/Command.js');
const Discord = require('discord.js');
class shuffle extends Command {
constructor(client) {
super(client, {
name: 'shuffle',
description: 'This command will display the current playing song.',
usage: 'np',
... | true |
9e13979c1b16c0ee1686d3b11e84c393a195ae91 | JavaScript | bowser0000/DankerBot | /commands/user-info.js | UTF-8 | 607 | 2.796875 | 3 | [] | no_license | module.exports = {
name: 'user-info',
description: 'Gives info about one or more mentioned user\'s ID, or yours if no one is mentioned.',
usage: '[mentioned users]',
execute(message) {
if(!message.mentions.users.size) return message.channel.send(`Your username: ${message.author.tag}\nYour ID: ${... | true |
0762484177dee8c720a920b5215b8bf610da0f21 | JavaScript | hechaojie/blog-1 | /blog-front-mobile/src/main/webapp/js/page/common/paginate.js | UTF-8 | 2,729 | 2.796875 | 3 | [] | no_license | $(function() {
var $paginate = $("#paginate_id");
var pageNumber = Number($paginate.attr("pageNumber"));
var totalPage = Number($paginate.attr("totalPage"));
var totalRow = Number($paginate.attr("totalRow"));
var params = $paginate.attr("params");
var url = $paginate.attr("url");
if(params == undefine... | true |
4da72e99f198c30b4e9f04809baec77585ab5499 | JavaScript | haveanicedavid/poker-hand-evaluator | /lib/evaluate-hand.js | UTF-8 | 1,477 | 2.9375 | 3 | [] | no_license | module.exports = evaluateHand;
var _ = require('lodash');
var handIs = require('../lib/hand-type-check.js');
var cardRanks = {
'A': 14,
'K': 13,
'Q': 12,
'J': 11,
'10': 10,
'9': 9,
'8': 8,
'7': 7,
'6': 6,
'5': 5,
'4': 4,
'3': 3,
'2': 2,
};
function evaluateHand (hand) {
var c... | true |
78da05cab3241dc9bfe08d03a4f6d7c1192b2fac | JavaScript | Laytoder/globus-management-backend | /src/controllers/patient.js | UTF-8 | 2,525 | 2.71875 | 3 | [
"MIT"
] | permissive | const { Patient } = require('../database/models/patient')
const log = require('debug')('app:controllers/patient')
const ObjectID = require('mongodb').ObjectID;
async function createPatientAndGetId(patientInfoJson) {
if (patientInfoJson == null) {
log('Creating patient: patient info value is null')
... | true |
9de8d25ed5cda9d274324af6d64548964db6be77 | JavaScript | SebT/VueWordCloud | /src/members/computeBoundedWords.js | UTF-8 | 4,991 | 2.640625 | 3 | [
"MIT"
] | permissive | import Worker_getMessage from '../helpers/Worker/getMessage';
import Array_first from '../helpers/Array/first';
import Array_last from '../helpers/Array/last';
import Array_sortBy from '../helpers/Array/sortBy';
import Array_dropRightUntil from '../helpers/Array/dropRightUntil';
import Math_mapLinear from '../helpers/M... | true |
41543d1b9fdc59663535aa40dd62ed495b4f6af5 | JavaScript | aaronUleat/node_begining | /book/chap4_node_packges/09_popular_node_packages/02_listing_underscore/app.js | UTF-8 | 166 | 2.78125 | 3 | [] | no_license | var foo = [1,2,3,4];
var _ = require("../../../../node_modules/underscore");
var results = _.map(foo, function(item) {
return item * 2;
})
console.log(results); | true |
676764ebb71568ec792ac3d7455582097e3ee406 | JavaScript | RostyslavSynenko/meme-generator | /src/components/MemeGenerator/MemeGenerator.js | UTF-8 | 1,664 | 2.921875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './MemeGenerator.css';
const MemeGenerator = () => {
const [fields, setText] = useState({
topText: '',
bottomText: ''
});
const [randomImage, setRandomImage] = useState(
'http://i.imgflip.com/1bij.jpg'
);
const [memes, setMemes] = useSta... | true |
7a7c9a9f5dd21b75c823966799926399464bd2c8 | JavaScript | nsetnik0703/Crypto-Live | /static/js/liveplots.js | UTF-8 | 4,683 | 2.84375 | 3 | [] | no_license | // key: trace1=ETHBTC , trace2=EOSBTC , trace3=BCCBTC , trace4=BNBBTC
// trace5=LTCBTC , trace6=XRPBTC
// URL to help resolve CORS issue
var proxyurl = "https://cors-anywhere.herokuapp.com/";
// url endpoint for live ticker price
var url = "https://flask-crypto.herokuapp.com/api/v1.0/cryptosies"
fetch(proxyurl + u... | true |
1fc7dbb3bd666c0c3db2c523f75c371214e779c6 | JavaScript | Yenalgloshi/async-sim1-shelfie | /Server/controller.js | UTF-8 | 2,008 | 2.515625 | 3 | [] | no_license |
module.exports = {
getBins: (req, res) => {
const dbInstance = req.app.get('db');
dbInstance.get_bins(req.params.shelf)
.then(bin => res.status(200).send(bin))
.catch( (err) =>{
console.log(err)
res.status(500).send(err)
});
},... | true |
a6bd7ae17b1bbf0cb0591ad3ee31f7f50df7b674 | JavaScript | jfmnet/xplore | /js/xcanvassections.js | UTF-8 | 844 | 2.515625 | 3 | [
"MIT"
] | permissive | xplore.canvassections = function () {
this.properties = new xplore.DrawProperties();
this.selectedproperties = new xplore.DrawProperties();
};
xplore.canvassections.constructor = xplore.canvassections;
let canvassections = xplore.canvassections.prototype;
xplore.canvassections.Rectangle = function (x, y, w, ... | true |
1ffce2003ac7ebf64108e8d2191e7519da591e01 | JavaScript | brunett82/team_profile_generator | /tests/manager.test.js | UTF-8 | 672 | 2.765625 | 3 | [] | no_license | const Manager = require('../src/manager');
describe('Set office number', () => {
const office = 666;
const mgr = new Manager('name', 5, 'test@gmail.com', office);
expect(mgr.officeNumber).toBe(office);
})
describe('Can get role from getRole()', () => {
it('should get manager role', () => {
con... | true |
a343bc06203a511ab9c9eec0e1efed13599a1080 | JavaScript | subbuballa/XSSNAKE | /server/shared/powerup.js | UTF-8 | 1,745 | 2.78125 | 3 | [] | no_license | /*jshint globalstrict:true, es5:true, node:true*/
'use strict';
/**
* Snake
* @param {Array.<number>} location
* @constructor
*/
function Powerup(location) {
this.location = [location];
this.typeID = this.getRandomType();
}
if (typeof module !== 'undefined') {
module.exports = Powerup;
}
/** @const *... | true |