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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e1b78dae8d3d3c2e545e1229b9c7a40d470095f6 | JavaScript | HunterLarco/forum.mozillabuilders.com | /cli/commands/secrets:create.js | UTF-8 | 845 | 2.609375 | 3 | [] | no_license | const argparse = require('../util/argparse.js');
const secrets = require('../util/secrets.js');
module.exports = {
arguments: {
update: {
type: Boolean,
default: false,
},
},
async run(positionalArgs, args) {
args = argparse.parse(this.arguments, args);
const [name, value] = positio... | true |
b5f441ac8f19134e01cc084b7286c35851ba0721 | JavaScript | DarrinQ/JavaScriptExercise | /js/function.js | UTF-8 | 370 | 3.421875 | 3 | [] | no_license | 'use strict';
function sum (x, y, ...arg)
{
if (typeof x != 'number' || typeof y != 'number')
{
console.log('parameters is not number.');
return NaN;
}
for (var p in arguments)
{
console.log(arguments[p]);
}
console.log(arg);
return x + y;
}
//var z = sum(5, 8, 10, 20, 30);
//console.log(z);
var s... | true |
5816f3564d840babff2e39b8a1a0ba7a7a1ed192 | JavaScript | ian-kevin126/JavaScript-Knowledges | /src/3_Data_Structures_and_Algorithms/Data_and_Algorithms_14/3/Sorting/BubbleSort.js | UTF-8 | 1,161 | 4.15625 | 4 | [] | no_license | function bubbleSort(arr, compare) {
const size = arr.length;
let temp;
for (let i = 0; i < (size - 1); i++) {
for (let j = 0; j < size - i - 1; j++) {
if (compare(arr[j], arr[j + 1])) {
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;... | true |
de54a61d41548ee3282689c4b160afdcfd31da32 | JavaScript | roseboat/DogProject | /RosasApplication/scripts/umbraco-starterkit-app.js | UTF-8 | 5,767 | 2.515625 | 3 | [] | no_license |
document.getElementById("polarise-button").addEventListener("click", function () {
var outputBlock = document.getElementById("polarise-output");
while (outputBlock.hasChildNodes()) {
outputBlock.removeChild(outputBlock.firstChild);
}
var apiURL = 'https://localhost:44359/umbraco/api/news/pol... | true |
c3873a8c922194174e2a79b5021255af10cf4a85 | JavaScript | heythereworld/launchlab | /three.js | UTF-8 | 235 | 3.6875 | 4 | [] | no_license | var numberProvided;
var timesTableIterations = 12;
function myFunction(numberProvided) {
for (i = 1; i<=timesTableIterations; i++){
console.log(i + " x " + numberProvided + " = " + i*numberProvided);
}
}
myFunction(8); | true |
784b8a6aa8d0fa5aa5e67bfd4cfdbda1060d6dd5 | JavaScript | ivdavaro/clase3 | /src/components/__producto.jsx | UTF-8 | 5,185 | 2.953125 | 3 | [] | no_license | import React, { useState } from "react";
import { nanoid } from "nanoid";
const Formulario = () => {
const [nombre, setNombre] = useState("");
const [descripcion, setDescripcion] = useState("");
const [cantidad, setCantidad] = useState(0);
const [valor, setValor] = useState(0);
const [productos, setProductos... | true |
a31eb984ae02c3c029b16588668147299fa96eda | JavaScript | tuannguyenvku/mern-backend | /controllers/tuitionsController.js | UTF-8 | 2,078 | 2.984375 | 3 | [] | no_license | const Tuition = require("../models/Tuition");
// Add a new Tuition
const addNewTuition = async (req, res) => {
try {
const { name, description, category, image } = req.body;
const newTuition = await Tuition.create({
name,
description,
category,
image
});
return res... | true |
797db19db5b1d17267c5345e0f097f7203e99c45 | JavaScript | theCaptain420/gettingToKnowTypeScript | /src/multipleThreeFive/multipleThreeFive.js | UTF-8 | 545 | 2.921875 | 3 | [] | no_license | "use strict";
exports.__esModule = true;
var displayMessage;
displayMessage = "hello";
console.log(displayMessage);
function totalSumDividedByNumbers(from, to, num1, num2) {
var finalNumberSum;
finalNumberSum = 0;
for (var i = from; i < to; i++) {
if (i % num1 == 0) {
finalNumberSum += i... | true |
3db87b053c1633fb5f487470cdd10b3ce692e8f7 | JavaScript | sladiri/hyper-sam-example | /src/components/count-down.mjs | UTF-8 | 1,405 | 2.515625 | 3 | [
"ISC"
] | permissive | export const getCounterColour = ({ counter }) => {
if (counter === 10) {
return "reset";
}
if (counter > 6) {
return "fine";
}
if (counter > 3) {
return "warning";
}
if (counter > 0) {
return "critical";
}
return "done";
};
export const CountDown = co... | true |
1d67293a57089fd0e9e8386ad2c5e0c613319f5f | JavaScript | valyafrankova22/hw-7-frankova | /js/script.js | UTF-8 | 1,537 | 4.375 | 4 | [] | no_license | const a = +prompt(`Введите число`);
const b = +prompt(`Введите второе число`);
// 1.
result = (a === 0) ? alert(`Правильно`) : alert(`Неправильно`);
// 2.
result = (a > 0) ? alert(`Правильно`) : alert(`Неправильно`);
// 3.
result = (a < 0) ? alert(`Правильно`) : alert(`Неправильно`);
// 4.
result = (a >= 0) ? alert(`П... | true |
15384642e93672b8ec8404774dd16a957a11c190 | JavaScript | ahender1/ahender1.github.io | /jp.js | UTF-8 | 334 | 2.78125 | 3 | [] | no_license | function setup() {
createCanvas(1900, 1050)
}
function draw() {
if (mouseIsPressed) {
fill(13, 255, 255);
} else {
fill('rgb(0,255,0)');
}
if (keyIsDown(RIGHT_ARROW)) {
fill('#fae');
}
if (keyIsDown(LEFT_ARROW)) {
fill(color(0, 0, 255));
}
ellipse(mouseX, mouseY, 130, ... | true |
ac7ad710593499a6d1f2122cad7214c723d41d53 | JavaScript | Javert899/pm4py-tool | /html/js/app-main.js | UTF-8 | 5,282 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | const ServiceUrl = "http://localhost:5000";
let objMapping = {};
let algoMapping = {};
let objNames = {};
let tabsMap = {};
let childsCompMap = {};
let Tab = {
template: '<div v-if="isActive">{{name}}<br /><template v-for="(child, index) in children"><component :is="child" :key="child.name"></component></templat... | true |
c60045938666ee97cd2bac77fab9699bb4851ea1 | JavaScript | Badane/Translann | /back/app/controllers/translations.controller.js | UTF-8 | 2,868 | 2.578125 | 3 | [] | no_license | const db = require("../models");
const Translation = db.translation;
// Create and Save a new translation
exports.create = (req, res) => {
// Validate request
if (!(req.body.projectId && req.body.language)) {
res.status(400).send({
message: "Some required fields are empty !"
});
... | true |
be77568576b693fa6bd8ded14b8c25ccaa84a0ad | JavaScript | HunterHardin/ShittierReddit | /public/js/threads.js | UTF-8 | 4,168 | 2.84375 | 3 | [] | no_license | "use strict";
const id = _id => document.getElementById(_id);
let local_item;
let local_comments = [];
document.querySelector("body").onload = main;
function main() {
const isVerifiedStr = localStorage.getItem("isVerified");
if (isVerifiedStr) {
const isVerified = JSON.parse(isVerifiedStr)... | true |
971dfe30bfabd995bad625645e52fa8222cc1bde | JavaScript | PetyaKatsarova/softUni-fundamentals | /finalExamPrep2/mirrorWords.js | UTF-8 | 1,670 | 3.109375 | 3 | [] | no_license | function mirrorWords([str]){
//find the hidden words pairs:
const regex = /([@|#])[A-Za-z]{3,}\1\1[A-Za-z]{3,}\1/g
let matched = str.match(regex)
let result = []
if(matched){
for(let i=0; i<matched.length; i++){
let pair = []
let first = matched[i].substring(0, matched[i].le... | true |
bbe340caf1b99dfc2d7205cef62d64e6953af6d8 | JavaScript | odashj/portfolio | /old/processing/empty-example/sketch.js | UTF-8 | 560 | 3.109375 | 3 | [
"CC-BY-3.0",
"MIT"
] | permissive | // Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
// Example 1-1: stroke and fill
color c1 = color(255, 0, 0);
color c2 = color(0, 0, 255);
function setup() {
createCanvas(700,500);
frameRate(15);
}
function draw() {
background(0);
for (int i = 200; i < width-150; i = i+140+mo... | true |
8a1c7cb075064fb25b85a5b9e24e5828a0433320 | JavaScript | chicosilva/cotacao | /src/core/actionsDataApi.js | UTF-8 | 1,244 | 2.515625 | 3 | [] | no_license | import { getToken} from "../users/reduce";
import {toast} from 'react-toastify';
const axios = require('axios');
const keys = require('../configs/keys');
export const getDataApi = url => {
return axios.get(`${keys.urlApi}/${url}/?token=` + getToken());
}
export const postDataApi = (data, callBack) => {
i... | true |
8e97ae54368fe644307d78b5a12e2d683cca1f99 | JavaScript | uk-gov-mirror/dwp.dwp-digital-dashboards | /public/javascripts/dashboard-charts.js | UTF-8 | 3,487 | 2.65625 | 3 | [] | no_license | $(function(){
google.charts.load('visualization','1', {packages: ['corechart','line']});
google.charts.setOnLoadCallback(runQueries);
function runQueries() {
var spreadsheetKey = "19Uc0FgtNDp9EfFhiHZJHG0ax8ZCtdvxSkbZryiOxSKo&gid=1690305366";
var getLineChartData = new google.visualization.Query('http://... | true |
0f4740293719660e5b3494e1338876b59a2e6d6e | JavaScript | hrazaq/pizza-stadium-2-master | /src/scripts/custom.js | UTF-8 | 1,099 | 2.640625 | 3 | [] | no_license | $(document).ready(function () {
$(document).on("scroll", onScroll);
});
function onScroll(event){
var scrollPos = $(document).scrollTop()+160;
try {
$('.top-affix a').each(function () {
var currLink = $(this);
var refElement = $(currLink.attr("target"));
if (refE... | true |
c9cedee4d96db7c3283b9f95d9df978410690c1e | JavaScript | FrederickPi1969/Mobile-Github-Profile-Viewer | /ProfileDisplayer/src/following_screen.jsx | UTF-8 | 5,291 | 2.6875 | 3 | [] | no_license | /* eslint-disable global-require */
import React from 'react';
import {
StyleSheet, Text, View, TouchableOpacity,
ImageBackground, Image,
} from 'react-native';
import { StackActions } from '@react-navigation/native';
import { fetchData } from './model';
import EmptyScreen from './empty_screen';
/**
* Check wheth... | true |
887997984974e297bd3a18b1663f233c6b6d24fe | JavaScript | Requiem-of-Zero/W10D3 | /widgets/frontend/autocomplete.jsx | UTF-8 | 693 | 2.96875 | 3 | [] | no_license | import React from 'react';
class Autocomplete extends React.Component {
constructor(props){
super(props);
this.state = {
names: props.names,
}
this.handleChange = this.handleChange.bind(this);
}
handleChange(e) {
const newNames = this.props.names.filter(name =>
name.toLowerCas... | true |
146914fc874886c7c5c1674f0534e656f8441daf | JavaScript | Dipti104706/JS_Programming_Constructs | /ifelseifProblem/FindMaxMInInArithmaticOp.js | UTF-8 | 1,028 | 4.03125 | 4 | [] | no_license | const prompt = require("prompt-sync")();
const num1 =prompt("Enter first number:");
const num2 = prompt("Enter second number:");
const num3 = prompt("Enter third number:");
//Arithmatic operations
let res1 = (num1+num2)*num3;
let res2 = (num1%num2)+num3;
let res3 = (num3+num1)/num2;
let res4 = (num1*num2)+num3;
consol... | true |
2f9893facf8fcdb8fa6f8d10cb96186d7b9edb68 | JavaScript | oscarMartinezMalo/JWTexpressMongoDB | /routes/auth.js | UTF-8 | 1,835 | 2.578125 | 3 | [] | no_license | import express from 'express';
const router = express.Router();
import User from '../model/User';
import validation from './validation';
import bcrypt from 'bcryptjs';
import jwt from 'jsonwebtoken';
router.post('/register', async function (req, res) {
// VALIDATE THE DATA BEFORE REGISTER A USER
const { error } = ... | true |
20ce65d5060af96ddf9a31992e7476804260695a | JavaScript | adrianfalconi22/BlogComIT2017EM | /Aplicacion/Scripts/Funcion.js | UTF-8 | 2,483 | 3.0625 | 3 | [] | no_license | function bienvenida() {
alert("Bienvenido !!!");
var nombre = prompt("Ingresá tu nombre:");
while (nombre == '' || nombre == undefined) {
nombre = prompt("Ingresá tu nombre:");
}
alert("Hola " + nombre + "!!!!!! :)");
var respuesta = confirm("Sos de Vélez??");
if (respuesta) {
... | true |
bf9db6860e6fe22e2d6f699a033802baf63e8ead | JavaScript | nicolasazuara/watercolor | /sketch.js | UTF-8 | 20,808 | 2.96875 | 3 | [
"MIT"
] | permissive | /*
MIT License
Copyright (c) 2021 Nicolás Azuara Hernández (@nicolasazuara)
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, including without limitation t... | true |
90c33c16b934b23bf37418727a24e06013ab75dd | JavaScript | amanuel2/ng-forum | /app/shared/services/replaceService.js | UTF-8 | 478 | 2.6875 | 3 | [
"MIT"
] | permissive | (function(angular){
'use strict';
var app = angular.module('ForumApp')
app.service('replaceService', [replaceServicefunc])
function replaceServicefunc(){
this.replaceAllString = function(str1, str2, ignore) {
return this.replace(new RegExp(str1.replace(/([\/\,\!\\... | true |
095130f5afed65c68af445c4c78140a6ec9e7a36 | JavaScript | zhongxiaofeng123/WebTech2 | /projectPractice/01-origin/js/bom/index.js | UTF-8 | 247 | 2.578125 | 3 | [] | no_license | var he ='hello'
function fn(){
console.log('你好')
}
// console.log(window.he)
// console.log(window.fn())
// setTimeout(() => {
// location.href = 'http://www.baidu.com'
// location.reload()
// console.log(history.length)
// }, 1000);
| true |
24a6fbdbe9d548e7f4219f8588e430ebf37c1431 | JavaScript | bkiac/walfo | /backend/src/utils/helpers.test.js | UTF-8 | 938 | 3.0625 | 3 | [] | no_license | /* eslint-env jest */
const helpers = require('./helpers');
describe('helpers', () => {
describe('chunk', () => {
describe('array.length > chunkSize', () => {
it('should return a chunked array, with chunks in the given size', () => {
const array = [1, 2, 3, 4];
const chunkSize = 2;
... | true |
a600b24e7e846a1c67f82bffd249505a08c5113f | JavaScript | logan2013/java8 | /js/old/curry.js | UTF-8 | 672 | 3.8125 | 4 | [] | no_license | (function() {
Function.prototype.curry = function() {
var _method = this;
var args = Array.prototype.slice.call(arguments);
return function() {
return _method.apply(this, args.concat(Array.prototype.slice
.call(arguments)));
};
};
var add = function(number1, number2) {
return number1 + number... | true |
e7d0943201ecfd8bc0056a9b70e5f73aceeef302 | JavaScript | brunolrb/calltaxi | /services/usuario/service.js | UTF-8 | 2,304 | 2.8125 | 3 | [] | no_license | var UsuarioController = require("./controllers/usuarioController.js");
var controller = new UsuarioController();
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
var port = proces... | true |
f30fa34fce040449df7d9dbec0a37bf015108ad5 | JavaScript | abdurahmanrizal/belajar-node | /assignment_2/app.js | UTF-8 | 421 | 2.71875 | 3 | [] | no_license | const express = require("express");
const app = express();
app.use("/", (req, res, next) => {
console.log("this is index");
next();
});
app.use("/users", (req, res, next) => {
console.log("this is users");
res.send(`
<ul>
<li>Abdurahman</li>
<li>Node js</li>
</ul>
... | true |
30a5667a7d444b0140c49df60daf441e12b2bb89 | JavaScript | Vishalgit23/AsynchronousJS | /index.js | UTF-8 | 1,212 | 3.515625 | 4 | [] | no_license | var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest
const request = new XMLHttpRequest(); // we have a request object now use to send request from a browser
// XMLHttpRequest (XHR) objects are used to interact with servers.
// You can retrieve data from a URL without having to do a full page refresh.
// Th... | true |
0705fa9a3fcffdcb6121ef5e4e754dcc6c1fdf36 | JavaScript | jeromebravo/simple-realtime-chat-app-version2 | /public/joinNamespace.js | UTF-8 | 1,498 | 2.859375 | 3 | [] | no_license | function joinNamespace(endpoint) {
nsSocket = io(endpoint);
nsSocket.on('roomlist', nsRooms => {
const roomlist = document.querySelector('#roomlist');
roomlist.innerHTML = '<li class="description">TEXT CHANNELS</li>';
nsRooms.forEach(room => {
roomlist.innerHTML += `<li cla... | true |
1379ea278efa923a987cf35c6761d1fb7f469960 | JavaScript | Apollon77/bthreads-wrapper | /index.js | UTF-8 | 13,779 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* This file is the main class that implements a wrapper around bthrads worker classes
*/
let threads;
const path = require('path');
const EventEmitter = require('events');
const fs = require('fs');
/**
* Main method of the wrapper called to initialize a wrapped object
* @param options Object with settings for ... | true |
8e88a8f6ecfb67be3a97fe73b1df4fb0421325d9 | JavaScript | qnrjs42/Javascript_Basis | /5.Function_Instance/3. Constructor_Property.js | UTF-8 | 665 | 3.828125 | 4 | [] | no_license | /*
Constructor Property
생성하는 function 오브젝트 참조
- function 오브젝트를 생성할 때 설정
- prototype에 연결
ES5: constructor 변경 불가
- 생성자 활용 불가능
ES6: constructor 변경 가능
- 활용성 높음
*/
// Book function 오브젝트: {
// prototype: {
// constructor: Book
// }
// }
// 1. constructor 비교
var Book = function(){};
var result = Book ===... | true |
63c41d7397ed06ab65b31021427564c847e32dc7 | JavaScript | mvillarl/cifimad-data | /web/js/autocomplete.js | UTF-8 | 782 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | _ac_target = '';
function autocomplete(req, resp) {
_ac_target = $('input[name=' + this.element[0].name + ']').attr ('cf_target');
var ac_source = $('input[name=' + this.element[0].name + ']').attr ('cf_source');
if (req.term == '') {
$('#' + _ac_target).val ('');
} else if (req.term.length >= ... | true |
5aa557fb33007cc5b3bdf39fc34167c4069954fa | JavaScript | Diganta165/BaperBank | /Banking.js | UTF-8 | 4,481 | 3.484375 | 3 | [] | no_license | function getInputValue(inputID) {
const inputField = document.getElementById(inputID);
const inputAmountText = inputField.value;
const amountValue = parseFloat(inputAmountText);
inputField.value = '';
return amountValue;
}
function getCurrentBalance(){
const balanceTotal = document.getElementB... | true |
6a81b0f5b0bd372dfd8df8f95f20348b33eef5df | JavaScript | mynkMishra/redux_praktis | /src/localStorage.js | UTF-8 | 499 | 2.796875 | 3 | [] | no_license |
const LocalStorage = {
save : function(data){
var keys = Object.keys(data)
keys.forEach((key)=>{
// console.log(data[key])
localStorage.setItem(key,JSON.stringify(data[key]))
})
},
get : function(key){
return JSON.parse(localStorage.getItem... | true |
b934f4fae6db26e2989c947b07838f7bc64cd6af | JavaScript | suampak/digital_pet | /front-end/src/components/skill.js | UTF-8 | 593 | 2.859375 | 3 | [] | no_license | import { MAXPARA } from "./constant.js";
export default class Skill {
constructor(strength = 0, intelligence = 0, art = 0) {
// max: 100 (+), min: 0 (-)
this.strength = strength;
this.intelligence = intelligence;
this.art = art;
}
fill(strDiff, intDiff, artDiff) {
this.strength =
this.... | true |
4f1db9c0dd2526da51b9e6797ba086c505e52aef | JavaScript | isacvale/-dvo-batch-query | /index.js | UTF-8 | 996 | 2.734375 | 3 | [] | no_license | function formatBatch( query, data ){
let match = query.match(/\(([^\(]*)\);?$/)
let params = match[1].split(',').map(x=>x.trim())
let response = []
data.forEach( reg => {
let innerCount = 0
let args=[]
for(let i=0; i<params.length; i++){
if(params[i]=='?'){
args.push(typeof reg[innerCo... | true |
fb502074e21a49620bfaf7e9ca91dce5823393e1 | JavaScript | wslqqcom/h5_1607mia | /src/js/register.js | UTF-8 | 4,488 | 2.90625 | 3 | [] | no_license |
//注册页面 验证码
//window.onload=function(){
//
//function getmima(){
// var yzm_box = document.getElementsByClassName("yam_box")[0];
// var yzmsx = document.getElementsByClassName("yzmsx")[0];
//
//
// var yanzhengma = "0123456789zxcvbnmlkjhgfdsaqwertyuiopZXCVBNMLKJHGFDSAQWERTYUIOP";
// var arr = "";
// for( var i=0; ... | true |
21d517a03f02d03aafe888599b88b799980c75b5 | JavaScript | Mohammad-Naim2007/Form-validation | /JS/custom.js | UTF-8 | 2,811 | 3.265625 | 3 | [] | no_license | // variable declare;
var fName = document.getElementById('fName');
var fnameErr = document.getElementById('fnameErr');
var lName = document.getElementById('lName');
var lnameErr = document.getElementById('lnameErr');
var email = document.getElementById('email');
var emailErr = document.getElementById('emailErr');
v... | true |
3aa3eea7fe8da026859039193b2778c6b2eefd88 | JavaScript | TurtleFeeder/visual_menu_front | /src/review.js | UTF-8 | 2,408 | 3.21875 | 3 | [] | no_license | class Review {
constructor(data, mealObj) {
this.id = data.id;
this.username = data.username;
this.content = data.content;
this.rating= data.rating;
this.meal = mealObj;
Review.all.push(this);
} // end Review constructor fn
static findById(id) {
return this.all.find(review => review.i... | true |
ba7dc28e9023761527a9e9945f45cc3786d64904 | JavaScript | skayi/js-loop | /src/loop.js | UTF-8 | 1,121 | 3.15625 | 3 | [] | no_license | /**
* Author Kwange
* -------------------------------------------------------------------
* [Usage]
* 1. import: import loop from "js-loop";
* 2. init:
* const loopInst = loop({
run: yourFunction,
args: arguments, which is using in yourFunction (not required)
threshhold: 1000
});
... | true |
d160ce91b12d31e2500c063be500fc738bd88244 | JavaScript | SLI97/sliblog | /src/server/service/tag.js | UTF-8 | 1,186 | 2.515625 | 3 | [] | no_license | const Tag = require("../model/tag")
const moment = require('moment');
//获取分类列表
exports.getTagsList = () => {
return new Promise((resolve, reject) => {
Tag.find().all((err, result) => {
if (err) reject("没找到")
resolve(result)
});
})
}
//添加分类
exports.addTag = ({ tagname }) => {
const tag = {
tagname,
cr... | true |
864c9db7f1508762b00bd2c0249bb4897da51898 | JavaScript | thatmichaelpark/sliding-tile-puzzle | /js/selectimage.js | UTF-8 | 1,253 | 2.546875 | 3 | [] | no_license | (function() {
'use strict';
window.loadThumbnails = (searchTerms) => {
const url = 'https://api.flickr.com/services/rest/';
const params = {
method: 'flickr.photos.search',
format: 'json',
nojsoncallback: 1,
tags: searchTerms
};
// Hack to avoid eslint camelCase error.
c... | true |
a5e47dafc91380fc204162797e6665f7a29718a9 | JavaScript | belen-dominguez/ada_itw | /18-Ventas-PC/js/tests.js | UTF-8 | 3,165 | 3.203125 | 3 | [] | no_license |
describe("TP 1 - Ventas de PC", () => {
it("precioMaquina(componentes): recibe un array de componentes y devuelve el precio de la máquina que se puede armar con esos componentes, que es la suma de los precios de cada componente incluido. -Ej01", () => {
const componentes = ["Monitor GPRS 3000", "Motherbo... | true |
dba09bb6cfa1bd064974e3271e91bdb704b9aa0b | JavaScript | lucifer2355/JavaScript-Algorithms | /recursion/factorial.js | UTF-8 | 301 | 4.1875 | 4 | [] | no_license | function factorial(n) {
if (n === 1) {
return 1;
}
return n * factorial(n - 1);
}
//* Time Complexity
//! In every function call => O(1)
//! But we trigger multiple function calls => n function calls
//! T => n * O(1) => O(n)
//* Space Complexity
//! S => O(n)
console.log(factorial(5));
| true |
efe5e01b01b9d3bd07d0b61b23b6464456c8c7a3 | JavaScript | hagenwatkins/mustacheDaily | /app.js | UTF-8 | 3,167 | 2.90625 | 3 | [] | no_license | const express = require('express');
const mustache = require('mustache-express');
const app = express();
app.engine('mustache', mustache());
app.set('view engine', 'mustache');
app.set('views', __dirname + '/views');
app.get('/', function(req, res) {
//TODO: Create a mustache index view that links to the other pag... | true |
d69dee2d2f9ca7fc7ea3840c5c276d74f1034a31 | JavaScript | JordanMartin/marked | /examples/plugin.js | UTF-8 | 1,987 | 2.8125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | 'use strict';
var marked = require('marked');
var csv = require('csv-string');
var html = require('escape-html');
// Enable plugins for all instances
marked.setOptions({plugins: true});
// Initialize renderer
var renderer = new marked.Renderer({
plugins: {
// Convert `@link(title,url)` into link.
links: fu... | true |
952e609d86fc16371f6de4740af90ec1a5dd25ae | JavaScript | ValleySoftSystems/vgotjs0318 | /codingbat/a2/29_notAlone_Array-2.js | UTF-8 | 1,495 | 4.1875 | 4 | [] | no_license | /*
Problem:
We'll say that an element in an array is "alone" if there are values before and after it, and those values are different from it. Return a version of the given array where every instance of the given value which is alone is replaced by whichever value to its left or right is larger.
*/
function not... | true |
665fb07e0567c7ba32982e725f80064b512107cc | JavaScript | mattgawron/codewars-kata | /kyu-7/two-to-one/solution.js | UTF-8 | 580 | 3.3125 | 3 | [] | no_license | const mapStringToLetters = (string) => string.split('');
const filterUniqueElements = (array) => {
const reductor = (result, element) => {
if (!result.includes(element)) {
result.push(element);
}
return result;
};
return array.reduce(reductor, []);
};
const longest = (s1, s2) => {
const firs... | true |
076cc57e882f64efbc63af03a1d7527a9bce2612 | JavaScript | iamaracinghorse/shane-berry.com | /slider/assets/js/main.js | UTF-8 | 2,816 | 2.828125 | 3 | [] | no_license | // tap handler
(function($) {
$.event.special.tap = {
setup: function(data, namespaces) {
var $elem = $(this);
$elem.bind('touchstart', $.event.special.tap.handler)
.bind('touchmove', $.event.special.tap.handler)
.bind('touchend', $.event.special.tap... | true |
ef738fa50b6df1a2294842e4e3aa730a123b15a3 | JavaScript | vijayshankar123/NAYA-STUDIO | /client/src/reducers/userReducer.jsx | UTF-8 | 785 | 2.5625 | 3 | [] | no_license | import {
REGISTER_SUCCESS,
REGISTER_FAIL,
CLEAR_ERROR,
TOTAL_COUNT
} from "../actions/types";
const initialState = {
loading: true,
user: "",
error: null,
count: null
};
export default function(state = initialState, action) {
switch (action.type) {
case REGISTER_SUCCESS:
return {
.... | true |
91d5b7a0f896751c04b3b542af3e8e732e47901b | JavaScript | lndgalante/codewars-katas | /7-kyu/Formatting decimal places #1/index.test.js | UTF-8 | 285 | 2.515625 | 3 | [
"MIT"
] | permissive | const twoDecimalPlaces = require('.')
test('Test 1', () => {
expect(twoDecimalPlaces(10.1289767789)).toBe(10.12)
})
test('Test 2', () => {
expect(twoDecimalPlaces(-7488.83485834983)).toBe(-7488.83)
})
test('Test 3', () => {
expect(twoDecimalPlaces(4.653725356)).toBe(4.65)
})
| true |
3339f80f5988275149a12575b5b7d718a7fdb9a0 | JavaScript | bjlv1997/jQTest | /work/js/03_jQuery核心函数.js | UTF-8 | 751 | 3.71875 | 4 | [] | no_license | //1.1当DOM加载完成后,执行此回调函数
$(function () {//绑定文档加载完成的监听
$("#btn").click(function () {
// alert(this.innerHTML);
console.log('js方法获取:'+this.innerHTML)
alert($(this).html());
console.log('jQ方法获取:'+$(this).html())
$('<input type="text" name="msg3"><br>').appendTo('div');
});
})
... | true |
67cc708f7d2998af11f32f3f9842ac907e0ca165 | JavaScript | sbenn9210/js201 | /exercises/230-long-long-vowels.js | UTF-8 | 557 | 4.25 | 4 | [
"ISC"
] | permissive | // Write a function "longLongVowels" which is given a string, and returns a
// version of that string extending any long vowels to 5 characters.
//
// Examples:
// > longLongVowels('Good')
// 'Goooood'
// > longLongVowels('Cheese')
// 'Cheeeeese'
// > longLongVowels('Man')
// 'Man'
function longLongVowels(word) {
va... | true |
9127668a565b3c6d3d3601175e4ab6420f92e7fe | JavaScript | The-Fireplace/P2.14 | /js/SceneMainMenu.js | UTF-8 | 3,981 | 2.5625 | 3 | [] | no_license | let bgConfig = {
volume: .3,
loop: true
};
class SceneMainMenu extends Phaser.Scene
{
constructor()
{
super({ key: "SceneMainMenu" });
}
preload()
{
this.load.image("sprBg", "resources/background.png");
this.load.image("sprBtnPlay", "resources/play_button.png");
... | true |
d4e507031c404288970eccb564ee8863b928475b | JavaScript | bharani-palani-zz/D3Charts | /charts/chartconfig.js | UTF-8 | 2,456 | 2.765625 | 3 | [] | no_license | export default class ChartConfig {
// errorMsg(property, type) {
// return `Please pass ${property} type as ${type}`;
// }
name(t) {
if (
t !== undefined &&
t !== null &&
t !== "" &&
(typeof t === "string" || typeof t === "number")
) {
this.name = t;
} else {
//... | true |
932dd85512096a0eaaa9557ba1cbf7eff2399ee3 | JavaScript | XiaoHeng20190505/NodeJS | /http/http.js | UTF-8 | 474 | 2.6875 | 3 | [] | no_license | var http = require('http'); // 引入http模块,使用http
http.createServer((request, response) => {
// request 请求头
console.log(request.url);
// response 响应头
// 设置响应头的参数
response.writeHead(200, { 'Content-Type': 'text/html;charset=utf-8' });
// 设置响应信息
response.write('你好 Hello World')
response.end(... | true |
8e42862e0dc5d24205c9fe94b28988830a114724 | JavaScript | kevinbrianfahy/kevinbrianfahy.github.io | /js/effects.js | UTF-8 | 2,706 | 2.53125 | 3 | [] | no_license | var drawcurt = function() {
var commands = {
a: $('html').addClass('lightson'),
b: $('body').addClass('fadeblack'),
c: $('body').addClass('patternfade'),
d: $('.videotext').hide(),
e: $('.curtaintop').show().animate({'top': '85px'}, 'fast'),
f: $('.curtaintop').animat... | true |
20a92fa502df521fd85d811942ae891d216c15e2 | JavaScript | ikheraj17/DMI_take_home | /app/containers/String/reducer.js | UTF-8 | 808 | 2.578125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
*
* String reducer
*
*/
import produce from 'immer';
import {
LOAD_STRINGS,
LOAD_STRINGS_FAILURE,
LOAD_STRINGS_SUCCESS,
} from './constants';
export const initialState = {
allStrings: [],
loading: false,
error: true,
};
/* eslint-disable default-case, no-param-reassign */
const stringReducer = (sta... | true |
a3c608420eb676f5691719854b4a59f21d1f2029 | JavaScript | youmeiluoyang/hnyz | /src/main/webapp/resources/js/common.js | UTF-8 | 7,942 | 2.671875 | 3 | [
"MIT"
] | permissive | $(function(){
//主菜单点击
$('.cate_hd').each(function(){
$(this).click(function(){
if(!$(this).parent().hasClass('current')){
$('.cate').removeClass('current');
$(this).parent().addClass('current');
$('.cate_bd').slideUp();
$(this... | true |
da5b0b9b9c6ddd625612b36de321ed502b78b054 | JavaScript | alexmanyeki/mern-movie-booking-app | /server/app/services/seats.js | UTF-8 | 5,238 | 2.6875 | 3 | [] | no_license | import async from 'async';
import Seats from '../models/seats';
import { generateSeatSeed } from '../seed/seatSeed';
export const getAllSeats = (req, res) => {
Seats.find({}, (err, seats) => {
if(err) {
res.status(500).send(err);
return;
}
res.status(200).send(seats... | true |
5c440b1699cb3dba6ae7e37fc2757bf3c66f6ffa | JavaScript | Manmohan7/MathQuiz | /src/App.js | UTF-8 | 753 | 2.9375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Game from './Game';
import Score from './Score'
class App extends Component {
state = {
totalAnswers: 0,
correctAnswers: 0
};
updateMarks = (isCorrect) => {
let correct = isCorrect ? 1 : 0
this.setState((current) => ({
... | true |
98061c0a702b163b532c1aa29f09b648f0f43aa8 | JavaScript | mbordner/APIAuthDynamicValue | /APIAuthDynamicValue.js | UTF-8 | 2,927 | 2.5625 | 3 | [] | no_license | var APIAuthDynamicValue = function () {
this.sha1 = function (str, key) {
var dv = new DynamicValue('com.luckymarmot.HMACDynamicValue', {
'input': str,
'key': key,
'algorithm': 1 /* SHA1 */
});
return dv.getEvaluatedString();
};
this.b64 = function... | true |
4ddf33410fc8029fb3eaa3cf6779cbda3283dfe5 | JavaScript | Drumsid/fuso-test | /calculator/res/calc.js | UTF-8 | 8,712 | 2.921875 | 3 | [] | no_license | (function(){
function MyCalc(element, options) {
self = this;
this.element = $(element);
this.options = $.extend({}, MyCalc.Defaults, options);
this.init();
this.calc(false);
}
MyCalc.Defaults = {
};
MyCalc.prototype.init = function() {
$(document).on('change', '#sc', function() {
self.calc($(... | true |
960ec4b7a27830a2950cc39a9f171b357ea10bb6 | JavaScript | louiselynggaard/Eksamen-2020 | /app.js | UTF-8 | 864 | 2.59375 | 3 | [] | no_license | //Middleware
const express = require('express');
const bodyParser = require('body-parser');
//const fs = require('fs');
//const http = require('http');
//console.log(http.METHODS); //Viser alle tilgængelige http-metoder vdr. API'er.
//console.log(http.STATUS_CODES); //Viser alle tilgængelige hhtp-statuskoder - forespør... | true |
b068af7bac4e716a2f22dc9ba9b4c67c7126c2ae | JavaScript | nanoshinonomee/express-tutorial | /main/handlerExample.js | UTF-8 | 1,523 | 3.4375 | 3 | [] | no_license |
// this is called from appCallHandler.js which is called from index.js
// this is basically a way you can link things and organize them if you want
// this is basically exporting a function that will handle a request, and the response
exports.handlerExampleFunc = function(req, res){
// you could do something her... | true |
0c2fdfb4305cc9f1dae97c3c90a7452267c9b02e | JavaScript | filipnathanel/canvas-scanner | /app/scripts/scanResult.js | UTF-8 | 2,261 | 2.875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | import * as utils from './utils/utils';
import Canvas from './canvas';
/**
* A class to handle the canvas containng the result of scanning
*/
export default class ScanResult extends Canvas {
constructor( scanResult, context ) {
super( scanResult, context );
this.init();
this.initEvents();
}
init() {
... | true |
e3e61726d9738c3be0061afe2f317bdd1ff09780 | JavaScript | Jelly-Donuts/Resume_Gen | /public/assets/js/formInputManagement.js | UTF-8 | 779 | 2.640625 | 3 | [] | no_license | $(document).ready(function () {
$(".phone").blur(function (){
let x = $(this).val().replace(/[{()}]/g, "");
x = x.replace(/[\[\]']+/g, '');
x = x.replace(/-| /g, '');
if (x.length === 10){
$(this).val("(" + x.substring(0,3) + ") " + x.substring(3,6) + "-" + x.substr... | true |
40ff188e40a7ea7a8f383c44c80f69b73de946cb | JavaScript | AlexTaber/uphold | /app/assets/javascripts/home.js | UTF-8 | 1,403 | 2.765625 | 3 | [] | no_license | var fadeInAboutsIndex = 0;
var scrollPosition = 0;
$(document).ready(function() {
fadeInHeader();
$(".service").on("mouseenter", serviceEnter);
$(".service").on("mouseleave", serviceLeave);
setTimeout(checkScroll, 200);
});
function fadeInHeader() {
$(".home-header-container").hide();
$(".home-header-con... | true |
58f984090402b46e3a56cf348a7ef8f5d086b383 | JavaScript | setun-90/mongof | /src/init.js | UTF-8 | 455 | 2.53125 | 3 | [] | no_license | var loadPredicats = function(db){
//db.trapeze.insert( { name: "Jeune", value : new trapeze(18,20,30,35), domain : { property : [ "Age" ], collection: [ ] }});
cursor = db.trapeze.find();
print("Creating Variables");
while(cursor.hasNext()){
var c = new predicat(cursor.next());
var name ... | true |
b27c4e072aad2be8593dadcb0ae907d996aa6d25 | JavaScript | lohmander/tidy | /src/lexer.js | UTF-8 | 2,273 | 2.921875 | 3 | [] | no_license | var Lexer = require('lex');
var indent = [0];
module.exports = (new Lexer)
// Indentation
.addRule(/\n\s+/g, function(lexeme) {
var indentation = lexeme.replace(/\n/g, '').length;
if (indentation > indent[0]) {
indent.unshift(indentation);
return 'INDENT';
}
var tokens = [];
whil... | true |
496e0d0049ee24b1f146bc72d2b38c3605621286 | JavaScript | Cybre3/JanKM3 | /Lesson5_Advanced DOM/EXER13_Advanced DOM/EXER13_4.NumpadCalc/04. Numpad-Calculator/solutionAttempt1.js | UTF-8 | 1,785 | 3.484375 | 3 | [] | no_license | function solve() {
const buttons = document.querySelectorAll("button");
const expressField = document.getElementById("expressionOutput");
const resultField = document.getElementById("resultOutput");
const validOpRegex = /^\d+\.?\d*[\+\-\/\*]\d+/gm;
const validNumRegex = /^\d+\.?\d*/gm;
let resul... | true |
b5fb0047322f8323437ee6747a6cf20e7c0bc749 | JavaScript | francomastrantonio/React-Native-Final | /screens/landing.js | UTF-8 | 2,693 | 2.53125 | 3 | [] | no_license | //import logo from './../../img/tinderWorldWideLogo.png';
import React from 'react';
import { View, Image, Text, StyleSheet } from 'react-native';
export default function Landing () {
return (
<View>
<Text>
¿Estas listo para un encuentro casual?
</Text>
</View>
)
}
const styl... | true |
4b06c393983fb576364ebe97bfc6c8aff7cb9aac | JavaScript | zendesk/turtle | /test/client/ok.server1.test1.client.js | UTF-8 | 445 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | describe('Remote testing the server behaviour', function() {
it('$.get should return "ok"', function(done) {
$.get('http://localhost:4200/')
.success(function(data) {
if(data === 'ok') {
done();
} else {
done(new Error('Expected the returned data to be "ok" but it was "... | true |
d47613006fe444b615fa2ead9953f522c496f351 | JavaScript | MohamedTebba/landing-page | /js/app.js | UTF-8 | 6,086 | 2.859375 | 3 | [] | no_license | const domElements = () => {
const domStrings = {
SECTION: "section",
NAVBAR_LIST: "navbar__list",
TO_UP: ".to-up",
PAGE_HEADER: ".page__header",
LIST_ITEM: "ul li"
};
return {
sections: document.querySelectorAll(domStrings.SECTION),
ulList: document.g... | true |
9a0b0b567da17a6aff9b3520600b78501c382ad5 | JavaScript | priyamsharma2704/SourceCodes | /javascript tutorials/packageInstaller.js | UTF-8 | 2,463 | 2.75 | 3 | [] | no_license | //var input = ["Leetmeme: Cyberportal","Cyberportal: Leetmeme"];
var input = ["KittenService: ","Leetmeme: Cyberportal","Cyberportal: Ice","CamelCaser: KittenService","Fraudstream: Leetmeme","Ice: "];
var inputLines = new Map();
var installOrder = [];
var success = true;
processInput = function(){
document.write(inp... | true |
2226965e2ce612a49b45da23ebb02ab3ba560326 | JavaScript | amercier/sandbox | /amd/08-phantomjs/module1.js | UTF-8 | 240 | 2.546875 | 3 | [] | no_license | "use strict";
console.log('Loading module1.js');
define([], function(){
console.log('Executing module1.js');
return {
speak: function(message) {
console.log('module1.js: ' + message);
return 'ok';
}
};
});
| true |
65821cbb4a284b256ac952888b8652a63233ea28 | JavaScript | laurieboyes/ovo-tech-test | /src/lib/get-annual-consumption.js | UTF-8 | 2,042 | 3.046875 | 3 | [] | no_license | const toTwoDecimalPlaces = require('./util/to-two-decimal-places');
const prices = require('../config/prices.json');
const vatMultiplier = require('../config/vat-multiplier.json');
module.exports = ({ tariffName, fuelType, targetMonthlySpend }) => {
// I recognise the irony of deciding not to use TypeScript and then... | true |
df47eb1db0d7a2a1705bd7f3a594ec0fe4ad00f7 | JavaScript | NKKFu/tcp-server | /server.js | UTF-8 | 1,528 | 2.640625 | 3 | [] | no_license | const net = require('net');
const { v4: uuidv4 } = require('uuid');
const socketsList = [];
const server = net.createServer((socket) => {
const client = {
socket,
id: uuidv4(),
ip: socket.remoteAddress
};
socket.write(JSON.stringify({
id: uuidv4(),
ip: socket.remo... | true |
669031ba04feb87fd29359536239b1838a73c1f8 | JavaScript | 1800F/Alexa | /skill/variables.js | UTF-8 | 4,081 | 2.578125 | 3 | [] | no_license | /**
* Copyright (C) Crossborders LLC - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
*
* Variables use with responses.
*
* Written by Christian Torres <christiant@rain.agency>, March 2016
*/
'use strict';
var _ = require('lodash')... | true |
95e76e78ffdd80ff6915b9c4c3d3b91f70e560ae | JavaScript | DharanishV/mern-crud | /crud-frontend/src/Popup.js | UTF-8 | 2,480 | 2.75 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import CancelIcon from '@material-ui/icons/Cancel';
// For real time
import io from 'socket.io-client'
// For uploading data
import axios from 'axios'
const socket = io('http://localhost:5000/');
const Popup = ({ setPopup, task, setTasks, setCardTask }) => {
... | true |
dfc9ae111006c4c094e60f1d69f11e8c5b5b4a3a | JavaScript | arschmitz/status-cat-bot | /index.js | UTF-8 | 1,978 | 2.671875 | 3 | [
"MIT"
] | permissive | var Slack = require( "slack-client" );
var httpCats = function( key ) {
var slack = new Slack( key, true, true );
slack.on( "open", function() {
var channels = [];
var groups = [];
var unreads = slack.getUnreadCount();
for ( var channelName in slack.channels ) {
var channel = slack.channels[ channelName ];
i... | true |
509e896b3e194a7e4d2d1471d7677fa953989d97 | JavaScript | shang19875366/smart-classroom | /src/utils/test.js | UTF-8 | 4,759 | 2.6875 | 3 | [] | no_license |
/* <![CDATA[ */
var penColor="#F31718";
var penWight=8;
var draw = null;
function initDraw(){
$("#canvasContainer").html("");
var width=1920 || window.innerWidth;
var height=1080 || window.innerHeight;
var openDrawPen=1;//1为开启画笔功能
//width=1920;
//height=1920;
//$("#canvasContainer").css("he... | true |
0dc466fece1e38b25843f4190211f56bcfd02573 | JavaScript | jefferson99ss/prueba | /ejercicio2.js | UTF-8 | 499 | 3.8125 | 4 | [] | no_license | let tiradas = 20;
function init(){
let count = 0;
for (let i = 0; i < tiradas; i++) {
count += this.tirarDados();
}
console.log("Las veces que dio 10 la suma de los dados fue:" + count);
}
function tirarDados(){
let dado1 = Math.ceil(Math.random() * 6);
let dado2 = Math.ceil(Math.rando... | true |
4db6a7237f8c2e1951aeb75b905ea158ed3d5baf | JavaScript | lenndachen/MeetFresh | /src/Context/CartContext.js | UTF-8 | 2,250 | 2.609375 | 3 | [] | no_license | import React from "react";
const CartContext = React.createContext();
// export const CartProvider = CartContext.Provider;
const Reducer = (state, action) => {
console.log("heoak;dfja;dkfja", state, action.payload);
switch (action.type) {
case "ADD_CART_ITEM":
console.log(action.payload);
return ... | true |
d56bfc77fe093157724cd38920a05338a7598af5 | JavaScript | Dmitry-White/HackerRank | /30 Days of Code/JavaScript/day_14.js | UTF-8 | 752 | 4.0625 | 4 | [
"MIT"
] | permissive | /*
Created on Sat May 13 17:41 2023
@author: Dmitry White
*/
/*
TODO: Complete the Difference class by writing the following:
A class constructor that takes an array of integers as a parameter
and saves it to the elements instance variable.
A computeDifference method that finds the maximum absolute ... | true |
f2e79d355629ee49313d08753588bded718fe3c0 | JavaScript | JoshuaHolloway/amazon-motivational-quotes | /src/hooks/use-http.js | UTF-8 | 2,055 | 2.859375 | 3 | [] | no_license | import { useReducer, useCallback } from 'react';
// ==============================================
function httpReducer(state, action) {
if (action.type === 'SEND') {
return {
data: null,
error: null,
status: 'pending',
};
}
if (action.type === 'SUCCESS') {
return {
data: ac... | true |
d47e445b85170480e8507ac088a747ab61df4cc5 | JavaScript | broucz/create-action | /src/index.js | UTF-8 | 1,780 | 3.5 | 4 | [
"MIT"
] | permissive | /**
* Utility function that ensure `creator` to be a function.
* If the `creator` is undefined or not a function, an Identity function
* is applied.
*
* @type {any}
* @return {Function}
*/
const selectCreator = creator =>
(typeof creator === 'function')
? creator
: value => value;
/**
* Warp an actio... | true |
114b6d9ec4d7ab7ec76a0eb9f8a51e63036f1fba | JavaScript | danielSanchez98/OTO-StreamingApp | /back/control/usuarioControl.js | UTF-8 | 1,889 | 2.84375 | 3 | [
"MIT"
] | permissive | const Usuario = require('../modelo/usuario');
// Función Registro Usuario
function registrarUsuario(req, res){
var usuario = new Usuario();
var parametros = req.body;
usuario.nombre = parametros.nombre;
usuario.apellido = parametros.apellido;
usuario.correo = parametros.correo;
usuario.contras... | true |
af54f309d7797d1d05b5a484c6ad920f0680f571 | JavaScript | 4rno/freshbooks.js | /examples/invoice.list.js | UTF-8 | 957 | 2.9375 | 3 | [
"LicenseRef-scancode-other-permissive",
"MIT"
] | permissive | var FreshBooks = require('../');
/* FreshBooks() initiates your connection to the FreshBooks API.
This requires your "API URL" and "Authentication Token". To get these variables
open FreshBooks and goto My Account > FreshBooks API. */
var api_url = "https://freshbooksjs.freshbooks.com/api/2.1/xml-in"
, api_token ... | true |
c2ae2d21d109a944e4abc68ed98c632d3190c7d2 | JavaScript | natorius/power-game | /lib/cards.js | UTF-8 | 2,913 | 3.15625 | 3 | [] | no_license |
function Card(value, resourceType, resourceCount, citiesPowered) {
this.value = value;
this.resourceType = resourceType;
this.resourceCount = resourceCount;
this.citiesPowered = citiesPowered;
}
// holds the indices of the cards to be shuffled to init the deck
// 3-10 start in the market, 13 gets add... | true |
506f356d1cb8a33287929dbcd997d4cc04784264 | JavaScript | fengxianqi/front_end-demos | /src/interview/倒计时.js | UTF-8 | 1,342 | 3.328125 | 3 | [] | no_license | // 实现更精确的倒计时
// https://github.com/wengjq/Blog/issues/26
// 当前服务器时间 = 服务器系统返回时间 + 网络传输时间 + 前端渲染时间 + 常量(可选)
// 思路:
// 在setTimeout函数的内部,通过当前时间-理论执行时间,得出下一个setTimeout执行的间隔
// 线程占用
setInterval(function () {
var j = 0;
while(j++ < 100000000);
}, 0);
// ***********************倒计时开始****************************... | true |
ed392f940fecc0242b95a580799476e42c2cf63b | JavaScript | real-jacket/pika-music | /src/utils/index.js | UTF-8 | 1,313 | 2.640625 | 3 | [
"MIT"
] | permissive | export const awaitWrapper = pFn => {
return async (...args) => {
try {
const res = await Promise.resolve(
typeof pFn === "function" ? pFn(...args) : pFn,
)
return [null, res]
} catch (error) {
return [error, null]
}
}
}
export const isDEV = process.env.NODE_ENV !== "prod... | true |
eda399978fd6f7aa10047734dc49072757d14336 | JavaScript | ciffelia/email-notification | /src/renderer/resizeToContentAndMoveWindow.js | UTF-8 | 720 | 2.53125 | 3 | [
"MIT"
] | permissive | import { remote } from 'electron'
const resizeToContentAndMoveWindow = position => {
const browserWindow = remote.getCurrentWindow()
const displaySize = remote.screen.getPrimaryDisplay().size
const width = document.documentElement.offsetWidth
const height = document.documentElement.offsetHeight
browserWindo... | true |
b7f22001f40ee6aa330a2d31c9fe865b092738a4 | JavaScript | 301choso/capital_match_game | /capital_match/js/start.js | UTF-8 | 3,595 | 3.03125 | 3 | [] | no_license | const main = document.querySelector('#main');
const qna = document.querySelector('#qna');
const result = document.querySelector('#result');
const arr=[0,0,0,0,0,0,0,0];
const endpoint = arr.length;
function resultAnswer(){
const resultName2 = document.querySelector('.resultname2');
/*
let table = document.cre... | true |
5c6fcc86893852ed000a0da800f5cdac9880b2bc | JavaScript | GuhaAG/bwj-test | /public/EmployeeRoster.jsx | UTF-8 | 5,535 | 2.515625 | 3 | [] | no_license |
var EmployeesAll = React.createClass({
getInitialState: function () {
return { name: '' ,address: '',email:'',phone:'',id:'',job:'',salary:'',Buttontxt:'Save', data1: [] };
},
handleChange: function(e) {
this.setState({[e.target.name]: e.target.value});
},
componentDidMount() {
... | true |
3257a8c9543b36348029602cdda2ea2e90df7d4b | JavaScript | yikuansun/svggame | /code.js | UTF-8 | 6,020 | 2.859375 | 3 | [] | no_license | svgns = "http://www.w3.org/2000/svg";
playerCoords = [];
velocity_up = 0;
velocity_right = 0;
function buildPlatform(x, y, width, height) {
platform = document.createElementNS(svgns, "rect");
platform.style.fill = "rgb(0, 120, 0)";
platform.setAttribute("width", width); platform.setAttribute("height", hei... | true |