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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
957b77c22a0b71db3fb222af3381734550f9f71d | JavaScript | vigor-rus/montage | /ui/router.js | UTF-8 | 3,880 | 2.765625 | 3 | [] | no_license | var Montage = require("montage").Montage;
var Map = require("montage/collections/map").Map;
exports.Router = Montage.specialize({
routes: { value: [] },
parts: { value: null },
path: { value: null },
default: { value: null },
constructor: {
value: function() {
var _this = this;
//https:/... | true |
f82ad498184c9f948ddf0f85a54e955323c0a434 | JavaScript | mickaelpol/loutrotter | /assets/js/inscription.js | UTF-8 | 4,815 | 2.796875 | 3 | [] | no_license | $(document).ready(function () {
//////// variable qui stocke l'envoi du formulaire ////////////////////
var inscription = $('#inscription');
//////// variable qui stocke les valeur des inputs ////////////////////
var nom = $('#nom');
var prenom = $('#prenom');
var mail = $('#email');
var mail2 = $('#emailVerif');
var... | true |
a0093809cafee560a2c260d45f3809f828001146 | JavaScript | Ruth-A/testphp | /public/js/address_ajax.js | UTF-8 | 1,834 | 2.796875 | 3 | [] | no_license | $(document).ready(function(){
let citySelector = $('#city');
let districtSelector = $('#district');
let groupCity = $('#group-city');
let groupDistrict = $('#group-district');
groupCity.hide();
groupDistrict.hide();
// Обновить варианты выбора адреса
function updateOptions(selector, gr... | true |
df0e371529a0571575b135cc7e47910abb5170f8 | JavaScript | liip/coding-dojo-katas | /02_todo_list/src/toDoList.js | UTF-8 | 1,190 | 3.109375 | 3 | [] | no_license | ToDo = {};
/**
* ToDoList
*
* @constructor
*/
ToDo.List = function() {};
ToDo.List.prototype.items = [];
/**
* Add item
* @param item
*/
ToDo.List.prototype.add = function(item) {
this.items.push(item);
};
/**
* Check item
* @param item
*/
ToDo.List.prototype.check = function(item) {
// Loop throu... | true |
f781bf4e669516d58768a3f2bc097b4bdbd77260 | JavaScript | ato214/programator | /src/ex32/ex32.js | UTF-8 | 115 | 2.875 | 3 | [] | no_license |
function bold(){
let element = document.getElementById("myHead");
element.innerHTML = "New Heading";
}
| true |
2ff7301b805c783fb334c900c59c80152fa55caa | JavaScript | LaunchCodeLiftoffProjects/Pipe-Dream-UI | /src/pages/restroomDetails.jsx | UTF-8 | 6,088 | 2.625 | 3 | [] | no_license | import React from "react";
import axios from "axios";
import {Stars} from "form-ratings";
export default class RestroomDetails extends React.Component {
constructor(props) {
super(props);
this.state = {
restroomId: this.props.match.params.id,
businessName: '',
... | true |
5a32d269dace6a03be9ec6cf4107d315e9025abb | JavaScript | imyelo/backend-store | /lib/BackendStore.js | UTF-8 | 1,495 | 2.59375 | 3 | [
"MIT"
] | permissive | ;(function (name, definition) {
// this is considered "safe":
var hasDefine = typeof define === 'function';
if (hasDefine) {
// AMD Module or CMD Module
define(definition);
} else {
// Assign to common namespaces or simply the global object (window)
this[name] = definition();
}
})('BackendSto... | true |
d9aaecc707fc79ea5dfb6358323af50513c49eb4 | JavaScript | sskyy/roof-node | /test/spec/node-event.js | UTF-8 | 2,735 | 2.734375 | 3 | [] | no_license | var assert = require("assert")
var _ = require("lodash")
var Node = require("../../lib/node")
var async = require("async")
var User = Node.createClass({
push : [function(){
return new Promise(resolve=>{
this.set('id', Date.now())
setTimeout(resolve, 50)
})
}, 'unpushed', 'pushing', 'pushed']
})... | true |
6bd618669d0c28ab8bdb9dd7ab38f8325378bfa7 | JavaScript | lyt2598/NGU-Blog | /source/1.0/MyBlog/src/main/webapp/js/mybuild/utils/login.js | UTF-8 | 6,001 | 2.75 | 3 | [] | no_license | //提交登录
function submitLogin() {
if (checkUserName() == false) {
return false;
}
if (checkPassWord() == false) {
return false;
}
if (checkCheckCode() == false) {
return false;
}
var userAccount = $(".login-username").val();
var password = $(".login-password").val();
var checkcode = $(".login-checkcode").v... | true |
09271225c2e8ab5d2fd997d3c4907c2a9a8dea89 | JavaScript | eairaudo/expressproyect | /routes/favorites.js | UTF-8 | 3,091 | 2.703125 | 3 | [] | no_license | var express = require('express');
var request = require('request');
var fs = require("fs");
var router = express.Router();
/* GET agencies by id and add favorites*/
router.get('/:siteID/payment_methods/:paymentMethodID/agencies/:id', function(req, res) {
var siteID = req.params.siteID
var paymentMethodID = r... | true |
7f70f2f02d09d9d45c8f442d8b94d67a6c8b6178 | JavaScript | leechongren/backend-simple-rpg | /src/config/jwt.js | UTF-8 | 422 | 2.609375 | 3 | [] | no_license | const jwt = require("jsonwebtoken")
const getJWTSecret = () => {
const secret = process.env.JWT_SECRET_KEY;
if (!secret) {
throw new Error("Missing secrets to sign JWT token");
}
return secret;
};
const createJWToken = (username) => {
const payload = { name: username };
const token = j... | true |
6a721c6b692e261ba89f112f538bc9ad46e32096 | JavaScript | seankuus/lessons | /lesson_4/obj.js | UTF-8 | 199 | 2.859375 | 3 | [] | no_license | let obj = { apple: 'Produce', carrot: 'Produce', pear: 'Produce', broccoli: 'Produce' }
obj['apple'] = 'Fruit'
obj.carrot = 'Vegetable'
obj.pear = 'Fruit'
obj.broccoli = 'Vegetable'
console.log(obj)
| true |
dc0e18e75c98a4f95ee28717be77f00f1c672ad1 | JavaScript | onursimsekkk/Patika.dev--JavaScript-Assignments | /odev_1/app.js | UTF-8 | 1,168 | 3.515625 | 4 | [
"MIT"
] | permissive | let myName = prompt("Lütfen isminizi yazınız.");
let currentDate = new Date();
console.log(Date());
// İsim Ekleme
document.querySelector('#myName').innerHTML = myName;
// Saat - Dakika - Saniye Alma, DOMA'a Ekleme
function showTime () {
document.querySelector('#myClock').innerHTML = (
`${new D... | true |
cc4f89d3e9737e55d8982432246c937372cde32e | JavaScript | charles2075/PAYG-Calculator | /calculation.js | UTF-8 | 3,641 | 2.890625 | 3 | [] | no_license | function calculate()
{
var normalHours=document.getElementById("normalHours").value;
var hourlyRate=document.getElementById("hourlyRate").value;
var halfHours=document.getElementById("halfHours").value;
var doubleHours=document.getElementById("doubleHours").value;
var weeklyPay = (hourlyRate * normalHou... | true |
a89cf7e2315bf450901ab5451d470e57d749d3f9 | JavaScript | GZYZG/Three | /tsdist/app/commons/Dom.js | UTF-8 | 1,299 | 2.671875 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function fillBlanks(monkey) {
//console.log("\n\n", $('.center'),"\n\n\n");
var blanks = document.getElementById("monkey_info").children;
var info = new Array();
var id = monkey.ID;
info.push("ID: " + id);
var name = mo... | true |
892f2313f51a882d2c2b4de8281044533daedbdf | JavaScript | audiojs/audio-buffer-list | /index.js | UTF-8 | 12,562 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* AudioBufferList class
*/
import util from 'audio-buffer-utils'
export default AudioBufferList
// @constructor
function AudioBufferList(arg, options) {
if (arg?.constructor === Object && !options) options = arg, arg = null
if (!(this instanceof AudioBufferList)) return new AudioBufferList(arg, options)
... | true |
b63789f1e6feba472b1e2c959dd7dbaa44f512f2 | JavaScript | MrLoog/LGenToolsApp | /main.js | UTF-8 | 1,396 | 2.515625 | 3 | [] | no_license | const { app, BrowserWindow , ipcMain} = require('electron')
const basepath = app.getAppPath();
//const appName= basepath.substring(basepath.lastIndexOf("\\")+1,basepath.length);
const appName='LGenToolsApp'
let win;
function createWindow () {
console.log('omg');
var temp='D:/ThangTT/Dropbox/Project/LGenToolsApp';... | true |
97a7d63bac74e06260599ae2da3a4f6cb300b1f0 | JavaScript | dhing1024/cloudflare_fullstack_application | /index.js | UTF-8 | 2,208 | 3.03125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/*
* Define an element handler class for transformation
*/
class ElementHandler {
element(element){
//Set url to linkedin to open in a new tab
if (element.tagName === "a"){
element.setAttribute("href", ... | true |
02d3a3529a41efd1d24ec47f4f25b661360f0d4b | JavaScript | yuichkun/resonage-hp | /prototypes/prototype-3/src/Particle.js | UTF-8 | 301 | 3.09375 | 3 | [
"MIT"
] | permissive | class Particle {
constructor(ctx, w, h) {
this.ctx = ctx;
this.r = Math.random() * 20;
this.x = Math.random() * w;
this.y = Math.random() * h;
}
draw() {
ctx.beginPath();
ctx.arc(this.x, this.y, this.r, 0, 2 * Math.PI);
ctx.stroke();;
}
}
export default Particle; | true |
196a4cf229d6aa612325f9026a81fb1dfc263ca1 | JavaScript | rupi9191/JSSeed | /Examples/Lesson2-DOM/Example1/js/app.js | UTF-8 | 682 | 3.734375 | 4 | [] | no_license | /**
* Simple example on accessing dom elements
*
*
*/
window.onload = function() {
var header1 = document.getElementById("headerId");
header1.innerHTML = "I am not a header please do not call me that";
var paragraph = document.getElementById("paragraphId");
paragraph.style.color = "#FF0000";
var s... | true |
e27c0570ed09f0317bbd3bef8eb31bf307c7c4f9 | JavaScript | kujian/kujian.github.com | /css3/animate/js/cubic.js | UTF-8 | 5,229 | 2.53125 | 3 | [
"MIT"
] | permissive | // JavaScript Document
$(function(){
var canvas = document.getElementById("curve"),
ctx = canvas.getContext("2d"),
supportsTouch = ("createTouch" in document),
timeVal = 500;
function BezierHandle(a, b) {
this.x = a;
this.y = b;
this.width = 12;
this.height = 12;
}
BezierHandle.prototype = {
getSides: ... | true |
492350f61058f88909ba349b655b7350f514bb11 | JavaScript | lloydXmas/GoodBot | /commands/nexushub/price.js | UTF-8 | 2,116 | 2.546875 | 3 | [] | no_license | const Discord = require("discord.js");
exports.run = async function(client, message, args) {
let itemString = args.join(' ');
let server = await client.customOptions.get(client, message.guild, 'server');
let faction = await client.customOptions.get(client, message.guild, 'faction');
if (!faction) ... | true |
514140b643c89893613014ba7d168ffd64eb3c66 | JavaScript | ianidi/leetcode | /algorithms/0082.Remove Duplicates from Sorted List II/index.js | UTF-8 | 594 | 3.15625 | 3 | [] | no_license | 'use strict';
module.exports = { deleteDuplicates };
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val
* this.next = null
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}
*/
function deleteDuplicates(head) {
const res = { next: null };
let cur = res;
w... | true |
5ccc82fd0559480b8dc217493c3fffc0dfa32270 | JavaScript | arif05rachman/e-commerce | /server/controllers/product.js | UTF-8 | 2,250 | 2.546875 | 3 | [] | no_license | const {Product, Category} = require('../models')
const createError = require('http-errors')
class Controller{
static findAll(req, res, next){
Product
.findAll({
include: [Category]
})
.then(data =>{
if (data.length > 0) {
res.status(200).json(... | true |
17b9974b49de53cf7ee4ef0eda39f682f757c67e | JavaScript | rmorgan2011/Trainer-Helper | /trainer_helper/src/App.js | UTF-8 | 4,244 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import PictureWindow from './PictureWindow'
import './App.css';
import "core-js/fn/symbol/iterator.js";
import {BrowserRouter, Switch, Route, NavLink} from 'react-router-dom'
import {typesColor} from './helpers/Types'
const typeStrings =['normal','fighting','flying','poison','... | true |
2a34542369c909a7d8e728ab364e38af7c8cf213 | JavaScript | stanfish/potluck-fun | /src/Party.js | UTF-8 | 3,021 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import firebase from './firebase.js';
import './Party.css';
import { Input, Button, Divider } from 'semantic-ui-react';
class Party extends Component {
state = {
inputItem: '',
inputUser: this.props.user && (this.props.user.displayName || this.props.user.email),
... | true |
5798e4f26db51aa7d2e1a8ce7f3b5e45a82e037a | JavaScript | revelrylabs/wp-harmonium | /src/js/concat/modal.js | UTF-8 | 3,936 | 2.859375 | 3 | [] | no_license | /**
* File modal.js
*
* Deal with multiple modals and their media.
*/
// Make sure everything is loaded first.
if ( ( 'complete' === document.readyState || 'loading' !== document.readyState ) && ! document.documentElement.doScroll ) {
wdsModals();
} else {
document.addEventListener( 'DOMContentLoaded', wdsModals... | true |
f0ad0a69fa26b270a7b6739cdad3d70eb0d7a01e | JavaScript | shamskhalil/jumare | /gen.js | UTF-8 | 301 | 2.921875 | 3 | [] | no_license | let x = 0;
function* g(usaernam, pass) {
while (true) {
yield ++x;
}
}
let p = g();
let stop = 0;
while (stop < 1000) {
stop++;
console.log(p.next().value);
}
console.log(p.next().value);
console.log(p.next().value);
console.log(p.next().value);
console.log(p.next().value);
| true |
0084ea5cb1c7a484c5678f7efef097225fb70e70 | JavaScript | micgreene/insertion-sort | /insertion-sort.js | UTF-8 | 1,078 | 4.09375 | 4 | [
"MIT"
] | permissive | 'use strict';
var testArr = [8,4,23,42,16,15];
function insertionSort(arr){
for(let i = 1; i < arr.length; i++){
//this will create an integer which represents the previous item in the array.
let j = i -1;
//this assigns the current array index item being evaluated inside a temporary variable
let... | true |
50160be2e1ef8eaef71220c0848f723f3c68c6f2 | JavaScript | rwjblue/ember-composable-helpers | /tests/integration/helpers/w-test.js | UTF-8 | 927 | 2.734375 | 3 | [
"MIT"
] | permissive | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('join', 'Integration | Helper | {{join}}', {
integration: true
});
test('It splits the string on whitespace', function(assert) {
this.set('string', 'foo bar\nbaz');
this.render(hbs`{{#each (... | true |
50ae758b6298f244ef3b8f9d348776ace2e8fa76 | JavaScript | mikeday37/AdventOfCode2019 | /src/days/day10/run.js | UTF-8 | 10,660 | 2.78125 | 3 | [
"MIT"
] | permissive | import { assert } from 'console';
import * as common from '../../lib/common.js';
import * as manager from '../../lib/dayManager.js';
(function(){
manager.day(10, 'Monitoring Station',
[
334,
1119
],
(api) =>
{
common.addExtensions();
const asteroidField = api.time(... | true |
b8e266efc74833d630785c6d65f2b98f0b1fe20b | JavaScript | danasilver/tiny-human-time | /index.js | UTF-8 | 1,536 | 3.09375 | 3 | [] | no_license | 'use strict';
const units = {
long: ['just now', 'nanosecond', 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day', 'week', 'year'],
short: ['now', 'ns', 'μs', 'ms', 's', 'm', 'h', 'd', 'w', 'y']
};
function tinyHumanTime(t1, t2, u) {
u = typeof arguments[arguments.length - 1] === 'string' ? argumen... | true |
8e5d603add1b4210a1de634968aa8104b824aad6 | JavaScript | FernandoJavierCuadro/electro-hack-back | /controllers/userController.js | UTF-8 | 1,793 | 2.5625 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
const { User } = require("../models");
const createToken = (user) => {
return jwt.sign(user, process.env.JWT_SECRET);
};
module.exports = {
register: async (req, res) => {
const user = await new User({
name: req.body.name,
lastname: req.body.lastname,
ema... | true |
6c4904bbe556ef49b102b2e63679d9a2b652f118 | JavaScript | ohm1993/simple_note | /server/services/user.service.js | UTF-8 | 2,259 | 2.5625 | 3 | [] | no_license | //const firebase = require("firebase-admin");
const firebase = require("firebase");
const Q = require('q');
//const serviceAccount = require("../barsys-7fc95-firebase-adminsdk-8uxju-92284c4d40.json");
firebase.initializeApp({
//credential: firebase.credential.cert(serviceAccount),
apiKey: "AIzaSyA4-kIvkgyh7pJ3i3lz... | true |
880d1288e8894c16c3b732fe880550dfbf1dad93 | JavaScript | bhaamati/fireworks | /js/renderer.js | UTF-8 | 7,361 | 2.5625 | 3 | [] | no_license | // This js file abstracts away the rendering aspects of three.js
// Unless you are interested, do not read into this file.
var Renderer = Renderer || {
// internal variables
_canvas : undefined,
_renderer : undefined,
_controls : undefined,
_camera : undefined,
_stats : undefin... | true |
939d6d41dba72450a7dcf9b48993f46f5b7d9642 | JavaScript | nicholasmf/nicholasmf.github.io | /javascript/processors/p6/p6pipe.js | UTF-8 | 22,373 | 2.59375 | 3 | [
"MIT"
] | permissive | function P6Pipe() {
const SimplePipe = this;
const reorderBuffer = new ReorderBuffer(256);
const memoryBuffer = new ReorderBuffer(256);
function fetchExecution(instructions, pc, cycle) {
let retArray = [];
let missing = this.missingInstructions();
for (let i = 0; i < missing; ... | true |
80ff7795a6d3565746a0c60688bf19d740cd9096 | JavaScript | MartaMoran/Ejercicios-React-1 | /src/ejercicios/ej-9/api.js | UTF-8 | 188 | 2.546875 | 3 | [] | no_license |
const myIp= async()=>{
const response= await fetch(`https://api.ipify.org/?format=json`)
const {ip}= await response.json()
console.log(ip)
return ip
}
export {myIp} | true |
3438ca470c973ea97890897036a1823980e98b4f | JavaScript | rayenbensaad/piExpress | /client/src/dashboard/Content/claim/Claim.js | UTF-8 | 3,968 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react'
import axios from 'axios'
export default class Claim extends Component {
constructor(props) {
super(props);
this.state = {
"object": localStorage.getItem("consultedUser") ? JSON.parse(localStorage.getItem("consultedUser")).object:null,
... | true |
8c6289d28563f8556a24b489672e9e058ec8af03 | JavaScript | ReinaldoDomingos/timetabling | /grade-horaria-app/js/edicaoProfessor.js | UTF-8 | 1,174 | 2.578125 | 3 | [] | no_license | let URL_API = "http://localhost:8080/gradehoraria-api";
new Vue({
el: '#app',
data: {
id: null,
professor: {},
visualizando: false,
filters: getFilters(),
alertaOptions: criarAlertaOptions()
},
mounted() {
if (this.filters.id) {
this.buscarPro... | true |
9f41aba89fe0366170bd39a2af5ae00c93f46391 | JavaScript | AhmedGamal710/IP-Address-Tracker | /app.js | UTF-8 | 2,432 | 2.78125 | 3 | [] | no_license |
const mapcontainer = document.querySelector('.map');
const form = document.querySelector('form');
const ip_address = document.querySelector('.ip');
const user_location = document.querySelector('.location');
const user_timezone = document.querySelector('.timezone');
const isp_location = document.querySelector('.isp');
... | true |
6de20a5796075f96b160cad5389a8bb0614d4f1c | JavaScript | davidoster/JS_OOP_All | /producer.js | UTF-8 | 479 | 3.3125 | 3 | [] | no_license | class Book {
constructor(name, city) {
this.name = name
this.city = city
}
produce() {
// setTimeout(() => {console.log("Hello")},5000)
let thisofclass = this //.myThis
setTimeout(function() {
console.log(new Book(this.name, thisofclass.city))
}, 1... | true |
110abc8637d134bd88e1515d046c22978792d341 | JavaScript | jadame10/Rivers | /public/app.jsx | UTF-8 | 3,373 | 2.609375 | 3 | [
"MIT"
] | permissive | import React from "react";
import ReactDOM from "react-dom";
import { Router, Route, Link,
IndexLink, IndexRoute, hashHistory
} from 'react-router';
class App extends React.Component{
constructor(props){
super(props);
this.state = {
search: this.props.search,
data: [],
rzeki: [],
wojewodztwa: [],
st... | true |
f967165b9864e8e1ce78c2b71bc11537b15c11d8 | JavaScript | lizagne/react-quiz | /src/React-router-challenges.jsx | UTF-8 | 436 | 2.890625 | 3 | [] | no_license | //Visiting /even-clicks shows <EvenClicks>
//Visiting /hide-me shows <HideMe>
//Visiting /count-by/5 shows <CountBy> with the step value set to 5 (it should work for any value in the URL)
//Visiting /minimum/20 shows <MinimumLength> with the minimum length set to 20 (it should work for any value in the URL)
//Visit... | true |
1397f135daa626272da163100071eca3918c7288 | JavaScript | spitzerc22/my-game | /index.js | UTF-8 | 3,869 | 2.921875 | 3 | [] | no_license | window.prompt('Do you head left or right?')
let answer = window.prompt('Do you head left or right?')
if(answer === 'left'){ //why do I have to enter the anwser twice??//
let secondAnswer = window.prompt ("You come across a stray car. It scampers off down a small hole, just large enough for you to crawl throu... | true |
4f9501192b2d3ab969112b7eed2d3a01426043e7 | JavaScript | pomber/netlify-webpack-static-lambda-sample | /src/index.js | UTF-8 | 417 | 2.6875 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
class App extends React.Component {
state = { result: "..." };
componentDidMount() {
fetch("/.netlify/functions/time?code=123")
.then(r => r.json())
.then(({ result }) => this.setState({ result }));
}
render() {
return <div>Resu... | true |
5add24199be7801d995b41da2f5135edaa7802e0 | JavaScript | eswat2/coding-105 | /docs/main.js | UTF-8 | 2,798 | 2.71875 | 3 | [] | no_license | //
// NOTE: here's an example of 2 independent vue instances on a single page
// that are talking to each other thru a third vue instance that's
// surving purely as an eventBus for the elements on the page...
//
//
const eventBus = new Vue()
const models = [{
param: 'accountName',
title: 'Accou... | true |
76c69089b414f8f871cd9777c0a3690b9c9d027b | JavaScript | wenlove/baixiu-finished | /assets/js/posts.js | UTF-8 | 6,390 | 2.71875 | 3 | [] | no_license | $(function() {
//分页数据页码与条数
var pageSize = 3 //每页显示的条数
var pageNum = 1 //当前页码
//获取所有数据
function render(obj = {}) {
$.ajax({
type: 'get',
url: '/getPostsList',
data: {
pageNum: pageNum,
pageSize: pageSize,
// ... | true |
d531ef9abf3304d6a4de9c38c460fea71d2f5ac8 | JavaScript | the-douglas-soares/origin-insurance-advisor | /test/functional/application/user-risk-profile.test.js | UTF-8 | 1,610 | 2.515625 | 3 | [] | no_license | /* global describe, expect, it, beforeAll, afterAll */
const request = require('request-promise');
const MockDate = require('mockdate');
const app = require('../../../src/application/app');
const PORT = '8181';
const serverUrl = `http://localhost:${PORT}`;
let server;
describe('/user-risk-profile', () => {
beforeAl... | true |
b37a6b9f09038a273317a46394dc2cf44d7b9caa | JavaScript | zino974/Data-Visualisation-Vue-JS | /api/index.js | UTF-8 | 1,276 | 3.03125 | 3 | [] | no_license | // Fetch data for visulisation
const axios = require('axios');
const formattedData = [];
function fetchUsers() {
const baseURI = "https://updates.suade.org/files/people.json";
const { data } = await axios.get(baseURI);
formattedData = formatData(data);
};
fetchUsers();
countAndFormat = arr => {
cons... | true |
3df0780580de711e703ec7e12cb53cabb1821da7 | JavaScript | cristina-Q/cristina-popescu-js | /M01S04/ex01/app.js | UTF-8 | 1,206 | 4.46875 | 4 | [] | no_license | var messageParagraph = document.getElementById('message');
// var value = window.prompt('Introdu o valoare:');
// var isOdd = false;
// if (value % 2 === 0) {
// isOdd = false;
// } else {
// isOdd = true;
// }
// // ternary operator
// var word = isOdd === true ? 'impara' : 'para';
// console.log(`Valoarea este... | true |
f228659c2f17866538f0980c7a7de262df9eeb1f | JavaScript | jiangshanmeta/meta | /src/0031.next-permutation.31/solution.js | UTF-8 | 935 | 3.328125 | 3 | [
"MIT"
] | permissive | /**
* @param {number[]} nums
* @return {void} Do not return anything, modify nums in-place instead.
*/
var nextPermutation = function (nums) {
for (let i = nums.length - 1; i > 0; i--) {
if (nums[i] > nums[i - 1]) {
let moreVal = nums[i];
let moreIndex = i;
for (let i... | true |
0d496af2348cccd017ff5e28825d17a8996ac510 | JavaScript | ifotn/comp2068-lesson3 | /tax-calculator.js | UTF-8 | 688 | 3.21875 | 3 | [] | no_license | var http = require('http');
// require node's url module to parse the url's querystring
var url = require('url');
// create the server to run the page
http.createServer(function (req, res) {
// get the querystring and parse the subtotal as a float value
var qs = url.parse(req.url, true).query;
var subTot... | true |
49ab600bbe63501e51ae2c8e6cfe05a7b85246b1 | JavaScript | LunaSystemsPeru/seaqsac | /vendors/assets/js/funciones_basicas.js | UTF-8 | 5,302 | 2.765625 | 3 | [] | no_license | function enviar_ruc() {
var ruc = $("#input_ruc").val();
if (ruc.length === 11) {
var parametros = {
"ruc": ruc
};
$.ajax({
data: parametros,
url: '../../data/ajax/validar_ruc.php',
type: 'post',
beforeSend: function () {
... | true |
9da559032a5ee12ada1f759fbc8cafc412fac26c | JavaScript | MZHoffman/Planner | /src/components/Input.js | UTF-8 | 1,814 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react'
class Input extends Component {// eslint-disable-line react/prefer-stateless-function
// nameHR = React.createRef();
handleChange = (event) => {
console.log(event.target.value)
const len = event.target.value.length
console.log(len)
if (ev... | true |
939cad5266d78b21defdccc372406f8780ae8efe | JavaScript | gusuziyi/movieInfo-app | /js/ctlPub.js | UTF-8 | 1,717 | 2.84375 | 3 | [] | no_license | function goMovieDetail(film) {
if(!detailPage) {
var detailPage = plus.webview.getWebviewById("movie-detail");
}
//绑定自定义事件
mui.fire(detailPage, 'movieId', {
id: film.id,
casts: film.casts
});
//打开
mui.openWindow({
id: 'movie-detail'
});
}
function goCastDetail(cast){
if(!castPage) {
var castPage = p... | true |
1d05188b6294ffc7b13c934b431a216aa2cdd73d | JavaScript | Cicy29/JSDanceClub | /week-3/index.js | UTF-8 | 2,164 | 2.765625 | 3 | [] | no_license | const User = require('./models/user')
const SuggestedEvent = require('./models/suggested-event')
const Club = require('./models/club')
const UserService = require('./services/user-service.js')
const SuggestedEventService = require('./services/suggested-event-service.js')
const ClubService = require('./services/club-ser... | true |
a3184f3684f757b217513fe2aed6f6402179beda | JavaScript | DIWithers/Fancy-Forms | /scripts.js | UTF-8 | 2,600 | 3.0625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | $(document).ready(function() {
//Add a listener for the form submission(when we want the validation to happen)
$(".sign-up-form").submit(function() {
event.preventDefault();
// console.log("Submitted!");
// 1. Password must be 6 characters
var password = $(".password").val();
var password2 = $(".password2")... | true |
faabf4e74b28e2186038ac8fa5a66c1ac9e780fa | JavaScript | vikkanaev/learn.javascript.ru | /09-sum-to/sum-to.js | UTF-8 | 857 | 4.65625 | 5 | [] | no_license | /*
Напишите функцию sumTo(n), которая для данного n вычисляет сумму чисел от 1 до n, например:
sumTo(1) = 1
sumTo(2) = 2 + 1 = 3
sumTo(3) = 3 + 2 + 1 = 6
Сделайте три варианта решения:
С использованием цикла.
Через рекурсию, т.к. sumTo(n) = n + sumTo(n-1) для n > 1.
С использованием формулы для суммы арифметической ... | true |
9b1a35103e28228b2f9a8bf25dce31db331768f7 | JavaScript | Huunhat22/helloreactr | /src/component/Props.js | UTF-8 | 1,050 | 2.75 | 3 | [] | no_license | import 'bootstrap/dist/css/bootstrap.min.css';
import React, { Component } from "react";
class Props extends Component{
// tạo 1 function để xử lý sự kiện onclick
onAddToCard = () => {
alert(this.props.Name + " - "+ this.props.Price);
}
render(){
return(
<div className="co... | true |
b8b31506cee70072cfaf78112a8decfdc43c1786 | JavaScript | RocketTeeWars/rocket | /node/rocketlauncher.js | UTF-8 | 2,495 | 2.671875 | 3 | [
"MIT"
] | permissive | "use strict";
var HID = require("node-hid");
function ThunderConnector() {
this.options = {
vendorID : 0x0a81,
productID : 0x0701,
left : [ 4, 0, 0, 0, 0, 0, 0, 0],
right : [ 8, 0, 0, 0, 0, 0, 0, 0],
up : [ 2, 0, 0, 0, 0, 0, 0, 0],
down : [ 1, 0, 0, 0, 0, 0, 0, 0],
stop : [32, 0, ... | true |
1913c164506ce538ce3f39ae20964d8991af1f74 | JavaScript | Panfen/algorithm | /codes/1.6matrixCirclePrint.js | UTF-8 | 970 | 3.5625 | 4 | [] | no_license | /*
@brief: 矩阵分圈打印
@remark: 利用数组的indexOf方法
*/
function matrixCirclePrint(matrix){
var tR = 0;
var tC = 0;
var dR = matrix.length - 1;
var dC = matrix.length - 1;
while(tR <= dR && tC <= dC){
printCircle(matrix, tR++, tC++, dR--, dC--);
}
}
function printCircle(matrix, tR, tC, dR, dC){
if(tR == dR){ //子矩阵只有... | true |
edba880e578099d51eed7bf7524ee0c7e82e2424 | JavaScript | HyunnoH/algorithm | /4w/connect_islands.js | UTF-8 | 895 | 3.53125 | 4 | [] | no_license | class UnionFind {
tree = [];
constructor(n) {
for(let i = 0; i < n; i+=1) {
this.tree.push(i);
}
}
union(x, y) {
x = this.find(x);
y = this.find(y);
if(x > y) {
this.tree[x] = y;
} else {
this.tree[y] ... | true |
047d0fe7fd13940f599c14686c69d09d5c9f4014 | JavaScript | tquinlan1992/texas-holdem-websockets | /statics/websockets/websockets.js | UTF-8 | 4,226 | 2.703125 | 3 | [] | no_license |
var socket = io();
$("#next-table-cards").hide();
$("#new-hand").hide();
$("#deal-hands").hide();
var player = false;
socket.on('current-players', function(msg){
if (msg =="") {
$('#current-players').html("No Players Right Now");
} else {
$... | true |
b380857699e7fceb1ec1154514d9229a41da39ab | JavaScript | woodie/mocha-and-chai-testing | /app/examples.js | UTF-8 | 1,587 | 3.171875 | 3 | [] | no_license | "use strict";
var max = function (one, two) {
return (one >= two) ? one : two
};
var reverse = function(str) {
var out = '';
for (let i = str.length - 1; i >= 0; i--) {
out += str[i]
}
return out;
};
var filterLongWords = function (words, length) {
var out = [];
for (let word of words) {
if (w... | true |
751c4eb421076e892833d9369d66ce8b1ab8db79 | JavaScript | ssssss45/pacman | /js/stateMachine.js | UTF-8 | 3,266 | 2.984375 | 3 | [] | no_license | class pacmanStateMachine
{
/*
states:
0 - loading
1 - idle, state before the game
2 - playing
3 - pause
4 - game over screen
5 - high score entry
7 - level clear screen
8 - player dead
9 - resetting
10 - ready screen
11 - new game
*/
constructor()
{
this.state = 0;
this.loading = 0;
this.idle = 1;
this.pl... | true |
c9815196a5b8336d64020a77428ed921ddd2c9d6 | JavaScript | KR4705/complete-javascript-course-master | /16-Asynchronous/starter/script.js | UTF-8 | 9,481 | 3.296875 | 3 | [] | no_license | 'use strict';
const btn = document.querySelector('.btn-country');
const countriesContainer = document.querySelector('.countries');
///////////////////////////////////////
const renderError = function (msg) {
countriesContainer.insertAdjacentText('beforeend', msg);
// countriesContainer.style.opacity = 1;
};
co... | true |
d2ca6ac772ec370afc81271981396d82d7c0ce36 | JavaScript | sedexdev/pepysr | /utils/secure-entry.js | UTF-8 | 1,258 | 2.671875 | 3 | [] | no_license | const Cryptr = require("cryptr");
const config = require("config");
const key = config.get("entryKey");
const cryptr = new Cryptr(key);
module.exports = {
/**
*
* @param {String} content - plain text version of the the
* journal entry
* @description Uses the cryptr npm packag... | true |
eaa5b827e9ab1d96ba4a3d52739b4331f2d401fa | JavaScript | Lafiagi/hosted | /routes/handler.js | UTF-8 | 5,066 | 2.53125 | 3 | [] | no_license | "use strict";
var data_structures = require('../models/db');
setInterval(update, 10000);
module.exports.deleteOne = function (req, res) {
var deleted = "";
data_structures.messages.forEach(function (element) {
if (parseInt(req.params.id) === element.id) {
deleted = data_structures.messages.splice(data_... | true |
ba05e9f6484a57ffa577c8821593b268227fb44b | JavaScript | cloneforyou/content-review-lookup | /dist/ru.rules-of-war/Common.js | UTF-8 | 3,409 | 2.703125 | 3 | [
"CC-BY-4.0"
] | permissive | /* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */
/* кнопка "На вверх" */
function hideFade () {
// hide #backtotop first
$( "#backtotop" ).hide ();
// fade in #backtotop
$( function () {
$( window ).scroll( function () {
if ( $( this ).scrollTop () > B... | true |
19df34927ba740af9e91a2d8e66b1abcac1a5481 | JavaScript | nj1a/Sharing-Economy | /models/db_function.js | UTF-8 | 10,582 | 2.6875 | 3 | [] | no_license | // A list of db functions for postgressql query to call
var pg = require('pg');
module.exports = {
get_info_by_post_id: function(post_id, callback){
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
client.query('SELECT product_post.*, user_account.username, user_account.email, user_account.gen... | true |
5ebd0828546091aeeaeb259cc0aa8ff4677454f3 | JavaScript | w3reality/async-thread-worker | /examples/serial-vs-parallel/my-thread-worker.js | UTF-8 | 788 | 2.703125 | 3 | [
"MIT"
] | permissive | importScripts('../../dist/async-thread-worker.min.js');
class MyThreadWorker extends AsyncThreadWorker.ThreadWorker {
onRequest(id, payload) {
const { task, sec } = payload;
switch (task) {
case 'run': this.run(id, sec); break;
default: console.log('unknown task:', task);
... | true |
b6ae819cf5d4cf8f70fa8b880802d1c1e5fe55b5 | JavaScript | GabrielleSudik/Redux-Tutorial | /Ex_Files_Learning_Redux/Exercise Files/Ch02/02_02/start/src/store/reducers.js | UTF-8 | 587 | 3.5625 | 4 | [] | no_license | import C from '../constants'
//the basic function:
//function goal(state, action) {
// if (action.type === C.SET_GOAL) {
// return action.payload
// }
// else {
// return state
// }
//}
//written in ES6 syntax (better):
//an arrow function
export const goal = (state=10, action) => {
if (... | true |
bcbb65523ec05889fa436fde0bcc1adba0d241c4 | JavaScript | dlcecile/jqp4exo2 | /assets/js/script.js | UTF-8 | 1,323 | 3.671875 | 4 | [] | no_license | function validateInput(marks){
let isOk = true;
marks.each(function(){
if(isNaN($(this).val())){
isOk = false;
}
});
return isOk;
};
function averageCalc(marks){
//On lui donne des notes et il va nous donner la moyenne (averageCalc)
var sum = 0;
// on l'initialise à 0
// stocker la somme des é... | true |
17a31b4f22feeb655e87d983e2bea224453eee7f | JavaScript | PitneyBowes/LocationIntelligenceSDK-JavaScript | /src/main/javascript/geojs/v1/geo911.js | UTF-8 | 2,894 | 2.546875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*Copyright 2016 Pitney Bowes Inc.
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 agreed to in writing, softw... | true |
7a4d8859b3614f6c103965142d075eaae9b2d55c | JavaScript | Eduardo-Vitesse/Desenho-em-tela | /scripts.js | UTF-8 | 1,080 | 3.421875 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
const pincel = {
ativo: false,
movendo: false,
pos: { x:0, y:0 },
posAnterior: null
}
const tela = document.querySelector('#tela')
const contexto = tela.getContext('2d')
tela.width = 700
tela.height = 500
contexto.lineWidth = 7
contexto.strokeSty... | true |
38d38c1f3fd6921b6eafb40db71aaf38f4a0545f | JavaScript | macintoshpie/pentaku-js | /static/pentaku.js | UTF-8 | 24,875 | 3.09375 | 3 | [] | no_license | //////
//GAME CONSTANTS
var blankVal = 0;
var normalDrawWidth = 1
var gridDrawWidth = 3;
//////
//SETUP CANVAS
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.canvas.width = boardWidth;
ctx.canvas.height = boardHeight;
var canvasx = canvas.getBoundingClientRect().left;
var ca... | true |
e79dcfb53485b56c92259a511548ceaa813f7970 | JavaScript | swipely/aviator | /src/helpers.js | UTF-8 | 2,158 | 3.234375 | 3 | [
"MIT"
] | permissive | /**
binds a function to a context
@method bind
@param {Function} func
@param {Object} context
@return {Function}
@private
**/
var bind = function (func, context) {
return function () {
func.apply(context, Array.prototype.slice.call(arguments));
};
};
/**
@method each
@param {Array} arr
@param {Function} itera... | true |
603b2416a145d34c7f71f5a8df8e847984cf2b3a | JavaScript | OlgaKonst/list-events | /src/index.js | UTF-8 | 6,558 | 2.90625 | 3 | [] | no_license |
const eventWrapper = document.querySelector(".event-wrapper");
const form = document.querySelector(".form-event");
/*const tableEvent = document.querySelector(".event-table");
const tbody = tableEvent.querySelector("tbody");*/
const dateEvent = form.querySelector(".event-name");
const eventNameInput = form.querySelec... | true |
43b96507a98f5c1d4351126a398f09ddd83a19b0 | JavaScript | MinskyNg/leetcode | /058_LengthofLastWord.js | UTF-8 | 461 | 3.296875 | 3 | [] | no_license | /**
* @param {string} s
* @return {number}
*/
var lengthOfLastWord = function(s) {
var reg = s.match(/\s*([a-zA-Z]+)\s*$/);
return reg && reg[1] ? reg[1].length : 0;
};
/**
* @param {string} s
* @return {number}
*/
var lengthOfLastWord = function(s) {
var len = 0,
i = s.length - 1;
whi... | true |
55942450721b8f3692dc9fc89201fe7367075e4e | JavaScript | duanjiaang/duanjiaang | /web01/2019-3-javaScript/201902-vue/templates/vue-router-template/src/directives/mydirectives.js | UTF-8 | 801 | 2.609375 | 3 | [] | no_license | // src/directives/mydirectives.js
// 自定义指令
import Vue from 'vue';
// 第一步,定义指令
Vue.directive('focus', {
// inserted表示指令被加入的到vue页面元素时触发
// el参数是指令作用的元素,binding是绑定的指令信息,其中的value就是绑定值
inserted(el, binding) {
console.log('mydirective focus:', el, binding);
if (binding.value) {
el.focus();
}
// e... | true |
36cab0cbc242eb8e7b3891768d9136cfe962de18 | JavaScript | Jason-Abbott/vasst | /script/entry.js | UTF-8 | 918 | 2.71875 | 3 | [] | no_license | var Entry;
AddEvent(null, "global", function() { Entry = new ContestEntry(); } );
function ContestEntry() {
var _actionNode = DOM.GetNode("fldAction");
var _edit = (_actionNode != null);
if (!_edit) { SetupValidation(); }
this.Delete = function() {
if (confirm("Click OK to permanently delete this entry")) {
... | true |
007ea3ac05b387d67f28d891da09e550eb393b6e | JavaScript | Daniel-N-Huss/lighthouse-js-fundamentals | /mergeArrays.js | UTF-8 | 363 | 3.359375 | 3 | [] | no_license | function merge(arr1, arr2){
const merged = [...arr1, ...arr2]
merged.sort((a, b) => a - b)
return merged;
}
console.log(merge([1, 2,], [4, 5, 6]));
// console.log(merge([ 4, 5, 6 ], [ 1, 2, 3, 4 ]), "=?", [ 1, 2, 3, 4, 4, 5, 6 ]);
// console.log(merge([ 4 ], [ 2, 5, 8 ]), "=?", [ 2, 4, 5, 8 ]);
// console.log(m... | true |
6b9d9218df6a6f8dde1b6c7c9aaeac9ebda9049e | JavaScript | lhan10/RocketPatrolMod | /src/scenes/Play2.js | UTF-8 | 9,002 | 2.65625 | 3 | [] | no_license | class Play2 extends Phaser.Scene{
constructor(){
super("playScene2");
}
preload(){
// load images/tile sprites
this.load.image('hand', './assets/hand.png');
this.load.image('food1', './assets/food1.png');
this.load.image('food2', './assets/food2.png')
thi... | true |
a7f4c0773f117d3ebd883027557ec80a04eb0c33 | JavaScript | acrylc/hayda-rayna | /seattle/twitterStream.js | UTF-8 | 3,788 | 2.5625 | 3 | [] | no_license | var Twitter = require("twit"),
EventEmitter = require('events').EventEmitter,
_ = require('underscore');
var reconnectAttempts = 0
function TwitterStream(config) {
if (!(this instanceof TwitterStream)) return new TwitterStream(config)
this.config = config
this.keywords = [];
this.filters = [];
this.reconnect_a... | true |
7f0c6f132dcee54f7f3b72f7f96a4519aaccd57f | JavaScript | jatzz10/chat-app | /server.js | UTF-8 | 1,035 | 2.890625 | 3 | [] | no_license | let express = require('express');
// Using app as an instance of 'express' class
let app = express();
let http = require('http').Server(app);
let io = require('socket.io')(http);
// GET requst from the application
app.get('/', function(req, res) {
res.sendFile(__dirname + '/index.html');
});
// Serving static... | true |
7bd499225de80093ce8bbe16599fed4f03a32715 | JavaScript | sunchengbin/cms | /src/libs/utils/debounce.js | UTF-8 | 881 | 3 | 3 | [] | no_license | /*
* 防抖(以最后一次事件的触发时间为起始时间,去不断推移事件的执行)
* 应用场景(例如:避免快速点击造成的多次提交、降低input检索频次)
* 用例:
* debounce(function () {
* console.log(this.name)
* }, 1000)
*/
function debounce (callback, wait = 300) {
let timeout, timestamp, context, args
function laterFn () {
let laster = Date.now() - timestamp
if (laster < wa... | true |
6f4f7785cf111a89ef63f091e9edb163e3bea169 | JavaScript | CarlosAndres20/NinosOutLimits | /web/boots/js/appuser.js | UTF-8 | 1,152 | 2.609375 | 3 | [
"MIT"
] | permissive |
$(document).ready(function(){
console.log('Jquery esta funcionando userr');
let edit=false;
fetchTasks();
$('#User-form').submit(function(e){
const postData={
Nombre:$('#Nombre').val(),
Apellido:$('#Apellido').val(),
Documento:$('#Documento').val(),
... | true |
e773a5efff7484945cf582e70c3cd207ba5b588b | JavaScript | Agnes-commits/gbadou | /src/redux/reducers/menuReducer.js | UTF-8 | 1,053 | 2.53125 | 3 | [] | no_license | import {FETCHING_MENUS_REQUEST,
FETCHING_MENUS_SUCESS,
FETCHING_MENUS_FAILURE,
SET_CATEGORY,
SEARCH_KEY_WORD
} from '../actions/types'
const initialState = {
isLoading: false,
keyword: "",
menus: [],
category: null
}
const menuReducer = (state=initialState, acti... | true |
8026ea1f1d275b9dbebbf96875acf4fbfd0fae35 | JavaScript | nhieunguyen1510/cv-builder | /model/user.js | UTF-8 | 9,767 | 2.578125 | 3 | [] | no_license | function userModel(firstName, lastName, username, email, password, createdDate, verifyToken, isConfirmed, isBlocked, resetToken, resetExpired) {
var self = this;
self.attribute = {
"Firstname": firstName,
"Lastname": lastName,
"Username": username,
"Email": email,
"Passwo... | true |
5b24560d48fad1ac64c5c8e88285b496066521a2 | JavaScript | FatmanDesigner/dirty-corners-api | /app/routes/reports.js | UTF-8 | 2,587 | 2.578125 | 3 | [
"MIT"
] | permissive | // =============================================
// IMPLEMENTATION
// =============================================
var Report = require('../models/report');
var SUPPORTED_VERBS = ['confirm', 'deny'];
/**
* @access PUBLIC
*/
exports.GET = function getReports (req, res) {
Report.find().sort([['created_at', 'descend... | true |
5e6ec6b0f8710f0025b38d883cf691557938d2a6 | JavaScript | TiddoLangerak/yoloader | /src/errors/UnresolvedDependenciesError.js | UTF-8 | 832 | 2.625 | 3 | [] | no_license | let util = require('util');
let UserError = require('./UserError');
/**
* Error that indicates that certain dependencies could not be resolved.
* @param {String} file The file in which the dependencies are `require`d
* @param {String[]} dependencies An array of dependencies that could not be resolved;
*/
function ... | true |
2888b40ed1a2c0c3d4c0c66a0df255cf949c40ae | JavaScript | vivirenremoto/fakeinet-extension | /fakeinet-browser-extension/background.js | UTF-8 | 862 | 2.5625 | 3 | [] | no_license | var version = 1;
var url = 'https://vivirenremoto.github.io/fakeinet-extension/domains.json?v=' + version;
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onload = function () {
if (xhr.status === 200) {
var domains = xhr.response;
if (domains.indexOf(document.location.host) > -1) {
... | true |
f6d9d40a5a4a7b3653ac93c83bef245e093217f5 | JavaScript | rostik-t/neuron | /index.js | UTF-8 | 2,544 | 3.984375 | 4 | [] | no_license | // Import stylesheets
import "./style.css";
class Neuron {
constructor() {
this.a = 0;
this.b = 0;
this.b = 0;
}
findWeight(educationArr, a, b, c) {
let score = 0;
educationArr.forEach(ed => {
const weight = ed[0] * a + ed[1] * b + ed[2] * c;
if ((weight > 0 && ed[3] === true) ||... | true |
1a9d29345050f0980aad505c77514e30a4325bf8 | JavaScript | bafrimpong/js-jasmine-tests | /src/ojects.js | UTF-8 | 768 | 4.125 | 4 | [] | no_license | // literal object - using curly braces - JSON
let myBook = {
title: 'The book moses',
author: 'Bismark',
numberOfPage: 300,
isAvailable: false
};
const passengers = [
{
name: "Bismark Atta",
ticketNumber: "45200A"
},
{
name: "Margaret",
ticketNumber: "45200B"... | true |
4f38078b08a140d309d3c8adcd1406ff21c15149 | JavaScript | suman-tiwari/my-new-js | /windows.js | UTF-8 | 5,769 | 2.71875 | 3 | [] | no_license | var elemnt;
function dragMouseDown(thisWindow, e) {
e = e || window.event;
elemnt = thisWindow.viewObject;
thisDraggedWindow = thisWindow;
e.preventDefault();
//mouse position at startup
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call function whe... | true |
f0d0a84ba81ebc93335d80564245487ef93c058a | JavaScript | ufqrf13vv/CryptoExchange | /src/ducks/tests/walletReducers.test.js | UTF-8 | 3,446 | 2.578125 | 3 | [] | no_license | import walletReducer, {
fetchWalletRequest,
fetchWalletSuccess,
fetchWalletFailure,
buyCurrencyRequest,
buyCurrencySuccess,
buyCurrencyFailure,
sellCurrencyRequest,
sellCurrencySuccess,
sellCurrencyFailure
} from '../wallet';
describe('Wallet reducers:', () => {
describe('Данн... | true |
2f51f6696273fe60087f261b6d30240c02c0adb6 | JavaScript | CBaptiste/AlgoliaAppSearch | /controllers/controller.js | UTF-8 | 810 | 2.5625 | 3 | [] | no_license | /*jshint -W069 */
var AlgoliaService = require('../libs/algoliaService');
module.exports = {
/**
* get POST request and call AlgoliaService to use algolia's API
* @param request
* @param httpResponse
*/
create: function(request, httpResponse) {
var data = request.body.data;
AlgoliaService.create(data, func... | true |
acdcf68caa3443fd3a5386047be0ac4f0e0656ac | JavaScript | jangot/form | /js/class/form/decorator/element/base-checkbox.js | UTF-8 | 1,457 | 2.796875 | 3 | [] | no_license | Form.Decorator.Element.Abstract('Form.Decorator.Element.Checkbox', {
_html : null,
decorate : function (result, element){
this._html = $('<div></div>');
this._html.html(this._getHtmlForOptions(element));
this._addListeners(element);
return this._html;
},
update : fun... | true |
d9389356c46da3b9878df442a64d6d6b205b9839 | JavaScript | tiwariakhilesh/Shoppingcart | /src/store/reducers/bookReducers.js | UTF-8 | 1,285 | 2.84375 | 3 | [] | no_license |
let initialState={
books:[],
error:false
}
export function booksReducers(state=initialState, action){
switch(action.type){
case "GET_BOOKS": return {books:[...action.payload]};
case "POST_BOOKS": return {books:[...state.books,...action.payload]};
case "DELETE_BOOK":
con... | true |
2bf70590c38f0c886cf478b59b83f0e226f838ed | JavaScript | prossouw79/research-artefact | /node-socket-drones/util/newPosition.js | UTF-8 | 3,575 | 2.53125 | 3 | [] | no_license | module.exports = function newPosition(currentPosition) {
let copyPosition = JSON.parse(JSON.stringify(currentPosition));
let limit = 30;
let maxSpeed = 2;
let rangeUpperLimit = 10;
let rangeLowerLimit = 2;
let closestNode = null;
let sumX = [];
let sumY = [];
let sumZ = [];
... | true |