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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1d03daab4117e0bca632605493f5c6a8c00a7508 | JavaScript | xxn520/Algorithms-Js | /dfs/NQueens.js | UTF-8 | 1,024 | 3.671875 | 4 | [] | no_license | let n = 8
let a = [] // 列坐标
let b = [], c = [], d = []
let ans = 0
function dfs(row) {
if (row > n) {
ans++
let ret = ''
for (let j = 1; j < n; j++) {
ret = ret + a[j] + ' '
}
ret += a[n]
console.log(ret)
} else {
for (let i = 1; i <=... | true |
973fef80e29b2e298ca99052a44e618bcde6d780 | JavaScript | aA-curtissimo/AA-Group-Project | /public/js/signin.js | UTF-8 | 1,802 | 2.59375 | 3 | [] | no_license | import { handleErrors, api } from "./utils.js";
const registerForm = document.querySelector(".register-form");
const guestButton = document.querySelector(".guest-button");
registerForm.addEventListener("submit", async (e) => {
e.preventDefault();
const formData = new FormData(registerForm);
const userName ... | true |
8776cf363801e509e05a0248e4ecb5bfdc9e441c | JavaScript | lndgalante/codewars-katas | /7-kyu/Linked Lists - Push & BuildOneTwoThree/index.test.js | UTF-8 | 636 | 2.703125 | 3 | [
"MIT"
] | permissive | const { Node, push, buildOneTwoThree } = require('.')
test('Test 1', () => {
expect(push(null, 1).data).toBe(1)
})
test('Test 2', () => {
expect(push(null, 1).next).toBeNull()
})
test('Test 3', () => {
expect(push(new Node(1), 2).data).toBe(2)
})
test('Test 4', () => {
expect(push(new Node(1), 2).next.data)... | true |
09604eae42f5d39ec4562615c21b56f67185f65a | JavaScript | CristhianCV/quizz | /src/context/Reducer.js | UTF-8 | 745 | 2.609375 | 3 | [] | no_license | import { EVENTS } from "./ReducerEvents";
export const initialState = {
currentQuestionIndex: 0,
name: "",
score: 0,
startTime: null,
time: null,
};
const reducer = (state, action) => {
switch (action.type) {
case EVENTS.LOGIN:
return {
...state,
name: action.name,
startT... | true |
800b0159950a9354dbc85a64c2ad3ec56828d2ce | JavaScript | ranadeeb92/JavaScript_Small_Problems | /codeWars/mexicanWave.js | UTF-8 | 1,563 | 4.15625 | 4 | [] | no_license | // PEDAC
// Input:
// -string
// Output:
// - array (array of string where uppercase letter is a person standing up)
// Rules:
// - Explicit requirements:
// - input string is all lowercase or empty
// - ignore white space character
// - Implicit requirements:
// - empty string => return empty array
// -
// -
// EXA... | true |
24aa77d16db55c7f76dc8592d81c6121571626c5 | JavaScript | matteo-hertel/FPTalk | /snippets/07-03CanonicalreduceFunctionalTwo.js | UTF-8 | 192 | 3.6875 | 4 | [
"Apache-2.0"
] | permissive | const numbers = [1, 2, 3, 4, 5];
const total = numbers.reduce(
(accumulator, number) => sum(accumulator, number),
0,
);
function sum(a, b) {
return a + b;
}
console.log(total); // 15
| true |
bea26d5487c388d55697986e132ad2a3bde343ad | JavaScript | JenEEsquivel/ywebca | /chapter02/chessboard.js | UTF-8 | 1,232 | 3.796875 | 4 | [] | no_license | // Still trying to solve this one without looking at the key. Going to look at key, enter answer and study that.
Chess.start = function (n) {
var sz = n || 8;
var chessboard = "";
for (var a = 0; a < sz; a++) {
for (var b = 0; b < sz; b++) {
if ((a + b) % 2 == 0)
chessboard += " ";
e... | true |
51e566165539c40f1d6a6f32507c2d7ef32f7f00 | JavaScript | sottar/googlemap_api_demo | /demo/javascript/script.js | UTF-8 | 6,320 | 2.59375 | 3 | [] | no_license | "use strict";
createMap();
/* map表示処理 */
function createMap() {
var $cassette = $('.item');
var mapPin = new Array(); // mapに表示されるpin
var stationListWidth = $('.block').width(); // 駅リストの横幅を取得
// mapPinの値を設定
$cassette.each(function (i) {
mapPin.push({
'latitude': Number($(this).attr('lat')),
... | true |
6273d16cea52c3eec2223e72ef6dbc3e370a5446 | JavaScript | tnct-spc/ibird | /server/lib/doclist.js | UTF-8 | 712 | 2.59375 | 3 | [] | no_license | import models from '../models'
const documents = models.documents
export default classid => {
return documents.findAll({
where: {classid: classid}
}).then(c => {
var returndata = c.filter(p => {
var startTime = new Date(p.startTime)
startTime = new Date(startTime.setHours(startTime.getHours() -... | true |
8b375210a2525f791fe9ddfcd581d99cbb5117e3 | JavaScript | iralitv/speakIt | /src/js/api-requests.js | UTF-8 | 983 | 2.578125 | 3 | [] | no_license | const getWord = async (page, level) => {
try {
const url = `https://afternoon-falls-25894.herokuapp.com/words?page=${page}&group=${level}`;
const res = await fetch(url);
const json = await res.json();
return json;
} catch (e) {
console.log(e);
}
};
const getImage = async (src) => {
try {
... | true |
f231a0f7c34d6f71712359d895ad506721ea4214 | JavaScript | patrickbucher/inf-stud-hslu | /aiot/src/web_backend/src/redis.js | UTF-8 | 1,774 | 2.859375 | 3 | [
"MIT"
] | permissive | const redis = require('redis');
const {promisify} = require('util');
class RedisDataStore {
constructor(address) {
this.client = redis.createClient(address);
this.client.on('error', () => {
console.error(`unable to connect to redis at ${address}`);
});
this.client.on('r... | true |
86c5367668135ee0ada32471689d029a6fc09c47 | JavaScript | step-batch-7/jsTools-symbiote-ux | /src/headLib.js | UTF-8 | 2,244 | 2.859375 | 3 | [] | no_license | 'use strict';
const StreamPicker = require('./streamPicker');
const isIntegerButNotZero = function(num) {
const illegalCount = 0;
return Number.isInteger(num) && num !== illegalCount;
};
const isCountValid = function(option, count) {
return option.includes('-n') && isIntegerButNotZero(+count);
};
const isFileP... | true |
57380ffdf59faf4a4e724c8c231245dd7713b1bd | JavaScript | microlabig/portfolio | /src/admin/requests.js | UTF-8 | 2,343 | 2.515625 | 3 | [] | no_license | import axios from 'axios';
import {CONSTS} from "../helpers/consts";
// возьмем токен из localstorage браузера
const token = localStorage.getItem('token');
// базовый URL
axios.defaults.baseURL = CONSTS.BASEURL;
// заголовок запроса
axios.defaults.headers['Authorization'] = `Bearer ${token}`;
// интерсепторы есть на... | true |
4f36c96289cc73501fc66d5e1d969b448333c28d | JavaScript | soberanesmajo/cdmx-social-network-frameworks | /social-network/src/components/login/Login.js | UTF-8 | 1,964 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import firebase from 'firebase';
import './Login.css';
import { Row, Input, Button } from 'react-materialize';
class Login extends Component { // clase padre component
constructor () {
super ();
this.state = {
user:... | true |
1cce535f7ac1b6bc23c3eefe4aa462d79972743e | JavaScript | apathy-dude/texture-builder | /src/menuBuilder.js | UTF-8 | 2,067 | 2.890625 | 3 | [
"Unlicense"
] | permissive | var plumb = require('./jsPlumbInstance');
module.exports = function menu() {
var width = 0;
var height = 0;
var style;
var newMenu = document.getElementById('menu-template').cloneNode(true);
newMenu.setTitle = function(title) {
newMenu.children[1].innerHTML = title;
};
if(argumen... | true |
938c7021656676c84a9f61bbe2f8bee251055b55 | JavaScript | gabocode2907/Challenges | /mayorElem.js | UTF-8 | 282 | 3.359375 | 3 | [] | no_license | function mayorElem(x) {
var mayorHastaAhora = x[0];
for(var i = 0 ; i <= x.length ; i++){
if(x[i]>mayorHastaAhora){
mayorHastaAhora = x[i];
}
}
return mayorHastaAhora;
}
console.log( mayorElem([8,3,11,2,-8]) ); // debe imprimir 11 | true |
cbf845c8ad992876f5fc672b66645447c9631d4e | JavaScript | nishanttelange1997/Using-useState | /src/App.js | UTF-8 | 634 | 2.921875 | 3 | [] | no_license | import {useState} from 'react';
import './design.css';
function App()
{
const [my_name,changeMyName] = useState("Nishant");
const [my_Age,changeMyAge] = useState(24);
const Click = () =>
{
changeMyName("Chetan");
}
const forAge = () =>
{
changeMyAge(23);
}
return(
<center >
<div className="create">
... | true |
69510c2baedefcf7484ff82dc31cc724e3661c79 | JavaScript | nathanosborn/Book-Viewer | /script.js | UTF-8 | 980 | 2.78125 | 3 | [] | no_license | // Code goes here
(function() {
// Create new module called bookViewer
var app = angular.module("bookViewer", []);
var MainController = function($scope, $http) {
$scope.message = "Welcome to the Book Viewer!";
$scope.bookSortOrder = "";
$scope.searchterm = "harrypotter";
$scope.countdown = 5;
... | true |
fdd4a77233d3fd883ba040474557e5ee5911e96c | JavaScript | elfmsk/Brain-Games-Hexlet | /src/games/gcd.js | UTF-8 | 740 | 3.078125 | 3 | [] | no_license | import brainGame from '..';
import randomNum from '../utils';
const description = 'Find the greatest common divisor of given numbers.';
const findGCD = (num1, num2) => {
let numberOne = num1;
let numberTwo = num2;
if (numberOne === numberTwo) {
return numberOne;
}
if (numberOne > numberTwo) {
numberO... | true |
48f6bc8b7fa8ea40438d0f0ee449248c39ed585e | JavaScript | Gase18/frontend-recepies | /src/RamenRecipeData.js | UTF-8 | 905 | 2.65625 | 3 | [] | no_license | /**
* Get data from database
*/
let url = "/RamenRecipes/resources";
export async function getRecipeData() {
let result = await fetch(url + "/recipe/1", {
method: "GET"
});
/**
* extra data
* */
if (result.ok) {
const data = await result.json();
return await data;
}
throw new Error("C... | true |
ce9d1b4c408f0fb96e51a52e00ad4384b766349c | JavaScript | AdrianKs/DIME | /individualanteile/KipkaJan/cordova-mobile-app/www/js/index.js | UTF-8 | 5,127 | 2.640625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | true |
10ae59ea1bd636c8d9dd32d4b87ee91b5c6e7fab | JavaScript | xszi/js | /es6/5.function.js | UTF-8 | 1,450 | 4.3125 | 4 | [] | no_license | /**
* 函数参数的默认值
*/
/* 以前 */
function log(x, y) {
y = y || 'World';
console.log(x, y);
}
log('Hello') // Hello World
log('Hello', 'China') // Hello China
log('Hello', '') // Hello World
/* 现在 */
function log(x, y = 'World') {
console.log(x, y);
}
log('Hello') // Hello World
log('Hello', 'China') // Hello ... | true |
f1f6a9714aab270b241372854e6467edad4fc025 | JavaScript | wanghuanhuan01/study-demo | /2020.08(ES6)/15-Map.js | UTF-8 | 1,369 | 4.15625 | 4 | [] | no_license | // 3.Map转为对象
function strMapToObj(strMap) {
let obj = Object.create({});
for (let [key, value] of strMap) {
obj[key] = value;
}
return obj;
}
// 如果有非字符串的键,会先转为字符串
const m = new Map().set({ name: 'obj' }, 'a').set(2, 'b').set(3, 'c');
const obj = strMapToObj(m);
console.log('map转为对象', obj);
// 4.对象转为Map
// ... | true |
db891a38faa023b572ea17f4af42f25c08277a4f | JavaScript | Kaxuo/BeachResort | /src/components/Services.js | UTF-8 | 1,700 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react';
import Title from './Title'
import { FaCocktail, FaHiking, FaShuttleVan, FaBeer } from 'react-icons/fa'
function Services() {
const [services] = useState([
{
icons: <FaCocktail/>,
title: "Free cocktails",
info: 'Lorem Ipsum is si... | true |
98f870702f324d59d11b7681b6d8d71e224a2ba9 | JavaScript | carlesba/webClock | /js/model.js | UTF-8 | 918 | 3.1875 | 3 | [] | no_license | function Clocker () {
this._now = {h:0, m:0, s:0}; // tiempo actualizado
this._before = {}; // tiempo antes de actualizar
this.update();
}
// Devuelve la hora en JSON
Clocker.prototype.getClock = function(){
return {h: this._now.h, m: this._now.m, s: this._now.s};
}
// Actualiza el reloj
Clocker.prototype.u... | true |
d88243d5bc35e467507dd1b92b5629d70f0e84b2 | JavaScript | TonyTezak/restart_assignments | /momsShoppingList/index.js | UTF-8 | 1,474 | 2.796875 | 3 | [] | no_license | document.addEventListener ("submit", function(event){
event.preventDefault()
const newItem = document.getElementById("list")
const addGrocery = document.addItem.title.value
const newDiv = document.createElement("div")
const newButtonRemove = document.createElement("button")
newButt... | true |
88a71eaa6d748367e15f677a2a941e1c027842b4 | JavaScript | corzero/zero-blog | /server/other/SHUANG.js | UTF-8 | 4,254 | 2.53125 | 3 | [
"MIT"
] | permissive | const axios = require('axios')
const qs = require('qs')
const cheerio = require('cheerio')
class SHUANG {
constructor(params = { cookie: null, times: 60 }) {
this.times = Math.ceil(params.times)
this.axios = null
this.projectList = []
this.initAxios(params.cookie)
}
async init() {
await this.g... | true |
616075c9f5633388cc054bdf5386413135c0dc6b | JavaScript | jsstrn/katas | /js/parseQueryToString/parseQueryToString.js | UTF-8 | 378 | 2.6875 | 3 | [] | no_license | const parseQueryToString = query => {
if (!query) {
throw new Error("Please include a query, dammit!");
}
if (Object.entries(query).length === 0) {
return "?";
}
const keys = Object.keys(query);
const keyValuePair = keys.map(key => {
return `${key}=${query[key]}`;
});
return `?${keyValueP... | true |
ccaa0ccf51186ee88ae86cbc5bab14ded42b6238 | JavaScript | cjhuaxin/nightmare-real-mouse | /index.js | UTF-8 | 4,638 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Created by chenjun on 2017-07-03.
*/
'use strict';
const debug = require('debug')('nightmare:realClick');
module.exports = function realMouse(Nightmare) {
if (!Nightmare) { Nightmare = require('nightmare'); }
Nightmare.action(
'realClick',
realClickInternal,
actionOnElementCen... | true |
ea973b140ef3dbe88d84522a15a57d0172fa2e96 | JavaScript | nataliaCodes/lighthouse-web-notes | /Week_1/arrayTest.js | UTF-8 | 608 | 3.25 | 3 | [] | no_license | //this is a test case file (they all have the same pattern)
//for Node testing, require chai
//this is not needed for browser testing
//var chai = require('chai');
//set up the assert variable, so we don't need to keep typing chai.assert
let assert = chai.assert;
//a 'describe' block, used to group individual tests
... | true |
fe05086386f46bb6e5dcbf2052f067896625a699 | JavaScript | Emurgo/yoroi-frontend | /packages/yoroi-extension/app/utils/routing.js | UTF-8 | 4,482 | 2.90625 | 3 | [
"MIT"
] | permissive | // @flow
import RouteParser from 'route-parser';
export const matchRoute = (
pattern: string, path: string
): false | { [param: string]: string, ... } => new RouteParser(pattern).match(path);
/**
* Build a route from a pattern like `/wallets/:id` to `/wallets/123`
* by calling it with the pattern + params:
*
*... | true |
864252d2ee78cceaf8f159633c4185488400cdd7 | JavaScript | MarcGregi/lighthouse-web-notes | /nodeServer/expressServer.js | UTF-8 | 530 | 2.640625 | 3 | [] | no_license | const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.get('/', (req, res) => {
res.send('cooking with homepage');
});
app.get('/profile', (req, res) => {
res.send('Cooking ... | true |
836e2f4cf452f9a3dda6e4a241172eb8c5bdff36 | JavaScript | sheenjustin/sheenjustin.com | /js/index.js | UTF-8 | 824 | 2.828125 | 3 | [] | no_license | let vh = window.innerHeight;
let h = document.body.clientHeight;
if (vh < h)
{
let btm = document.getElementById('btm-scroll');
let tip = document.getElementById('top-scroll');
btm.style.display = 'grid';
window.onscroll = function(ev) {
if ((window.innerHeight + window.... | true |
0d17aa40936ed054669c325d62e8a6580d51ec52 | JavaScript | adrianoyuji/goomer-lista-rango | /src/components/Screens/Restaurants/RestaurantItem.js | UTF-8 | 3,198 | 2.9375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import "./RestaurantItem.css";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCheck } from "@fortawesome/free-solid-svg-icons";
import { faTimes } from "@fortawesome/free-solid-svg-icons";
import setInverval from "../../../utils/index";
... | true |
3ff85605a1a78527dbdf314bea2c79958843e923 | JavaScript | avalonmediasystem/react-structural-metadata-editor | /dist/services/__test__/iiif-parser.test.js | UTF-8 | 4,943 | 2.546875 | 3 | [
"MIT"
] | permissive | import * as iiifParser from '../iiif-parser';
import {
manifest,
manifestWithStructure,
manifestWoStructure,
manifestWoChoice
} from '../testing-helpers';
describe('iiif-parser', () => {
let originalError, originalLogger;
beforeEach(() => {
/** Mock console.error and console.log functions with empty j... | true |
8a74eaa56b41ad0bb72df6ae50615958181f4624 | JavaScript | MLH-Fellowship/AirFop-Dasboard | /src/components/dashboard/DateRangeFilter.js | UTF-8 | 5,871 | 2.515625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import DatePickerTool from './DatePicker'
import { connect } from 'react-redux'
import { updateFilter, getProjects, getProjectByName } from '../../store/actions/projectActions'
var moment = require('moment');
const DateRange = ({showAll,showProjects,showSearch,searchT... | true |
483b7c3ebbff6e6fc1c7754085c7acb9f4fb81d5 | JavaScript | abhaykhurana1999/Blogging-Website | /src/routes/posts/index.js | UTF-8 | 567 | 2.59375 | 3 | [] | no_license | const { Router}=require('express')
const route=Router()
const {findAllPosts,createNewPost}=require('../../controllers/post')
route.get('/', async (req,res)=>{
const posts=await findAllPosts()
res.status(200).send(posts)
})
route.post('/',async(req,res)=>{
const {userId,title,body}=req.body
if((!user... | true |
b10300e45e155623835d7871b9af9794be5eca1b | JavaScript | stuart4404/Javafoundation | /java arrays.js | UTF-8 | 335 | 3.609375 | 4 | [] | no_license |
//arrays
var shoppinglist = ["jam","milk","eggs"];
console.log(shoppinglist);
// index number
var eggs = shoppinglist[0]
console.log(eggs);
//change an item
shoppinglist[1] = ("sausage");
//remove an item
shoppinglist.pop ("milk");
//add an item
shoppinglist.push("milko");
console.lo... | true |
c683170be5ab1967c0463fc21eac7981d6bf35fd | JavaScript | leontaolong/ChitChat | /chatbot/handlers/handlers.js | UTF-8 | 9,388 | 2.65625 | 3 | [] | no_license | "use strict";
const express = require('express');
const {
Wit
} = require('node-wit');
//export a function from this module
//that accepts a tasks store implementation
module.exports = function (channelStore, messageStore, userStore) {
//create a new Mux
let router = express.Router();
const witaiTok... | true |
c16d5013325114707cdba778e79551efedb4e9ba | JavaScript | icepolarizer/extrapolator.js | /src/makeKey.js | UTF-8 | 225 | 2.875 | 3 | [] | no_license | function makeKey(rotation1, rotation2, results) {
var key = '';
for(var i = 0; i < rotation1.length; i++){
if (rotation1[i] == rotation2[i]) {
key += results[i];
}
}
return key;
};
| true |
ff29d7cef7fc65971454ba12935d007c584851bd | JavaScript | drag-code/form-progresbar | /src/App.js | UTF-8 | 3,270 | 2.8125 | 3 | [] | no_license | import "./App.css";
import React, { useRef } from "react";
function App() {
const progress = useRef();
const errors = useRef();
const current_percentage = useRef(() => {});
const nameChangeHandler = (event) => {
current_percentage.current = {
...current_percentage.current,
name: validateName(event.target.... | true |
565bdbffd02a42ada3aacc706fae2b03afaa454a | JavaScript | dianafaye17/scratch-track | /server/models/user.js | UTF-8 | 1,874 | 2.78125 | 3 | [] | no_license | var db = require('../lib/db');
var bPromise = require('bluebird');
var bcrypt = bPromise.promisifyAll(require('bcrypt-nodejs'));
var User = {};
// returns all users
User.all = function () {
return db('users').select('*');
};
// finds a user by email
User.findByEmail = function(email) {
return User.findUser({ ema... | true |
28b0571da398d361d72e7f9508a5bd5c5db59133 | JavaScript | HristoMachikov/03_JSCore | /JavaScript Advanced/08.OBJECT COMPOSITION - EXERCISE/4. Extensible object.js | UTF-8 | 482 | 2.703125 | 3 | [] | no_license | function solve() {
let myObj = {
extend: function (template) {
for (let property in template) {
if (typeof template[property] === "function") {
myObj.__proto__[property] = template[property]
//Object.getPrototypeOf(this)[property] = templat... | true |
d0d97637d3f63b065242b7899dc5a1c553227fee | JavaScript | zacharynewton-wk/s16-wgetter-react | /src/ListBuilder/ListBuilder.js | UTF-8 | 1,782 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './ListBuilder.css';
class ListBuilder extends Component {
constructor () {
super();
this.state = {
cikInput: ''
};
}
shouldComponentUpdate (nextProps, nextState) {
return this._arraysEqual(nextProps.cikLi... | true |
f7a4b5d16715e42a3f44287d4ee3afc82a42aafd | JavaScript | zk1169/home-party | /api/models/config.model.js | UTF-8 | 1,654 | 2.515625 | 3 | [] | no_license | const _ = require('lodash');
const BaseModel = require('./base.model');
const STATUS = require('./status.enum');
const MYSQL_QUERY = require('./mysql-pool');
class ConfigModel extends BaseModel{
getByField(success, error) {
const sql = `select * from t_config where name='${this.name}'`;
MYSQL_QUERY... | true |
c09ed2288c44c98e415d64e35b09734fc37f585c | JavaScript | VAIBHAV-2303/ResMngr | /src/utils/announce.js | UTF-8 | 739 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
Simply sends a message to all
the channels(reads from the db)
in the workspace where the app
has been added
*/
var slackApiClass = require("../slack/slackApi");
var slackApi = new slackApiClass();
exports.announce = function announce(workSpaceId, msg, db){
var addedChannelsListPromise = db.getAddedChan... | true |
cde2d93ff13006ded38fb8bc65090d7d222d08a8 | JavaScript | raulgupto/learnyounode | /Async/asyncparallel.js | UTF-8 | 305 | 2.609375 | 3 | [] | no_license | var async=require("async");
var stack={};
stack.getA =function(callback){
callback("","A");
}
stack.getB =function(callback){
callback("","B");
}
stack.getC =function(callback){
callback("","C");
}
async.parallel(stack,function(err,data){
if (err){
console.log(err);
}
else
console.log(data);
}) | true |
a27926cfba5327362f9341d9148b1c60745acd06 | JavaScript | ShazidNawasShovon/Meal | /Others/json.js | UTF-8 | 929 | 3.4375 | 3 | [] | no_license | // fetch('https://jsonplaceholder.typicode.com/posts')
// .then(res=> res.json())
// .then(data=>console.log(data));
function loadPost(){
fetch('https://jsonplaceholder.typicode.com/posts')
.then(response => response.json())
.then(data => displayTitle(data))
}
function displayTitle(data)
{
const ul=d... | true |
7caeedc1386f1563c37cf81065e05f00e146e35c | JavaScript | KBClayton/Node_bot | /liri.js | UTF-8 | 4,583 | 2.625 | 3 | [] | no_license | require('dotenv').config();
//{path: '~/.env'}
var fs = require("fs");
var inquirer = require('inquirer');
var request=require("request");
var Twitter = require('twitter');
var keys=require("./keys.js");
var Spotify = require('node-spotify-api');
var stuff=[];
var runobj={
twit: function(){
var tweets = ne... | true |
88c9e60db095d70fd4702d4171eacc88a98a4a09 | JavaScript | brianneisler/stutter | /src/lang/isFunction.test.js | UTF-8 | 1,770 | 2.578125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | import isFunction from './isFunction'
describe('isFunction', () => {
test('returns true for functions', () => {
expect(isFunction(async () => {})).toBe(true)
expect(isFunction(() => {})).toBe(true)
expect(isFunction(function () {})).toBe(true)
expect(isFunction(function* () {})).toBe(true)
})
te... | true |
f81c353dc6e3f2229cbf90eebefda36929d9d318 | JavaScript | ksmself/JS100 | /1-14.js | UTF-8 | 867 | 4.75 | 5 | [] | no_license | /*
영희는 친구와 게임을 하고 있습니다. 서로 돌아가며 랜덤으로 숫자를 하나 말하고 그게 3의 배수이면 박수를 치고 아니면 그 숫자를 그대로 말하는 게임입니다.
입력으로 랜덤한 숫자 n이 주어집니다.
만약 그 수가 3의 배수라면 '짝'이라는 글자를, 3의 배수가 아니라면 n을 그대로 출력해 주세요.
입출력)
입력 : 3
출력 : 짝
입력 : 2
출력 : 2
*/
//My Answer
const n = parseInt(Math.random() * 10 + 1);
console.log("입력 : ", n);
if(n % 3 == 0){
console.... | true |
c2fcc5c85eb2d26bf99ad9ab0782fb404f13a213 | JavaScript | walgys/growmies-evaluation | /src/redux/ducks/planets/reducers.js | UTF-8 | 653 | 2.53125 | 3 | [] | no_license | import { combineReducers } from "redux"
import * as types from "./types"
const planetsReducer = (state = {items: [], loading: false, error: ''}, action) => {
switch ( action.type ){
case types.FETCH_PLANETS_START:
return {...state, loading: true}
case types.FETCH_PLANETS_COMPLETED:
... | true |
2135def3b08a62deb0d4e72a50ae8ee92c75bb34 | JavaScript | clinical-meteor/glass-ui | /client/glass-ui.js | UTF-8 | 4,479 | 2.609375 | 3 | [
"MIT"
] | permissive | // Write your package code here!
Session.setDefault("colorA", "");
Session.setDefault("colorB", "");
Session.setDefault("colorC", "");
Session.setDefault("colorD", "");
Session.setDefault("colorE", "");
Session.setDefault("paintPageBackgrounds", true);
Session.setDefault("paintCardBackgrounds", false);
Session.setDefau... | true |
782e3d01ad6922e05f5ecaf108e2786080cad24e | JavaScript | peipei1234/react-demo | /Game/index.js | UTF-8 | 2,385 | 2.96875 | 3 | [] | no_license | import React from 'react';
import '../index.css'
import ReactDOM from 'react-dom';
import Board from '../Board'
// import Squares from '../Square'
// 整个游戏
export class Game extends React.Component{
constructor(props){
super(props);
this.state= {
history:[
{
squares:Array(9).fill(null... | true |
a0c8ee28f9aca87dba4f01e23ee8d3e36d27d6f1 | JavaScript | furstenheim/iterative-greedy | /test/test.js | UTF-8 | 3,289 | 2.890625 | 3 | [] | no_license | const iterativeGreedy = require('./../src/index')
const assert = require('assert')
const _ = require('lodash')
const maxBy = _.maxBy
const max = _.max
const partition = _.partition
const clone = _.clone
const filter = _.filter
describe('Max sum problem', function () {
const tests = [
{
description: 'Only o... | true |
79c57de67e23f34f1b8daf76503e912aef1cbf28 | JavaScript | sebastian018/EjerciciosJS | /Ejercicios JavaScript/lista-objetos.js | UTF-8 | 353 | 3.046875 | 3 | [] | no_license | function listaTodasLasPropiedades(o){
var objetoAInspeccionar;
var resultado = [];
for(objetoAInspeccionar = o; objetoAInspeccionar !== null; objetoAInspeccionar = Object.getPrototypeOf(objetoAInspeccionar)){
resultado = resultado.concat(Object.getOwnPropertyNames(objetoAInspeccionar)) + "\n";
}
... | true |
d755d7fbfd50b1ed03c5c2302dbf5f367a2816cf | JavaScript | raghav-misra/UFOLoader | /loader.js | UTF-8 | 1,700 | 2.625 | 3 | [] | no_license | class UFO {
static init(conf = {}) {
const style = document.createElement("style"); // OR, create style.
style.innerText = (`body, html { overflow-x: hidden; }.fp-loader-a5b2dy7 {position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;background:${conf.background || "rgb(29, 34, 37)"};display: flex;... | true |
813909dec8ce796d903976914b104abff83e03ea | JavaScript | mayconvm/monitor-webpage | /js/PersistData.js | UTF-8 | 2,728 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | // class to record data in indexDB
class PersistData {
constructor(firebase) {
this.db = new Dexie("tracker_database");
this.db.version(1).stores({
tracker: 'end,start,url,domain',
firebase: 'apiKey,authDomain,databaseURL,projectId,storageBucket,messagingSenderId',
user: 'id,email,token,di... | true |
a6a8cf15c90a1b468d69ad9e2df878635ecf0e8d | JavaScript | Camixxx/MusicLab | /static/muse.js | UTF-8 | 1,434 | 2.953125 | 3 | [] | no_license | var audio;
var framePlayer;
framePlayer =document.getElementById('frame_player');
window.onload = function(){
initAudio();
// var clipboard = new Clipboard('.copyBtn');
//
// clipboard.on('success', function(e) {
// console.info('Action:', e.action);
// console.info('Text:', ... | true |
57631cbd2ccf65cf7fa61ca84fa9cb1fe11bb173 | JavaScript | PatriciaCJ/Patricia_Calderon | /src/Componentes/Ejemplo3/HookEstado/HookEstado.js | UTF-8 | 715 | 3.53125 | 4 | [] | no_license | import React, { useState } from 'react';
export function HookEstado() {
// Se declara una nueva variable de estado, denominada "contador"
// "useState" es un Hook que devuelve el valor del estado actual y
// una función para modificarlo
// el único argumento es "0" que corresponde al estado inicial
cons... | true |
2cf2a1776a4026921069213f887ebf069165f89e | JavaScript | hoangvu96z/Support-Building-PC | /components/DetailsProduct/BUILDTUDONG.js | UTF-8 | 2,763 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Text, ScrollView } from 'react-native';
import Spinner from 'react-native-spinkit';
import { View } from 'native-base';
export default class BUILDTUDONG extends Component {
constructor() {
super();
this.state = {
id: [],
mas... | true |
ebae981186d3c302945c20719b51499ac9619d7e | JavaScript | kotharinilay/node-react-webpack-starter | /src/client/app/layout-auth/header/reducer.js | UTF-8 | 468 | 2.578125 | 3 | [] | no_license | 'use strict';
/**************************
* Perform the actions of header.
* Return the state based on previous and current actions
* **************************** */
import { SEARCHKEY } from './actiontypes';
function headerReducer(state = {}, action) {
var newState = Object.assign({}, state);
switch (act... | true |
abbe4bce9111d5dfc1b279e3d5e769fac310921d | JavaScript | pche3/quote_machine | /script.js | UTF-8 | 1,424 | 3.03125 | 3 | [] | no_license | var got_quote = false;
var quote="";
var author="";
/* Function will get a quote from Forismatic APi */
function getAQuote() {
$("#quote").fadeOut("slow");
$("#quoteAuthor").fadeOut("slow");
$("#buttonShake").effect("shake");
$.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&key=c... | true |
d1cfdf4313c333254d34e317575bfe823dd532bf | JavaScript | joelhealy/icpdt | /app/static/scripts/myscript.js | UTF-8 | 1,511 | 3.390625 | 3 | [] | no_license | function openTab(evt, tabName) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
... | true |
9fade0aaf4443079e7449299ebeca1f94d07ed00 | JavaScript | Denis-Tek/IFSUDESTEMG-PosWebMobile-TecnologiasBackend-Atividade5 | /routes/comentario.js | UTF-8 | 1,564 | 2.65625 | 3 | [] | no_license | const express = require('express');
const bcrypt = require('bcrypt');
const router = express.Router();
const Comentario = require('../models/comentario');
// VIEWS
router.get('/comentario', (req, res) => {
res.render("comentario");
});
// POST
router.post('/comentario', (req, res) => {
console.log(req.body);... | true |
86b0860906a30029e7c64a72d36209f96f996bc4 | JavaScript | wor101-ls-javascript/JS210 | /small_problems/find_duplicate.js | UTF-8 | 1,339 | 4.3125 | 4 | [] | no_license | /*
**Problem**
Given an unordered array and the information that exactly one value in the array occurs twice (every other value occurs exactly once),
determine which value occurs twice. Write a function that will find and return the duplicate value that is in the array.
**Examples / Test Cases**
**Data Structures**... | true |
dcee35cdcef7dca8c6eea90c06dcebf95c752c22 | JavaScript | vitaliy-b-s/covid | /src/js/graph.js | UTF-8 | 1,536 | 3.078125 | 3 | [] | no_license | import Chart from "chart.js";
export function buildGraph() {
const grpah = document.getElementById("graph");
Chart.defaults.global.defaultFontColor = "whitesmoke";
const newGarph = new Chart(grpah, {
type: "bar",
data: {
labels: getDatesArray(new Date("December 15, 2020"), new Date("December 29, 20... | true |
48eb3db519a7dcd3ecf15435bb8607f697cd4ff7 | JavaScript | lilypop/SNJavaScriptCourse | /Homework_5/script.js | UTF-8 | 5,329 | 3.046875 | 3 | [] | no_license | let key = '8f57a995';
let baseUrl = `http://www.omdbapi.com/?apikey=${key}&`;
let searchInput = document.getElementById('search');
let searchButton = document.getElementById('search-button');
let resultContainer = document.getElementById('result-container');
let paginationContainer = document.getElementById("paginati... | true |
27bf95250c9b594cac42e9baff30423754898211 | JavaScript | bertmclin/personal | /server/controllers/userController.js | UTF-8 | 2,237 | 2.625 | 3 | [] | no_license | const bcrypt = require('bcrypt');
const saltRounds = 12;
module.exports = {
async login(req, res) {
let { username, password } = req.body;
const db = req.app.get('db');
let [existingUser] = await db.get_user_by_username(username);
if (!existingUser) return res.status(400).send(... | true |
c108e96a49db4471c4445262789f6e77bb71a5b8 | JavaScript | dinsebi22/Web-Graphics-D | /In The Clouds/index.js | UTF-8 | 3,101 | 2.796875 | 3 | [] | no_license | const canvas = document.querySelector("#canvas");
const renderer = new THREE.WebGLRenderer({ canvas });
let color = "#226be0";
renderer.setClearColor(color, 1);
let scene = new THREE.Scene();
const n = noise;
function setFog(color, near, far) {
scene.fog = new THREE.Fog(color, near, far);
}
var camera ... | true |
3b450923146941c87918d2de643d49a849fb0ff6 | JavaScript | valdirunars/vef2-2018-h1 | /Public/scripts/signup.js | UTF-8 | 6,647 | 2.515625 | 3 | [
"MIT"
] | permissive | // signup.js
$(document).ready(function () {
let LoginNowButton = $('#login-button-homescreen');
let signUpNowButton = $('#sign-up-button-homescreen');
let verPass = $('#verPassword');
let passwordLogin = $('#password-login');
let passwordSignUp = $('#password-sign-up');
let name = $('#name');
let usern... | true |
c3288bd8a4196442232d75643b8146cca31e4b11 | JavaScript | bloublou2014/mep2 | /src/drivers/starter/StarterDriver.js | UTF-8 | 321 | 2.515625 | 3 | [] | no_license | /** @namespace drivers.starter */
const EventEmitter = require('events');
/**
* Detects when rope is pulled out of the robot and starts counting game time.
* @memberof drivers.starter
*/
class StarterDriver extends EventEmitter {
getTime() {
}
getTimeMicro() {
}
}
module.exports = StarterDriver... | true |
28dd364b32cee8135df835072e7e03bf2147a235 | JavaScript | SunDawning/deno-oak-rest-users | /onV1DeleteUser.js | UTF-8 | 567 | 2.546875 | 3 | [] | no_license | import{USERS}from"./USERS.js";
import{consoleLog}from"./consoleLog.js";
/*
* DELETE访问"/v1/users/:id"
* "/v1/users/1"得到到"context.params"为:{ id: "1" }
* 根据用户的ID来删除用户的数据
*/
function onV1DeleteUser(context){
consoleLog("接收到删除用户的请求",context.params);
let id=parseInt(context.params.id);
let user=USERS.filter(f... | true |
bc60dfc3bdfd7da1f447ece223cbe6e3b2b7f523 | JavaScript | amberchiodini/note-taker | /server.js | UTF-8 | 573 | 2.625 | 3 | [
"MIT"
] | permissive | //Dependencies
const express = require("express");
const fs = require("fs");
const path = require("path");
//Set-up the express app
const app = express();
//Set-up a port
const PORT = process.env.PORT || 3000
//Set-up the express app to handle data parsing
app.use(express.urlencoded({ extended: true }));
app.use(ex... | true |
456711e13f0e45e6c2e1b1049a0e5f5d070a4841 | JavaScript | Andydandy77/burger | /public/assets/js/burgers.js | UTF-8 | 954 | 2.953125 | 3 | [] | no_license | $(function() {
$("#submit").on("click", function(event) {
console.log("clicked")
var newBurger = {
burger_name : $("#input").val().trim(),
devoured: false
};
console.log(JSON.stringify(newBurger));
$.ajax("/api/burgers", {
type: "POST"... | true |
b6dd1e58a3c286d787aa6d206793d4589d1a57aa | JavaScript | way2mohsun/scentronix | /requester.js | UTF-8 | 1,130 | 2.65625 | 3 | [] | no_license | const fetch = require('node-fetch');
const fs = require('fs');
var sort = require('./sort');
let load_balancer = JSON.parse(fs.readFileSync('load-balancer.json')); // Load servers
let requests = load_balancer.map(o => fetch(o.url, { timeout: 5000 })
.then(function (response) {
if (response.status < 200 ||... | true |
6c169df4331d728103fc98d6becfc2e76b23c58c | JavaScript | mashinosatoshi/sample_node_express | /src/designs/facade/facade.js | UTF-8 | 293 | 2.734375 | 3 | [] | no_license | import func1 from "./func1"
import func2 from "./func2"
import func3 from "./func3"
class facade {
static programing() {
console.log(func1.activity());
console.log(func2.activity());
console.log(func3.activity());
return;
}
}
module.exports = facade; | true |
d55fe1bd9720fcf54de034154b2fb0b88a8865b6 | JavaScript | jjrush/codingdojo | /00_web_fundamentals/13_foundations/challenge_4.js | UTF-8 | 464 | 5.375 | 5 | [] | no_license | // Iterate an array - Write a function that returns the sum of all the values within an array. (e.g. [1,2,5] returns 8. [-5,2,5,12] returns 14).
function returnSumOfArrayElements(array)
{
var sum = 0;
for( var i = 0 ; i < array.length ; i++ )
{
sum = sum + array[i];
}
return sum;
}
... | true |
05cb2f4d8c867fc347dae4167fc1b4f2cfa1533f | JavaScript | josinho101/memory-game | /app.js | UTF-8 | 3,003 | 3.34375 | 3 | [
"MIT"
] | permissive | window.addEventListener("DOMContentLoaded", () => {
memoryGame.init();
});
var memoryGame = (function () {
let grid = undefined;
let result = undefined;
let totalTryElm = undefined;
let cardItems = [
{
name: "alien",
image: "images/alien-icon.png",
},
{
name: "ange... | true |
09822e6849dafbc57ce4a6098f3b7191cf259939 | JavaScript | JCoathup/Whispers | /public/scripts.js | UTF-8 | 4,139 | 3.25 | 3 | [] | no_license | /*
WHISPERS
A simple chat program with private messaging functionality
*/
// declare variables
var username = document.getElementById("username");
var connect = document.getElementById("connect");
var chatLogin = document.getElementById("chatLogin");
var chatWindow = document.getElementById("chatWindow");
var message =... | true |
7236f8b38aa4184b424b0030a11fbe9ec858c390 | JavaScript | hmkoba/calq | /arithmetic/script.js | UTF-8 | 4,213 | 3.21875 | 3 | [] | no_license | var isMenu = true
var first, second, mode, count, endCount, timerId = 0
var startDate
var timerResult = ''
var problemCount = 1
var MAX_PROBLEM_COUNT = 10
var formula_func = {}
///////////////////////////////////////////////////
// 足し算
///////////////////////////////////////////////////
formula_func[49] = [
function... | true |
13f438a6dc195a58f2ca86252affd879f0cefd6d | JavaScript | andreaardenti/SmartFreezer-API | /routes/freezers.js | UTF-8 | 6,961 | 2.671875 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var key1 = "4AQDUA+mO9o=";
var key2 = "4AQDUA+mOXk=";
var key3 = "4AQDUA+k9o8=";
var rfID = {
key1: "Cavo HDMI",
key2: "Playstation game",
key3: "Mouse"
};
var freezers = [{
id: 1,
lock: true,
events: [],
products: [],
... | true |
9bcac003b22aa2de111bfb3074a0e9cc609c6df0 | JavaScript | COMPTCA/COMPTCA.github.io | /Tutorials/JavaScript & Jquery/JavaScript & JQuery - Interactive Front End Web Development Book/JavaScript/JS/5-5-JavaScript.js | UTF-8 | 1,105 | 3.4375 | 3 | [] | no_license | function checkLength(e, minLength){ // Declare function; e = event
var element, elementMsg; // Declare variables
if (!e){ // If event object doesn't exist
e = window.event; // Use IE f... | true |
db1a52f57fad9becb0bd9fe1c98b7f35d472eab0 | JavaScript | franknmungai/frank.ng | /src/components/Ternary/index.jsx | UTF-8 | 503 | 2.515625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
const Ternary = ({ fallback, condition, children }) => {
//when condition is true, show children, when the condition is false, show fallaback
return <React.Fragment>{!!condition ? children : fallback}</React.Fragment>;
};
Ternary.propTypes = {
fallbac... | true |
260807f684a47f3d921314393ec4c88d43b3d9b0 | JavaScript | Vladimir-Novikov/javascript_basic_course | /lesson_2/task_8.js | UTF-8 | 449 | 4.5 | 4 | [] | no_license | // задание 8
alert('Задание 8');
function degree(number, degreeOfNumber) {
if (degreeOfNumber < 1)
return 1;
return number * degree(number, degreeOfNumber - 1);
}
var num1 = 2, num2 = 3; // укажите число и степень в которую нужно его возвести
alert('Результат возведения числа ' + num1 + ' в степень '... | true |
883753d70087fb6eb9ebbb0f310b8d0158e3cda2 | JavaScript | abdurrehman2001/React_Practice | /src/MyPracticeComponent/EffectWithProps.js | UTF-8 | 503 | 2.84375 | 3 | [] | no_license | // import { useEffect } from "react";
// function EffectWithProps(props) {
// useEffect(() => {
// alert("count with props: " + props.count)
// }, [props.count])
// useEffect(() => {
// console.log('data with props :' + props.data);
// }, [props.data])
// return (
// <>
// ... | true |
81b10421380de1e694d6a5c12a4d10111af5fbc5 | JavaScript | PNfeather/pnfeatherWeb | /src/pages/homeContent/method/index.js | UTF-8 | 657 | 3.0625 | 3 | [] | no_license | class Typing {
constructor (element, text) {
this.count = 0;
this.element = element;
this.text = text;
}
startTyping () {
if (this.count < this.text.length) {
if (this.element.attributes['data-text']) {
this.element.attributes['data-text'].value = this.text.slice(0, this.count);
... | true |
a8b4c31669e436655aa05f0a149414c5bbd364dc | JavaScript | 5tigerjelly/allowance-gamification-app-1 | /src/js/parent-task.js | UTF-8 | 4,567 | 2.953125 | 3 | [] | no_license | var database = firebase.database();
var url_string = window.location.href
var url = new URL(url_string);
let famId = sessionStorage.getItem("familyUID");
let userUID = sessionStorage.getItem("userUID");
let userRole = sessionStorage.getItem("role");
let avaiable = document.getElementById("available");
let inprogress =... | true |
7b1a332185df192be9e49b0f51229d6b368027bf | JavaScript | muthu2326/Projects | /javascript/day11-functions/return.js | UTF-8 | 592 | 3.8125 | 4 | [] | no_license | function add(a,b){
console.log(a + b)
}
const result = add(10,20)
console.log(result)
// console.log(add(10,20))
function addSub(a,b){
const add = a + b
const sub = a - b
// return multiple values from the function
// return [add, sub]
return {
addition: add,
subraction: sub
... | true |
d546fad0331288c8085a6234fce4929fccd1f43b | JavaScript | 2changs/hackuva | /js/background.js | UTF-8 | 10,085 | 2.796875 | 3 | [] | no_license | //JUST AN EXAMPLE, PLEASE USE YOUR OWN PICTURE!
var imageAddr = "http://www.kenrockwell.com/contax/images/g2/examples/31120037-5mb.jpg";
var downloadSize = 4995374; //bytes
var globalAddress = "";
var buildingLat;
var buildingLong;
var lati;
var longi;
va... | true |
3c71be30ebb93cb24f4c504ec22358640dde7621 | JavaScript | lucus8508/web039 | /Source-Code-省地方金融监督管理局人民政府金融工作办公室网站及OA全站源码/JS/Modal/APIResult.js | UTF-8 | 507 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | var APIResult = {};
APIResult.Success = 1;
APIResult.Failed = -1;
APIResult.getModel = function (str) {
if (!str || str == "" || str == "[]") { return { "retcode": APIResult.Failed, "retmsg": "", "result": "{}", "addon": "", "action": "" }; }
var model = JSON.parse(str);
if (model.result) { model.result = ... | true |
5fc211ab1d3e8ad5990fc02a6d402e72b039e1c0 | JavaScript | mehedih20/burger-shop | /script.js | UTF-8 | 289 | 3.015625 | 3 | [] | no_license | const checkbox = document.querySelector(".checkbox");
const navList = document.querySelector(".nav-list");
checkbox.addEventListener("click", function () {
if (checkbox.checked) {
navList.classList.add("toogle");
} else {
navList.classList.remove("toogle");
}
});
| true |
4494597b7d579e102d052e297dab725c1c2a043a | JavaScript | PublicInMotionGmbH/ui-kit | /packages/form/src/transformChildrenRecursively.js | UTF-8 | 1,349 | 3.046875 | 3 | [
"MIT"
] | permissive | import React from 'react'
/**
* Transform React node according when pass some conditions (recursively).
*
* @param {React.Element} node
* @param {function} transform
* @param {function} [condition]
* @returns {*}
*/
export function transformNodeRecursively (node, transform, condition = x => x) {
if (!node || ... | true |
0b97f714b91e0a4be88b2d0f79585659f79572bd | JavaScript | HermanLD/Intro-sign-up-component | /js/form-validation.js | UTF-8 | 2,486 | 3.703125 | 4 | [] | no_license | function globalFunction() {
//
// Variables
//
const form = document.getElementById('form');
const firstName = document.getElementById('first-name');
const lastName = document.getElementById('last-name');
const email = document.getElementById('email');
const password = document.getEleme... | true |
59a312b1c2b1cfce0faf2112f407dcc34cf177e4 | JavaScript | learning-layers/BitsAndPieces | /js/utils/DateHelpers.js | UTF-8 | 1,422 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | define(['logger'],
function (Logger) {
return {
LOG: Logger.get('DateHelpers'),
_zeroFillIfNeeded: function(number) {
if ( number < 10 ) {
number = '0' + number;
}
return number;
},
_getDate: function(date) {
return thi... | true |
41bdb9eebff248287cb1a9942da0629ed31efd7a | JavaScript | emersonps/logica_programacao | /projetos/js/primeiro.js | UTF-8 | 109 | 2.734375 | 3 | [] | no_license | var nota, nota1, nome, media, primeiroNome, segundoNome, endereco;
nota = 100;
alert("Resultado: " + nota);
| true |
869910dae50425b9cbfc3316b02eb46576bd4372 | JavaScript | ylacaute/todo-react | /src/main/js/component/ClockWidget.jsx | UTF-8 | 1,335 | 2.890625 | 3 | [
"MIT"
] | permissive | import React from 'react';
// Clock available here : http://jsfiddle.net/rainev/vx4r5qzv/
class Clock extends React.Component {
constructor(props) {
super(props);
}
render() {
var d = this.props.date;
var millis = d.getMilliseconds();
var second = d.getSeconds() * 6 + millis * (6 / 1000);
... | true |
c49361d18891c5275f85670a85f0d1ac654609d5 | JavaScript | anyeloert/tiendaAuth | /cliente/src/componentes/Buscador/Buscador.js | UTF-8 | 529 | 2.53125 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import './Buscador.css';
class Buscador extends Component {
leerDatos = (e) => {
// termino de busqueda
const termino = e.target.value;
// enviamos por props
this.props.busqueda(termino);
}
render() {
return ... | true |
3882dc5fd558922651e7c945d40fa2bb6e9c6d7e | JavaScript | ShreyashSalian/Php_project_2 | /Php_project_2/admin/assets/js/user_profile.js | UTF-8 | 2,037 | 3.203125 | 3 | [] | no_license | let first_name = document.getElementById('first_name');
let last_name = document.getElementById('last_name');
let contact_number = document.getElementById('contact_number');
let submit = document.getElementById('submit');
$('#success').hide();
$('#failure').hide();
let valid_first_name = false;
let valid_last_na... | true |
99630aa2beb163b64f070441cd9e9a44310f0ae7 | JavaScript | hartfh/Proximity-Micro | /js/components/event-emitter.js | UTF-8 | 919 | 2.6875 | 3 | [] | no_license | module.exports = function() {
var _self = {};
var _events = {};
_self.dispatch = function(event, data) {
if ( !_events[event] ) {
return;
}
for (var i = 0; i < _events[event].length; i++) {
var actions = _events[event][i];
for(var prop in actions) {
actions[prop](data);
}
}
};
_sel... | true |