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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ded167a7ccf4d2c3feba7ddc88e0deb0e404fce9 | JavaScript | Panda-Whale-CWMMV/study-buddy-4000 | /client/components/SchoolLanding.jsx | UTF-8 | 1,816 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect, useContext } from "react";
import axios from "axios";
import { Link, useRouteMatch, useParams } from "react-router-dom";
import { AppContext } from "./ContextProvider";
function SchoolLanding() {
const { currentSchool_id, user } = useContext(AppContext);
const [school, setSchoo... | true |
8953974ea5c666a654b070d060a1e3d35a01dff1 | JavaScript | tranhieu97/toeic_app | /api/package/part/part.service.js | UTF-8 | 2,293 | 2.625 | 3 | [] | no_license | import partModel from './part.model'
const findByID = async (partID) => {
return new Promise ( async (resolve, reject) => {
const part = await partModel.getPartByID(partID)
if (part) {
return resolve(part)
}
const error = {
code: 404,
name: 'PartNotFound'
}
return reject... | true |
5708a93142fb319f0d7bb577e0ce5c4043a713be | JavaScript | jessica-lau/functions | /functions.js | UTF-8 | 1,736 | 5.1875 | 5 | [] | no_license | // PROBLEM 1
// Write a function that accepts one parameter - a name - and logs "Hello I am _____"
// Fill in the blank with the name given to the function
function myName(name) {
console.log("Hello I am " + name);
}
myName("Jessica");
// PROBLEM 2
// Modify this function to accept two parameters, representing tw... | true |
151a5c74e0f893d0163ea41a8b1fb8378f262463 | JavaScript | rene-mdd/jquery | /Browser-Library-jQuery-02-checkboxes/Browser-Library-jQuery-02-checkboxes/index.js | UTF-8 | 2,008 | 3.265625 | 3 | [] | no_license | // let check = $(":checkbox");
// let dish = $(":checked");
// let span = $("span");
// var array = [];
// var array2 = array;
// const regex = /[-]/gi;
// let connector = ", ";
// check.change(function(e) {
// if (span.text() == "...") {
// span.text(" ");
// connector = "";
// }
// array.push(' ' + e... | true |
cbafb8af7d02141a56882f736dead98bbc0f65c5 | JavaScript | kpowch/tweetr | /server/lib/data-helpers.js | UTF-8 | 1,100 | 2.765625 | 3 | [] | no_license | "use strict";
var ObjectId = require('mongodb').ObjectId;
// Defines helper functions for saving and getting tweets, using the database `db`
module.exports = function makeDataHelpers(db) {
return {
// Saves a tweet to `db`
saveTweet: function(newTweet, callback) {
db.collection('tweets').insertOne(new... | true |
43a4c53d0d597b290007e5b323162213ed513fc8 | JavaScript | Vishwajit7204/json-day4 | /region json.txt | UTF-8 | 323 | 2.59375 | 3 | [] | no_license | var request=new XMLHttpRequest();
request.open('GET','https://restcountries.eu/rest/v2/all',true);
request.send();
request.onload=function()
{
var data=JSON.parse(request.response);
console.log(data);
for (var i in data)
console.log(data [i].name,data [i].region,data [i].subregion,data [i].regionblock);... | true |
39b42c952c59593a9bea1db89c09779781a8a893 | JavaScript | candreoliveira/comprecssor | /src/helpers.js | UTF-8 | 664 | 2.6875 | 3 | [] | no_license | var Maybe = require('ramda-fantasy').Maybe;
module.exports = function(R) {
var konsole = function(method) {
return R.tap(function(x){
R.invoke(method, ['********** ', x], console);
return x;
});
}
var run = R.curry(function(method, output, input){
return R.invoke(method, [output], input)... | true |
eba20361f9b9dea5a2db07d80c17ce5d482a4e8d | JavaScript | christian-caldwell/TableTopToolbox | /src/api/status/status-controller.js | UTF-8 | 3,025 | 2.609375 | 3 | [] | no_license | import User from '../../model/user-model';
import Status from '../../model/status-model';
import Character from '../../model/character-model';
export function create(req, res) {
const status = new Status(req.body);
status.save((error, status) => {
if (error) {
return res.status(500).json();... | true |
8e2c457a0f86cc3d5e8856cc87b44113a8258fd3 | JavaScript | Joey-Essuman/Team_Stats | /Team_Stats.js | UTF-8 | 1,298 | 3.0625 | 3 | [] | no_license | team = {
_players: [
{
firstName: "Joey",
lastName: " Essuman",
age: 28,
},
{
firstName: "Charis",
lastName: "Ocloo",
age: 26,
},
{
firstName: "Sebastian",
lastName: "Cudjoe",
age: 16,
},
],
_games: [
{
opponent: "Broncos",
... | true |
16293b1816c9e0837df546cef1e82d136a3c7a73 | JavaScript | firstclasspostcodes/geohash | /docs/embeds/ranges.js | UTF-8 | 313 | 2.578125 | 3 | [] | no_license | export default `
const { BoundingBox } = require('@firstclasspostcodes/geohash');
const center = { latitude: 48.97415, longitude: -13.94988 };
// create a bounding box with a radius 50km
const box = new BoundingBox(center.latitude, center.longitude, 50 * 1000);
const ranges = box.hashRanges(7);
ranges[0];
`; | true |
52d052adf369393f0c18a22d867b27f1fdc62c9c | JavaScript | xmflswood/fuckLeetCode | /39-combination-sum.js | UTF-8 | 1,234 | 3.53125 | 4 | [] | no_license | // https://leetcode-cn.com/problems/combination-sum/
/**
* @param {number[]} candidates
* @param {number} target
* @return {number[][]}
*/
// 比较标准的 减法 解法: 最好加上排序 可以方便剪枝 提升效率
var combinationSum = function(candidates, target) {
let r = []
function _(tempPath, target, start) {
if (target < 0) return
... | true |
76d4b73183341a880357d6215f3681139aad7f1d | JavaScript | MustaMohamed/TanksAlgo | /Tasks/Taher/struct.js | UTF-8 | 999 | 3.125 | 3 | [] | no_license | class structure
{
constructor()
{
this.id = null ;
this.sprite = null;
this.scale = null;
this.positionX=null;
this.positionY = null;
this.image_path = null;
}
random_intiation()
{
this.positionX = random(width);
this.positionY = random(height);
this.scale = ran... | true |
d50f359f3868559f10c54e9817b04f8960f883ca | JavaScript | brnbp/warehouse-finder | /assets/js/main.js | UTF-8 | 4,626 | 2.859375 | 3 | [
"MIT"
] | permissive | var url_api_base = 'api.warehouse.io/logs';
var auth_api = 'auth_here';
$(document).ready(function() {
$("#form-finder").attr('hidden', true);
$.ajax(url_api_base + 'tables', {
dataType: 'json',
success: function(json) {
$(".stores-select").select2({
data: json
... | true |
17916214a5b52efec6288ad07cf4d3579f4d36e6 | JavaScript | Torrespain/MorningChallengeAlgorithms | /removeFromFront.js | UTF-8 | 479 | 4.53125 | 5 | [
"MIT"
] | permissive | /*Write a function called "removeFromFront".
Given an array, "removeFromFront" returns the given array with its first element removed.
Notes:
* You should be familiar with the method 'shift'.
var output = removeFromFront([1, 2, 3]);
console.log(output); // --> [2, 3]
Starter Code :*/
function removeFromF... | true |
2fb2bd777ca1ffad8e74bd8c74d251254eb66594 | JavaScript | BrandonCoates1/Weather | /src/App.js | UTF-8 | 4,173 | 3.125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import './App.css';
const API_KEY = process.env.REACT_APP_API_KEY;
const API_KEY_UNSPLASH = process.env.REACT_APP_API_KEY_UNSPLASH;
const App = () => {
const [data, setData] = useState([]);
const [weather, setWeather] = useState("");
const [imgData, setImgData... | true |
59a2b724b0a7edf06635f23da64502849f13ffc5 | JavaScript | manohar95/manohar95.github.io | /DT/j/external.js | UTF-8 | 419 | 3.03125 | 3 | [] | no_license | function validate(){
var name= document.getElementById("name").value;
var email= document.getElementById("email").value;
var message = document.getElementById("message").value;
if(name=="")
{
alert("plz enter name");
return false;
}
else if(validemail.test(email)=="false"){
alert("plz enter email");
r... | true |
cec0a009d3f734a0f9d9333778847b178268eadf | JavaScript | xuexishiwokuaile/competition_node | /service/TeamService.js | UTF-8 | 3,920 | 2.59375 | 3 | [] | no_license | /*
* @Author: chenanran
* @Date: 2021-04-03 15:54:15
*/
import TeamDao from "../dao/TeamDao.js";
import TakepartDao from "../dao/TakepartDao.js";
import ApplyDao from "../dao/ApplyDao.js";
import AddError from "../error/AddError.js";
import DeleteError from "../error/DeleteError.js";
import { hasEmpty, isEmpty } fr... | true |
8e1ef4b6166e760daf39cacf6f9f13e498bd895f | JavaScript | gloriama/mytunes | /client/views/SongQueueEntryView.js | UTF-8 | 526 | 2.75 | 3 | [] | no_license | // SongQueueEntryView.js - Defines a backbone view class for the song queue entries.
var SongQueueEntryView = Backbone.View.extend({
// your code here!
tagName: 'tr',
template: _.template('<td>(<%= artist %>)</td><td><%= title %></td>'),
events: {
//if a click happens, dequeue
'click': function() {
... | true |
a2606537806a9f3bf7a4aac7bb5b76ee05082c30 | JavaScript | xxgicoxx/steam-players | /src/utils/request.js | UTF-8 | 673 | 2.96875 | 3 | [
"MIT"
] | permissive | const fetch = require('node-fetch');
/**
* Request URL
*
* @param {Object} options Options
* @param {string} options.url URL
* @param {Object} [options.qs] Query parameters
* @param {string} [options.method = 'GET'] Method
* @param {string} [options.type = 'json'] Response type
*/
async function request(option... | true |
d401ef4a0a7d23ef652ec0ada3b1bde89ac593ec | JavaScript | jacktv1/jacktv1.github.io | /jquery/form-validate/js/app.js | UTF-8 | 2,805 | 3.03125 | 3 | [] | no_license | $(document).ready(function() {
// init calendar
calendar.initListYear();
var nowDate = new Date();
calendar.curMonth = nowDate.getMonth() + 1;
calendar.curYear = nowDate.getFullYear();
calendar.initListDay(nowDate.getMonth() + 1, nowDate.getFullYear());
// Validate data when submit form
var $formInfo = $('#... | true |
4eed7b6ae67709a4e55b455b7b7fe257e0c30f76 | JavaScript | hainguyen81/nlh4j | /modules/web-client/src/main/java/META-INF/resources/WEB-INF/resources/lib/angular-scanner-detection/0.0.1/angular.scannerdetection.js | UTF-8 | 7,449 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Angular Scanner Detection
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* https://github.com/DazeySolutions/angular-scanner-detection
*
* Version: 0.0.1
*
*/
'use strict';
/* global angular */
(function () {
var module;
module = angula... | true |
0ed923c7b2c8aaabdf1416d528bd2b660fe39da1 | JavaScript | regentmarkets-repo-archive/binary-utils | /src/date/__tests__/nextXDay-test.js | UTF-8 | 338 | 2.765625 | 3 | [
"MIT"
] | permissive | import nextXDay from '../nextXDay';
describe('nextXDay', () => {
it("should return X days ahead of today's date", () => {
const theDate = new Date();
theDate.setDate(theDate.getDate() + 20);
const givenDate = nextXDay(20);
expect(givenDate.toDateString()).toEqual(theDate.toDateStrin... | true |
b6028d9547d2fe12c129c36b4d8ee65295af6a02 | JavaScript | austynwunsche/ethbattleshipReverted | /test/includes/utils.js | UTF-8 | 318 | 2.546875 | 3 | [] | no_license | const _sanitizeBN = arg => (arg && arg.toNumber) ? arg.toNumber() : arg
const _sanitizeOutput = arg => Array.isArray(arg) ? arg.map(_sanitizeBN) : _sanitizeBN(arg)
exports._assertCall = (fn, expected) => (typeof fn === 'function' ? fn.call() : fn).then(val => {
assert.deepEqual(_sanitizeOutput(val), expected)
})
| true |
704844024962a4c55e275590395f5995e1db1f44 | JavaScript | snyggme/free-courses | /task2.js | UTF-8 | 304 | 3.421875 | 3 | [] | no_license | var process = require('process');
function fibo(n) {
var a = 0,
b = 1;
if (n != 0) {
for (var i = 1; i < Math.abs(n); i++) {
b += a;
a = b - a;
}
return n < 0 && n % 2 == 0 ? -1 * b : b;
}
return 0;
};
process.stdout.write(fibo(process.argv[2]).toString());
| true |
364d40c67b21f8be7ca78a75c33ec1af992498bc | JavaScript | aleksandraGrushko/jsTask | /js/task1.js | UTF-8 | 1,108 | 3 | 3 | [] | no_license | window.onload = function() {
initSameHeight('#block1', '#block2');
initSameHeight('.element', '.container', '.my-box');
initSameHeight('#list-holder');
};
function initSameHeight() {
var doc = document,
argArray = [];
for (var i = 0; i < arguments.length; i++) {
argArray[i] = doc.querySelector(arguments[i]);... | true |
bdd5cbd3a87cbc2b42971629e0d9de0d1528eed8 | JavaScript | batelKanarek/Coupon-System-Project | /CouponSystemPart2/src/main/webapp/Customer/scripts/controllers/getAllPurchasedCoupons.ctrl.js | UTF-8 | 2,196 | 2.984375 | 3 | [] | no_license |
/* get all coupons controller contains 4 functions:
*
* 1.getAllPurchasedCoupons- requests all coupons purchases by the currently logged in customer from the relevant service function
* 2.getAllPurchasedCouponsByType- gets all coupons matching the type and purchases by the currently logged in customer from the ... | true |
46c3417387e32b93eef1535fc83714092d58b617 | JavaScript | ckuang/bestgifsever | /nasita_haque/server.js | UTF-8 | 1,424 | 2.640625 | 3 | [] | no_license | var http = require('http');
var fs = require('fs');
var server = http.createServer(function(request, response) {
var url = request.url
if (url === '/') {
response.writeHead(200, { 'Content-Type': 'text/html' })
fs.readFile('index.html', function(err, data) {
response.write(data.toSt... | true |
ce78b68ef1f0988126cad572e7480e48a0f1409e | JavaScript | tdude92/discord-distances | /src/commands/update.js | UTF-8 | 1,670 | 2.59375 | 3 | [
"MIT"
] | permissive | // SUPER DUPER SUPER JANKY LMAO
'use strict';
const fs = require('fs');
const https = require('https');
function getAvatars(client) {
return Promise.all(fs.readdirSync('./cache/models/').map(async file => {
// Download avatar if not exists
let uid = file.substring(0, file.length - 3); /... | true |
15414f502c66bf70d32cc3b25957011c9df6325f | JavaScript | Hannanazam/illustrator-portable-version | /Data/LocalAppdata/Adobe/Flash CS6/es_ES/Configuration/Behaviors/default.jsfl | UTF-8 | 1,376 | 2.671875 | 3 | [] | no_license | function behaviorAdd(symbolName, suppressConversionWarning)
{
//called when a behavior is to be added - prior to the UI for the behavior
var doc = fl.getDocumentDOM();
var alreadyActionSymbol = false;
if (doc.selection.length == 1) {
var selectedObj = doc.selection[0];
if (selectedObj.elementType == "instance... | true |
a4adb27edbaa98dbd7324cfb4b8f914b0d7bfec7 | JavaScript | UrielBatista/react-aplication-input-table | /src/Form/index.js | UTF-8 | 4,142 | 2.59375 | 3 | [] | no_license | import React, { useState } from 'react';
import api from '../services/api';
import './input.css';
import Swal from 'sweetalert2';
import {
Input,
Button
} from 'reactstrap';
import MascaraTelefone from 'react-text-mask';
const FormInput = () => {
const [PRIMEIRO_NOME, setNome] = useState('')
const ... | true |
206bae8ba91e2bf66dedc95c12d54255e468bbb1 | JavaScript | Zoweb/SJQ | /out/sjq.js | UTF-8 | 5,422 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* SJQ - The tiny, simple jQuery-like API
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Zoweb
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, includin... | true |
f948343a5057ccb4c5f866f69e9e80b5e1b90cb4 | JavaScript | Cwill14/endorsement-practice | /hackerank-test/test3.js | UTF-8 | 2,993 | 4.125 | 4 | [] | no_license | // ANAGRAM
function makeAnagrams(a, b) {
// Write your code here
// store instances in object
let trackerA = {}
let trackerB = {}
// add number of occurences
a.split("").map(char => {
trackerA[char]
? trackerA[char]++
: trackerA[char] = 1
})
// compare o... | true |
d78e5d2f6aacb6b34339a496b6d561d9d020d296 | JavaScript | Chomtana/EventX-ResizeObserver-event | /src/resize.js | UTF-8 | 737 | 2.515625 | 3 | [
"MIT"
] | permissive | import evx from 'eventx-core';
if (!global.evx) global.evx = evx;
evx.setting.resizeObserverFirstRun = true;
evx.createEvent("resize",function(target,callback) {
var firstrun = true;
const ro = new ResizeObserver(entries => {
for (let entry of entries) {
if (entry.target == target) {
... | true |
d6b81b858566a91548e7b14833a18c807e544b8e | JavaScript | mc2pw/yuyo | /src/index.js | UTF-8 | 5,232 | 2.6875 | 3 | [
"MIT",
"ISC"
] | permissive | import * as sym from './symbol';
import * as core from './core';
import * as iter from './iterable';
import {unary, match} from './func';
import {Vector} from './vector';
import tensor from './action/tensor';
export * from './func';
export {sym as symbol};
/** A Yuyo is a composition. */
export class Yuyo extends Arr... | true |
54c8f91366776131959d3e6cca8c9f31e9377ba0 | JavaScript | carolineamaro/gerenciador-de-orientacoes-express | /backend/app/controllers/autenticaController.js | UTF-8 | 1,700 | 2.53125 | 3 | [] | no_license | const mongoose = require('mongoose');
const Usuario = mongoose.model('Usuario');
// rota de login
module.exports = {
signin(req, res) {
return res.render('autenticar/signin');
},
// criaçao de conta
signup(req, res) {
return res.render('autenticar/signup');
},
async register(req, res, next) {
... | true |
e8ab9e34d228af743ef5eb272b610e637b7c453e | JavaScript | Meiyanthan/sample | /src/index.js | UTF-8 | 487 | 2.609375 | 3 | [] | no_license | const express = require('express');
const { PORT } = require('./config');
const { databaseConnection } = require('./database');
const expressApp = require('./express-app');
const StartServer = async() => {
const app = express();
await databaseConnection();
expressApp(app);
app.listen(PORT, ()=>{
... | true |
a47446a09b45b9586d0a77c856d6d0ec70f77655 | JavaScript | Kaldus/Kald | /js.decimalDilema/jsDecimal_toFixed.js | UTF-8 | 542 | 3.328125 | 3 | [] | no_license | function roundD() {
var x = 0.1 + 0.2;
var x = x.toFixed(2); // This .toFixed(#) narrows the result down to a hundredths placed decimal. Naturally if you change it to 3 it would be thousandths, 1 is tenths etc.
var to = document.getElementById("fixer");
var z = to.innerHTML = x;
// ... | true |
01933edd8c47206c0574a7ecc1f366a0a22ceb18 | JavaScript | OCLC-Developer-Network/oclc-auth-node | /src/util.js | UTF-8 | 1,427 | 3.203125 | 3 | [] | no_license | module.exports = class Util {
/**
* Returns a normalized list of scopes.
* @param scope an array of scopes like ["WMS_CIRCULATION","WMS_NCIP","refresh_token"]
* @returns {string} a single string of space separate scopes like "WMS_CIRCULATION WMS_NCIP refresh_token"
*/
static normalizeScope(... | true |
0e5a67c532fa321b68467edb4912f02fb5df59a8 | JavaScript | Athul0491/gifthub | /src/components/Contents/Pages/Question1.js | UTF-8 | 1,536 | 2.84375 | 3 | [] | no_license | /** @format */
import React, { Fragment, useState } from 'react';
import { ages } from '../../Reusable/interests';
const Question1 = ({ changeAge, changeShow, changeProgress }) => {
const [radio, setRadio] = useState('1');
changeProgress(11.11);
const changeQuestion = (choice) => {
changeAge(Number(choice)... | true |
350d01a9558a6839d2fb878730fd9b01b43f5800 | JavaScript | codigorefinado/curso-typescript | /essencial/fundamentos/generics/exemplo-simples/casa.js | UTF-8 | 501 | 3.171875 | 3 | [] | no_license | var Casa = (function () {
function Casa(morador) {
this.morador = morador;
}
Casa.prototype.quemMora = function () {
console.log(this.morador);
};
return Casa;
}());
var Pai = (function () {
function Pai() {
this.nome = 'Clayton';
}
return Pai;
}());
var Filha = (... | true |
6a4ee3cff45195ab6ca189cafea865de24188264 | JavaScript | ShenBao/front-end-notes | /iv-3:JavaScript 高级进阶/code/3. 对象认知升级/1. 属性和隐藏类/1. 常规属性.js | UTF-8 | 115 | 2.78125 | 3 | [] | no_license | var obj = {};
obj.p1 = "p1";
obj.p6 = "p6";
obj.p2 = "p2";
for (var p in obj) {
console.log("property:", p)
} | true |
2ec6b0c5fe288b4e2a426bcf14ae9950cc2a3d4e | JavaScript | galcianuk/todo-list | /script.js | UTF-8 | 2,015 | 3.453125 | 3 | [] | no_license | var button = document.getElementById("enter");
var input = document.getElementById("userinput");
var ul = document.querySelector("ul");
var list = document.getElementById("list");
var item = document.getElementsByClassName("item");
var itemsArray = Array.prototype.slice.call(ul);
function inputLength() {
return inpu... | true |
44d38589f815803699053b38ab646c09e3dc608e | JavaScript | u-jo/cally | /app/assets/javascripts/angular/eventCtrl.js | UTF-8 | 2,142 | 2.546875 | 3 | [] | no_license | app.controller('EventModalCtrl', ['$scope', '$modalInstance', '$filter', 'eventService', 'eventObj', 'displayEvents',
function ($scope, $modalInstance, $filter, eventService, eventObj, displayEvents) {
$scope.closeModal= function() {
$modalInstance.dismiss('cancel');
};
$scope.tempEventObj = angular.copy... | true |
67e82aa69936b478a4b0e8517dd7007c84cd83a6 | JavaScript | Gabriel-Moraes350/search-musics-spotify-react | /src/services/localstorage.js | UTF-8 | 2,101 | 2.890625 | 3 | [] | no_license | export function getFavorites() {
const favorites = {};
favorites.albums = JSON.parse(localStorage.getItem('albums'));
favorites.artists = JSON.parse(localStorage.getItem('artists'));
favorites.tracks = JSON.parse(localStorage.getItem('tracks'));
return favorites;
}
export function isAlbumFavorite(id) {
con... | true |
e0788bdebfdc82872a58912ff7509c6be8cff5a2 | JavaScript | NizarNadif/bank-simulator | /src/graficoTitoli.js | UTF-8 | 1,065 | 2.765625 | 3 | [
"MIT"
] | permissive | const URL_titolo = "http://localhost:63342/banca/sito/profilo/dati_titolo.php";
let grafico_titoli;
let utente = sessionStorage.getItem("utente");
let titoli, labels, colori, valori;
fetch(URL_titolo + "?user=" + utente)
.then((r) => r.json())
.then((data) => {
titoli = data;
labels = titoli.map(
(titolo) =>... | true |
c03a9861af72cefbeb9475dadabd24834f38c886 | JavaScript | nyoko708/javascript | /nodejs/test.js | UTF-8 | 259 | 2.953125 | 3 | [] | no_license | function init() {
var name = "Mozilla";
function displayName() {
console.log(name);
}
displayName();
}
function test() {
var x = 1;
return function() {
x = x + 1;
}
}
var hoge = test();
hoge();
hoge();
hoge();
function test() {
}
| true |
49ddc82a0b2cffae8e844454f99803f9ce950708 | JavaScript | hyejuju/SiteDemo | /app_server/routes/index.js | UTF-8 | 812 | 2.625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
// Declaring the controllers
const ctrlMain = require('../controllers/ctrlMain'); // Controller for the Home page
const ctrlDICE = require('../controllers/ctrlDICE'); // ... for the list of DICE winners
const ctrlBritish = require('../controllers/ctr... | true |
7b303b05ff140aaeca7d74ba26a11982d84030a2 | JavaScript | omfgitsjack/HipLei | /scripts/services/SACalculator.js | UTF-8 | 2,483 | 2.953125 | 3 | [] | no_license |
import materials from '../constants/materials'
function toInch(cm) {
return cm/2.54
}
function convertToFloat(fields) {
let obj = {}
for (var prop in fields) {
if (fields.hasOwnProperty(prop)) {
obj[prop] = parseFloat((fields[prop]))
}
}
return obj
}
export function calculateStrat1(fields) {
let f = co... | true |
e98fec97ffa633ed1245cf563fdb7ceba034a4b0 | JavaScript | BaoYen99/finalintern | /laptop-online/src/main/webapp/assets/js/donhang.js | UTF-8 | 1,273 | 2.96875 | 3 | [] | no_license | $(document).ready(function(){
function removeAscent (str) {
if (str === null || str === undefined) return str;
str = str.toLowerCase();
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
... | true |
df0b059017a7421c08b57bd97069f470c84448de | JavaScript | Miguel1357Ruiz/20ds2b | /1P/P2/P2ex/forof.js | UTF-8 | 61 | 3.1875 | 3 | [] | no_license | let anArray=[2,3,4,5,6];
for(let x of anArray){
print(x);
}
| true |
c59f001d77d42076d16a97e17a3ceaf50a986a24 | JavaScript | masikotimo/Company_Selection_App | /src/utils/InputFile.js | UTF-8 | 1,844 | 3.265625 | 3 | [] | no_license | /* eslint-disable func-names */
/*
Below is the format of the input string. Separated by vertical whitespace
*/
export const inputString = `"Company A" requires an apartment or house, and property insurance.
"Company B" requires 5 door car or 4 door car, and a driver's license and car insurance.
"Company C" requires ... | true |
ccb44ac1f6645e0f9b8ac757135f5b16a8f3815f | JavaScript | kyhwin2000/habit-maker | /Resources/app.js | UTF-8 | 4,856 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /* 전역 변수 선언 */
var osname = Ti.Platform.osname,
version = Ti.Platform.version,
scrHeight = Ti.Platform.displayCaps.platformHeight,
scrWidth = Ti.Platform.displayCaps.platformWidth;
var defaultFontSize = Ti.Platform.name === 'android' ? 16 : 14;
var newHabit = '';
/* DB 만들기 */
var db = Ti.Database.open('habitDB')... | true |
bdb735f9272c34cb5294dd02b999cbd60a13afd0 | JavaScript | Laboratoria/coi | /exercises/object_composition/test/murderDog.spec.js | UTF-8 | 466 | 3.078125 | 3 | [] | no_license | describe('murderDog()', () => {
it('debería ser una función', () => {
Assert.equal(typeof Submission.murderDog, 'function');
});
it('debería retornar un objeto con bark, poop y kill', () => {
const obj = Submission.murderDog();
Assert.deepEqual(Object.keys(obj), ['bark', 'poop', 'kill']);
Asse... | true |
08231402af3a17983d4fb0fb3ed03d5218d6ea2b | JavaScript | aakashkishan/Node-developement | /NodeModules/BenFranklin.js | UTF-8 | 703 | 3.578125 | 4 | [] | no_license | // We can also include EventEmitter this way.
/* var events = require('events');
// EventEmitter is a constructor.
var emitter = new events.EventEmitter(); */
var EventEmitter = require('events').EventEmitter;
EventEmitter.on( 'customEvent', function( message, status ) {
if( status === 200 ) {
console... | true |
6145b3687b50ec7a0060fac090da2dfaaf5e261f | JavaScript | olgalatkina/typical-arrays-problems | /src/index.js | UTF-8 | 873 | 3.5625 | 4 | [
"MIT"
] | permissive |
exports.min = function min (array) {
if (array === undefined || array.length === 0) {
return 0;
} else {
let result = array[0];
array.forEach(element => {
if (result > element) {
result = element;
}
});
return result;
}
}
ex... | true |
9e5b683a3acaa32e7b2b6e4c037b349944cc3e36 | JavaScript | FCappelli/RockPaperScissors | /code.js | UTF-8 | 3,494 | 4.125 | 4 | [] | no_license | // Rock Paper Scissors
var log = document.querySelector('#log');
var strText = "Here the results will be shown.";
log.textContent = strText;
strText += "\n";
log.textContent = strText;
const rockButton = document.querySelector('#Rock');
const paperButton = document.querySelector('#Paper');
const scissorsButton = docu... | true |
b4c87b7ea5f6414c78a16cc4b4260bc240346a88 | JavaScript | gbunce-studygroup/University_website_framework | /assets/scripts/components/sticky_header.js | UTF-8 | 301 | 2.734375 | 3 | [] | no_license | // FIX HEADER TO THE TOP OF THE BROWSER WINDOW IF THE PAGE IS SCROLLED MORE THAN 70PX
$(window).scroll(function() {
if ($(this).scrollTop() > 70){ // CHANGE VALUE TO ADJUST POINT AT WHICH HEADER BECOMES FIXED
$('header').addClass("affix");
}
else{
$('header').removeClass("affix");
}
}); | true |
1efaa77ecef347916f5231b216c74688857ca8ed | JavaScript | Sushmitha-93/Vidly--Vedio-Rental-app-React- | /src/components/registerForm.jsx | UTF-8 | 1,728 | 2.5625 | 3 | [] | no_license | import React from "react";
import Form from "./common/form";
import Joi from "joi-browser";
import userService from "../services/userService";
import auth from "../services/authService";
class RegisterForm extends Form {
state = {
data: { name: "", email: "", password: "" },
errors: {}
};
//Schema for j... | true |
cb18281802db56dde235ce8e7e9220801722c805 | JavaScript | likaituan/caad | /docs/simulate.js | UTF-8 | 1,125 | 2.921875 | 3 | [] | no_license | /**
* Created by likaituan on 27/04/2017.
*/
var getNumber = function(count) {
return new Array(count).fill(1).join('');
};
var getString = function(count) {
return new Array(count).fill('a').join('');
};
var getData = function(dataType, range){
range = range.split('-')[0];
if (dataType === 'Number... | true |
c6d803c6b196e8af36b78f7a08dce60d1698303a | JavaScript | elderferreiras/film-festival | /store/reducers/favorites.js | UTF-8 | 987 | 2.609375 | 3 | [] | no_license | import * as types from '../actions/types';
import { updateObject } from '../../utility';
const initialState = {
favorites: [],
loading: true,
err: null
};
const favoritesReducer = (state = initialState, action) => {
switch (action.type) {
case types.FETCH_FAVORITES_START:
return fetchFavoritesStart(state, ac... | true |
61d2a4e9450db0ef51100c90e6133a1caa5176bd | JavaScript | rafaelmuto/rafaelmuto.github.io | /cannon/index.js | UTF-8 | 1,299 | 2.796875 | 3 | [] | no_license | let resolution = {
width: window.innerWidth,
height: window.innerHeight - 5
};
let screen = document.querySelector('canvas');
screen.setAttribute('height', resolution.height);
screen.setAttribute('width', resolution.width);
let myEngine = new GameEngine(screen);
let myFloor = new Floor('floor', resolution);
let m... | true |
d3fe941a3503b00ed9f7e477dfef814479ac0dcf | JavaScript | kozakl/js-legacy-utils | /src/BezierUtil.js | UTF-8 | 1,965 | 3 | 3 | [] | no_license | class BezierUtil
{
static pointOnCubicCurve(x1, y1,
c1x, c1y,
c2x, c2y,
x2, y2,
t, result) {
const ax = c1x - x1,
ay = c1y - y1,
bx = c2x - c1x - ax,
... | true |
8f58e07639cd7a4f48176b51d1c5058dfeda473d | JavaScript | anderson0741/dev | /projects/rock-the-votedb/client/src/shared/Comments.js | UTF-8 | 2,073 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react'
export default class Comments extends Component {
constructor(props) {
super(props);
this.state = {
comment: ''
}
}
handleChange = (e) => {
let { value } = e.target;
this.setState((prevState) => {
retur... | true |
2f86ec37e203b91c39ead90120b466ed22a31dc6 | JavaScript | dpetrova/nodeJS-in-action | /ch02-intro-to-node/listing_203/test_currency.js | UTF-8 | 963 | 3.1875 | 3 | [] | no_license | const Currency = require("./currency");
const canadianDollar = 0.91;
const currency = new Currency(canadianDollar);
console.log(currency.canadianToUS(50));
//Node will follow certain rules, to search for this module:
//1. Start looking in the same directory as the program file
//2. Is the module a core module?
//3. Is... | true |
a7683480932bad677a4d3bc9b86d0f85ebd80ca2 | JavaScript | Omri-twik/intern_variants | /denis_the_terrible/pipelbiz_things/average_investment.js | UTF-8 | 3,439 | 2.859375 | 3 | [] | no_license | function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
let currencySign;
let desktopMainSection;
let desktopGreyHeader;
let desktopBlackText;
let totalInvested;
let totalInvestors;
let averageInvestment;
let mainSectionInterval = setInterval(() => {
if (
document.querySele... | true |
f7e7c488cef01e1527abbaf2fecca51174226a5e | JavaScript | kamilogerto2/haralick-features | /js/source/libs/general-operation.js | UTF-8 | 424 | 2.625 | 3 | [] | no_license | /**
* Created by Kamil on 2016-03-15.
*/
var math = require('mathjs');
var HaralickFeaturesCalculator = require('./haralick-features');
var COOCMCalculator = require('./co-oc-matrix');
// use math.js
//var x = math.zeros(3, 3);
//console.log(x);
var y = math.matrix([[1, 3, 1], [2, 1, 0], [1, 1, 2]]);
console.log(y);... | true |
4b53b07190c8167bc00ada7331a13670282a547a | JavaScript | pepdbm7/skylab-bootcamp-201809 | /staff/fede-gomez/js-arrays/for-each.js | UTF-8 | 282 | 3.328125 | 3 | [] | no_license | function forEach (array, callback){
if(!(array instanceof Array)) throw Error (array + ' is not an array');
if(!(callback instanceof Function)) throw Error ('callback is not a function');
for(var i=0; i<array.length; i++){
callback(array[i], i, array);
}
} | true |
4fc6b669bd8a168c7a314566255f5a69e8eaeb10 | JavaScript | Sphinx500/Curso-Intermedio-JS-POO | /json.js | UTF-8 | 308 | 3.265625 | 3 | [] | no_license | const obj1 = {
a: "a",
b: "b",
c: {
d: "d",
e: "e",
},
editA(){
this.a = "AAAAA";
}
};
//convertimos a STRING el objeto 1
const stringComplexObject = JSON.stringify(obj1);
//creamos un objeto a partir de un STRING
const obj = JSON.parse(stringComplexObject);
| true |
32bf20bc526fc4a94c67c43554782fa103cb6db9 | JavaScript | knnan/Movie-info-website | /js/main.js | UTF-8 | 3,464 | 2.703125 | 3 | [] | no_license | var apikey = 'bd22bc4344b2cde516ad4066c4e6e73a';
var keyword_api = 'https://api.themoviedb.org/3/search/movie?api_key=' + apikey + '&language=en-US&page=1&query=';
var MovieId_api = 'https://api.themoviedb.org/3/movie/';
var apirest = '?api_key=' + apikey;
$(document).ready(() =>
{
$('#searchForm').on('su... | true |
5305b2fde540f6c3cbac713e5b479e3e131cd0c5 | JavaScript | davidjosefson/mah-book-room | /index.js | UTF-8 | 3,568 | 2.640625 | 3 | [
"MIT"
] | permissive | #! /usr/bin/env node
var request = require('request');
var args = require('commander');
var constants = require('./constants');
var validators = require('./validators');
var helpers = require('./helpers');
// Saves response cookies for each request and uses them for the next one
var request = request.defaults({
jar... | true |
87377df4249d1f52a28143e8a99cf1142f8338bf | JavaScript | patrickjmcd/node-ethernet-ip-scanlist | /src/ScanList/ScanList.test.js | UTF-8 | 1,997 | 2.734375 | 3 | [
"MIT"
] | permissive | const ScanList = require("./").ScanList;
const ScanTag = require("../ScanTag").ScanTag;
describe("ScanList", () => {
let scanList;
beforeEach(() => {
scanList = new ScanList("192.168.1.1");
});
it("should create an instance of ScanList", () => {
expect(scanList).toBeInstanceOf(ScanList)... | true |
5bf4e830b932acdec5c4ff03768a2bdcc0afe80c | JavaScript | SI669-internal/dyu2 | /anon.js | UTF-8 | 572 | 3.53125 | 4 | [] | no_license | let fruit = ['grape', 'plum', 'apricot'];
let veg = ['pea', 'asparagus', 'carrot'];
let cheese = ['cheddar', 'brie', 'colby'];
function init(s) {
return s[0];
}
console.log(fruit.map(init));
let f = fruit.map(x => x.length);
console.log(f);
veg.sort(function(x, y) {
x_last = x[x.length - 1];
y_last = y[y.le... | true |
5858b373984729e73b58fbe8c6bc6742b2eb87b9 | JavaScript | needle-project/needle-url | /docker/http/admin/base.js | UTF-8 | 3,163 | 2.59375 | 3 | [
"MIT"
] | permissive | var needleApp = {
RESPONSE_OK: 'ok',
RESPONSE_ERROR: 'error',
_writer: null,
setWriter: function (writer) {
this._writer = writer;
},
/**
* @return writer
*/
getWriter: function () {
if (this._writer == null) {
throw new Error("No writer injected!");
... | true |
2a0798a4e3b4234697489e6c6e7ed57d12a4dbaa | JavaScript | fainapahanko/students-portfolio | /client/src/Components/AddStudent.jsx | UTF-8 | 2,325 | 2.53125 | 3 | [] | no_license | import React from 'react';
import {Button, Form, FormGroup, Label, Input, Container} from 'reactstrap'
class AddStudent extends React.Component {
state = {
newStudent: {}
}
handleChange = (e) => {
e.preventDefault()
this.setState({
newStudent: Object.assign(this.state.... | true |
f75fea3df5c7d900a839c431cdc239c020747ff4 | JavaScript | syd-cavs/javascript-challenge | /UFO-level-1/StarterCode/static/js/app.js | UTF-8 | 822 | 3.0625 | 3 | [] | no_license | // from data.js
var tableData = data;
//console.log(tableData);
var tbody = d3.select('tbody');
function createTable(x){
tbody.html('')
x.forEach(function(ufo) {
//console.log(ufo);
var row = tbody.append('tr');
Object.entries(ufo).forEach(([key, value]) => {
//console.log(`... | true |
a342a9d5c767f93e8ddb6dc228c9d62f61666937 | JavaScript | signicode/jetlog | /lib/getlog.js | UTF-8 | 836 | 2.515625 | 3 | [
"MIT"
] | permissive | const JetLog = require("./jetlog");
/**
* Creates a new JetLog instance given the parameters below.
*
* @lends jetlog
* @memberof module:jetlog.
* @param {Object|string} origin
* @param {boolean} out push to stdio (1 for stdout, 2 for stderr)
* @param {string|Function} reporter reporter scramjet module
* @para... | true |
47d5b497fb62d2ceaaf271165fbfaf8f456a8292 | JavaScript | Jyang772/spatial-web | /knn.js | UTF-8 | 1,815 | 3.203125 | 3 | [] | no_license | var neighborslist = [];
var nprint = [];
function neighbor() {
this.x = 0;
this.y = 0;
this.dist = 0;
this.circles = 0;
}
var measureDistance = function(index,k,initial,second) {
neighborslist = [];
for(var i in circles) {
if(i != index) {
var n = new neighbor();
dx = circles[index].x - cir... | true |
182443c60656a71717ec49b5f4190d707c46dc33 | JavaScript | vinaytech23/Java-script-practice-programs | /ticket-validation.js | UTF-8 | 564 | 2.6875 | 3 | [] | no_license | function getData() {
var tick = document.getElementById('ticket');
console.log(tick.value);
// alert(tick.value);
var mob_em = document.getElementById('mob_email');
console.log(mob_em.value);
// alert(mob_em.value);
// mob_email
function valid() {
console.log(mob_em.... | true |
2617e13bab908058593bb673ccd45411ffab98a3 | JavaScript | craig552uk/jobsite | /test/routes/organisation-children.js | UTF-8 | 8,266 | 2.734375 | 3 | [] | no_license | //
// Generated test suite for all child models of Organisation
//
var assert = require('assert');
var request = require('../bootstrap').requestAPI;
var Orgs = require('../../models/organisations');
var Users = require('../../models/users');
var Files = require('../../models/files');
var Apps = require('..... | true |
a01ef39ecac950fb2fefab2a4eb0043abcfa42f3 | JavaScript | psunkari/spicebird | /mail/test/mozmill/junk-commands/test-junk-commands.js | UTF-8 | 4,116 | 2.53125 | 3 | [] | no_license | /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
... | true |
61061b0ef4fb3a265cdea21845a578e30f7921f6 | JavaScript | ksmxxxxxx/js-practices | /asynchronous/index.js | UTF-8 | 489 | 3.25 | 3 | [] | no_license | async function loadFjord(url) {
const fetchUrl = await fetch(url);
const text = await fetchUrl.text();
const domParse = await new DOMParser().parseFromString(text, "text/html");
console.log(domParse);
}
loadFjord("https://bootcamp.fjord.jp");
// fetch('https://developer.mozilla.org/ja/docs/Web/API/Fetch_API/Us... | true |
147736c03bf2a9b54c3c8c4845b1fff783963977 | JavaScript | susi189371/CRUD_API_OUTH_HANDLEBARS | /app/api/controllers/employees.js | UTF-8 | 3,929 | 2.53125 | 3 | [] | no_license | const employeeModel = require('../models/employees');
const express = require('express');
var app = express();
module.exports = {
getById: function (req, res, next) {
employeeModel.findById(req.params.employeeId, function (err, employeeInfo) {
if (err) {
next(err);
} else {
res.json({... | true |
e810f9c6d85460349946df8d9461306856ccb89c | JavaScript | barthdamon/peat-api | /routes/Friend.js | UTF-8 | 4,211 | 2.859375 | 3 | [] | no_license | 'use strict';
//MARK: DEPENDENCIES
let express = require('express');
let app = express();
var Promise = require('bluebird');
var Friend = require('./../models/FriendSchema.js');
var User = require('./User.js');
var UserModel = require('./../models/UserSchema.js');
exports.createFriend = function(req, res) {
let se... | true |
c7897dbd4bdab54970acb77a653826a59b535525 | JavaScript | BoltKey/rogue-manager | /game/grid.js | UTF-8 | 4,522 | 2.96875 | 3 | [] | no_license | function Grid(m, n) {
var rows = n || 50;
var cols = m || 50;
this.tiles = [];
this.tilew = 16;
this.offset = [0, 0];
for (var i = 0; i < rows; ++i) {
var topush = [];
for (var j = 0; j < cols; ++j) {
topush.push(new Tile(j, i, "grass"));
}
this.tiles.push(topush);
}
this.generateMap = function... | true |
2e04789f2dc2b0a6ab90f4089d449267019267e0 | JavaScript | appache/appache | /src/plugins/deduplicate/removeDuplicateOptions.js | UTF-8 | 654 | 2.59375 | 3 | [
"ISC"
] | permissive | module.exports = function removeDuplicateOptions(batch) {
return batch.map((command) => {
let { options } = command
// In case there are options with the same id,
// prefer the one with a higher index
options = options.filter((option, i) => {
let { id, default: isDefault } = option.config
... | true |
28b5d73b19895fc247f5e53c3053685b65d1d6f5 | JavaScript | jrobinson0529/weatherforecaster | /src/javascripts/components/weatherCard.js | UTF-8 | 674 | 2.578125 | 3 | [] | no_license | const weatherCard = (array) => {
$('#forecast-container').empty();
array.forEach((element) => {
$('#forecast-container').append(`<div class="card city-weather-card" style="width: 18rem;" id="${element.cityId}">
<button type="button" class="btn btn-outline-dark delete-btn" id="delete-card--${element.firebase... | true |
bc4f46fcd6a94387df681238e341bce1de796e8c | JavaScript | nguyendacchien/oop | /bai_tap/Nought_Cross/js/Play.js | UTF-8 | 191 | 2.65625 | 3 | [] | no_license | function play(x, y) {
gameBoard.play(x, y);
}
function start() {
gameBoard = new GameBoard(DEFAULT_ROWS, DEFAULT_COLS, "game-board");
gameBoard.draw();
}
let gameBoard;
start();
| true |
758033084083af6f64765e6efe1a7a0295ded020 | JavaScript | FaustoRosado/sei | /outlines/19-working-with-ajax/example/use-axios.js | UTF-8 | 536 | 3.65625 | 4 | [] | no_license | // create new p tag
const p = document.createElement("p");
// makes request via axios
axios.get("https://raw.githubusercontent.com/orlandocaraballo/sei/master/outlines/19-working-with-ajax/json/person-1.json")
.then(response => {
const data = response.data;
// adds response data to p tag
p.innerHTML += `<h1>${ ... | true |
ad15c09f27ea75cd8e41f66d9019500815887bea | JavaScript | karima-elhachimi/euri-exercises | /topics/javascript/exercises/_solutions_/calc/calc.common.js | UTF-8 | 316 | 2.75 | 3 | [] | no_license | module.exports.sum = function(val1, val2) {
return val1 + val2;
};
module.exports.substract = function(val1, val2) {
return val1 - val2;
};
// module.exports = {
// sum: function(val1, val2) {
// return val1 + val2;
// },
// substract: function(val1, val2) {
// return val1 - val2;
// },
// };
| true |
1b6014a2e863010fa1e1a1c40ec74e695d8ea660 | JavaScript | Kriostak/React_learning | /complete_guide/lesson_11/scripts.js | UTF-8 | 102 | 2.921875 | 3 | [] | no_license | const myName = 'Dmitry';
console.log(myName);
myName = 'Other';
console.log(myName); //displays error | true |
2a82bd79e46f071e0a8e95e0869d4844a232b44c | JavaScript | renatosheep/Paketa-Academy_Atividade3 | /Paketa-Academy_atividade3/Mini-Projetos/FrasesAleatorias/index.js | UTF-8 | 2,142 | 2.921875 | 3 | [
"MIT"
] | permissive | const MGS = [
{
text: 'Akita inu (em japonês: 秋田犬) é uma raça de cães de grande porte do tipo spitz originária das regiões montanhosas do norte do Japão. Existem duas variedades distintas de Akita: um tipo japonês, comumente chamado Akita inu (inu significa cão em japonês) ou Akita japonês, e um tipo americano, conh... | true |
63796dc06d87c8c39148dca7e37d8a6b30213f08 | JavaScript | tpaphysics/esp8266_simulation | /api/src/controllers/espController.js | UTF-8 | 715 | 2.78125 | 3 | [
"MIT"
] | permissive | const state = [
0,
0,
0,
0,
]
module.exports = {
defaulTeste( req, res ){
res.send('Hello API!');
},
setState(req,res){
const { plug } = req.query;
if ( ( plug < 1 || plug >4 ) ) {
res.send('Invalid State Error!');
} else {
... | true |
a64504db585b7cb3aeebabcce64720ee12c86e71 | JavaScript | mutkurebharat/JS | /Promise/table.js | UTF-8 | 1,260 | 3.203125 | 3 | [] | no_license | function loadData(url) {
return new Promise((resolve, reject) => {
const request = new XMLHttpRequest();
request.onreadystatechange = (e) => {
if (request.readyState === 4) {
if (request.status === 200) {
resolve(request.response);
} else {
reject(request.status);
... | true |
336df509a400b8e646706210b6f94b1d03ac3407 | JavaScript | assainov/just-slider | /index.js | UTF-8 | 5,354 | 2.78125 | 3 | [] | no_license | module.exports = (options) => {
if (!options.container) {
throw new Error ('Kiss slider: container option is neccessary');
}
const container = options.container,
slideItems = Array.from(container.children),
slideWidth = container.offsetWidth,
autoplaySpeed = options.autoplay... | true |
c70ae3ab7cdc8c33310f5317c04c07926ceeadc1 | JavaScript | nguyenchilong/mysql_node_orm | /spec/model_spec.js | UTF-8 | 7,204 | 2.734375 | 3 | [] | no_license | var DataType = require('../lib/datatype');
var DATABASE = 'test_database';
var Adapter = require('../index');
Adapter = new Adapter( 'localhost', 'root', '' );
var Query = Adapter.query;
var AUTHOR_TABLE = "CREATE TABLE authors (\
`id` int(11) NOT NULL AUTO_INCREMENT,\
`name` varchar(255) NOT NULL,\
`age` ... | true |
398c7e0ee36f504cd801c25f400a56a9fdae2507 | JavaScript | marsxul/modeify | /lib/geocode.js | UTF-8 | 3,707 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | var express = require('express')
var Mapbox = require('mapbox/lib/services/geocoder')
var config = require('./config')
var mapbox = new Mapbox(config.mapbox_access_token)
var center = config.geocode.center.split(',').map(parseFloat)
var proximity = {
latitude: center[1],
longitude: center[0]
}
/**
* Expose `rou... | true |
910b79c4e94e04d0840a0934bee65d3682fb8990 | JavaScript | Structor01/projetos-fluig | /SEBRAE/forms/39224 - Cadastro de Recurso/imagem.js | UTF-8 | 2,755 | 2.890625 | 3 | [] | no_license | //$(function() {
//
//}
/***
* Mostra a imagem selecionada
*/
function VisualizarImagem(){
var imagem = document.getElementById('imagem'); //seleciona a imagem
var reader = new FileReader();
//Revisar como armazenar via API Public no Ged e fazer sua chamada devido o tamanho de Base64 nao suportar no datase... | true |
3ed03ebc741beea4498a40a1862e4a5964ee3771 | JavaScript | ManuelChapela/quiz_fullStack | /src/routes/users.js | UTF-8 | 7,938 | 2.796875 | 3 | [] | no_license | const { create, validate } = require('../models/Users')
const server = require('express').Router()
const User = require('../models/Users') // Hacemos referencia al documento Users que es donde definimos el PoemaSchema
const md5 = require('md5')
// Create dependencies jwt
const jwt = requir... | true |
ae8da6bd2d14ee6bf6e44874a4c25ce491ce07b9 | JavaScript | ritvikpen/Cool-Surveys-for-Cool-Kids | /js/index.js | UTF-8 | 646 | 3.046875 | 3 | [] | no_license | // Get a reference to the database service
var database = firebase.database();
function writeUserData(name, age, gender, marital, employment, health, data) {
firebase.database().ref(name).set({
age: age,
gender: gender,
marital_status: marital,
employment_statues: employment,
health_c... | true |
b3d7d28ef5b800d4b908a25664a5e6325e6e38b6 | JavaScript | Shawntaria91/KINGSLAND-FULL-STACK | /JS Advanced/ADVANCED ARRAYS/Topic 3 Advanced Arrays/8. Adv Arrays Lab/2. Even Position Element.js | UTF-8 | 614 | 4.71875 | 5 | [] | no_license | // 2. Even Position Element
// Write a function that finds the elements at even positions in an array.
// The input comes as an array of string elements.
// The output is the return value of your function. Collect all elements in a string separated by a space.
function main(arrOfStrings){
evenIndexByModulus(arrOfSt... | true |