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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
780fd8339e9c668cdfcd9d71f750df4649ee5972 | JavaScript | mkora/GitHub-profile | /src/react/src/utils/round.js | UTF-8 | 259 | 3.3125 | 3 | [
"MIT"
] | permissive | /**
* To avoid problems like,
* * Number((1.005).toFixed(2)) returns 1 instead of 1.01
* * Math.round(1.005*100)/100; returns 1 instead of 1.01
*/
export default (value, decimals = 2) =>
Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);
| true |
f969962735c70465862b7629f1d8521dfd08fb21 | JavaScript | bdesham/littlefoot | /src/init.js | UTF-8 | 3,907 | 2.921875 | 3 | [
"MIT"
] | permissive | import closest from 'component-closest'
import classList from 'dom-classlist'
import escape from 'lodash/escape'
import template from 'lodash/template'
import getFootnoteLinks from './getFootnoteLinks'
import hideOriginalFootnote from './hideOriginalFootnote'
/**
* Get the closest related footnote to a footnote link.... | true |
1902598a3621545691be780c4bca8468f677e5d7 | JavaScript | liaof/challenge-10 | /lib/Employee.js | UTF-8 | 378 | 2.8125 | 3 | [] | no_license | function Employee(name,id,email){
this.name = name;
this.id = id;
this.email = email;
Employee.prototype.getInfo = function (){
return{
name: this.name,
id: this.id,
email: this.email
}
}
Employee.prototype.getRole = function (){
retu... | true |
f6abc3d1a4315539c4e82deb179f353290a28f16 | JavaScript | lingyanzhou/SomeGenerativeArt | /FractalTree-js/js/FractalTree.js | UTF-8 | 2,223 | 2.828125 | 3 | [] | no_license | function FractalTree(ele, debugEle) {
this.app = new PIXI.Application({
width: FractalTree.WIDTH,
height: FractalTree.HEIGHT,
autoStart: false,
view: document.querySelector(ele),
backgroundColor: '#000000'
});
this.pen = new PIXI.Graphics();
this.app.stage.addChild(this.pen);
this.pen.x =... | true |
6b4fc8513be3681c2a0df3e9859074ff406f82de | JavaScript | r-franke/brim | /src/js/lib/connHistoryView.js | UTF-8 | 1,514 | 3.25 | 3 | [
"BSD-3-Clause"
] | permissive | /* @flow */
/*
Records the state history of connections as a string of letters.
The meaning of those letters is:
Letter Meaning
s a SYN w/o the ACK bit set
h a SYN+ACK (“handshake”)
a a pure ACK
d packet with payload (“data”)
f packet with FIN bit set
r packet with RST bit set
c packet with a ba... | true |
d1a7c8b92fd7757bf5f70820b476b28952f4e6fc | JavaScript | rench/ipfs-shoutao | /index.js | UTF-8 | 1,011 | 2.515625 | 3 | [] | no_license | const ipfsAPI = require('ipfs-api')
const ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/5001')
function addFile(path) {
ipfs.util.addFromFs(
path,
{ recursive: true, ignore: ['subfolder/to/ignore/**'], hidden: false },
(err, result) => {
console.log(result)
})
}
function catFile(hash) {
ip... | true |
330c2a989d41beb037d4523e1b47cea576649acc | JavaScript | ronilbhatia/advent-of-code-2019 | /day-13/part-2/grid.js | UTF-8 | 1,991 | 3.140625 | 3 | [] | no_license | const readline = require('readline')
class Grid {
constructor() {
this.points = {}
this.state = 1;
this.ballDir = 1
this.print = false;
}
addPoint(coord, type) {
if (type === 3) this.paddle = coord;
if (type === 4) {
this.ballDir = this.ball ? (coord[0] > this.ball[0] ? 1 : -1) : 1... | true |
1a3ad3aaa21ae672d1c2dcbc7e8f4be6f5a6d230 | JavaScript | BrunnerLivio/package-json-to-template | /test/checkTemplate.js | UTF-8 | 1,278 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const packageJsonToTemplate = require('../src');
const assert = require('assert');
describe('Check packageJsonToTemplate', () => {
it('should inject the name of the package into the template', done => {
packageJsonToTemplate({
template: `{{ packageJson.name }}`,
packageJson: { name: 'Hello' }
})
... | true |
140a4e66f4c33e4c10b7159cb32a1a0e68307d34 | JavaScript | bruno-alencar/desafio-evnts | /app/infra/ProductDAO.js | UTF-8 | 1,199 | 2.53125 | 3 | [] | no_license |
var Product = require('../models/Product');
function ProductDAO(mongoose){
}
ProductDAO.prototype.list = function(callback){
Product.find(callback,function(err, data){
if(err){
console.log('Erro: ', err);
}
// console.log('Listou:', data);
});
}
ProductDAO.prototype.listByCategory = function(category, ca... | true |
800b0eb96ba993c51382f5fd0a18c8bd34ba1a64 | JavaScript | freebz/Functional-Javascript | /chA/exA-3.js | UTF-8 | 533 | 2.96875 | 3 | [] | no_license | // A.1.3 RxJS
var codes = [
38, // up
38, // up
40, // down
40, // down
37, // left
39, // right
37, // left
39, // right
66, // b
65 // a
];
function isKonamiCode(seq) {
return seq.sequenceEqual(codes);
}
var kePressStream = $(document).keyupAsObservable()
.selec... | true |
2c2d4afb56d5930a622e17e38ebfb552edd5dae7 | JavaScript | noamoss/mapapp | /scripts/speechrecognitions.js | UTF-8 | 1,193 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | const talkButton = document.getElementById('talk')
const speechIndicator = document.getElementById('speechIndication')
window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition
const recognition = new SpeechRecognition()
const story = document.querySelector('#storyField')
recognition.inter... | true |
021f65b08a44b42648ef5600cb0a23d5716fc854 | JavaScript | judgemnt/workoutLog | /controllers/workoutController.js | UTF-8 | 3,920 | 2.90625 | 3 | [] | no_license | const Workout = require("../models/workoutSchema");
const Program = require("../models/programSchema");
const Exercise = require("../models/exerciseSchema");
//function to sort
const sorter = (property, condition) => {
const key = condition ?
function (x) {
return condition(x[property... | true |
3660bf3e4cecba1fadf240ca0b43ac727f51a9bb | JavaScript | audinue/binding-js | /src/scope/key-observer.js | UTF-8 | 643 | 2.921875 | 3 | [] | no_license |
function KeyObserver (key, next) {
this.key = key
this.next = next
this.object = null
this.change = this.change.bind(this)
}
KeyObserver.prototype = {
change: function (e) {
if (e.key === this.key) {
this.next.observe(this.object[this.key])
}
},
observe: function (object) {
if (this.ob... | true |
85a34fa9bc7c2e6ae374d1195b0e611b9cdec7d8 | JavaScript | Fr0sk/LAIG | /TP2/MySceneGraph.js | UTF-8 | 46,371 | 2.703125 | 3 | [] | no_license | var degToRad = Math.PI / 180.0;
function MySceneGraph(filename, scene) {
this.loadedOk = null;
// Establish bidirectional references between scene and graph
this.scene = scene;
scene.graph = this;
// File reading
this.reader = new CGFXMLreader();
/*
* Read the contents... | true |
fe924dd1544b1cfdc8ec338d7673ff0dfb7378ed | JavaScript | Roragok/brewhive-deck | /index.js | UTF-8 | 1,668 | 2.875 | 3 | [] | no_license | const express = require('express')
const path = require('path')
const random = require('random')
const fs = require('fs')
const app = express()
const port = 7070
const images = 'public/json/images.json'
// load the image data.
let imageData = fs.readFileSync(images, (err, data) => {
if (err) throw err;
return dat... | true |
5fe2a494e4f9544e23e90fea5957f96376d60417 | JavaScript | jakobmpalmer/React-Udemy | /src/app.js | UTF-8 | 1,391 | 3.109375 | 3 | [] | no_license | console.log("App.js is running");
const headingObj = {
title : 'Indicision App',
subtitle : 'Automate the decision stuff.',
options: ['One', 'Two']
};
// JSX - JavaScript XML
const template = (
<div>
<h1>{headingObj.title}</h1>
{(headingObj.subtitle) && <p>{headingObj.subtitle}</p>}
... | true |
e0612893a432b4cf6fe33d69414c9e9a37b27d41 | JavaScript | Kandarp143/TUKaiserslauternLTD | /MoleculeDBFinal/moleculeDB/js/mollist.js | UTF-8 | 2,554 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Created by Kandarp on 4/24/2017.
*/
/*for saved data retrive*/
var data = null;
$(document).ready(function () {
/* apply datatable to table */
var table = $('#listmol').DataTable({
stateSave: true,
// "pagingType": "input"
// "pagingType": "scrolling"
});
/*add text inp... | true |
db6c2ad74a0687f15e34fd18fc0f5192cd3d0e48 | JavaScript | seenevz/fetch-intro-dog-ceo-challenge-london-web-121018 | /src/index.js | UTF-8 | 2,063 | 3.3125 | 3 | [] | no_license | console.log('%c HI', 'color: firebrick')
const imgUrl = "https://dog.ceo/api/breeds/image/random/4";
const breedUrl = 'https://dog.ceo/api/breeds/list/all'
const anchor = document.querySelector('#dog-breeds')
const dropDownAnchor = document.querySelector('#breed-dropdown')
const getDoggosPics = () => {
fetch... | true |
13b7c47a641ecb1bf994337b5284af466b8a59f3 | JavaScript | Rabson/Loopback-mysql | /common/models/user.js | UTF-8 | 1,571 | 2.515625 | 3 | [] | no_license | 'use strict';
module.exports = (User) => {
/**
* beforeRemote create
*
* @param {object} context request object.
* @next will create user.
*/
User.beforeRemote('create', (context, userInstance, next) => {
const email = context.args.data.email;
// validate emial... | true |
4c12af17d896ed6d1ca1c459c896bcef5b004683 | JavaScript | EfficiencyJunky/eec-for-squarespace | /guide/utilities/getCartItemsListFromScriptInDocument.js | UTF-8 | 2,039 | 3.53125 | 4 | [] | no_license | /**
* A Utility function that scrapes the documentObj to find a script containing the text "cart:"
* the script that contains this text is actually the Squarespace cart object that Squarespace generates and contains all of the information on the cart.
* the cart object contains a reference to the list of items in t... | true |
86a615fad72eb27206bae590413a6637847a87d4 | JavaScript | iLighting/local-server | /src/utils/appMsg.js | UTF-8 | 3,746 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* `src/libs/controller:sendAppMsg()`中调用应用模型的`build`方法
*/
/**
* 检查对象是否匹配keyList
*
* @param {Object} m
* @param {Array} keyList
* @return {Boolean}
*/
function objContain(m, keyList) {
let i;
let len = keyList.length;
for (i = 0; i < len; i++) {
if (!m.hasOwnProperty(keyList[i])) return false
}... | true |
199d39f9866ed51782671fb3c3f190cf12dad5c3 | JavaScript | fcfe/fcui2 | /dep/markdown/dialects/dialect_helpers.js | UTF-8 | 1,078 | 2.671875 | 3 | [
"MIT"
] | permissive | if (typeof define !== 'function') { var define = require('amdefine')(module) }
define([], function (w) {
var DialectHelpers = {};
DialectHelpers.inline_until_char = function( text, want ) {
var consumed = 0,
nodes = [];
while ( true ) {
if ( text.charAt( consumed ) === want ) {
// Fo... | true |
f902b241adffd98b932da80ff5f0b2ac07de1a81 | JavaScript | huy1992nd/faceboob_search | /utils/helper.js | UTF-8 | 3,610 | 2.765625 | 3 | [] | no_license | var model = require('../model');
const puppeteerException = model.PuppeteerException;
const puppeteerEmailRegister = model.PuppeteerEmailRegister;
function savePuppeteerException(data) {
var exception_data = new puppeteerException(data);
exception_data.save(function(err) {});
}
function splitZipcode(zipcode) ... | true |
276d6e3f6ab9c5848d8bf7f6d7aed971144752bf | JavaScript | IronOnet/codebases | /codebases/app.hubspot.com/usr/share/hubspot/build/hubspot/static-archive/usage-tracker-core/static-1.662/js/dictionary.js | UTF-8 | 3,822 | 2.765625 | 3 | [] | no_license | 'use es6';
import { between, isArray, mapObject, trim } from './common/helpers';
import * as schema from './common/schema';
import { eventError } from './common/messages';
import { eventPropertyTypes, eventDefinitionSchema, eventPropertySchema } from './schemas';
/*
* v1.5 of the bender-event-definition-loader packa... | true |
b6875a7eadc59744fe2d9faa8e5c0bcec355c2b2 | JavaScript | Newsee-Frontend/ns-ui | /src/packages/Table-v4/validate/validate-rule.js | UTF-8 | 2,082 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
* regular expression validation
* you can use this form-validation for this project,as an extension script.
* created: 2017/6/5.
* author: Broccoli spring( 高仓雄 - gcx )
* copyright (c) 2017 Broccoli spring( gcx )
*/
// import { judgeType } from '../../../utils/index';
/**
* judge type accurate
* @param valu... | true |
f531563afd42e927f48bb35de0b4c7757c173d3e | JavaScript | Guy-deMessimy/d22-context-api | /my-context-api/src/components/UserProfile.jsx | UTF-8 | 583 | 2.6875 | 3 | [] | no_license | import React, { useContext } from "react";
import UserContext from "../contexts/UserContext";
const UserProfile = () => {
// access the context information with useContext hook
const { status, toggleStatus } = useContext(UserContext);
return (
<>
{/* if status value is true, show "online", otherwise "... | true |
db53a573551203e61c0bee942ce66f33ad54cd7d | JavaScript | kigipaul/kigipaul.github.io | /dnf/js/datacode.js | UTF-8 | 7,969 | 2.578125 | 3 | [] | no_license | class DataCode {
constructor(targetElem){
this._skill_base_list = [90,85,80,75,70,60,50,48,45,40,35,30,25,20,15,10,5,1];
this._en_base = [];
this._data_code_length = 0;
this._debug = false;
var _targets = [];
var _version = 0;
for(var i=0; i<10; i++){
... | true |
3384a114288fe94ee9c69e494f3999d8b7253940 | JavaScript | silvi15/socialwork | /app/routes/api.js | UTF-8 | 2,023 | 2.546875 | 3 | [] | no_license | var User = require('../models/users');
var jwt = require('jsonwebtoken');
var secret = "harrypotter";
module.exports = function (router) {
//localhost:3000/api/users
//user Registration
router.post('/users', function(req, res){
var user = new User();
user.username = req.body.username;
user.password = req.body... | true |
f78a7dbbee4d8188060f4a07868e8cce2d64c1e4 | JavaScript | operrobin/oper-workshop-otp | /services/fake-otp.js | UTF-8 | 714 | 2.59375 | 3 | [] | no_license | const axios = require('axios');
/**
* fake-otp.js
* This file used for triggering fake-otp on local environment.
* Currently the service is set to Telegram.
* For more information, please refer to this link.
*
* @link https://core.telegram.org/bots/api
*/
const send_otp = async (phone, generated_otp) => {
t... | true |
812e96d178a87dfc38cb89aea0458baf981670bf | JavaScript | shlomijs/cloudinary-home-assignment | /js/components/search-message.js | UTF-8 | 1,798 | 2.71875 | 3 | [] | no_license | class SearchMessage extends HTMLElement {
constructor() {
super();
this.shadow = this.createShadowRoot();
this.timer = null;
this.registerCustomEvent();
this.classNameByMessageType = {
error: 'error',
success: 'success',
info: 'info',
warning: 'warning'
};
}
reset(... | true |
2c8a5bbee5132a136fdf9965f7a411eb4a7ce1df | JavaScript | bitflower/angular-inputmodeller-directive | /src/net.bitflower.angular.inputModeller.js | UTF-8 | 5,020 | 2.75 | 3 | [] | no_license | // Copyright (c) 2014 All Right Reserved, http://bitflower.net/
//
// </copyright>
// <author>Matthias Max</author>
// <email>touch@bitflower.net</email>
// <date>2014-09-01</date>
// <version>0.0.2</version>
(function() {
"use strict";
var moduleName = 'net.bitflower.angular.input';
angular.module(modu... | true |
847f5696700ea2134c5e874943d810cd514d71cd | JavaScript | kisaraF/BnWPhotolio.github.io | /main.js | UTF-8 | 1,292 | 2.734375 | 3 | [] | no_license | let body = document.getElementById('body');
let btn = document.getElementById('nightMode');
let footer = document.getElementById('footer');
let head = document.getElementById('head');
let pay = document.getElementById('pay');
let priceText01 = document.querySelectorAll('.title')[0];
let priceText02 = document.querySele... | true |
9b47278f5d4aa43f485e099cce6e079507c5e475 | JavaScript | hyunseo0419/daum-post-code-example | /src/App.js | UTF-8 | 1,295 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import DaumPostcode from "react-daum-postcode";
export default class App extends Component {
state = {
showPostcode: false,
address: ""
};
handleAddress = data => {
let fullAddress = data.address;
let extraAddress = "";
if (data.addressType === "R")... | true |
09d56cea27b358470ff6d49185c65ee8692073f1 | JavaScript | rakshithbellamane/toyproblems | /17-Hard/13-ReSpace/reSpaceSol2.js | UTF-8 | 1,918 | 3.609375 | 4 | [] | no_license | const findBestSplit = (dictionary, sentence) => {
let memo = [];
let result = split(dictionary, sentence, 0, memo);
return result === null ? null : result;
}
// recursive function to split the sentence with least num of invalid chars
const split = (dictionary, sentence, start, memo) => {
// base case: we have... | true |
8a86b0077822dc51586fb2da02147f566eab6383 | JavaScript | tonyharish/Javascript | /JavasScript/Variables/boolean.js | UTF-8 | 1,056 | 3.328125 | 3 | [] | no_license | // var max_amount = 4000; // Fixed by programmer
// var user = 4000; // User Input
// if (user > max_amount) {
// document.writeln("Unable to dispense cash");
// } else if(user==max_amount) {
// document.writeln("fail");
// } else {
// document.writeln("continue");
// var max_amount=5000;
// va... | true |
896da5ae92ad6e15eda99b30822862797bc86ecf | JavaScript | josefinemsson/iproglab2.1 | /js/view/menuOverView.js | UTF-8 | 1,452 | 2.875 | 3 | [] | no_license | var MenuOverView = function (container,model) {
var sub = container.find("#sub");
var food= container.find("#foodOverview")
var print = '';
print += '<br /><h2>My Dinner: '+model.getNumberOfGuests()+' people</h2><span id=back-button><input class="btn btn-lg" type="submit" value="Go back and edit dinner"></span... | true |
388fede8aba22549a0792d6eb6430f31eb781730 | JavaScript | Xivid2/Javascript | /JS Core/JS Applications/2. Asynchronous Programming/02. FISHER-GAME/app.js | UTF-8 | 3,279 | 3 | 3 | [] | no_license | function attachEvents() {
let mainUrl = 'https://fisher-game.firebaseio.com/catches.json';
const elements = {
btnLoad: document.querySelector('button.load'),
btnUpdate: document.querySelector('button.create'),
btnAdd: document.querySelector('button.add'),
btnDelete: document.que... | true |
f088e12895c1bc91d13f45b01a566390f7cd72d6 | JavaScript | whitecube/swipy | /src/swipy.js | UTF-8 | 2,598 | 2.953125 | 3 | [
"MIT"
] | permissive | export default class Swipy {
constructor(element) {
this.root = element;
this.events = this.getDefaultEvents();
this.touch = this.getDefaultTouches();
this.bind();
}
// API
on(listener, callback) {
if(this.events[listener] === undefined) {
cons... | true |
f52c7a42e1b106cae218783eccf94909466781fd | JavaScript | bferte/node-api-mydigitalschool | /middlewares/auth.js | UTF-8 | 900 | 2.53125 | 3 | [] | no_license | const jwt = require ('jsonwebtoken')
const withAuth = (req, res, next) => {
if (req.headers.authorization) {
// req.headers.authorization = bearer <token>
const token = req.headers.authorization.split(' ')[1]
if (!token) {
res.status(401).send('Unauthorized: No token provided')
... | true |
15ee523ca5c85a33c2354e6ca0a0e9144ecfdee5 | JavaScript | Vsmergulhao/angular | /Type Script - Aula 2/dist/app.js | UTF-8 | 721 | 3.28125 | 3 | [] | no_license | var message;
var episode = 4;
console.log("This is epsode:" + 4);
episode = episode + 1;
console.log("Next episode is " + episode);
var favoriteDroid; //váriavel fica do tipo any
favoriteDroid = 'BB-8'; //inicialmente a variável é uma string
console.log("My favorite Droid " + favoriteDroid);
favoriteDroid = 10; //depoi... | true |
c91017f94c92895f2e149ede4c7e10db9f503cd7 | JavaScript | webInRoad/es6-basicSyntax | /src/kaike/数组函数.js | UTF-8 | 2,365 | 4.09375 | 4 | [] | no_license | /*
数组:
map 映射 一个对一个
reduce 汇总 一堆出来一个
filter 过滤器
forEach 循环(迭代)
*/
/*
map:
[12, 58, 99, 86, 45, 91] ==>[不及格, 不及格, 及格, 及格, 不及格, 及格]
[45, 57, 135, 28] ==>
[
{name: 'blue', level: 0, role: 0},
{name: 'zhangsan', level: 99, role: 3},
{name: 'aaa', level: 0, role: 0},
{name: 'blue', level: 0, r... | true |
e6fb5cffa7e12444cb5fb7a4de732fc6c4232e2b | JavaScript | fsjohnhuang/iPromise | /test/iPromiseSpec.js | UTF-8 | 23,732 | 2.96875 | 3 | [
"MIT"
] | permissive | describe('iPromise', function(){
var expect
before('initialize chai', function(){
expect = chai.expect
})
describe('#<instance>.resolve', function() {
describe('argument pattern test', function() {
var arg, expval
it('expect resolve(1) to be 1', function(done){
arg = expval = 1
var promise = iP... | true |
b4cdb2c1c243e2cbfe76f2ad695e72638f00582d | JavaScript | DubbleA/SynchRewrote | /scripts/addy/prefx.js | UTF-8 | 867 | 3.125 | 3 | [] | no_license | const prompt = require('prompt');
const randomstring = require('randomstring');
var prefx = [];
prompt.start();
// Get two properties
console.log('Input your line one address and how many prefix jigged addresses you want to generate');
prompt.get(['addyl1', 'number'], (err, result) => {
if (err) return console.log... | true |
9a4933d56497384241dae4adb83a63d4b52e6a46 | JavaScript | avelasco13/CalculadoraEdu | /Calculadora/js/calculadora.js | UTF-8 | 2,067 | 3.59375 | 4 | [] | no_license |
var numeroIn = null;
var num1 = "";
var num1Int = 0;
var num2 = "";
var num2Int = 0;
var operador = "";
var resultat = 0;
function escriure (n)
{
// if(n == "=")
// {
// llegirText(numeroIn);
// }
if (numeroIn != null)
{
//numeroIn=numeroIn+n;
if(n == "="){
llegirText(numeroIn);
}else{
... | true |
3cae0b7a3bee06f356f52666e78bf0ea79a14283 | JavaScript | young8179/algorithm-javascript | /exercise2/12-sliceSplice.js | UTF-8 | 521 | 4.4375 | 4 | [] | no_license | // Basic Algorithm Scripting: Slice and Splice
// You are given two arrays and an index.
// Copy each element of the first array into the second array, in order.
// Begin inserting elements at index n of the second array.
// Return the resulting array. The input arrays should remain the same after the function runs.... | true |
7cf10cb89056e14630aa5e1303f10bf4ddaf35f9 | JavaScript | baole229801/javascript-begin | /lesson1/mikey.js | UTF-8 | 130 | 2.65625 | 3 | [] | no_license | function Mouse(name) {
this.name = name ;
this.type = 'black' ;
};
var mickey = new Mouse('mickey');
console.log(mickey); | true |
64b19da6535c2f22bc9ead11adfc8a29664927d9 | JavaScript | swapnilvathare/multiplayer-tic-tac-toe | /js/custom.js | UTF-8 | 4,600 | 2.75 | 3 | [
"MIT"
] | permissive | "use strict";
// $(document).ready(function(){
(function() {
//console.log('hi1');
var username=getCookie("username");
if (username!="") {
//console.log('hi2');
//alert("Welcome again " + username);
startGame();
}else{
//console.log(username);
window.location.as... | true |
692358300978c88564d7022ca3d1f2bb9d6bfad1 | JavaScript | valeguti2001/fechaActual | /fechaActual.js | UTF-8 | 5,369 | 3.03125 | 3 | [] | no_license |
function setup() {
createCanvas(800, 400);
angleMode(DEGREES);
}
function draw() {
let elipseCntrR = 0;
let elipseCntrG = 0;
let elipseCntrB = 0;
let elipseDerR = 0;
let elipseDerG = 0;
let elipseDerB = 0;
let elipseIzqR = 0;
let elipseIzqG = 0;
let elipseIzqB = 0;
let m... | true |
b80774e2ea2caf489d27f7cc1ebc4bb9b08e1250 | JavaScript | Zeeerooo/BolsaTrabajo | /normal_user/static/js/printdiv.js | UTF-8 | 308 | 2.78125 | 3 | [
"MIT"
] | permissive | function printdiv(val)
{
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = $('#'+val)[0].innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
| true |
d580c67c632d1f355430752a45b289ed65d2675c | JavaScript | misterwolf/blocks_and_snake | /spec/javascripts/units/blocks_and_snake/table_spec.js | UTF-8 | 5,175 | 2.984375 | 3 | [] | no_license | /* global describe, it, expect, spyOn, beforeEach */
(function(blocks_and_snake) {
'use strict';
var Table = blocks_and_snake.Table;
blocks_and_snake.TableSlice = function(opts){
opts = opts || {};
this.empty = opts.empty || false;
this.hardLevel = opts.hardLevel || 0;
this.positionY... | true |
28a2717d475ffd7dfd1d6c142014093431f1060e | JavaScript | CAUCA-9-1-1/javascript-api | /js/uncompressed/client/connection-ip.js | UTF-8 | 7,786 | 2.5625 | 3 | [] | no_license | /** Singleton for helping when we process the ip address
*
* @constructor
* @memberOf cause.objects
*/
cause.objects.connectionIp = function () {
this.name = 'connectionIp';
this.info = {};
this.total = 0;
this.return = 0;
this.callback = null;
this.localIPs = [];
this.localCallback = null;
};
/** Find the ... | true |
1fab5ef929eacbb5cd119821f4a56106c05cf401 | JavaScript | nikshalavelayutham/Problems | /Building blocks/countWords.js | UTF-8 | 638 | 4.75 | 5 | [] | no_license | // countWords.js
/*
Write a function called “countWords”.
Given a string, “countWords” returns an object where each key is a word in the given string, with its value being how many times that word appeared in the given string.
Notes:
* If given an empty string, it should return an empty object.
var output = countW... | true |
86dce4b71dd3fd5a5bfa4d8f97b100906357898c | JavaScript | redneck-f25/StateMachine.js | /test/run-parallel.js | UTF-8 | 3,190 | 2.78125 | 3 | [
"MIT"
] | permissive | "use strict";
var runParallelMachines = ( function() {
var getRandomDelay = ()=>( Math.ceil( Math.random() * 2000 + 200 ) );
var parallelOuterMachine = new StateMachine(
( next, context, machines )=>{
next.context = context;
context.runningMachines = 0;
con... | true |
777f51dca2e65d8fa0cb47cc922cec03ed30ce6e | JavaScript | zapakh/whitelipstick | /White Lipstick.user.js | UTF-8 | 5,619 | 2.890625 | 3 | [] | no_license | // ==UserScript==
// @name White Lipstick
// @namespace https://twitch.tv/zapakh
// @version 0.2
// @description Add single-character spans to Whitelips for fine-grained highlighting
// @author Zapakh
// @match https://vii5ard.github.io/whitespace/
// @grant unsafeWindow
// ==/UserS... | true |
c6c3bdfe131cc79752a1999de128aee9bf396a17 | JavaScript | EncoreTaK/JS_BASIC | /4th/03_break.js | UTF-8 | 550 | 4.9375 | 5 | [] | no_license | //练习:声明一个变量存储数字;循环弹出提示框 ,输入数字,如果输入的数字大于存储的数字,警示框提示猜大了,如果输入的数字小于存储的数字,警示框提示猜小了,否则提示猜对了,结束循环
var num=8;
while(true){
var str=prompt('请你猜一个数字,输入你猜的数字');
str=parseInt(str);
if(str>num){
alert('猜大了');
}else if(str<num){
alert('猜小了');
}else if(str==num){
alert('猜对了');
break;
}else {
alert('错误输入,请重输')}
} | true |
f58e50eed13113d0fdcae2b2ff7d1746651e31dc | JavaScript | CodeNext-CSSI-OAK/codenext-cssi-2018-4frapra | /loops-practice.js | UTF-8 | 2,935 | 3.5 | 4 | [] | no_license | let readline = require("readline-sync");
// let correctPassword = "prado";
// let input = "";
// let attempts = 2;
//
// while (input !== correctPassword && attempts >= 0) {
// input = readline.question("Please enter the correct password: ");
// attempts--;
// }
//
// if (input === correctPassword) {
// console.l... | true |
decf02d3dcf7dd97d7eb662a23a42ed6858cc1fc | JavaScript | keebon/todo | /src/components/Todo.js | UTF-8 | 1,115 | 2.578125 | 3 | [] | no_license | import React from 'react';
import TodoForm from './TodoForm';
import TodoList from './TodoList';
export default class Todo extends React.Component{
state = {
todos : []
}
addTodo = (todo) => {
this.setState({
todos : [todo, ...this.state.todos]
});
}
handleDele... | true |
4dc785bf7ef23a53dfd93f2d809f6a868e3374df | JavaScript | jhfinamore/PersonalWebsite | /final/formvalidator.js | UTF-8 | 2,381 | 2.890625 | 3 | [] | no_license | function validate()
{
var errorno = 0;
var errormsg = "";
if (document.getElementById('firstname').value == "" || document.getElementById('firstname').value == null)
{
errormsg = errormsg + "First name is required! \n";
errorno = 1;
/*window.alert(errormsg);
alert("Firs... | true |
ffe6ad1927e8310291951e4b47f2b6d94cda3fee | JavaScript | IshaTr/channel-manager | /src/store/reducer.js | UTF-8 | 5,753 | 2.65625 | 3 | [] | no_license | import sampleChannels from '../utils/channels'
import {transformData} from '../utils/helper'
import * as types from './types'
export const currentChannels = transformData(sampleChannels.channels)
const defaultState = {
currentChannels: currentChannels || {},
favoriteChannels: [],
activeIndexChannel: 1,
active... | true |
eeecbacdfcd50257b91c6b33d3013ee977adf840 | JavaScript | hoangddt/JS-note | /varAsProperty.js | UTF-8 | 839 | 3.953125 | 4 | [] | no_license | /*==============================================
= Variable as Properties =
==============================================*/
/**
* $ 3.10.2
* When you declare a global JavaScript variable, what you are actually doing is defining
* a property of the global object (§3.5). If you use var to declare... | true |
89af3d4f0ff38777e0fda819f1affe99a3176f63 | JavaScript | RyanLinrm/CSC473Project | /src/PhaserGame/gameObjects/Melee.js | UTF-8 | 2,919 | 3.09375 | 3 | [] | no_license | import {Player} from "./Player";
import { sword } from "./Projectiles";
/**
* Melee Class. One character type of the player.
* Holds the same properties as a regular player but have
* the ability to use sword bullet.
*/
export class Melee extends Player{
/**
*
* sets up the bomber object. calls cre... | true |
7926fa2e655687fdb8083b0e2213898a95cae307 | JavaScript | pavinane/react-basic | /src/Hooks/Hookselectoption.jsx | UTF-8 | 4,800 | 2.609375 | 3 | [] | no_license | import React, { useState } from "react";
class SelectOption extends React.Component {
state = {
selected: ""
};
onchange = e => {
console.log(e.target.value);
this.setState({ selected: e.target.value });
};
render() {
const { selected } = this.state;
return (
<div className="revie... | true |
aa339cf8217bb61c8b8c47517481db2fa781990e | JavaScript | angiecarojas/REST-Countries-API | /src/CountryDetails.js | UTF-8 | 4,329 | 2.640625 | 3 | [] | no_license | import React from "react";
import { Link } from "@reach/router";
class Languages extends React.Component {
render() {
const { name } = this.props;
var languages = [];
name.map((language) => languages.push(language.name));
return (
<p>
<span className="font-bold">Languages: </span>
... | true |
bfb232dc6e381ed9ead9caf36f1363a8387de713 | JavaScript | kn9/LittList | /bibliographies/bibliographyGenerator.js | UTF-8 | 1,066 | 2.703125 | 3 | [] | no_license | var Citeproc = require('citeproc');
var CSL = require('../models/csl.js');
var config = require('../config.js');
// Convert the references from the list to CiteJSON
// format so that citeproc can intrepret it
function BibliographyGenerator (list, done) {
// Convert the list to a CSL compatible form... | true |
fec334a865559a3714663e6324468b476d70bf5c | JavaScript | github/codeql | /javascript/ql/test/library-tests/frameworks/SQL/postgres1.js | UTF-8 | 1,691 | 2.796875 | 3 | [
"MIT"
] | permissive | // Adapted from the documentation of https://github.com/brianc/node-postgres,
// which is licensed under the MIT license; see file node-postgres-LICENSE.
const pg = require('pg');
// create a config to configure both pooling behavior
// and client options
// note: all config is optional and the environment variable... | true |
a35f0bf4be2bc170601b8971dd3219605eef81fa | JavaScript | alimacloughlin/programadorWeb-2935 | /Clase 05/Alumno/Desafío/index.js | UTF-8 | 1,128 | 3.515625 | 4 | [] | no_license | console.log('init app')
var students = [
{
firstName: 'Juan',
lastName: 'Pérez',
dni: 45678987,
email: 'juan@gmail.com'
},
{
firstName: 'Ana',
lastName: 'Fernandez',
dni: 45678989,
email: 'ana@gmail.com'
},
{
firstName: 'Pedro',
lastName: 'Mármol',
dni: 45678956,
... | true |
59559e7b7b6c2119dd5079857465eeec597bb48e | JavaScript | nelsontobon/proyecto_deliah | /Project/controllers/order/createOrder.js | UTF-8 | 1,855 | 2.546875 | 3 | [] | no_license | /**
* Controlador para generar una nueva orden
*/
const response = require('../../config/response.js')
const {
insertOrder,
selLastOrder,
insertOrderPlate
} = require('../../model/db_orders')
const createOrder = (req, res) => {
const {id_user, order, payment, address} = req.body
insertOrder([id... | true |
f2aa92f815f2d5ea2fb5e192c2db62d40c4a1bcb | JavaScript | MiguelB23/curso-js | /12-ArrayMethods/js/01-app.js | UTF-8 | 985 | 3.484375 | 3 | [] | no_license | const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
const carrito = [
{ nombre: 'Monitor 27 pulgadas', precio: 2000},
{ nombre: 'Lavarropas con secado', precio: 40000},
{ nombre: 'Anafe calientes-aguas', precio: 230},
{ nombre: 'Televisión lindavisión', precio: 1500},
{... | true |
88a7df235ae8b7fde75d0b99e7b5a593e823a271 | JavaScript | kdelgadop/react-task-tracker | /src/App.js | UTF-8 | 2,616 | 2.828125 | 3 | [] | no_license | import React from "react";
import Header from "./components/Header"
import Tasks from "./components/Tasks";
import { useState, useEffect } from 'react'
import AddTask from "./components/AddTask";
function App() {
const [showAddTask, setShowAddTask] = useState(false)
const [tasks, setTasks] = useState([])
const ... | true |
a3d8dffca6cfc7fe69558d78f9dad769895ad30c | JavaScript | curran/model-contrib | /modules/dummyVis.js | UTF-8 | 4,057 | 2.71875 | 3 | [
"MIT"
] | permissive | // This module implements a dummy visualization
// demonstrating the API structure for authoring visualizations
// that work with the `overseer` framework and nested box layout.
//
// Curran Kelleher September 2014
define(["d3", "model", "lodash"], function (d3, Model, _) {
return function DummyVis(overseer) {
... | true |
388dc927ec1aa6b6d233ba1b9da135c53ec54d93 | JavaScript | Haack79/learn_javascript | /the_this.js | UTF-8 | 1,856 | 4.625 | 5 | [] | no_license | // this is this in this - LAST STEP OF CREATION PHASE
// creation phase, and execution phase
// object variable creation as scope chain creation
// this is variable that every execution context gets.
// it is stored in the execution context object.
// in a regular function call it (this) points at the global objec... | true |
14167270004ccbb705962022da93ee3f5eee1ccd | JavaScript | anan235/tabs-backend | /src/routes/users.js | UTF-8 | 3,495 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const users = require('express').Router();
// MODELS
const User = require('../models/User');
const Friendship = require('../models/Friendship');
// Custom Middleware
function requiresLogin(req, res, next) {
if (req.session && req.session.userId) return next();
const err = new Error('User must be logged in.');
e... | true |
b82a4c37daccb18d9cd1c5c5a0730037dedf8897 | JavaScript | anteriovieira/vue-enterprise-boilerplate | /src/utils/format-date-relative.js | UTF-8 | 447 | 3.046875 | 3 | [] | no_license | // https://date-fns.org/docs/parse
import parseDate from 'date-fns/parse'
// https://date-fns.org/docs/distanceInWords
import distanceInWords from 'date-fns/distance_in_words'
// https://date-fns.org/docs/isToday
import isToday from 'date-fns/is_today'
export default (fromDate, toDate = new Date()) => {
fromDate = p... | true |
204dba4e8e95c662c420317af5975cafaeaba66b | JavaScript | Javran/leetcode | /factorial-trailing-zeroes/solution.js | UTF-8 | 1,003 | 3.734375 | 4 | [
"MIT"
] | permissive | /**
* @param {number} n
* @return {number}
*/
const trailingZeroes = n => {
/*
idea: counting trailing zeros is actually just figuring out
how many 10s can we find from factors of n.
we do this by count how many 5s are there - this is because the only
way to create a 10 is by 2*5, and since we ... | true |
b7f21b3ab0f93094bc8f088e132701ab5d280395 | JavaScript | Tamothy/groceries | /js/scripts.js | UTF-8 | 624 | 2.75 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$("#blanks form").submit(function(event) {
var blanks = [$("input#item_one").val(), $("input#item_two").val(), $("input#item_three").val(), $("input#item_four").val(), $("input#item_five").val()];
var alpha = blanks.sort();
var a_u = alpha.map(function(a){
return a.toUpperC... | true |
9bb83dece144f32c8809271b07edcd1ee7064ea3 | JavaScript | beibei6703/mobile-project | /yearend/src/util/getcookie.js | UTF-8 | 271 | 2.890625 | 3 | [] | no_license | //获取cookie
export const getCookie = name=> {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
arr = document.cookie.match(reg)
if(arr){
//console.log('cookie:',arr[2])
return(arr[2]);
}else{
return null;
}
}
| true |
1170ecc553d8c4baa3cd4cd6ba31ca132c6ce6b9 | JavaScript | jaymovaliya/website | /myscript.js | UTF-8 | 2,010 | 2.921875 | 3 | [] | no_license | function signupValidate(){
var user = document.forms["signup_form"]["username"].value;
var email = document.forms["signup_form"]["email"].value;
var passwd = document.forms["signup_form"]["password"].value;
if(user==null || user=="")
{
window.alert("Please enter username");
document.signup_form.username.focus(... | true |
b23cfb7825d362ee6246149681b099033cb5ca07 | JavaScript | honger05/effects-jsdom | /src/utils/core/_core.js | UTF-8 | 4,664 | 3.390625 | 3 | [] | no_license |
// 核心方法
/**
* 在数组中查找项
*
* @param {Array} arr 数组
* @param {基本数据类型} item [description]
* @return {[type]} [description]
*/
export function inArray (arr, item) {
if (arr.indexOf) {
return arr.indexOf(item)
}
for (let i = 0, l = arr.length; i < l; i) {
if (arr[i] === item) {
return i
... | true |
a585569c62fc22694375e867aab80456dd629f2d | JavaScript | noelleleigh/emoji-picker | /contentScripts/contentScript.js | UTF-8 | 466 | 2.65625 | 3 | [
"MIT"
] | permissive | const inputTypes = [];
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.emoji) {
const emoji = request.emoji;
const activeElement = document.activeElement;
if (
activeElement.tagName === "INPUT" &&
["text", "search"].includes(activeElement.type)
) {
... | true |
e3e2b4131862faa35b30b5670bd8e3d04c95edbf | JavaScript | kanatohodets/wallethawk | /lib/LineItem.js | UTF-8 | 3,712 | 2.8125 | 3 | [] | no_license | /**
* File: lib/LineItem.js
* Synopsis: CRUD for Line Items.
*
*/
"use strict";
var db = require("./DatabaseConnection");
var Util = require('./Util.js');
/**
* Short-hand for the line item select block.
*
* @return string - a chunk of sql
*/
var getSQL = function () {
var sql = "" +
"SELECT "+
"l... | true |
2b969de53c14995722020ca434327279ee894b77 | JavaScript | hexfusion/chartjs-plugin-datasource-prometheus | /src/datasource.js | UTF-8 | 1,442 | 2.859375 | 3 | [
"MIT"
] | permissive | // Min step is 1s
const PROMETHEUS_QUERY_RANGE_MIN_STEP = 1;
export default {
/**
* Compute a step for range_query (interval between 2 points in second)
* Min step: 1s
* Default: 1 step every 25px
* @param {Date} start
* @param {Date} end
* @param {number} chartWidth: width in pixel... | true |
f6ea44ce9222068c514e626d0260e8ba84e96252 | JavaScript | AndyLuuuuu/React-Chat-App | /socket-client/src/Redux/reducers/userReducer.js | UTF-8 | 793 | 2.84375 | 3 | [] | no_license | const userDefaultState = {
username: null,
room: null
};
export const userReducer = (
state = userDefaultState,
{ type, username, room }
) => {
switch (type) {
case "SET_USERNAME":
if (username === "" || null || undefined) {
return state.username;
} else {
return {
.... | true |
428475289161b167152634c71a02f7cdeeb95f37 | JavaScript | bl1nkker/finn-app-frontend | /src/redux/reducers/authReducer.js | UTF-8 | 831 | 2.671875 | 3 | [] | no_license | import { LOGIN_USER, LOGIN_USER_ERROR } from "../types";
const initState = {
user:{},
token:'',
error:null
}
const authReducer = (state=initState, action) =>{
switch (action.type) {
case LOGIN_USER:
localStorage.setItem("token", action.payload.token);
localStorage.setIt... | true |
0f4a12d3303262ecdab8b21fd4dbea9aeaa957ea | JavaScript | Khulankana/QuizRoom | /src/reducers/quizReducer.js | UTF-8 | 1,140 | 2.578125 | 3 | [] | no_license | import { v4 as uuidv4 } from "uuid";
export const quizReducer = (state, action) => {
switch (action.type) {
case "ADD_QUIZ":
return [
...state,
{
question: action.quiz.question,
answer_1: action.quiz.answer_1,
answer_2: action.quiz.answer_2,
answer_3:... | true |
a57b0f2fc59c2a124d9d880fce58eb72789ea4e4 | JavaScript | nickburrows/yt-PiP | /src/hooks/arrayParams.js | UTF-8 | 320 | 2.96875 | 3 | [
"0BSD"
] | permissive | // Convert `URLSearchParams` `[]` properties to array objects.
export const arrayParams = props => {
const params = {}
for (const key of props.keys()) {
if (key.endsWith("[]")) {
params[key.replace("[]", "")] = props.getAll(key)
} else {
params[key] = props.get(key)
}
}
return params
}
| true |
587e5021b5b797a535960dbe5d412d78a8d002a3 | JavaScript | sagarbhp/React-Native-Home-Challenge | /pages/Register.js | UTF-8 | 5,750 | 2.5625 | 3 | [] | no_license | import React, {useState} from 'react'
import {
Text,
TextInput,
View,
TouchableOpacity,
KeyboardAvoidingView,
TouchableWithoutFeedback,
Keyboard,
Platform ,
} from "react-native"
import AsyncStorage from '@react-native-community/async-storage'
import {globalStyles} from "../styles/g... | true |
7d9da8903be0b1907b95928a33fd532ddc143f5f | JavaScript | RavenVl/paternJS | /O3_Stratege.js | UTF-8 | 1,473 | 3.171875 | 3 | [] | no_license | let module = (function () {
let stratege = {
metod : function () {
}
};
let goods = [
{name:'Car', price:1999, rate:2},
{name:'Book', price:100, rate:3},
{name:'Plate', price:20, rate:1},
];
function printGoods () {
let ul = document.querySelector('#rez')... | true |
678fc3fb03549abe0366f3c6ba0c9534cb4a80ed | JavaScript | fnehmer/screeps | /role.mechanic.js | UTF-8 | 2,408 | 2.78125 | 3 | [] | no_license | var roleMechanic = {
/** @param {Creep} creep **/
run: function(creep) {
if(creep.memory.repairing && creep.store[RESOURCE_ENERGY] == 0)
{
creep.memory.repairing = false;
creep.say('🔄 harvest');
}
if(!creep.memory.repairing && creep.store.getFreeCapacity() == 0) {
creep.m... | true |
0387939a48afaa35c1c665d931bd9b22dc6742d7 | JavaScript | smathew/NorthernStar | /public/javascripts/ccpcc.js | WINDOWS-1252 | 1,020 | 2.90625 | 3 | [] | no_license | // **************************************************************
// Copyright Share One
// **************************************************************
var V = A;
var D = 0;
var I = 0;
var R = 0;
var S = 0;
var T = 0;
var U = 0;
var J = 0;
var W = 0;
var INT = 0;
// Check for first payment; if greater
... | true |
5549fa973ccbfb7d33a629dfe8f3ae21485c38fc | JavaScript | ray-mash/supportDash | /test/pages/helpers.js | UTF-8 | 1,450 | 3 | 3 | [
"MIT"
] | permissive | var helpers = function () {
var scrollFn = function (location) {
browser.executeScript('window.scrollTo(' + location.x + ', ' + location.y + ');');
};
// The following wait removes test flakyness when we try to click an element that is not displayed yet
this.wait = function (element) {
... | true |
7e79a0fb7b3cd9b8bb2d1b88582d804f7ad76b75 | JavaScript | neojski/random | /es-harmony/iterator.js | UTF-8 | 450 | 3.453125 | 3 | [
"MIT"
] | permissive | function Range (from, to) {
this.from = from;
this.to = to;
}
function RangeIterator (r) {
this.range = r;
this.current = r.from;
}
RangeIterator.prototype.next = function () {
if (this.current > this.range.to) {
throw StopIteration;
} else {
return this.current++;
}
}
Range.prototype.__iterator_... | true |
c136d2c06886944a4f274241390c9805dd894627 | JavaScript | fullstack99/react-fitness | /src/utils/validation/validators/longerThan.js | UTF-8 | 382 | 3.328125 | 3 | [
"MIT"
] | permissive | /**
* string - validator that checks that value is longer than N
*
* @param {String} n value
* @return {Function} error
*/
export default function (n) {
return function (value) {
const errorMessage = `Should be longer than ${n} characters`
if (value === undefined || value === null) return null
if ... | true |
76f7a866308f8b3bed8c3efbb5af19733a19eba1 | JavaScript | Samuel-Black/321-Project | /src/pages/games/Throw-Eyes.js | UTF-8 | 4,906 | 2.828125 | 3 | [] | no_license | /*
Author: Samuel Black
https://github.com/Samuel-Black
*/
import React, { useState, useEffect } from 'react';
import Character from '../../components/throweyes/Character';
import TargetTemplate from '../../components/throweyes/Target-Template';
import { returnRandomThrowEyesChar } from '../../components/images/Image-... | true |
9b8deeeef33d2e525d36ee6ca7969e4ba28900a2 | JavaScript | FacuVidiella/Videogames-Web-App | /client/src/actions/index.js | UTF-8 | 3,190 | 2.625 | 3 | [] | no_license | import axios from 'axios'
export const ADD_VIDEOGAME = 'AddVideogame';
export const GET_VIDEOGAMES = 'GetVideogames';
export const GET_DETAILS = 'GetDetails';
export const GET_GENRES = 'GetGenres';
export const GET_BY_NAME = 'GetByName';
export const FILTER_BY_RATING = 'GetByRating';
export function addGames(payload){... | true |
ac93cbfec5aae85b15c04894259829bbe198644f | JavaScript | NonameMedia/firescript | /src/js-elements/MethodDefinition.js | UTF-8 | 1,231 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | const JSElement = require('./JSElement')
/**
* MethodDefinition
*
* @class MethodDefinition
* @extends JSElement
*
* interface MethodDefinition {
* type: 'MethodDefinition';
* key: Expression | null;
* computed: boolean;
* value: FunctionExpression | null;
* kind: 'method' | 'constructor';
* st... | true |
574777c28dbe8e37b33112b64bb843cde7559a4b | JavaScript | yangnianbing/leetcode | /44.wildcard-matching.js | UTF-8 | 2,553 | 3.421875 | 3 | [] | no_license | /*
* @lc app=leetcode id=44 lang=javascript
*
* [44] Wildcard Matching
*
* https://leetcode.com/problems/wildcard-matching/description/
*
* algorithms
* Hard (22.18%)
* Total Accepted: 157K
* Total Submissions: 707.9K
* Testcase Example: '"aa"\n"a"'
*
* Given an input string (s) and a pattern (p), impl... | true |
7889ba4d6b94eefc54b8b8a29ab85d4d86511ee9 | JavaScript | izzysalles/wirepayments | /src/controllers/utils/controllerValidation.js | UTF-8 | 2,051 | 2.828125 | 3 | [] | no_license | const cardValidator = require('card-validator');
const { validName,
validEmail,
validCpf,
validAmount,
validType,
validExpirationDate,
} = require('../../utils/inputValidation');
const validateBuyerInfo = (name, email, cpf) => {
if (!validName(name))
return { invali... | true |
bcd11813983a85235b6e5cf592f021da20e33a6e | JavaScript | prefertwo/interviews | /algorithm/31_The_Maximum_sum_of_subarrays.js | UTF-8 | 269 | 3.234375 | 3 | [] | no_license | /**
* 剑指offer面试题31:连续子数组的最大和。
* 输入一个整数数组,数组里有正数也有负数。
* 数组中一个或连续的多个整数组成一个子数组,求所有子数组的和的最大值。
* 要求时间复杂度为 O(n)
*/ | true |
b9c35f6463de271d040e747492f477ae8728c876 | JavaScript | MiguelDominguezSanchez/ES6_Refresher | /main_0.js | UTF-8 | 1,408 | 4.125 | 4 | [] | no_license | // CONST & LET
// let name = 'Jhon';
// let test;
// name = 'Jack';
// const person = {
// name: 'Jhon',
// age: 33,
// };
// person.name = 'Jack';
// const nums = [1, 2, 3, 4];
// nums.push(5);
// console.log(nums);
// ARROW FUNCTIONS
// function sayHello() {
// console.log('Hello');
// }
// const sayHello... | true |
a08bc4a0b118c3fc83e060f628fb6ed083d699e1 | JavaScript | lindokuhlendamane25/semitone_assignments | /semitone/src/semitone.js | UTF-8 | 1,116 | 4.0625 | 4 | [
"MIT"
] | permissive | let notes=['A','A#','B','C','C#','D','D#','E','F','F#','G','G#'];
class JamBuddy{
constructor(){
this.num1;
this.num2;
}
selectNotes(){
//select two different notes
this.num1 = Math.floor(Math.random()* (notes.length));
this.num2 = Math.floor(Math.random()* (notes.lengt... | true |