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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
62c2bd28253c1845e60cf2895c934d75f69b8d44 | JavaScript | craig552uk/express-sequelize-boilerplate | /lib/app.js | UTF-8 | 1,643 | 2.53125 | 3 | [] | no_license | var HTTPError = require('http-errors')
var parser = require('body-parser')
var express = require('express')
var logger = require('./logger')
// ---------- //
// Middleware //
// ---------- //
var app = express()
// Parse JSON requests
app.use(parser.json())
// Wrap jsonp responses in json API ... | true |
b531bfa775f82644e83ee31a4d9f42360b9cd419 | JavaScript | ajf412/Sprint-Challenge-Mongo | /budget/budgetRouter.js | UTF-8 | 895 | 2.6875 | 3 | [] | no_license | const express = require('express');
const Budget = require('./Budget.js');
const router = express.Router();
// add endpoints here
router.get('/', (req, res) => {
Budget.find()
.then(budget => {
console.log(budget);
res.status(200).json(budget)
})
.catch(err => {
res.status(404).json({... | true |
90274feb0672fc9fee1ae9fd6efef60d3cdd4c24 | JavaScript | pnwnelson/pnwlabelr | /src/models/me.js | UTF-8 | 1,768 | 2.6875 | 3 | [] | no_license | // This model will contain the API token from Github (or whatever API) so it can be persisted throughout a state.
// Without this persistence, every time the browswer window is refreshed, the token will disappear and the EU
// will have to go through the login process again.
import Model from 'ampersand-model'
import... | true |
a46858a9716c44138adada35fce2b9ee65d7d412 | JavaScript | dann1609/itcrow-app | /src/api/weatherApi.js | UTF-8 | 773 | 2.5625 | 3 | [] | no_license | import Environments from '../config/environments';
export default {
getCityWeather: function (city) {
let afterParams = `?q=${city}&appid=${Environments.APPID}`;
const url = `${Environments.BASE}${Environments.WEATHER}${afterParams}`;
console.log(url);
return fetch(url, {
method: 'GET',
h... | true |
a7f7defea8ab2ce2b0d5cc1cbd1a631687c3e497 | JavaScript | D4nte/PhotoShow | /src/js/slideshow.js | UTF-8 | 2,219 | 2.625 | 3 | [] | no_license | /**
* This file implements the slideshow.
*
* Javascript
*
* LICENSE:
*
* This file is part of PhotoShow.
*
* PhotoShow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the Lice... | true |
f9b4da8d3dbc062a4f7e2cefaffde2e820d1a75b | JavaScript | Misaka1001/html-css | /阿里云邮箱/iframe/APP.js | UTF-8 | 602 | 2.96875 | 3 | [] | no_license | var app1 = document.querySelector('.app1');
var app2 = document.querySelector('.app2');
addEvent(app1,'mouseenter',handle);
function handle(){
moveStart(app1, {'opacity':0}, function(){
app1.style.display = 'none';
app2.style.display = 'inline-block';
moveStart(app2,{'... | true |
f76845733451bdc80c2b0c9621d4c9870dd6c912 | JavaScript | jamboooooo/nmp | /first.js | UTF-8 | 115 | 2.609375 | 3 | [] | no_license | let a = 25;
let b = 39;
function sum(a, b) {
return a + b;
}
module.exports = { a: a, b: b, func: sum(a, b) } | true |
a91fa22ab2d4e2cd7460ea88ef7ad9b7ca08509e | JavaScript | harmenjanssen/recursive-js | /tests/to-obj.js | UTF-8 | 486 | 2.53125 | 3 | [] | no_license | const toObj = require("../lib/to-obj");
const assert = require("assert");
describe("toObj", () => {
it("creates an object when given an array of keys and values", () =>
assert.deepEqual(toObj(["foo", "data", "baz"], ["bar", [1, 2, 3], true]), {
foo: "bar",
data: [1, 2, 3],
baz: true
}));
... | true |
6e433d02cf301fa536897864c310ffc1e865b4a7 | JavaScript | ox-it/sakai | /reference/library/src/webapp/editor/ckextraplugins/oxpoints/js/oxpoint-map.js | UTF-8 | 2,784 | 2.796875 | 3 | [
"LicenseRef-scancode-generic-cla",
"ECL-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /**
* Given an .oxpoint div with suitable 'data-' tags, it produces the
* corresponding Google Map using the jQuery plugin goMap.
*/
(function($){
$.fn.oxPointMap = function(options) {
// pull settings from oxpoint div (data attributes)
var getDisplaySettings = function(oxpoint) {
return {
uri: oxpo... | true |
0846f7ef59e02044b790b722121e3a7a223f8b16 | JavaScript | lachlanhunt/generator-utilities | /spec/chainables/differenceBy.spec.js | UTF-8 | 381 | 2.53125 | 3 | [
"MIT"
] | permissive | const { differenceBy } = require("../../");
describe("differenceBy generator", () => {
it("should exclude values compared by converting to numbers", () => {
let iterator = differenceBy(
[0, 1, 2, 3, 4, 5],
["0", "2", "4"],
Number
);
let result = [...itera... | true |
b4489f0d2126fc186eefc0ef679d186910e546fb | JavaScript | edirates/lecture-oop-characteristics | /01-OOP-Basics.js | UTF-8 | 612 | 4.65625 | 5 | [
"MIT"
] | permissive | // Class name format must be PascalCase and singular
class Person {
// All properties must be declared first in constructor
constructor (firstname, lastname) {
// No logical process here, use instance method instead
this.firstname = firstname;
this.lastname = lastname;
}
// Inst... | true |
04cb79e61117f2c32c3539108765dfb2abd6846d | JavaScript | shubham-kedia/d3jstask | /js/barchart.js | UTF-8 | 6,987 | 3.09375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
function renderChart() {
// var data = d3.csv.parse(d3.select('#csv').text());
data = d3.csv("data/data.csv", function(error, data) {
// Convert strings to numbers.
// Name,Population (mill),Average Life Expectancy,Area (1000 sq mi),Continent
data.forEach(function(d) {
d['Mon... | true |
13e56e6af8e6be5789298741a4b9fbc4c8b75ca9 | JavaScript | AlexKosz/pokebattlesim | /src/components/Battler.jsx | UTF-8 | 17,648 | 2.765625 | 3 | [] | no_license | import axios from 'axios';
import React from 'react';
import BattleCard from './BattleCard';
import BattleMessages from './BattleMessages';
import MoveBar from './MoveBar';
import SwitchingCard from './SwitchingCard';
import MoveService from '../services/MoveService';
class Battler extends React.Component {
constr... | true |
2e10d8f84e5edb3e90730c3fc3447d0a339921b3 | JavaScript | PawanGulati/Notes-App | /notes.js | UTF-8 | 1,706 | 3.296875 | 3 | [] | no_license | const fs = require('fs');
const chalk = require('chalk');
//function dealin with adding notes
const addNotes = (title,body)=>{
let notes = loadNotes();
// console.log(notes);
//Checking notes duplicacy
let duplicate = notes.filter((el)=>{
return el.title === title;
})
//Making new not... | true |
c939c577ef7a0a2f00f4622218c5459d2dd55345 | JavaScript | ajhxk/react_learn_jsp | /src/XiaojiejieItem.js | UTF-8 | 1,544 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
class XiaojiejieItem extends Component {
constructor(props){
super(props)
this.handleClick = this.handleClick.bind(this)
}
render() {
console.log('child render')
return (
<div onClick={this.handleClick}>
... | true |
f46551ebeb835adaa2cc44ee159f8ffdb67d8972 | JavaScript | dneprm/cart | /src/javascripts/components/cartComponent.js | UTF-8 | 1,499 | 2.8125 | 3 | [] | no_license | var React = require('react');
var _ = require("underscore");
var CartProductComponent = require('./cartProductComponent');
var CartComponent = React.createClass({
render: function() {
console.log(this.props.cart);
var cartList = this.props.cart.map(function(product, index){
return (<CartProductCompone... | true |
32024ed0af692be020acba204dee74f2f2d86255 | JavaScript | Seryiza/TomatoRattle | /src/components/progressBar.js | UTF-8 | 1,149 | 2.75 | 3 | [] | no_license | import { watch } from 'melanke-watchjs';
import { Component } from './component';
const getFlexFromProgress = progress => Math.round(progress * 100);
export default class ProgressBar extends Component {
static defaults() {
return {
progress: 0,
};
}
static template() {
return `
<div class... | true |
7fd4b5c5aab9d700a40347113781d595d5bd86d6 | JavaScript | KyriSagui/Kyriale-Vasconcelos | /modulo1/variaveis/index.js | UTF-8 | 3,540 | 4.6875 | 5 | [] | no_license | //Exercícios de interpretação de código
/* 1. Analise o programa abaixo e diga o que será impresso no console, **SEM EXECUTAR o programa.**
```jsx
let a = 10
let b = 10
console.log(b)
b = 5
console.log(a, b)
``` */
//R - irá aparecer 10 e 5
/* 2. Analise o programa ab... | true |
0bbe70ff4b990eef0521ab99cabd49ff1703e0b7 | JavaScript | CoffeeVictor/ConwaysGameOfLife | /src/sketch.js | UTF-8 | 2,580 | 3.171875 | 3 | [] | no_license | const width = 700
const height = 700
const n_py = 50;
const n_px = 50;
const pxw = Math.floor(width / n_px)
const pxh = Math.floor(width / n_py)
let runningRate = 3
const freezeRate = 60
let slider
let grid = new Array(n_py)
for(let i = 0; i < grid.length; i++) {
grid[i] = new Array(n_py).fill(0)
}
let simulatio... | true |
e3ff95fa409e16d7b0ad7a5c1c2c9f619687abb8 | JavaScript | Momijiichigo/momijiichigo.github.io | /src/js/codeRain.js | UTF-8 | 1,700 | 3.328125 | 3 | [
"MIT"
] | permissive | "use strict";
//let xint = process.stdout.columns,yint = process.stdout.rows;
let xint,yint;
//first rgb and final rgb
const colorInfo={
r1:27,
g1:64,
b1:27,
r2:4,
g2:255,
b2:0
}
const length = 30;
//color change steps
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
cons... | true |
5e6cae614a67f5ef5f4ee286087328b5e3f8f282 | JavaScript | sandypockets/spinner | /spinner2.js | UTF-8 | 263 | 3.25 | 3 | [] | no_license | const spinner = () => {
const spinnerCharacters = '|/-\\|/-\\|'
let delay = 100;
for (let character of spinnerCharacters) {
setTimeout(function() {
process.stdout.write('\r' + character + ' ');
}, delay);
delay += 200;
}
};
spinner(); | true |
fe30fdf701352386e2bae75e2037dcf8131bb7ed | JavaScript | irnjunior/react-sorteio | /src/components/Layout.jsx | UTF-8 | 1,217 | 2.828125 | 3 | [] | no_license | import React, {useEffect, useState} from "react";
import {sleep} from "helpers/sleep";
import Item from "components/Item";
export default function Layout({texto, children, ...props}) {
const [label, setLabel] = useState("Nome do botão");
const [items, setItems] = useState({data: []});
useEffect(() => {
... | true |
ba4127d75326fc4742247199c001d3924b78e70e | JavaScript | JuanDiegoM/JJSSERVICE | /web/boostrap/js/tipoServicioVehiculo.js | UTF-8 | 3,685 | 2.75 | 3 | [
"MIT"
] | permissive | /* global toastr */
$(document).ready(function () {
$("#guardarNuevoTipoServicio").click(function () {
if ($("#tipoServicioNew").val() === "") {
$("#tipoServicioNew").css('background', 'red');
alert("Los Campos pintados de rojo son obligatorios");
return false;
... | true |
fff2af92debf4186315b299371ce7c010f355707 | JavaScript | bhar937/bhar937v6.github.io | /demos/codelab/app/Parallelisation.js | UTF-8 | 7,647 | 2.609375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
//Static Parallel
Blockly.Blocks['parallel_construct'] = {
init: function() {
this.appendValueInput("NAME")
.setCheck(null)
.appendField("Parallelize")
.appendField(new Blockly.FieldTextInput("Static"), "")
.appendField(new Blockly.FieldVariable("Chunck Size"... | true |
3aa5f2c0be4031eb025e21e3d7ea9116d220ad33 | JavaScript | PDanielY/youtube-clicker | /script.js | UTF-8 | 2,398 | 3.0625 | 3 | [] | no_license | function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.s... | true |
44ce99dd1ed72151452836fc0bc1d4d42e525c90 | JavaScript | conscab/JS-HTML-CSS | /JavaScript functions/Ex. 3/js/main.js | UTF-8 | 247 | 2.984375 | 3 | [] | no_license | function subSTR(str){
var sub = [];
for (var i = 0; i < str.length; i++)
{
for (var j = i + 1; j <= str.length; j++)
{
sub.push(str.substring(i,j));
}
}
return sub;
}
alert(subSTR("galaxy")); | true |
0a10e02c814d1c74855e36b6d8fc0d72898cafb3 | JavaScript | bill42362/pbplus-member-sdk | /src/Calendar.js | UTF-8 | 2,942 | 2.640625 | 3 | [] | no_license | // Calendar.js
'use strict';
import 'isomorphic-fetch';
const today = new Date();
const defaultState = {
selectedDate: today,
month: today.getMonth(),
year: today.getFullYear(),
events: [],
promotions: [],
};
const Reducer = (state = defaultState, action) => {
switch(action.type) {
cas... | true |
f1257ff567de6f2048aa81a9cf1eeb3d7e4a8d8a | JavaScript | efallancy/chimerical-partner-node | /src/components/news/NewsDisplay.js | UTF-8 | 1,340 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
class NewsDisplay extends Component {
render() {
const title = this.props.article.title;
// Join the author name since it is in array form
const authors = this.props.article.authors.join( ", " );
const date = this.props.article.date;
// Transform all th... | true |
f5ec41650170277f8222bfa97f670f13cb605a8d | JavaScript | USN-Lanelitt/FrontEnd | /src/components/admin/new-user.jsx | UTF-8 | 1,364 | 2.5625 | 3 | [] | no_license | /*Nicole har jobbet med denne siden*/
import axios from "axios";
function newUser(nickname, firstname, middlename, lastname, address, address2, zipCode, phone, email, usertype, active, newsSubscription, userterms) {
console.log("editUser ", sessionStorage.getItem('userId'));
axios.post('/api/register', {
... | true |
a27827e29ea126b08f9152dddcc5657fe561c562 | JavaScript | charan2628/Re-assign-NPTEL | /content_scripts/re-assign.js | UTF-8 | 2,322 | 2.734375 | 3 | [
"MIT"
] | permissive | (function() {
const _window = window;
if (_window.hasRunReAssignNptel) {
return;
}
_window.hasRunReAssignNptel = true;
/*
* Clears answer and add as show answer button for each quesion.
*/
function hideAnswers() {
// clear and enable input
Array.prototype.forEac... | true |
547c0dca2ad89b68122bc48e6d733b9be7926f7d | JavaScript | yangfeng-gh/es5-demo | /examples/syntax/switch.js | UTF-8 | 358 | 3.3125 | 3 | [] | no_license | function testSwitch(arg) {
switch (arg) {
case 1:
console.log(1);
break;
case arg >= 4:
console.log(2, 3, 4);
break;
default:
console.log('default');
}
}
function testSplice(arr) {
return arr.splice(0,4);
}
testSwitch(4);
... | true |
46808a18f8e056a2bcb0f3fb3e83cd7351783e5a | JavaScript | crg-corin/jsoop | /Math.rand.js | UTF-8 | 1,531 | 3.03125 | 3 | [] | no_license | (function () {
"use strict";
if (!Math.rand) {
Math.rand = function (min, max, step) {
var swap,
delta,
rand;
switch (arguments.length) {
case 0:
return !Math.round(Math.random());
case 1:
... | true |
06867328447cb809faed89cb8ef75a01b5dad221 | JavaScript | nylira/phaser-examples | /geometry/line/game.js | UTF-8 | 370 | 2.578125 | 3 | [] | no_license | // Generated by LiveScript 1.2.0
(function(){
'use strict';
var game;
game = new Phaser.Game(800, 600, Phaser.WEBGL, '', {
create: create
});
function create(){
var g;
g = game.add.graphics(50, 50);
g.beginFill(0xff0000);
g.lineStyle(10, 0xff0000, 1);
g.moveTo(50, 50);
g.lineTo(250... | true |
6050863a9a41bf04ae5a86876dbf20054fee9ff1 | JavaScript | Soure14/listaexercicios1 | /R/atividade6.js | UTF-8 | 176 | 2.796875 | 3 | [] | no_license | var kilo_prato= Number
var peso_servido= Number
kilo_prato= 12
peso_servido =0.500
var total = kilo_prato * peso_servido
console.log("total a pagar é Rs.- "+ total)
| true |
2f706ebd2aa034823e308772565ff66241896857 | JavaScript | PKVkpi/OrDeer | /client/src/components/parts/menu-list.component.js | UTF-8 | 4,660 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import MenuItem from "./menu-item.component";
import axios from 'axios';
import config from '../../config/config'
const url = config.url;
export default class RestaurantList extends Component {
constructor(props) {
super(props);
this.state = {
d... | true |
25261cc9be644c0617531f081e8ad63901e7d226 | JavaScript | codingJWilliams/Moe_Assignment_Try | /test.js | UTF-8 | 293 | 2.59375 | 3 | [
"MIT"
] | permissive | var library = require("./library");
var inp = "I am the captain";
console.log("Testing with input: " + inp);
console.log("Returned: " + library.encode(inp))
var inp = "Void is da best developer ukno";
console.log("Testing with input: " + inp);
console.log("Returned: " + library.encode(inp)) | true |
ba9c29011547ff76c3d54089d227470264d49d92 | JavaScript | muchabi/Quokka | /public/js/helper-interface.js | UTF-8 | 4,017 | 2.90625 | 3 | [] | no_license |
// copy paste image code adapted from
// http://stackoverflow.com/questions/18377891/how-can-i-let-user-paste-image-data-from-the-clipboard-into-a-canvas-element-in
document.onkeydown = function(e) {return on_keyboard_action(e); }
document.onkeyup = function(e) {return on_keyboardup_action(e); }
var canvas = documen... | true |
d90ed81de5d0fc3271c4e784098fdb17cc161944 | JavaScript | uzomezu/MERN-Auth_Todo-App | /backend/routes/todo.routes.js | UTF-8 | 2,991 | 2.765625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const Todo = require('../models/Todo');
const passport = require('passport');
const validateTodoInput = require('../validation/todo');
//get all todos
router.get('/', passport.authenticate('jwt', {session: false}), async (req, res) => {
try {
... | true |
0d5b0df1d865384446c196506fdf3a614f56d517 | JavaScript | hallen95/shortenLinks | /server.js | UTF-8 | 1,492 | 2.640625 | 3 | [] | no_license | const express = require('express')
const mongoose = require('mongoose')
const ShortUrl = require('./models/shortUrls')
const app = express()
/* esto funciona para una base de datos local,
pero para hacer el deploy en Heroku necesitamos otros datos */
mongoose.connect('mongodb+srv://root:5Z7mwkfUOuhvZfLs@cluster0.zq2... | true |
a303f07d6fdf1cd73acf3778a355cffad1564506 | JavaScript | dydaev/you-back | /src/trackUploader.js | UTF-8 | 587 | 2.578125 | 3 | [] | no_license | const fs = require('fs');
import { downloadFile } from './trackDownloader.js'
const format = 'webm'
const fileFolder = 'files'
const url = 'https://www.youtube.com/watch?v=';
export const getTrackPath = async treckId => {
const path = `${fileFolder}/${treckId}.${format}`
try {
await fs.accessSync(path, fs.c... | true |
348b9d05321e8ec860d54dda9951b768c9315d22 | JavaScript | mlima83/empresabdr | /locadora/src/main/js/components/paginator.js | UTF-8 | 1,637 | 2.59375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import { Pagination, PaginationItem, PaginationLink } from 'reactstrap';
/**
* Componente de paginação
* Propriedades:
* links= Links retornados pelo springDataRest
* page= Object Page retornado pelo springDataRest
*/
export default class Paginator ... | true |
6da7b63ed80d5d2ca82a764ca30fe09331f257ec | JavaScript | meowtsai/flashcards | /utils/api.js | UTF-8 | 1,555 | 2.609375 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | import { AsyncStorage } from 'react-native'
const FLASHCARDS_STORAGE_KEY = 'FlashCard:deck'
const FLASHCARDS_STORAGE_QUIZ_KEY = 'FlashCard:quiz'
export const QuizTakenTime_KEY = 'QuizTakenTime'
export function addQuizTakenTimeToDB( entry ){
//console.log("addDeckToDB",entry +"," +key )
return AsyncStorage.merge... | true |
d21cd721791d8af10e56a1a6a895a48f6bd1e114 | JavaScript | amitpathak111/intellact_Latest | /repository/trade_handler.js | UTF-8 | 1,024 | 2.5625 | 3 | [] | no_license |
let express = require('express');
let router = express.Router();
let config = require("./config.js");
// add new trade to db
router.post('/',function(req,res){
let trades = req.body;
trades.timestamp = new Date(trades.timestamp);
config.trades_col.save(trades,function(err,msg){
if(err ){
res.status('400').... | true |
ca94cf1d302cb6eabc9cd3130eb366952d6b3894 | JavaScript | vassjozsef/audio-input | /app/volume-meter.js | UTF-8 | 1,110 | 2.625 | 3 | [] | no_license | export default class Vad {
constructor(stream) {
this.currentVolume = 0;
const context = (this.context = new AudioContext());
var processor = context.createScriptProcessor(512);
processor.volume = 0;
const source = context.createMediaStreamSource(stream);
source.connect(processor);
proce... | true |
b885cffa10db875930c690e6596816c5d93d3c03 | JavaScript | usefulmana/secure-chat-app | /frontend/src/core/Team/handleAccess.js | UTF-8 | 951 | 3.0625 | 3 | [] | no_license |
const getUserId = () => {
if (JSON.parse(localStorage.getItem('jwt'))) {
return JSON.parse(localStorage.getItem('jwt')).user._id;
} else {
return null
}
}
export const isUserHasAccessToThisChannel = (channel) => {
var userId = getUserId()
if (!channel) return false;
if (cha... | true |
cf41638a2712479b9622fc850465edef1a30f6a6 | JavaScript | ashenm/dsa | /linked-lists/10.js | UTF-8 | 1,896 | 3.796875 | 4 | [] | no_license | /**
* 10.js
* Linked Lists
* https://github.com/ashenm/dsa
*
* Implements a double-ended queue
*
* Ashen Gunaratne
* mail@ashenm.ml
*
*/
'use strict';
class Node {
constructor (value, prev=null, next=null) {
this.prev = prev;
this.value = value;
this.next = next;
}
}
class LinkedList {
... | true |
2c1bc71039f11f7ede643d40cca38d95991930ee | JavaScript | AnkitAgarwal547/vuetest | /client/src/models/BoxType.js | UTF-8 | 957 | 2.5625 | 3 | [] | no_license | import axios from "axios";
const url = "http://localhost:8000/api/boxtype";
export default class BoxType {
constructor(boxtype = {}) {
this.type = boxtype.type || "";
this.freeshippinglimit = boxtype.freeshippinglimit || null;
this.predefineditems=boxtype.predefineditems||[];
}... | true |
eaefe55fdcf62e91fff2b6e70fb382c2976c2f09 | JavaScript | Keyymie/bot-discord | /commands/Modération/sondage.js | UTF-8 | 975 | 2.75 | 3 | [] | no_license | const Discord = require('discord.js')
module.exports.run = async (bot,message,args) =>{
if(message.member.hasPermission("MANAGE_CHANNELS")) {
if(!message.guild.channels.find('name','sondages')) {message.channel.send("Le channel sondages n'existe pas. Veuillez le créer puis réassayer."); return}
... | true |
1fdbc6a3d0e05be33d3d6c02720e7c7afb79d5bf | JavaScript | Faudelhadroug/ALG_Pushswap | /push_swap.js | UTF-8 | 2,362 | 3.21875 | 3 | [] | no_license | let l = process.argv.slice(2);
let la = [];
l.map((el) => la.push(parseInt(el)));
let lb = [];
let algoUsed = [];
const sa = () => {
[key1, key2] = la
if(!key1 || !key2) return;
let copie = {...la, 0 : key2, 1 : key1}
la = Object.values(copie);
}
const sb = () => {
[key1, key2] = lb;
if(!key1 || !key2) ret... | true |
81faa14b7b6f93c26e9cd23009079a2c9519a024 | JavaScript | yaskovdev/math-game-web-app | /src/RoundSummary.js | UTF-8 | 751 | 2.578125 | 3 | [
"MIT"
] | permissive | import React, { PureComponent } from 'react'
export default class RoundSummary extends PureComponent {
render() {
const { value } = this.props
return <h2>{this.formatWaitingMessage(value)}</h2>
}
formatWaitingMessage = (roundSummary) => {
if (roundSummary === 'CORRECT_FIRST_ANSWER... | true |
66935dc0e1c811401a28a5c240b2e2ed6afcc9da | JavaScript | pinussilvestrus/variables-prototypes | /packages/variables-modeler/src/features/behavior/OutputVariableBehavior.js | UTF-8 | 3,824 | 2.59375 | 3 | [
"MIT"
] | permissive | import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
import {
forEach,
find
} from 'min-dash';
import {
getBusinessObject,
is
} from 'bpmn-js/lib/util/ModelUtil';
import {
add as collectionAdd,
remove as collectionRemove
} from 'diagram-js/lib/util/Collections';
import {
getVari... | true |
b67ba2fc008c001843fe8befffcc3b2b625e4bcd | JavaScript | k-e-r/prewmad | /week3/shiratori/kawanishi.js | UTF-8 | 1,141 | 3.078125 | 3 | [] | no_license | let KAWANISHI;
let image5 = document.getElementById('kawanishipic');
image5.onclick = changeImage;
document.getElementById("kawanishipic").onmouseout = function() {mouseOut4()};
function mouseOut4() {
document.getElementById("kawanishipic").src = './pics/kawanisi.jpeg';
}
function changeImage(){
if(image5.style.... | true |
c511becd67f050f0ecab07d4005679690f27a6b7 | JavaScript | Thiernope/cap-project | /UI/scripts/profile.js | UTF-8 | 655 | 2.8125 | 3 | [
"MIT"
] | permissive | //showing model
const trigaringButton = document.querySelector(".update");
const modal = document.querySelector(".modal");
const modalClose = document.querySelector(".modal-close");
trigaringButton.addEventListener("click", event=>{
modal.style.display= "flex";
document.body.style.overflow = "hidden";
moda... | true |
9aa92f227d0340ae422278aae5f6a11d01b69241 | JavaScript | PedroReal99/MyOwnCutlery | /MyOwnCutlery/md_vue/public/CutleryFatctoryDesign/machine1.js | UTF-8 | 1,678 | 2.765625 | 3 | [] | no_license | function init() {
var loader = new THREE.ObjectLoader();
// Create a material
var textureLoader = new THREE.TextureLoader();
var map = textureLoader.load('Utils/Factory_Utils/textures/clearMetal.png');
var material = new THREE.MeshBasicMaterial({ map: map });
var groupCilindro;
var loade... | true |
aa3981cf74e0d8ead766cc0d77ca9be6f68c01ee | JavaScript | kazimis/myDatabase_app | /public/myDataBase.js | UTF-8 | 2,027 | 2.859375 | 3 | [] | no_license |
var mytable = document.getElementById("myTable");
var del_link = document.getElementById("deleteLink");
var update_link = document.getElementById("updateLink");
var form = document.getElementById("updateForm");
function gett(id){
location.href = "/info".concat(id);
}
update_link.onclick = function(){
var id = m... | true |
e54b1985b816deb2b7f155359c90cecc080ed0af | JavaScript | KannanPalani57/100DaysOfCode | /Day - 94/Router in ReactJS/src/ClientRoute.js | UTF-8 | 1,303 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react'
class ClientRoute extends Component{
constructor(props){
super(props);
this.state = {
page: "",
}
}
handleClick(newPage){
this.setState( {
page: newPage
})
}
renderPage(){
if(this.state... | true |
94fc96c2203a38a1cf74a2b2a28354a5b1ee8b9d | JavaScript | dennisdavidarango/react-forms | /src/pages/mascotas/componentes/mascotas-table/mascotas-table.comp.jsx | UTF-8 | 4,016 | 2.5625 | 3 | [] | no_license | import React, { useState } from 'react';
import MascotasCategoryRow from '../mascotas-category-row/mascotas-category-row.comp';
import MascotasRow from '../mascotas-row/mascotas-row.comp';
import './mascotas-table.style.css';
const MascotasTable = (props) => {
const [descripcion, setDescripcion] = useState('ca... | true |
c750aef9fd65ac3cc0d2138e37231ec08cf5b62e | JavaScript | tiago123456789/BLOG-FRONTEND | /src/service/TokenService.js | UTF-8 | 641 | 2.75 | 3 | [] | no_license | import jwt from "jsonwebtoken";
export default class TokenService {
isValid(token) {
if (!token || !this._isJwt(token)) {
return false;
}
const { exp } = this.getPayload(token);
const dateCurrent = Date.now();
if (exp < (new Date().getTime() / 1000)) {... | true |
35a8a662e3fe5800f4d88651ca721a57bac10a2a | JavaScript | thinkjs/think-model-mysql | /test/lib/parser.js | UTF-8 | 4,609 | 2.671875 | 3 | [
"MIT"
] | permissive | const ava = require('ava');
const helper = require('think-helper');
const Base = require('../../lib/parser');
ava.test('escapeString is function', t => {
const instance = new Base();
t.true(helper.isFunction(instance.escapeString));
});
ava.test('escapeString, empty', t => {
const instance = new Base();
const... | true |
defd79abf908866c1f26a86c517d0fe4f5784430 | JavaScript | grabczakkamil/javascript-zadania-domowe | /zadanie8783-litera-w-stringu/js/index.js | UTF-8 | 480 | 3.421875 | 3 | [] | no_license | 'use strict';
function policzLitery(a,b) {
var inscription = a;
var arr = inscription.split('');
var wynik = 0;
if (b == b.toUpperCase()) {
var y = b.toLowerCase();
}
else {
var y = b.toUpperCase();
}
for (var i = 0; i <= arr.length; i++) {
var x = arr[i];
... | true |
db156f826c4279bbd1c6b19704784c40ed886852 | JavaScript | segersniels/terraform-ecs-plan-checker | /lib/util/fixFormatting.js | UTF-8 | 523 | 3.1875 | 3 | [] | no_license | /**
* Fixes the incoming Terraform output so we can later format it as a correct JSON object
*
* @param {String} json
* @returns {String}
*/
const fixFormatting = json => {
let replaced = json
.replace(/\]"/g, "]")
.replace(/"\[/g, "[")
.replace(/\]\[/g, "],[")
.replace(/\\"/g, ... | true |
a7086e84e20c721bd69ffc7537a480bc2f9ed135 | JavaScript | alexander-lyakhov/epam-tz | /src/components/contact-form/contact-form.jsx | UTF-8 | 2,797 | 2.59375 | 3 | [] | no_license | import React from 'react';
import InputMask from 'react-input-mask';
import './contact-form.scss';
class ContactForm extends React.Component {
constructor(props) {
super(props);
this.state = {
isButtonsEnabled: false
};
this.handleSubmit = this.handleSubmit.bind(this);
this.checkFormStat... | true |
f65e94a69cc83033efc612231b9651e0f7cff300 | JavaScript | saivamsikayala/sudoku | /game.js | UTF-8 | 3,456 | 2.78125 | 3 | [] | no_license | var Sudoku = {
matrix:[ [[7],[2],[],[9],[4],[5],[],[3],[]],
[[],[3],[9],[2],[],[6],[],[],[4]],
[[1],[5],[],[7],[3],[8],[6],[9],[2]],
[[6],[4],[7],[1],[],[3],[],[2],[]],
[[9],[8],[2],[6],[5],[7],[4],[1],[3]],
[[3],[],[5],[4],[9],[2],[7],[],[6]],
[[4],[9],[3],[],[... | true |
e25e34907698c663dbe8f1d963e8404f3f1599c3 | JavaScript | 99002584/web_development | /99002584/form validation/register.js | UTF-8 | 1,144 | 2.984375 | 3 | [] | no_license | function validate(){
if(document.getElementById("uname").value==""){
alert("Enter your Name");
// v1=document.getElementById("uname").value;
// if(v1.length<=5){
// alert("please enter more characters");
// }
document.registerform.username.focus();
}
els... | true |
28f908a26974014b592abecf4b7932aa73ca3cb9 | JavaScript | berzavlu/prueba-rimac | /src/pages/index/events/email.js | UTF-8 | 1,096 | 3.078125 | 3 | [] | no_license | /* eslint-disable no-useless-escape */
// remove error en campo email
const removeMessageOnEmailField = (messageErr = '*Error en campo') => {
const elmErrorPlaca = document.getElementById('validateEmail')
const elmFielPlaca = document.getElementById('email')
elmErrorPlaca.classList.add('hidden')
elmErrorPlaca.... | true |
f393833f39a909cbd90cd5313ac64d0a5938a4c8 | JavaScript | tomasechague/pruebas | /web/js/permisos.js | UTF-8 | 4,146 | 2.5625 | 3 | [] | no_license | function listPermisos(){
$.ajax({
url: "api/permisosApi.php",
type: 'GET',
data: {
busqueda: $("#busqueda").val(),
items: $("#cantItems option:selected").val(),
orden: $("#ordenActual").val(),
pagina: $("#paginaActual").val(),
direc... | true |
6e9b28b0cd124e15fed02894d44628fbe94ec367 | JavaScript | troyblank/filemanip | /commands/split.js | UTF-8 | 1,826 | 2.625 | 3 | [] | no_license | 'use strict';
const exec = require('child_process').exec;
const fileUtil = require('../util/file');
var isRecursive;
var garbageBag = [];
exports.run = function(action, otherParams) {
const flag = otherParams[0];
exports.splitFiles(fileUtil.getFilesInDir('-r' === flag));
}
exports.cleanHouse = function() {... | true |
83f98f2f391c06ab5df89fa41b9cac3012f01a33 | JavaScript | lzhenkang/escape_mini_games_room | /riddle.js | UTF-8 | 2,006 | 4.0625 | 4 | [] | no_license | //create game board for riddle
var riddleGameBoard = function(){
//create div for riddle text
var riddleText = document.createElement("div")
riddleText.classList.add("riddle")
riddleText.textContent = "Freeing me can bring both war and strife,<br> I am there at the beginning of life,<br>I am the symbol ... | true |
48e976f959b783ddec1427b5eb121ffb38d26369 | JavaScript | s300m22/my-next-app | /pages/blog/[id].js | UTF-8 | 1,312 | 2.578125 | 3 | [] | no_license | import React from 'react'
import { NextSeo } from 'next-seo';
// This function gets called during pre-rendering
export async function getStaticPaths() {
// 1. Use a blitz query to get all posts
// 2. Or call an external API endpoint to get posts
const res = await fetch('https://jsonplaceholder.typicode... | true |
9c64772c6473b5578dfa94a3994b2abdbd1c25ac | JavaScript | wcyjoyce/world-countries | /src/components/game.jsx | UTF-8 | 3,166 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import Summary from "./summary.jsx";
class Game extends Component {
state = { started: false };
renderButton = () => {
if (this.props.time > 0) {
if (this.state.started) {
return (
<div>
<button className="btn btn-info" onClick={th... | true |
7e7379cfd83dd2409b7b8a63f52a47009d13606f | JavaScript | lindabarba/WDI-LB-Work | /Week10/esplus/src/index.js | UTF-8 | 1,614 | 4.34375 | 4 | [] | no_license | // Spread Operators
let parts = ["shoulders", "knees"];
let lyrics = ["head", ...parts, "and", "toes"];
console.log(lyrics);
let sports = ["soccer", "basketball"];
let moreSports = [...sports];
console.log (moreSports);
// same but with objects
let firstObj = {a: 0, b:1}
let secondObj = {...firstObj}, c: 2, d: 3}... | true |
392d71d56e85c375e5e76e1254647fe041e797e7 | JavaScript | windyboy/dsapi-ui | /test/unit/modelsSpec.js | UTF-8 | 12,134 | 2.578125 | 3 | [] | no_license | 'use strict';
describe('Dataset', function() {
var datasets;
beforeEach(function(){
datasets = [
new Dataset({
'name': 'test_sdc',
'version': '0.1',
'os': 'smartos',
'description': 'some docs',
'uuid': 'test_sdc-2222',
'creator_name': 'sdc',
'expec... | true |
83870ff15043125734b57863ed495aefc00452e3 | JavaScript | indraraj26/react | /react-poc/src/index.js | UTF-8 | 376 | 2.921875 | 3 | [] | no_license | import fruitList from './foods/foods';
import {choice, remove} from './helper/helper';
let fruit = choice(fruitList);
console.log(`I'd like one ${fruit}, please.`);
console.log(`Here you go : ${fruit}`);
console.log('Delicious! May i have another?');
let remaining = remove(fruitList, fruit);
console.log(`I'm sorry... | true |
1a4c0666945c5eda2b7d5f7d3052542a3f0a4100 | JavaScript | JeysonM/proyectoHEB | /app/assets/javascripts/suscribers.js | UTF-8 | 1,240 | 2.609375 | 3 | [] | no_license | var serviceUrl= '/api/v1/';
var SuscribersModel = function(_suscribers){
var self = this;
self.suscribers = ko.observableArray(ko.utils.arrayMap(_suscribers, function(suscriber){
return {
id: suscriber.id,
email: suscriber.email,
code: suscriber.code,
};
}));
self.editingSuscriber ... | true |
918cdfec231a8701ce70d3a3cc05d43fc1b890a8 | JavaScript | Ianis-Bordrez/projet_web | /js/create_char.js | UTF-8 | 2,411 | 3.28125 | 3 | [] | no_license | $(document).ready(function(){
var gender = "male";
var curr_char = 0;
var base_path = "img/char/";
var char_m = ["char_m_ninja", "char_m_shaman", "char_m_sura", "char_m_warrior"];
var char_w = ["char_w_ninja", "char_w_shaman", "char_w_sura", "char_w_warrior"];
$(document).on('click', '.next_cha... | true |
fbb988f395eefde43f92bb82c27147ab31203978 | JavaScript | 971389117/GoodGoodStudy | /0-JavaScript.demo.key/1-遍历.note.js | UTF-8 | 1,885 | 4.625 | 5 | [] | no_license | /*
1. for(;;){}
2. for(in){}
3. for(of){}
4. 数组专用.forEach((value,index,arr)=>{})
5. 将类数组转换成数组
*/
let arr = [1, 2, 3]
// 一、 最传统的 for 循环
// 作用于数组或有数字键的对象 简单方便
console.log('最传统的 for 循环')
for (let index = 0; index < arr.length; index++) {
const element = arr[index];
console.log(element)
}
console.log("=========... | true |
1a5c7a2cd01860c83b6823ebe1f5a8362c7c469a | JavaScript | qback/js-practice | /002_jquery_refresher/05_jquery_practice.js | UTF-8 | 16,751 | 3.0625 | 3 | [] | no_license | import $ from 'jquery';
// Все абзацы <p>, внутри которых есть <b>, оберните в тег <div>.
$('p:has(b)').wrap('div');
// Найдите все абзацы <p> с классом .www, поставьте им в начало текст '!', затем добавьте к этим абзацам еще и заголовки h1-h6 и покрасьте эти абзацы и заголовки в красный цвет.
$('p.www').prepend('!'... | true |
b8d6c5cf326830459aebef4d03310944a288ede0 | JavaScript | XROLE/blueFlame-indoors-API | /server/middleWares/validateUser.js | UTF-8 | 9,218 | 2.6875 | 3 | [
"MIT"
] | permissive | import models from '../models';
import { isUUID } from '../helpers/validator';
import {
isDuplicate,
isEmail,
isEmpty,
checkLength,
containLowercase,
containUppercase,
containNumber
} from '../helpers';
const { User } = models;
let users = [];
/**
* @class
*/
export default class ValidateUser {
/**... | true |
e013870842f1ccb2029321f6e73eb236b16d0d30 | JavaScript | Albeforia/who-are-you | /js/o3d/ball.js | UTF-8 | 2,233 | 2.609375 | 3 | [] | no_license | 'use strict';
var THREE = require('three');
var TweenLite = require('tweenlite');
var TextureManager = require('../texture-manager');
var random = require('../utility').random;
var yoyo = require('../utility').yoyo;
function Ball() {
var texture = TextureManager.load('assets/texture/ball.png');
texture.wr... | true |
f66d9d9c3c5ed8d160007b49f94fe419d6f85207 | JavaScript | drusin/VoidTech_plus | /src/doors.js | UTF-8 | 3,181 | 2.703125 | 3 | [
"MIT"
] | permissive | import stateMachine from './stateMachine.js';
import dialog from './dialog/dialog.js';
import { getPhaserTileIndexFromTiledGid } from './dynamic-tilemap-layer-helper.js';
// I tried to remove these hardcoded Tile Ids, but failed.
// Problem is that it was not trivial for me to get a specific TileObject
// based on a ... | true |
2a0d42ee70141945d82ba3d7eec14cafe46b3eec | JavaScript | Luismi-Hub/DWEC_Javascript | /Unidad1/Worksheet5/Ejercicio1.js | UTF-8 | 286 | 2.625 | 3 | [] | no_license | var nombre = prompt("Introduzca su nombre");
document.write("<p>Nombre: " + nombre + "</p>");
var apellidos = prompt("Introduzca sus apellidos");
document.write("<p>Apellidos: " + apellidos + "</p>");
var edad = prompt("Introduzca su edad");
document.write("<p>Edad: " + edad + "</p>"); | true |
2cc1bd083ee8472acafe17b0dcdb508f6a4f35c3 | JavaScript | houterwamal/houterwamal.github.io | /assets/js/functions.js | UTF-8 | 2,984 | 2.65625 | 3 | [] | no_license | $( document ).ready(function() {
//slide intro-box homepage
function introSlide(){
var introBox = $("#intro-box");
introBox.animate({"marginLeft" : "0px"}, 1000);
}
//zooms image homepage
function showsZoom(){
var image = $(".image");
image.on("m... | true |
447be95ab71d8efe8edb409a0b04d2c6a1f5fafb | JavaScript | chrisbeckstrom/fishinglog | /scroll/javascript/custom_jquery.js | UTF-8 | 1,814 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | _debug = false;
function dbg(msg) {
if (_debug)
console.log (msg);
}
$(document).ready(function() {
doMouseWheel = 1 ;
$("#postedComments").append( "<p id='last'></p>" );
dbg("Document Ready");
$(window).scroll(function() {
dbg("Window Scroll Start");
if (!... | true |
49d07650c25e47918ae021fe952905d66d9a7592 | JavaScript | Zellps/Curso-Web-Moderno-JS-Cod3r | /4.Objeto/3.criandoObjetos.js | UTF-8 | 1,502 | 4.375 | 4 | [] | no_license | //usando a notação literal
const obj1 = {}
console.log(obj1)
//Object em JS
console.log(typeof Object, typeof new Object())
const obj2 = new Object()
console.log(obj2)
//funções construtoras
function Produto(nome, preco, desconto) {
// preço e desconto ficarão encapsulados
this.nome = nome // this. torna a variáv... | true |
15f539f382149c4c4fe14842e6bedb36e25b1008 | JavaScript | webbestmaster/canned-fish-back | /game/index.js | UTF-8 | 5,399 | 2.6875 | 3 | [
"MIT"
] | permissive | /* global */
const MainModel = require('main-model');
const ConnectionWrapper = require('./connection');
const Unit = require('./unit');
// const gameData = require('./data.json');
const attr = {
connections: 'connections',
units: 'units',
// dots: 'dots',
io: 'io'
};
class Game extends MainModel {
... | true |
61196f67498e98491c81978fe5b98c4e645d5d1a | JavaScript | gakimball/cadet | /lib/inheritence.js | UTF-8 | 712 | 3.5625 | 4 | [] | no_license | // Wrapper function to create basic inheritence for JavaScript objects.
// Thank you: http://phrogz.net/JS/classes/OOPinJS2.html
// Usage:
// var Mammal = function() { }
// var Cat = function() { }
// Cat.inheritsFrom(Mammal);
Function.prototype.inheritsFrom = function(parentClassOrObject){
if ( parentClassOrObjec... | true |
98d6e108e5f7558abd2620ee4f189444bb1faf47 | JavaScript | jyoti140220/JS_list | /total_sum.js | UTF-8 | 329 | 3.578125 | 4 | [
"MIT"
] | permissive | var number = 30
var n=[10, 11, 12, 13, 14, 17, 18, 19]
var a=[]
var i=0
while (i<n.length){
var j=i
var b=[]
while (j<n.length){
if (n[i]+n[j]==number){
b.push(n[i],n[j])
}j++
}if (b.length>=1){
a.push(b)
}
i++;
}console.log(a)
// Output: [[11,19], [12,18]... | true |
55a97da565e106df6d816052158b80d2ab338be8 | JavaScript | abbbaf/abbbaf.github.io | /mardi-gras/src/lightbox.js | UTF-8 | 1,323 | 2.71875 | 3 | [] | no_license | import initSlider from './base-slider.js';
function setImgOnClick(images, box, startSliderCallback) {
images.forEach((image,index) => {
image.onclick = () => {
box.style.display = 'flex';
startSliderCallback(index);
}
})
}
function setKeyPressListener(box) {
docum... | true |
0f372b66076eb5672f9d854c89884e1d43ffec5d | JavaScript | jonasblanc/Extended-TicTacToe | /src/components/Game/index.js | UTF-8 | 2,942 | 3.140625 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from "react";
import "./style.css";
import Grid from "../Grid";
import GameSettings from "../GameSettings";
import nextMoveIA from "./IA";
import { calculateWinner } from "./arrayUtilities";
export default function Game() {
const MIN_SIDE = 5;
const MAX_SIDE = 25;
cons... | true |
b96f29d7438b8b2c41b26065f510da43ca4ef054 | JavaScript | deepankkartikey/Javascript | /Learn/CallBack Functions/js/script.js | UTF-8 | 922 | 4.03125 | 4 | [] | no_license | console.log("CALLBACK Functions");
// synchronous - forEach()
// Asynchronous - setTimeout()
// mocked object from server
const students = [
{ name: "Deepank", subject: "Machine Learning" },
{ name: "Tanmay", subject: "Software Engineering" },
];
console.log(students);
function enrollStudent(student, callback) {... | true |
f2ccff37eaa4fdb1e33558d5bae293288ac9623d | JavaScript | SergioHGHomez/Equipo2_Tecestudio_Frontend | /src/main/webapp/js/user.js | UTF-8 | 4,536 | 2.765625 | 3 | [] | no_license | const URL_PUERTO = "http://18.212.90.18:8080/tecestudioweb-0.0.1-SNAPSHOT"
$(document).ready(function () {
$("#btn_test").click(function () {
let test = document.getElementById("inp_test").value;
$.post("http://18.212.90.18:8080/tecestudioweb-0.0.1-SNAPSHOT", { text: test }, function (data, status) {
$("#mens... | true |
e6dc225b27f4fd0734af21ba16cc6196861acf54 | JavaScript | waldivino/cervejaria | /cervejariathreerocks/cervejariathreerocks/scripts/jMensagem.js | UTF-8 | 1,974 | 2.96875 | 3 | [] | no_license | /*
* Método de Apresentação de Dialog Message
* Parâmetros :
* Label : Texto do botão da Modal.
* Button : Id do Botão que executa a função.
* Message : Mensagem a ser apresentada.
* OBS: Pode se utilizar Html no mesmo.
* Type : Definição de Cor da Janela Popup.
* "SUCCESS", "OK", "SUCESSO" - Cor Verde.
* ... | true |
1dcf7e060c12e498087523c1674533649a7583a2 | JavaScript | igncp/board-games | /catan/js/src/Utils.js | UTF-8 | 1,406 | 3.140625 | 3 | [
"MIT"
] | permissive | // @flow
type T_padWithZeros = (number, number) => string
export const padWithZeros: T_padWithZeros = (number, len) => {
let my_string = `${number}`
while (my_string.length < len) {
my_string = `0${my_string}`
}
return my_string
}
type T_getDoesArrayContainDuplicates = <T: *>([T, T, T] | [T, T] | Array... | true |
a0d33e48afd755be28bef45acc2e666079d022f4 | JavaScript | jason1985pdb/es6 | /day05/1-generator.js | UTF-8 | 384 | 3.046875 | 3 | [] | no_license | function* foo(){
yield "one";
yield "two";
yield "three";
return "ending"
}
let result = foo();
console.log(result.keys);
//let item;
//while(!(item = result.next()).done){
// console.log(item.value);
//}
/*console.log(result.next());
console.log(result.next());
console.log(result.next());
console.lo... | true |
89042702454d69fcab324cd13e76fd9b95cccb07 | JavaScript | aahmad94/algorithm_projects | /08_leet_code/google/longest_consecutive_branch/Algorithm.js | UTF-8 | 694 | 2.890625 | 3 | [] | no_license | class Algorithm {
static longestConsecutiveBranch(root) {
if (!root) return 0;
const props = {
max: 0
};
Algorithm.helper(root.left, 1, root.val, props);
Algorithm.helper(root.right, 1, root.val, props);
return props.max;
}
static helper(root, num, prev, props) {
if (!root) retu... | true |
1d04dbb39b177d416866ab57a66ab679d0910545 | JavaScript | Hugant/100js-Days | /Day 20 - Quantorium/javascript/sprites/BackgroundSprites.js | UTF-8 | 1,155 | 2.59375 | 3 | [] | no_license | const BACKGROUND_SPRITE_NAME = "Backgrounds";
const BACKGROUND_SPRITE_SRC = "images/backgrounds.svg";
const BACKGROUND_SECTION_NAME = "backgrounds";
const BACKGROUNDS = {
SHADOW_VALLEY: {
NAME: "Shadow valley",
X: 0,
Y: 0
},
VALLEY: {
NAME: "Valley",
X: 0,
Y: 560
},
CACTUS_SHADOW_VALLEY: {
NAME: "Ca... | true |
935fc9f751739215f8ccf704301389c7e64d055c | JavaScript | shanreed/background-generator | /main.js | UTF-8 | 1,485 | 3.875 | 4 | [] | no_license | var css = document.querySelector("h3");
var color1 = document.querySelector(".color1");
var color2 = document.querySelector(".color2");
var body = document.getElementById("gradient")
//Console log to make sure you are grabbing the right things
console.log(css);
console.log(color1);
console.log(color2);
// color1.addE... | true |
889f659f2a52e1615d48f35494645d26302d50e4 | JavaScript | luckyleonard/CodePractice | /Week2/taxation.js | UTF-8 | 447 | 2.9375 | 3 | [] | no_license | var income;
function getTax(income) {
var taxTable = [{
from: 0,
to: 18200,
base: 0,
percentage: 0,
}, {}]
// if(income > 180001) {
// return 54097 + (income - 180000) * 0.45
// } else if (income > 90001) {
// return 20797 + (income - 90000) * 0.37
// } else if (in... | true |
fb9e56bc3ab9a5c37a52ee87d2964501e6f6ec28 | JavaScript | b6018718/b6018718.github.io | /javaScript/class.js | UTF-8 | 2,788 | 2.71875 | 3 | [] | no_license | var ClassbuttonX = [20,326,632];
var ClassbuttonY = [120,120,120];
var ClassbuttonWidth = 300;
var ClassbuttonHeight = 480;
var ClassSelect = new Image();
var ClassScreen = new Image();
ClassSelect.src = "images/classSel.png";
var StopClass;
var ClassBoxVisible = false;
var ClassBoxX = 0;
var ClassBoxY = 0;
var ClassBo... | true |
72515e55bfc261f7fffd3800c9af0c7a368b2953 | JavaScript | silence0201/JavaScript-Study | /Simple/Map&Set.js | UTF-8 | 841 | 3.40625 | 3 | [
"MIT"
] | permissive | /**
* Created by silence on 2017/4/5.
*/
'use strict';
var m = new Map();
var s = new Set();
alert('你的浏览器支持Map和Set!');
var names = ['Michael', 'Bob', 'Tracy'];
var scores = [95, 75, 85];
var m = new Map([['Michael', 95], ['Bob', 75], ['Tracy', 85]]) ;
m.get('Michael');
var m = new Map(); // 空Map
m.set('Adam', 67)... | true |