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
0aa7256cbbb8ae0744ceb919d060e0956e3f964d
JavaScript
jasonwong94/jasonwong94.github.io
/googleMaps.js
UTF-8
319
2.546875
3
[]
no_license
function initMap() { var yyz = {lat: 43.6474570, lng: -79.3952882}; var map = new google.maps.Map(document.getElementById('map'), { zoom: 8, center: yyz, mapTypeId:google.maps.MapTypeId.ROADMAP }); var marker = new google.maps.Marker({ position: yyz, map: map }); }
true
915862b1d07b37a606e03fadd919ed38f1a857f8
JavaScript
zeckdude/memcode
/frontend/components/Problem/components/InlinedAnswersReview.js
UTF-8
3,050
2.828125
3
[]
no_license
/* eslint-disable no-param-reassign */ // because there is no alternative to el.readOnly import { ReadonlyEditor } from '~/components/ReadonlyEditor'; const focusOnTheFirstAnswer = () => { const answers = document.getElementsByClassName('answer'); const firstAnswer = answers[0]; if (firstAnswer) { firstAnswe...
true
ea68e9263fd3134908e7bd8a475d5ea5cebb0b6e
JavaScript
aungpyaenyein-21/react-memories-pj
/server/controllers/posts.js
UTF-8
3,061
2.53125
3
[]
no_license
const Post = require('../models/posts') const mongoose = require('mongoose'); const { update } = require('../models/posts'); exports.getPosts = async (req,res) =>{ const {page} = req.query try { const Limit = 8; const skip = (Number(page) -1) * Limit const total = await Post.countDocume...
true
00b4944381ba1423d45b2445b754b49f53989119
JavaScript
ISS-Switzerland/material-components-web
/test/screenshot/spec/fixture.js
UTF-8
2,483
2.515625
3
[ "CC-BY-4.0", "Apache-2.0", "LicenseRef-scancode-other-permissive" ]
permissive
/* * Copyright 2018 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
true
79514330ad3a9a9d0e56fb6017cdc8a416da1936
JavaScript
mohdovais/quran
/src/utils/array/from.js
UTF-8
226
2.8125
3
[]
no_license
export default function(obj){ if(Object.prototype.toString.call(obj) === '[object Array]'){ return obj; }else if (obj !== null && obj !== undefined){ return [obj]; }else{ return []; } }
true
9505fd03d72fc3ce5e67ab86a4ee6a5b9c5543c8
JavaScript
UlisesGascon/workshop-jest
/__tests__/setup_and_teardown.test.js
UTF-8
1,246
2.921875
3
[ "MIT" ]
permissive
// See: https://jestjs.io/docs/en/setup-teardown const { initializeCityDatabase, initializeFoodDatabase, clearCityDatabase, clearFoodDatabase, isCity, isValidCityFoodPair } = require('../lib/cities_and_foods') describe('Setup and Teardown', () => { // Applies to all tests in this file beforeAll(() => ...
true
6bc2437d3ae5d37e7253a17b357da85db540a64a
JavaScript
Shuta4/Drag-and-Drop-Advanced
/src/Components/CardForm.js
UTF-8
811
2.625
3
[ "MIT" ]
permissive
import Column from './Column' import columnArr from './ColumnArr'; class CardForm { constructor(form) { this._form = document.querySelector(form); this.setEventListeners = this.setEventListeners.bind(this); this._submitHandler = this._submitHandler.bind(this); } _submitHandler(even...
true
65883b6ee39ccd6acd00bbb11b72cf42029a6be7
JavaScript
namanmaheshwari97/ms3-node-backend
/middlewares/wishlist.middleware.js
UTF-8
3,041
2.5625
3
[]
no_license
function wishlistMiddleware(datastore, errorResponse, CONFIG) { 'use strict'; const USERS_KEY = CONFIG.ENTITY_KEYS.USERS; const PROPERTIES_KEY = CONFIG.ENTITY_KEYS.PROPERTIES; return { add, remove }; function add(req, res) { const tokenUser = res.locals.decoded.data; ...
true
9824f9b088eda5bdf854435884ac7f66eaf9f13a
JavaScript
txhuin/Javascript1exercises
/fibsetisevenwithfilter.js
UTF-8
1,022
3.296875
3
[]
no_license
function fibonacci(max){ if (max > 1){ var fibList = [1]; var current_fib = 1; while (current_fib < max){ fibList.push(current_fib); current_fib = fibList[fibList.length-1]...
true
bb6ff1c4cb95b7e83373220adc4580df68d87903
JavaScript
devonhackley/algorithms
/coding challenges/ctci in JS/ch1/1-4.js
UTF-8
494
3.75
4
[]
no_license
// palindrome permutation // input "Tact Coa" // output boolean const palindromePermutation = (str) => { // time: O(n) // space: O(n) str = str.toLowerCase(); let hash = {}; for (let i=0; i<str.length; i++) { if (str[i] === " ") continue; if (hash[str[i]] === undefined) { hash[str[i]] = 0; } hash...
true
94d61d3451824fd6ae2b5613dcd5586b7b5b5519
JavaScript
clm1100/moretaoweb
/components/image-preview/image-preview.js
UTF-8
2,655
2.953125
3
[ "MIT" ]
permissive
/* * image-preview * https://github.com/mambahao/image-preview * Copyright (c) Justin Hao */ (function () { var defaults = function (defaults, options) { for (var key in options) { if (options.hasOwnProperty(key)) defaults[key] = options[key]; } return defaults; }; var ImagePreview...
true
7053abee23b200e9f7b92fb81f6dfe3b5cd9ba31
JavaScript
aahill50/JS_Intro
/04_Recursion/05_makeChange.js
UTF-8
998
3.5
4
[]
no_license
// var makeChange = function (amount, coins) { // if (amount === 0){ // return []; // } // var purse = []; // // while (amount >= coins[0]) { // purse.push(coins[0]); // amount -= coins[0]; // }; // coins.shift(); // return purse.concat(makeChange(amount, coins)); // }; // // console.log(makeC...
true
a00430695e0e725e583862dd2f26c59e3cf092f8
JavaScript
udon-code-studios/boring-moba
/web-server/site/scripts/render-game.js
UTF-8
2,985
3.21875
3
[]
no_license
// canvas variables var canvas = document.getElementById("gameCanvas"); var ctx = canvas.getContext("2d"); // game variables var player; var players; function draw() { // clear canvas ctx.clearRect(0, 0, canvas.width, canvas.height); for (var i = 0; i < players.length; i++) { ctx.beginPath(); ctx.arc(p...
true
d85ad37d14a65ffcd3cfea63543242991f402759
JavaScript
PSSubramanyaBhat/xox-game
/xox-game/src/TicTacToe.js
UTF-8
2,814
3.109375
3
[]
no_license
import './TicTacToe.css'; import React, { useState } from 'react'; const Square = ({ value, handleClick }) => { return ( <button className="square" onClick={handleClick}> {value} </button> ); }; const Board = () => { let end = 0; let [count, setCounter] = useState(0); ...
true
b04fad7a7a07022a317bdd9f967bf39a4f6088b3
JavaScript
georgeapostol/DiceGame
/blackjack/Main.js
UTF-8
944
3.296875
3
[]
no_license
/** * Created by LostSouls on 1/6/17. */ var Pair = require("./Pair"); var Dice = require("./Dice"); var Player = require("./Player"); var Coin = require("./Coin") var dice = new Dice(); dice.roll(); //console.log(dice.number); var pair = new Pair(); // if pair >= dice.number: // print "pair wins" // else: //...
true
1e0764c074e3c64e5d4854478dd193028c9c932f
JavaScript
frmjar/bootcamp-fullstackopen
/part2/phonebook/src/components/PersonForm.js
UTF-8
2,388
2.78125
3
[]
no_license
import React from 'react'; import {saveContact, updateContact} from '../services/BBDD'; export const PersonForm = ({ persons, setPersons, newName, setNewName, newNumber, setNewNumber, setNewNotification, }) => { const submitHandler = (evt) => { evt.preventDefault(); const person = persons.fin...
true
627424c41423752694aa9331cbb6ea9216550924
JavaScript
XccelerateTech/dannyleung
/javascriptSelf.js
UTF-8
25,470
3.53125
4
[]
no_license
var DnaTranscriber = require('./rna-transcription'); var dnaTranscriber = new DnaTranscriber(); describe('toRna()', function () { it('transcribes cytosine to guanine', function () { expect(dnaTranscriber.toRna('C')).toEqual('G'); }); it('transcribes guanine to cytosine', function () { expect(dn...
true
d99cbef41421cfb5cbed77b6a458e2bbc52111fe
JavaScript
randycasburn/simpleCanvas
/index.js
UTF-8
2,183
2.828125
3
[]
no_license
import {state} from './js/state/state'; import {undo, redo, clear} from './js/utils/undoRedoClear'; // listen for clicks document.querySelector('header nav').addEventListener('click', e => toolClick(e)); // intialize colors setColor(state.get('currentColor')); function toolClick (e) { e.preventDefault(); e.stopPr...
true
1efb7e0ecb906a8738910f4842567675c54daf6a
JavaScript
dav3rid/card-game-fe
/src/components/board/neutral/PlayableDeck.jsx
UTF-8
1,749
2.75
3
[]
no_license
import React from 'react'; import Card from '../Card'; import * as game from '../../../game'; const PlayableDeck = ({ user_id, current_turn_id, game_state, playerRole, cardPlayedThisTurn, cards = [], updateGameState, setCardPlayedThisTurn, endTurn, }) => { const pickUpCards = () => { console.lo...
true
0fc5f801df933ae4812988abf6c71cac5d30ed9f
JavaScript
AsifDeveloper/React-Learning
/src/components/showLists.jsx
UTF-8
909
2.625
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; class showList extends React.Component { constructor() { super(); this.state = { posts: [], hasError: false }; } render() { const { posts } = this.state; if (!this.state.hasError) { return (...
true
30f6c3761a9481ce4c250ed9ad43bcb41587cd31
JavaScript
Bludwarf/gangsta-socca
/doc/maquettes/doodle.js
UTF-8
1,458
3.046875
3
[]
no_license
// // 03/04/2015 // function Doodle(url) { this.url = url; this.doodleJS = { data : null/*JSON.parse(...)*/ } this.setDoodleJS = function(doodleJS_string) { this.doodleJS = { data : JSON.parse(doodleJS_string) } } /** * @param i numéro du jour, 0 étant le prochain match (ou le mat...
true
f6d438bdd49c3aebed3bfbbf8d299e0594162264
JavaScript
ekospinach/gaed
/public/js/galeri.dev.js
UTF-8
2,196
2.671875
3
[]
no_license
/** * jQuery load */ $(function() { /** * konfigurasi wookmark * * @var array */ var opsi = { align: "center", autoResize: true, comparator: null, container: $("body"), direction: "left", ignoreInactiveItems: true, itemWidth: 300, fillEmptySpace: false, flexibleWidth: true, offset: 2, ...
true
ade86c3ee057e41a46e6a0b72d9c938e73abe84f
JavaScript
Xigua-gua/tkff-note
/tkff笔记.js
UTF-8
4,389
4.53125
5
[]
no_license
var log = function() { console.log.apply(console, arguments) } // 定义我们用于测试的函数 // ensure 接受两个参数 // condition 是 bool, 如果为 false, 则输出 message // 否则, 不做任何处理 var ensure = function(condition, message) { // 在条件不成立的时候, 输出 message if(!condition) { log('*** 测试失败:', message) } } JSON加强版 测试 JSON加强版 测试 J...
true
8362e96dd7f02d2e69e599cc9f1e0eea38a839ab
JavaScript
danielenstrom/Snuggles
/js/application.js
UTF-8
6,906
2.765625
3
[]
no_license
var Application = new function(){ var FRAMRATE = 40; var canvas; var context; var mouse = {x: 0, y: 0, isDown: false}; var particles = []; var lastX = 0; var vehicle; var isLeftDown = false; var isUpDown = false; var isRightDown = false; var KEY_LEFT = 37; var KEY_UP = 38; var KEY_RIGHT = 39; var ...
true
f967fa2370a2f3184dcfa2f1f62d6ade122d525b
JavaScript
nikozero01/memory-socialmedia-game
/scripts.js
UTF-8
1,503
3.0625
3
[]
no_license
const cards = document.querySelectorAll('.social-media-memory-card'); let hasFlippedSocialMediaCard = false; let lockBoard = false; let firstSocialMediaCard, secondSocialMediaCard; function flipSocialMediaCard() { if (lockBoard) return; if (this === firstSocialMediaCard) return; this.classList.add('flip'); ...
true
e81e82dcc529143e98778997aab5f63106afeb74
JavaScript
kevin7b7-ux/Adventure
/src/AdventuresOfDye/Objects/Platform.js
UTF-8
1,800
2.828125
3
[ "Apache-2.0" ]
permissive
/* File: Platform.js * * Creates and initializes a Platform */ /*jslint node: true, vars: true, white: true */ /*global gEngine, GameObject, IllumRenderable, vec2 */ /* find out more about jslint: http://www.jslint.com/help.html */ "use strict"; // Operate in Strict mode such that variables must be declared befo...
true
23ee3481354bc56ba9efbb2d00b6c7a868a02063
JavaScript
dmcquay/katas
/2021/2021-01-06-picoctf/the-numbers.js
UTF-8
173
2.921875
3
[]
no_license
const nums = [16, 9, 3, 15, 3, 20, 6, 20, 8, 5, 14, 21, 13, 2, 5, 18, 19, 13, 1, 19, 15, 14] const val = nums.map(x => String.fromCharCode(x + 64)).join("") console.log(val)
true
9db204160c7a041011a1d2e8572fd26ca165417a
JavaScript
Light0912/MVC_HotHotHot
/public/js/controller.js
UTF-8
1,289
2.8125
3
[]
no_license
"use strict" class Controller { animate() { return loader.show('content-embeded') } resetJSInjector () { let js = document.getElementsByClassName('js-inject') Array.from(js).forEach((el) => { el.remove() }) } addJsInjector(src) { ...
true
00d372072037cfb2aae967f529a62d2cce4bf7c1
JavaScript
chengchengpeng/leetcode
/first/242.js
UTF-8
657
4
4
[]
no_license
// 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 var isAnagram = function(s, t) { if (s.length !== t.length) return false let smap = new Map(),tmap = new Map() for (let i = 0; i<s.length; i++) { if (smap.has(s.charAt(i))) { smap.set(s.charAt(i), smap.get(s.charAt(i)) + 1) }else { smap.set(s.charAt...
true
fa36739b04320653736e5c5d255dfd98f700430c
JavaScript
Evelyn0804/DECO3200-A3-shhe8438-knie0519
/server/public/javascript/back.js
UTF-8
2,904
3.046875
3
[]
no_license
//Get the date at the home screen var td = setInterval(showDate, 1000); function showDate() { var today = new Date(); var month = today.getMonth() + 1; var day = today.getDate(); document.getElementById("date").innerHTML = month + "." + day; } // Image Slider const leftArrow = document.querySelector("#left"); ...
true
1d202b798f923900b979ffd99275d6e9f091d73f
JavaScript
ezcheung/kindred
/public/game.js
UTF-8
9,869
2.796875
3
[ "MIT" ]
permissive
let gameSettings = { width: 800, height: 600, numPlayers: 2, //not used yet, but potentially for the future? }; let game = new Phaser.Game(gameSettings.width, gameSettings.height, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render }); let tracking = false; let players; l...
true
d58a9ca717afe2cd54a1048a3b2e5d66873c1130
JavaScript
mmckie1/ARPuzzle
/js/script.js
UTF-8
2,808
3.046875
3
[]
no_license
'use strict'; //video variables var constraints; var imageCapture; var mediaStream; var takePhotoButton = document.querySelector('button#takePhoto'); var canvas = document.querySelector('canvas'); var video = document.querySelector('video'); var videoSelect = document.querySelector('select#video'); // takePhotoButt...
true
ba91c0df164996a5d9c91aab185b9da055f9cf6d
JavaScript
rbrochot/PhaserGulpBoilerplate
/src/Components/AsteroidFactory.js
UTF-8
2,117
2.75
3
[ "MIT" ]
permissive
import { Point, Physics, RandomDataGenerator, } from 'Phaser'; import _ from 'Underscore'; var RNG = new RandomDataGenerator(); // Should only be a factory, and have kill method (and static emitter) in asteroid class, // but it seems overkill in this case... class AsteroidFactory { constructor(game) { this.game...
true
5cc7a12cbaa11d36f1194e1a3e55ae363bf6cabd
JavaScript
Kaderimon/rich-texteditor
/assets/stores/SynonymStore.js
UTF-8
1,002
2.578125
3
[]
no_license
import { observable, computed, action, autorun } from "mobx"; import { SYNONYM_URL } from "./../constants/common"; class SynonymStore { @observable show; @observable synonyms; constructor() { this.show = false; this.synonyms = []; } @computed get isSynonymListShown() { return this.show; } ...
true
873487e1fd836d952502b4ae9cc208eb6dfcb369
JavaScript
gunar/record-locator
/test/index.js
UTF-8
2,288
2.828125
3
[ "MIT" ]
permissive
var chai = require('chai'); var recordLocator = require('../index'); var should = chai.should(); describe('record locator module', function () { it('should encode integers into record locator strings', function () { recordLocator.encode(270600).should.equal('AAAA'); recordLocator.encode(1048575).should.equal('ZZ...
true
ab97e1b1a751213569a74a53a8f0396cad5b007d
JavaScript
xiaohan6969/Iirs_template
/template/jsTem/index.js
UTF-8
1,216
2.515625
3
[]
no_license
function Index(){ var str = window.sessionStorage; $.ajax({ headers:{ "token":str.getItem("token"), }, url:str.getItem("domain_name")+'/miniProgram/index/list?page=game', type:'get', success: function (res) { // console.log(res) var re...
true
2a0e00fad2900a6a8d335bcb84c08c8a1678c662
JavaScript
Mujib517/html-demo
/old/test.js
UTF-8
2,336
3.890625
4
[]
no_license
var arr = [10, 20, 30, 40, 50]; for(var i=0;i<arr.length;i++){ console.log(arr[i]); } // var i = 0; // while (i < arr.length) { // console.log(arr[i]); // // i++; // } // var age = 50; // if (age == 20) { // console.log("You are young"); // } // else if (age == 30) { // console.log("You are...
true
99c15bff712d1fe085c6285a1dff560140e14781
JavaScript
db10bo/practiscore-match-manager
/public/javascripts/pmelib/tpp.js
UTF-8
4,950
2.640625
3
[]
no_license
/* global _:false */ // // Time Plus /w Points library for brower-side javascript // // Return values: // 0 - Unscored // 1 - Time only score // 2 - Points only score // 3 - Time + points score // 4 - DNF'ed // 5 - Zero time // 6 - Bad values // var pmelib = (function () { 'use strict'; pm...
true
e3ed6591675139da8def0b1e533ffea114a5bb3d
JavaScript
htbkoo/javascript
/src/main/javascript/online/codewars/higherOrderFunctionsSeries/CodingMeetup_7_FindTheMostSeniorDeveloper.js
UTF-8
2,272
4.1875
4
[]
no_license
/** * Created by Hey on 20 Nov 2016 */ /* http://www.codewars.com/kata/coding-meetup-number-7-higher-order-functions-series-find-the-most-senior-developer/train/javascript You will be given an array of objects (associative arrays in PHP) representing data about developers who have signed up to attend the...
true
7b3f1d83ca707d50b3495ad1b6e62a233edf4762
JavaScript
Lucaskitteridge/lotide
/test/middleTest.js
UTF-8
667
3.078125
3
[]
no_license
const assert = require('chai').assert; const middle = require('../middle'); describe('#middle', () => { it('returns an empty array for one or two values' , () => { assert.deepEqual(middle([1]), []) assert.deepEqual(middle([1, 2]), []) }); it('retrurns the middle of the array when the length is odd and ...
true
d89072e3e3df7e5d7a58ab589cc28646f85d3621
JavaScript
olavim/drawman
/src/server/game.js
UTF-8
11,300
2.609375
3
[]
no_license
import shortid from 'shortid'; import _ from 'lodash'; import schedule from 'node-schedule'; const State = { INACTIVE: 'inactive', START_OF_ROUND: 'start-of-round', CHOOSING_WORD: 'choosing-word', DRAWING: 'drawing', END_OF_TURN: 'end-of-turn', SHOW_TURN_SCORE: 'show-turn-score', SHOW_GAME_SCORE: 'show-game-sco...
true
efcf8081dadccf20725e9c827315470aaab34e76
JavaScript
AnshuSharma-164/3DEditor
/colorMouseTest/colorMouseTest.js
UTF-8
5,956
2.84375
3
[]
no_license
// initialization of Three.js function init() { // Check if WebGL is available see Three/examples // No need for webgl2 here - change as appropriate if (THREE.WEBGL.isWebGLAvailable() === false) { // if not print error on console and exit document.body.appendChild(THREE.WEBGL.getWebGLErrorMe...
true
4418a47b1488c71cb25c3a2d6f6fdf86dc24e08a
JavaScript
AshaSalorina/SparkInDotNET
/CoreSite/wwwroot/CoreAssets/Js/index-socket.js
UTF-8
2,549
2.8125
3
[]
no_license
/** * 初始化调用 */ (function () { /** * 初始化映射表 * */ var occupationMap = ["other", "academic", "artist", "clerical", "college", "service" , "doctor", "executive", "farmer", "homemaker", "student", "lawyer" , "programmer", "retired", "sales", "scientist", "self-employed", "engineer" ...
true
a7cdd37c0732615ba383e0d6c34bf11f8bca9786
JavaScript
keldaan-ag/Steel
/js/get_position.js
UTF-8
1,617
2.65625
3
[]
no_license
var terre = { r : 6371, // rayon approximatif de la terre en km }; var iss = { v : 27600, // vitesse de l'iss en km/h alt : 400, //L’altitude moyenne de l’ISS en km inclinaison : 51.64, polar : 90 //l'inclinaison de l'iss en ° }; var alert_de...
true
5250a9ccf30573c514dec78dbb3caf6dac259d09
JavaScript
paneMrazek/tessera
/public/javascripts/test2.js
UTF-8
4,982
2.96875
3
[]
no_license
window.addEventListener('load', eventWindowLoaded, false); function eventWindowLoaded() { canvasApp(); } function canvasSupport () { return Modernizr.canvas; } function canvasApp() { var mousePos = 20000; if (!canvasSupport()) { return; } function drawScreen () { context.fillStyle = '#EEEEEE'; context....
true
19de678e28cd38d4c369bec5f818c498dd4c9b80
JavaScript
kksarma/url-shortener
/api/controllers/UrlController.js
UTF-8
937
2.5625
3
[ "MIT" ]
permissive
const Url = require('../models/Url'); const mongoose = require('mongoose'); const webhost = 'https://encode-url.herokuapp.com'; function shorten(req, res) { if (req.body.url) { const longUrl = req.body.url; // Check if url already exists in the database Url.findOne({ longUrl: longUrl }).then(async (url)...
true
fc752cf05707973f50445e253c414eef48aa8374
JavaScript
loloula/Projetwebtechno
/static/js/annonce.js
UTF-8
3,748
2.640625
3
[]
no_license
document.addEventListener('DOMContentLoaded', () => { //console.log("page"); // debut script recuperer les annonces en cliquant sur un bouton const emp = document.getElementById("liste_annonces"); const leBoutonliste = document.getElementById("bouton_liste"); leBoutonliste.addEventListener("click", (evt) => {...
true
42861a7980c5bc9f80017acf4d33df7d1b5ad200
JavaScript
ConstanzaT/Ejercitacion-JS-02
/Par/main.js
UTF-8
489
4.6875
5
[]
no_license
/* esPar(numero) Crear una función esPar que tome como argumento un número y devuelva true si dicho números es par o false si no lo es TIP: un número es par si divido por 2 el resto (o módulo) de esa operación es 0 esPar(2) // true esPar(3) // false */ let numero = parseInt(prompt('Ingresa un valor para saber si es...
true
7b2e8f58bf0ba2484e57451884b4c591518bb211
JavaScript
radulescu-alexandru-nicolae/shop-online
/js/Controllers/CategoriesController.js
UTF-8
1,477
2.828125
3
[]
no_license
import Categories from "../class/Categories.js"; export default class CategoriesController{ constructor(){ this.categories=[]; this.load(); console.log(this.categories); } create=(name,description)=>{ let id; if(this.categories[this.categories.length-1]===undefined){ id=0; }else{...
true
723754d2ac5b7dcd42291620689bb1890b59fcbf
JavaScript
eileengalindo/TTP-FS
/src/components/buy-form.js
UTF-8
2,815
2.734375
3
[]
no_license
import React, { Component } from 'react'; import axios from 'axios'; import Portfolio from './portfolio'; import TextField from '@material-ui/core/TextField'; import Button from '@material-ui/core/Button'; import updatePrice from './helper-functions/update-price'; import buyFormHandleSubmit from './helper-functions/buy...
true
434a1dda8946b5c6a9a615490ecee1ed1c7c0e91
JavaScript
colosa171183/pmui
/src/form/Fieldset.js
UTF-8
10,454
2.5625
3
[]
no_license
(function(){ /** * @class PMUI.form.Fieldset * @extends PMUI.core.Panel * Class to handle form a fieldset container for {@link PMUI.form.Field Field objects}, {@link PMUI.form.FormPanel FormPanel objects}, {@link PMUI.form.Fieldset Fieldset objects} and {@link PMUI.form.TabPanel TabPanel objects}. ...
true
e9e2adc1e3ed8e28673be179a346c30b42e94ac7
JavaScript
SamueleBarbiera/ProjectWork
/ProjectWork_FULLSTACK/src/public/js/storico.js
UTF-8
4,257
2.578125
3
[ "MIT" ]
permissive
$(document).ready(() => { const urlParams = new URLSearchParams(window.location.search); const getcommessa = {}; getcommessa.commessa = urlParams.get("code"); getcommessa.stato = urlParams.get("stato"); getcommessa.from = urlParams.get("from"); getcommessa.to = urlParams.get("to"); const ta...
true
6094556e1688e1de9d7e0088b01d682df6bb955d
JavaScript
haroldcampbell/anemic-components
/lib/visuals/visuals-wrapped-shape.js
UTF-8
523
2.515625
3
[ "Apache-2.0" ]
permissive
import { createVisual, } from './create-visual' /** Creates an wrapper visual around the specified shape. @method wrappedShape @param {Object} shape - an Ancui shape that will be initialized @param {Object} data @param {Array} effectsArray - array of intents @return {Object} */ export const wrappe...
true
b818a888923ed56940dca2edc559d1a4d3cce052
JavaScript
alpha0202/Master-Frameworks-JS-victor-robles
/Maquetacion/React/js/script.js
UTF-8
436
2.984375
3
[]
no_license
window.addEventListener("load", function() { let template = document.getElementById("article-template"); let articles = document.getElementById("articles"); for (let i = 1; i < 5; i++) { let clonar = template.cloneNode(true); clonar.removeAttribute("id"); let h2 = clonar.getElements...
true
8a28ad1b7a3dda764b59f5ff5a7081a757ade2c0
JavaScript
sexyHuang/demos
/src/jsBase/newSimulation.js
UTF-8
1,758
3.59375
4
[]
no_license
/* * @Author: Sexy * @Date: 2019-02-19 14:57:33 * @LastEditors: Sexy * @LastEditTime: 2019-02-19 17:02:50 * @Description: * `new` 创建的实例有以下 2 个特性 * 1、访问到构造函数里的属性 * 2、访问到原型里的属性 * 当代码 new Foo(...)执行时,会发生: * 1.一个继承自Foo.prototype的新对象被创建; * 2.使用制定的参数调用构造函数Foo,并将this绑定到新创建的对象。new Foo 等同于 new Foo(),也就是没有制定参数列表,Foo...
true
f35a82884096d4976ba5d609be59ac307e2c57f7
JavaScript
ricardotg34/coffee-shop-rest
/server/routes/usuario.js
UTF-8
2,603
2.609375
3
[]
no_license
const express = require('express') const bcrypt = require('bcrypt') const Usuario = require('../models/usuario') const { verifyToken, verifyAdminToken } = require('../middlewares/authentication') const app = express() //Obtener datos de todos los usuarios app.get('/usuario', [verifyToken, verifyAdminToken], (req, res...
true
5f6550994978d8a2b6c9e1e4bb21eed97dad6b97
JavaScript
SinisterPepper/JScourse
/SpecialTasks/searchTableProject/searchTable/js/index.js
UTF-8
8,495
3.734375
4
[]
no_license
/** * ПЕРЕМЕННЫЕ: * table - сама таблица * tableRows - строки таблицы * selectedColumnIndex - индекс выбранного столбца (нужна для поиска) * searchText - поисковый текст * notFoundRow - строка таблицы где выводится сообщение что 'ничего не было найдено' */ let table = null, tableRows = null, selectedColu...
true
baa11a87de355f7ee664e8fc756bc726aac4de84
JavaScript
hentrymartin/audibene-reddit-clone
/src/utils/index.js
UTF-8
1,525
2.84375
3
[]
no_license
export const getScore = (score) => { if (score < 1000) { return score; } return `${score/1000}k` }; export const organizeComments = (comments) => { let commentsMap = {}; let maxDepth = 0; // This loop will create the map for the comments with respect to depth for (let i = 0; i < comments.length; i+...
true
392b90ac1475410a9ebc0f2020b0e346b2b7af4b
JavaScript
v3rt1go/egghead-express
/streams.js
UTF-8
1,060
2.6875
3
[]
no_license
'use strict'; var fs = require('fs'); var JSONStream = require('JSONStream'); // Much of the node functionality and the way it works is powered by streams var inputFile = './issues.json'; var outputFile = './savedIssues.json'; // Streams can be readable, writable or both - duplex var readStream = fs.createReadStream(...
true
1e49fd58df363afa78f75a993a57751695a08fc7
JavaScript
floweraviles/Pursuit-Core-Web-React-Routing-Lab-Tested
/src/Components/MultipleRandomDogs.js
UTF-8
919
2.84375
3
[]
no_license
import { Component } from 'react'; import axios from "axios"; class MultipleRandomDogs extends Component { state ={randomDogs: []} fetchRandomDog = async() => { try { const {num} = this.props.match.params const res= await axios.get(`https://dog.ceo/api/breeds/image/random/${...
true
7bdb2a2a09bbbf4ae6de59ce094967dfd87b9949
JavaScript
cgewecke/eth-gas-reporter
/mock/test/variablecosts.js
UTF-8
2,308
2.765625
3
[ "MIT" ]
permissive
const random = require("./random"); const VariableCosts = artifacts.require("./VariableCosts.sol"); const Wallet = artifacts.require("./Wallet.sol"); contract("VariableCosts", accounts => { const one = [1]; const three = [2, 3, 4]; const five = [5, 6, 7, 8, 9]; let instance; let walletB; beforeEach(async ...
true
daf131fe68addb308501ab5ccc49b7a14e502b5d
JavaScript
brodavi/htm-playground
/modules/canvas-display/index.js
UTF-8
7,285
3.078125
3
[]
no_license
const canvasDisplay = { getDigit: function getDigit (arr) { // Translate one-hot to digit for (var i = 0; i < arr.length; i++) { if (arr[i] !== 0) { return arr.indexOf(arr[i]) } } }, drawDigit: function drawDigit ({ layerID, digit, position }) { const canvases = document.query...
true
b90ef700d92331c972a07aee75b95faa495a0005
JavaScript
RyLuras/lab10-BusMall
/js/ResultsChart.js
UTF-8
2,673
2.703125
3
[]
no_license
/* exported productArray ResultsChart */ /* globals clearProductsArray */ 'use strict'; const chartTemplate = document.getElementById('results-chart-template').content; class ResultsChart { constructor(resultsList) { this.resultsList = resultsList; } render() { const dom = chartTempl...
true
6cd00dabe7b51ef4707a2c01d2f4804300f5c372
JavaScript
rrogerthat/HackerRank-Algorithm-Problems
/pickingNumbers.js
UTF-8
565
3.921875
4
[]
no_license
//HackerRank: Picking Numbers (Easy) [Javascript] //Link: https://www.hackerrank.com/challenges/picking-numbers/problem function pickingNumbers(a) { let arrSort = a.sort((a, b) => a - b); let arr1 = [[arrSort[0]]]; let longest = 1; let count = 1; for (let i = 1; i < arrSort.length; i++) { if (Math.abs(ar...
true
7aa281e14cc8c84050621390ab38d2f749e99f0c
JavaScript
skwid138/prime
/Prework Notes/loop.js
UTF-8
363
3.28125
3
[]
no_license
/*jshint multistr:true */ var text = 'Hey, my name is Hunter, my family calls me Hunter, I am not \ good at big game hunter.' ; var myName = 'Hunter'; var hits = [ ]; for (i = 0; i < text.length; i += 1) { if (text[i] === myName[0]) { for (var j = i; j < (text.length + myName.length); j += 1) { ...
true
710057e0ef80802d1dfe77cac3e25a7370e3c4c0
JavaScript
dvdfgrlnd/Samarbeta
/popup.js
UTF-8
2,911
2.734375
3
[]
no_license
document.getElementById('userForm').onkeydown = checkEnterPress; // Connecting => not creator of session document.getElementById('connectButton').onclick = () => connectHandler(false); document.getElementById('disconnectButton').onclick = disconnect; document.getElementById('createButton').onclick = createSession; doc...
true
06f78a6b64c8ae1e0ba9608d28e9e37a619aa120
JavaScript
rawagschal/budget-tracker
/public/js/idb.js
UTF-8
2,440
2.9375
3
[ "MIT" ]
permissive
let db; const request = indexedDB.open('budget_tracker', 1); // this happens if the db version changes request.onupgradeneeded = function(event) { //save reference to db const db = event.target.result; //create object store (table) with auto-incrementing primary key db.createObjectStore('new_entry', { ...
true
3e58a242db9e405ae2d70f46d711dd6a80bf546b
JavaScript
EdwinWalela/weatherJSON
/GeoLocation/main.js
UTF-8
7,314
2.921875
3
[]
no_license
//defining DOM elements var myButton = document.getElementById("btn"); var container = document.getElementById("container"); var loc = document.getElementById("location"); var temperature = document.getElementById("current-temp"); var icon = document.getElementById("weather-icon"); var today = document.get...
true
af6c8025c5daa276dd94dc5b9ae69d9fed3ed17d
JavaScript
humdrum-tools/verovio-humdrum-viewer
/_includes/vhv-scripts/html/applyParameters.js
UTF-8
3,433
2.9375
3
[]
no_license
{% comment %} // // Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> // Creation Date: Sat Jun 11 19:15:38 PDT 2022 // Last Modified: Sat Jul 2 20:45:13 PDT 2022 // Filename: _includes/vhv-scripts/html/applyParameters.js // Included in: _includes/vhv-scripts/html/main.js // Syntax: HTML; ECMAS...
true
a466424058a8e22d8b35fac92ce9f7bb5954dd43
JavaScript
michaelganesan26/testRxjsSequence
/SubjectReplay.js
UTF-8
859
2.5625
3
[]
no_license
"use strict"; <<<<<<< HEAD ======= /* =========================== Description: Sample Application for RxJs.ReplayObject Date: 03/29/2018 Notes: This will only display the values within a give time, this is how you can use it to cache the values =========================== */ exports.__esModule = true; ...
true
9cb6867805fad0a65acc0d1cc1b0e1921780e582
JavaScript
ypinchina/javascriptLearn
/js-base/promise-demo.js
UTF-8
1,050
2.640625
3
[]
no_license
function imgLoad(url) { let img = document.createElement('img') img.src = url return new Promise((resolve, reject) => { img.onload = function (){ resolve(img) } img.onerror = function () { let err = new Error(`图片加载失败: ${img.src}`) reject(err) ...
true
910c149af60117242b7fe69cbd1379534750127d
JavaScript
retrodungeon/JSTutorials
/getRgb.js
UTF-8
780
3.34375
3
[]
no_license
var getRGB = function(hexStr) { if (typeof hexStr !== "string"){ return TypeError("Expecting hexStr to be string value"); }; var arr = [], rgb; var firstHash = hexStr.slice(0,1); if(firstHash !== "#") { return Error("Expecting first symbol to be #"); } rgb = hexStr.substr(1); if(rgb...
true
a45825a12a7b31f7c0e6af60091afb5861e25d70
JavaScript
Sanotsu/DataStructures-Using-JavaScript
/10.Sort/merge_sort.js
UTF-8
1,329
3.796875
4
[]
no_license
// 合并两个有序数组 function merge(arr1, arr2) { var merge_arr = []; var index_1 = 0; var index_2 = 0; while (index_1 < arr1.length && index_2 < arr2.length) { // 哪个数组的头部元素小,就合并谁,然后更新头的位置 if (arr1[index_1] <= arr2[index_2]) { merge_arr.push(arr1[index_1]); index_1++; ...
true
f496e96ad05b70f2b91f762af0ecdaf886e48379
JavaScript
cuhtis/gift-it
/public/javascript/register.js
UTF-8
1,688
3.203125
3
[]
no_license
document.addEventListener("DOMContentLoaded", function(event) { var form = document.forms["form"]; var error = document.getElementById("message"); form.addEventListener("submit", validateForm); function validateForm (evt) { var ret = true; var message = ""; if (form["username"].value.match(/...
true
d5f9e11686faa99fe9216609446e403bc385347a
JavaScript
kvvzr/auto-layered-canvas
/src/libs/Drawing.js
UTF-8
10,867
2.65625
3
[ "MIT" ]
permissive
import Color from 'color'; import tools from '../libs/Tools'; class Drawing { constructor(mainColor, tool, canvas, width = 0, height = 0, showPen = true, showBase = true, showExtra = true) { this.mainColor = mainColor; this.tool = tool; this.canvas = canvas; this.url = null; this.history = nu...
true
6e53fa966f0d464354b11e8e642b8ed34d0123e3
JavaScript
FrederickPullen/Sfera-Dev-RC
/webroot/js/qualification/user/dashboard.js
UTF-8
2,918
2.515625
3
[ "MIT" ]
permissive
/** * The handler is being called on document ready */ $(document).ready(function(e) { // On clicking on pull request grid's accept link $(document.body).on('click', '.pull-request-accept-link', function(e) { // Prevent link from redirecting e.preventDefault(); // Call the handler ...
true
ea742ff99c04d1ab11ab7ae7bb8286f5337de75d
JavaScript
eric-endsley/99-reasons
/src/components/Reason.js
UTF-8
902
2.546875
3
[]
no_license
import React from "react"; import PropTypes from "prop-types"; function Reason(props){ return ( <React.Fragment> <div onClick = {() => props.whenReasonClicked(props.id, props.num)}> <h3>{props.logic} - {props.name}</h3> <p><em>{props.solution}</em></p> <p>{props.num}</p> {/*...
true
6d41edebb56a605854d550e91801fb1ea9e0398d
JavaScript
Wenodh/tinder-clone
/mongodb-backend-tutorial/app/controllers/stories.controller.js
UTF-8
2,675
2.546875
3
[]
no_license
const db = require('../models'); const Stories = db.stories; // create a stories exports.create = (req, res) => { console.log(req.body.stories); const story = new Stories({ name: req.body.name, avatar: req.body.avatar, stories: [req.body.stories], }); story .save(story)...
true
8b0dfdbfbc95eb8815365a7bbc9bfc49a65f59ce
JavaScript
gosiarutkowska/TypeScriptLearn
/dist/tuple-type.js
UTF-8
171
2.609375
3
[]
no_license
"use strict"; // ex. create array with knows lenght, but every arg has different type // type tuple creats sth like union type for more arg. var mix = ['cat', 13, false];
true
06db3416d9de914ea841f4fbf99297cad4a41bda
JavaScript
jledun/node-tunein
/browseHistory.js
UTF-8
1,652
3.0625
3
[ "MIT" ]
permissive
"use strict"; const querystring = require('querystring'); const crypto = require('crypto'); module.exports = class BrowseHistory { constructor() { this.reset(); } reset() { // init this.histo = []; this.index = -1; } indexOf( hash ) { if ( this.histo.length == 0 ) return -1; let ...
true
c5d303f67141f14f2da4e5e4af711a326f0c12dc
JavaScript
turchinskki/project-lvl1-s356-1
/src/games/brain-progression.js
UTF-8
894
3.1875
3
[]
no_license
import engine from '..'; import getRandom from '../utils'; const description = 'What number is missing in this progression?'; const progressionLength = 10; const getProgression = (firstElem, step, length) => { const progression = []; for (let i = 0; i < length; i += 1) { progression.push(firstElem + step * i)...
true
274e2c3cfc7512bf428825232992cc9bcdc5bdb3
JavaScript
2o3t/2o3t-OTUI
/libs/.sass/test/colors.js
UTF-8
3,149
2.6875
3
[]
no_license
const fs = require('fs'); const path = require('path'); const PREFIX = '$--color'; const SUFFIX = '!default;'; const datas = [ '// Mixin Color Libs' ]; const COLORS = { default: '#314659', white: '#FFFFFF', black: '#000000', primary: '#207FF6', success: '#37C385', warning: '#FFCC00', dang...
true
b31829de7f5dfc93383f853e34aa749c9a62089a
JavaScript
xvicmanx/image-processing-blocks
/src/actions/EditingFunctionActions.js
UTF-8
1,449
2.609375
3
[]
no_license
const Types = { SET_FUNCTION_NAME: 'SET_FUNCTION_NAME', SET_FUNCTION_ARGUMENTS: 'SET_FUNCTION_ARGUMENTS', SET_FUNCTION_BODY_CODE: 'SET_FUNCTION_BODY_CODE', FUNCTION_SAVED: 'FUNCTION_SAVED', FUNCTIONS_READ: 'FUNCTIONS_READ', }; export const setFunctionName = (name) => { return { type: Types.SET_FUNCTION...
true
f4a04b15d0a15ba4bb84a5164734107b68942478
JavaScript
rych182/apuntes
/practicas/ejercicios-js/09-try-catch.js
UTF-8
780
4
4
[]
no_license
try { let numero = "y" throw new Error("EL caracter no es un número"); console.log(numero * numero); } catch (error) { console.log(`Algo salio mal ${error}`); } /* EJERCICIO 1: Hacer un try-catch-finally try { console.log("Todo bien"); console.log(variable); console.log("Segundo mensaje d...
true
1b4264fc112c0f9aa0ce34b6dd89b6404fe05be5
JavaScript
fionavidra/aksara-jawa-classification
/frontend/src/Sketch.js
UTF-8
1,885
2.984375
3
[]
no_license
import React from 'react' import p5 from 'p5' class Sketch extends React.Component { constructor(props) { super(props) //p5 instance mode requires a reference on the DOM to mount the sketch //So we use react's createRef function to give p5 a reference this.renderRef = React.createRe...
true
21b16349c27cd587aa33f6cc36b662e156ea2335
JavaScript
leegion-z/myExampleCode
/CUIjs/douyu/util.js
UTF-8
1,009
3.03125
3
[]
no_license
function getCookie(name) { var cookie = document.cookie; // var cookie = 'user=cuijn; password=123456; tel=13012345678; email=1@qq.com'; //user=cuijn; password=123456; email=1@qq.com; tel=111222 // var arr = cookie.split('; '); // var key_value; // for(var i=0; i<arr.length; i++) { // key_value = arr[i].sp...
true
ec8c7db05837efcec530aa06c53f2cf2a8934ddb
JavaScript
JazminDominguez/fullstack-challenge
/src/App.js
UTF-8
1,394
2.953125
3
[]
no_license
import DirectoryList from "ui/components/DirectoryList"; import CustomHeader from "ui/components/CustomHeader"; import "./index.scss"; export default function App() { const [offerList, setOfferList] = useState([]); // default value 1 to fetch the first page const [page, setPage] = useState(1); const U...
true
598dc3681cc38491c78bd88c0f9a2b286bdaae06
JavaScript
tagoonp/nisa
/assets/js/custom.js
UTF-8
1,397
3.015625
3
[]
no_license
/** * * You can write your JS code here, DO NOT touch the default style file * because it will make it harder for you to update. * */ "use strict"; var engMonth = {}; engMonth['Jan'] = '01'; engMonth['Feb'] = '02'; engMonth['Mar'] = '03'; engMonth['Apr'] = '04'; engMonth['May'] = '05'; engMonth['Jun'] = '06'; en...
true
5a81c76c2b3ee6de8c98b16137be9f7c00b600ae
JavaScript
zacharymorel/DailyCodeWars
/April16th->20st/Find_The_Nth_Num.js
UTF-8
1,147
4.28125
4
[]
no_license
// Instructions // Complete the function that takes two numbers as input, num and nth and return the nth digit of num (counting from right to left). // Note // If num is negative, ignore its sign and treat it as a positive value // If nth is not positive, return -1 // Keep in mind that 42 = 00042. This means that fin...
true
eabb870dd711834d76caec6a2522dc6ccfeb8c3d
JavaScript
shaunakg/sixty-seconds-of-python-frontend
/script.js
UTF-8
8,708
2.640625
3
[ "MIT" ]
permissive
// // Sixty Seconds of Python // Under MIT Licence // const usp = new URLSearchParams(window.location.search); // Specify custom API with ?useAPI=my-api-host.com const apiHost = usp.get("useAPI") || "60api.srg.id.au" let isTerminalOn = false; let timeLeft = 1; let totalTime = 60; let interval = null...
true
34f478c2a2d21a8ccce5c9069f2e0a3279a89e29
JavaScript
gsicuto/WDPT_MAY_2021
/M2/10_07_2021/myreactapp/src/App.js
UTF-8
1,072
3.21875
3
[]
no_license
import React from 'react'; import './App.css'; import dog from './dog.jpg' import Comp from './Comp.js' function capitalizeFirstLetter(name) { return `${name[0].toUpperCase() + name.slice(1)}`; } const statement = <h1>React is Fun</h1> const student = { name: 'daniel', funFact: 'Fazia parte de um grupo de dança...
true
e3c05f7d3afba666f55cdb4a63c3f3b38cd99db9
JavaScript
skylerpcummins/react-widgets
/tabs.jsx
UTF-8
834
2.625
3
[]
no_license
var React = require('react'); var ReactDOM = require('react-dom'); var TabsComponent = React.createClass({ getInitialState: function() { return { selected: 0 }; }, clicked: function(index) { this.setState({ selected: index }); }, render: function() { var tabsList = this.props.tabs; // var t...
true
ae754bdfadc3327cacb32147ba3f8834290b7947
JavaScript
calvinstudebaker/simple-chess-ai
/js/myChess.js
UTF-8
2,820
3.140625
3
[]
no_license
var game; var board; var PIECE_POINTS = { 'p' : -1, 'n' : -3, 'b' : -3, 'r' : -5, 'q' : -9, 'k' : -1000, 'P' : 1, 'N' : 3, 'B' : 3, 'R' : 5, 'Q' : 9, 'K' : 1000 } function start(){ setupListeners(); newGame(); } var setupListeners = function(){ $('.reset-ga...
true
95067a52a720d95a2228dcf7177ddf7c1a0826bd
JavaScript
manimovassagh/JsUnterricht
/210419_node/node_1_basic/index.js
UTF-8
138
2.984375
3
[]
no_license
'use strict'; let meinArray = [...new Array(100)].map(el => ~~(Math.random()*100)); console.log( meinArray.reduce((a,b) => a+b) );
true
5d10afbfc77bba7a51e0c83cce363333cc8892f0
JavaScript
SCHYNS-Nathan/js-td-basics-4-fonctions
/starter/f09-fonction-anonyme-arrow.js
UTF-8
1,140
4.0625
4
[]
no_license
/***************************** * 020 - Fonctions - Préalable */ // 6. FONCTION ANONYME // 2°) ES6 : fonction fléchée (fat arrow function) // = une autre syntaxe pour la déclaration d'une fonction anonyme /* RAPPEL : fonction anonyme sous forme d'expression de fonction : const bonjour = function(prenom) { retur...
true
09fa67ba8a6f2d00ff3b3120058e251d76a1b691
JavaScript
smpalileo/jwtEx
/routes/test-routes.js
UTF-8
1,724
2.75
3
[]
no_license
const jwt = require('jsonwebtoken'); module.exports = (app) => { const payload = { data1: 'Data 1', data2: 'Data 2', data3: 'Data 3', data4: 'Data 4', } let token = ''; app.post('/login', (req, res) => { const { username } = req.body; const { passwo...
true
64536c5a27849b7783a6aceb1bbe11c4ca7e5774
JavaScript
sespinosav/UserAppWishesCollage
/backend/controllers/userController.js
UTF-8
677
2.53125
3
[]
no_license
const User = require('../models/User'); const addUser = async(req,res) => { try { const { name, commune, wish, imgUrl } = req.body; const user = User({ name, commune, wish, imgUrl }); if(req.file) { const { filename } = req.file; u...
true
ee9d8d077cab79db04a9c51f74c76c648485e69b
JavaScript
ease-templates/sdk-ui
/template/src/helper/animation.js
UTF-8
3,347
2.546875
3
[]
no_license
const _ = require('./util') module.exports = function animation (el, opts) { _.assert( el && el.nodeType, 'transition(el, opts) "el" must be a DOM element!' ) function noop () {} var defaultOpts = { name: '', 'enter-class': '', 'enter-active-class': '', 'leave-class': '', 'leave-ac...
true
1f828d3dd8479cbac84e8d7a17b8e952fb43a95f
JavaScript
someOneJYB/hehehe
/co-self.js
UTF-8
4,162
3.3125
3
[]
no_license
// co 最后都会返回成 promise 的形式打开; // 里面是一个 generator 如果还有一个 generator 进入到新的 generator 直到一个结束退回到上一级的 promise 中继续执行,利用了内部 promise 先执行完毕才会执行外部的 promise // 对象的话就会收集所有的 promise 属性添加 then 方法收集返回的值,最后 promise.all 里面统一返回 // 对象是数组的话直接把所有元素打开按照对应的逻辑处理,因为最后都是 promise 打开,所以 toPromise 方法很关键,所有处理都变成 promise 的关键, next 函数也是承上启下的作用,打开 promi...
true
c42e79e9a3ce670735079a948b9e6fd72361dabb
JavaScript
solostyle/elitetoma
/pub/js/elitetoma.comments.js
UTF-8
3,293
2.5625
3
[]
no_license
this.Elitetoma.Comments = this.Elitetoma.Comments || function() { // Elements var commentsWPElem = function() {return Ydom.get('commentsWP');}; commentsElem = function() {return Ydom.get('comments');}, formNameElem = function() {return Ydom.get('commentsWPName');}, formCommentElem = function() {return Ydom....
true