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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
530a42fe18bbc6e3ca6580db7a159e9cbd3be925 | JavaScript | ArjunBEG/cod3wars | /src/7kyu_⬜️/l0v3_vs_fr13ndsh1p/index.js | UTF-8 | 664 | 3.3125 | 3 | [] | no_license | // const wordsToMarks = (string, obj = {}, num = 0) => {
// let alphabet = "abcdefghijklmnopqrstuvwxyz".split("");
// string = string.split("").sort();
// for (let [i, v] of alphabet.entries()) obj[alphabet[i]] = i + 1;
// for (let i of string) num += obj[i];
// return num;
// };
const wordsT... | true |
14b944c29d30ef09e09882884a2736b811178cc6 | JavaScript | TrevorIslam/Pendulum | /index.js | UTF-8 | 354 | 2.578125 | 3 | [] | no_license | console.clear();
var p;
var GlobalTime;
var ropeLength = 250;
var oldSign = false;
var newSign = false;
var grav = 9.80665;
function setup () {
createCanvas(500,500);
GlobalTime = frameCount/60;
p = new Pendulum(ropeLength);
}
function draw () {
GlobalTime = frameCount/60;
background(200);
fill(100);
r... | true |
ccf9eec0b5b740291c642602c06d684dc5578f6e | JavaScript | bneiluj/ReactYoutubeApp | /src/components/search_bar.js | UTF-8 | 853 | 3.1875 | 3 | [] | no_license | // Import React and pull off Component directly from react, meaning React.Component
import React, { Component } from 'react';
// New SearchBar class and gives it access to all functionnality
// from the react component class
class SearchBar extends Component {
// Call automatically whatever a new instance of searchB... | true |
62115d725f4e698ab18dc99fa57cbf155e72fdbd | JavaScript | brucec5/none-of-you-are-free-of-sin | /background.js | UTF-8 | 2,244 | 3.078125 | 3 | [
"MIT"
] | permissive | /**
* Returns a new unique Id
*
* @param {Array<BlockItem>} existingItems The existing block items
* @returns {Number} A new unique numeric ID
*/
function newId(existingItems) {
return existingItems.reduce((acc, item) => Math.max(acc, item.id), 0) + 1;
}
/**
* addNewBlockItem - Adds a new block item to the st... | true |
655b570947611c5d2bf2348b2bc0a05a10c7c5cb | JavaScript | singajeet/designer | /static/js/ws/warehouse-ws.js | UTF-8 | 4,960 | 2.71875 | 3 | [] | no_license | /**
* Warehouse-ws.js - This file contains the client side web services
* interface to interact with server for fetching the required data
*/
/**
* WarehouseConfiguration - This class is used to configure the warehouse
* and build the metadata
* @constructor
*/
var WarehouseConfiguration = Class.create({
socke... | true |
dc46df3d1e06bbd6833c9db85a67619678263ad2 | JavaScript | Michael-Bergeron/React-is-the-answer | /client/components/App.js | UTF-8 | 4,390 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import Gameboard from './Gameboard';
import Response from './Response';
import Scoreboard from './Scoreboard';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
results: [],
currentQuestion: {},
answered... | true |
dade607a7104e68b0d1807a7d87d7b104abfa841 | JavaScript | lcorb/Tempus-Twitch-Bot | /twitch/commands/vid/format.js | UTF-8 | 576 | 3 | 3 | [] | no_license | /**
* Formats map vids into string.
* @param {object} mapObj Map response object
* @return {string} Return string of videos if any
*/
function parseVids(mapObj) {
let vids = [];
if (mapObj.videos['soldier'] || mapObj.videos['demoman']) {
mapObj.videos['soldier'] ? vids.push(`Soldier: youtu.be/` + mapObj.v... | true |
55217cfd638e140f24d1406fe549913e7f2a6160 | JavaScript | varunIIT/Covid-Vaccine-Tracker | /src/routers/stateRoute.js | UTF-8 | 436 | 2.640625 | 3 | [] | no_license | const axios = require('axios')
const stateRoute=require('express').Router()
stateRoute.get('/getStates',async (req,res)=>{
const {data}=await axios.get('https://www.cowin.gov.in/api/v2/admin/location/states')
let statesArray=[]
for(let state of data.states){
statesArray.push(state.state_na... | true |
9df5839ca0184573d11a4905cc2e9c7e3633d984 | JavaScript | badillosoft/node-essentials | /sesion_6/chat-client.js | UTF-8 | 218 | 2.84375 | 3 | [] | no_license | const io = require("socket.io-client");
const socket = io("http://localhost:4000/");
socket.emit("hola", "Hola soy el cliente");
socket.on("respuesta", mensaje => {
console.log("El servidor dice:", mensaje);
}); | true |
2e7aef4939d6ddf530c399baaed1226cbdf378e9 | JavaScript | rahmansadaf46/object-mastering | /new.js | UTF-8 | 653 | 3.796875 | 4 | [] | no_license |
class Person {
constructor(firstName, lastName, salary){
this.firstName = firstName;
this.lastName = lastName;
this.salary = salary;
this.changeBill = function(amount, tips, tax){
// console.log(this);
this.salary = this.salary - amount - tips - tax;
... | true |
931ad150e3f62cac3b5be6a51cb0e3258cadb763 | JavaScript | baopq19/CyberSoft_BaiTapAjax | /js/script.js | UTF-8 | 7,485 | 2.546875 | 3 | [] | no_license | const apiURL = 'http://svcy.myclass.vn/api/QuanLyNhanVienApi'
// Get elements
const inpId = document.querySelector('#inpId');
const inpIdError = document.querySelector('#inpIdError');
const inpName = document.querySelector('#inpName');
const inpNameError = document.querySelector('#inpNameError');
const selPosition = d... | true |
6b8ca9d35d695fd276a3aed1c1238cea1cf96946 | JavaScript | GustavoKratos19/demoday | /app/static/js/p_troca_frase.js | UTF-8 | 389 | 2.796875 | 3 | [] | no_license | $(document).ready(function(){
let frases = ['incrível', 'forte', 'poderosa', 'confiante', 'empoderada', 'resistência' ];
let cont = 0;
$('#troca').text(frases[cont++]);
setInterval(function(){
$('#troca').fadeOut(function(){
if (cont >= frases.length) cont = 0;
$('#t... | true |
9b3ec116de3569082c5db86198616b08a165717b | JavaScript | DanielaRenuncio/case-dp6.io | /js/tagueamento.js | UTF-8 | 1,691 | 2.71875 | 3 | [] | no_license | // Preencha este arquivo com qualquer código que você necessite para realizar a
// coleta, desde a biblioteca analytics.js, gtag.js ou o snippet do Google Tag
// Manager. No último caso, não é necessário implementar a tag <noscript>.
// O ambiente dispõe da jQuery 3.5.1, então caso deseje, poderá utilizá-la
// para fa... | true |
8fc6683112f69560cce9c5974ad08c593d4de16c | JavaScript | Juhye-Kim/Boosting-Study | /윤장원/210713/20.naver1.js | UTF-8 | 339 | 3.703125 | 4 | [] | no_license | function solution(m, k) {
let idx = 0;
let result = '';
for (let i = 0; i < m.length; i++) {
if (m[i] !== k[idx]) result += m[i];
else idx += 1;
}
return result;
}
let m = "kkaxbycyz";
let k = "abc";
let m1 = 'acbbcdc';
let k1 = 'abc';
console.log(solution(m, k)) // "kkxyyz"
console.log(solution... | true |
0310daa9e0728992225e91a59513008febd0af2d | JavaScript | JoaoOliviera/teste-tecnico-chuva | /components/MenuLateral/MenuLateral.js | UTF-8 | 2,212 | 2.515625 | 3 | [] | no_license | import styles from "./styles.module.scss";
import { useState } from "react";
export default function MenuLateral() {
// react: define estado para menu lateral
// estado inicial e apresentacao
const [selectedPage, setSelectedPage] = useState("apresentacao");
return (
<section className={styles.MenuLateral}... | true |
93b74ee49d5b93264384c32ec47594a5c9020bb5 | JavaScript | albanelshani/digital-agency | /js/javascript.js | UTF-8 | 2,038 | 3.15625 | 3 | [] | no_license |
function myFunction() {
var element = document.body;
element.classList.toggle("dark-mode");
}
function verify() {
var pw = document.getElementById("password").value;
var us =document.getElementById("username").value;
var pw2 =document.getElementById("confirmPassword").value;
var na =document.getEle... | true |
ba2b0fa8c03b555815671c039ccdbaba02d1f867 | JavaScript | han1009664882/myCrm | /src/main/webapp/js/data.dic.js | UTF-8 | 2,799 | 2.65625 | 3 | [] | no_license | function searchDataDic() {
$("#dg").datagrid('load', {
"dataDicName" : $("#s_dataDicName").combobox("getValue"),
"dataDicValue" : $("#s_dataDicValue").val()
});
}
function openDataDicAddDialog() {
$("#dlg").dialog("open").dialog("setTitle","添加数据字典信息");
$("#dataDicId").val('');
... | true |
4d63011c211c0a25c5764e2472edac77848c7dc3 | JavaScript | Guro2/yardsalemodel | /src/simulation.js | UTF-8 | 2,898 | 3.25 | 3 | [
"MIT"
] | permissive | class Agent {
constructor(name, wealth) {
this.name = name;
this.wealth = wealth;
}
trade(agent, rewardRate, penaltyRate) {
let richPerson = this;
let poorPerson = agent;
if (this.wealth < agent.wealth) {
richPerson = agent;
poorPerson = this;
}
cons... | true |
4539f382e8615dd6ccb6e2caaba0aef1d12f6f16 | JavaScript | katthartic/game-of-life-deux | /gameOfLife.js | UTF-8 | 1,913 | 3.90625 | 4 | [] | no_license | /* eslint-disable no-trailing-spaces */
/* eslint-disable no-warning-comments */
class GameOfLife {
constructor(width, height) {
this.width = width;
this.height = height;
this.board = this.makeBoard();
}
makeBoard() {
let boardWidth = new Array(this.width).fill(0)
let finalBo... | true |
91269d60cb988dcbd86839c4e76b7c3dcb78e1a5 | JavaScript | peterfarsinsen/PellMon | /src/Pellmonweb/media/js/logview.js | UTF-8 | 189 | 2.578125 | 3 | [] | no_license | function getLog() {
var container = $('#lines');
$.get(
'/logview/getlines?linenum='+container.data('lines'),
function(data) {
container.append(data)
}
);
}
getLog(); | true |
c6031ff3f04621d52c6c509e25e713466dd223b5 | JavaScript | LawrenceArcher/javascript-exercises | /repeatString/repeatString.js | UTF-8 | 231 | 3 | 3 | [] | no_license | var repeatString = function(str, num) {
var returnStr = "";
if (num <0 || num == NaN){
return "ERROR";
}else{
for (var i = 0; i < num; i++){
returnStr += str;
}
return returnStr;
}
}
module.exports = repeatString
| true |
d59171a6b125c3ec6e942e44f1532456cb67f8e7 | JavaScript | cristicismas/resume-architect | /client/src/utils/api.js | UTF-8 | 766 | 2.640625 | 3 | [] | no_license | export const apiCall = async (method, path, data) => {
const token = localStorage.getItem('token');
return fetch(`${process.env.REACT_APP_API_URL}/${path}`, {
method,
headers: {
Authorization: token
},
body: data ? JSON.stringify(data) : null
})
.then(res => {
if (!res.ok) {
... | true |
0ed548636b9f078fe4ec7296500bacd1a3d4f49a | JavaScript | karatayev/nosql-project | /favs.js | UTF-8 | 1,989 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env node
/** @module favs */
'use strict';
const config = require('./config');
const sqlite3 = require('sqlite3').verbose();
/** database connection */
const db = new sqlite3.Database(config.DATABASE_FAVORITES, sqlite3.OPEN_READWRITE, (err) => {
if (err) {
console.error(err.message);
}
});
... | true |
0948d8c62dc78a5993e1775db3af0d041862f17b | JavaScript | Sierra93/Sky | /Sky/wwwroot/js/Footer.js | UTF-8 | 1,349 | 2.53125 | 3 | [] | no_license | "use strict";
var footer = new Vue({
el: "#footer",
data: {
},
methods: {
// Функция отправляет заявку.
onSend() {
let sName = $("#id-client-name").val();
let sContact = $("#id-contact").val();
let sArea = $("#id-area").val();
if (!sName || !sContact || !sArea) {
$('#id-send-modal').modal('t... | true |
cf6e17314b05da0353a1e63c0713fa45ec57df5a | JavaScript | curtiscyoung/assignments | /exercise/stuttering.js/stuttering.js | UTF-8 | 663 | 4.4375 | 4 | [] | no_license | //write a for loop that loops through a string (ex: "code") and gives back one letter incrementally after another and returns a new string.
//if we were to enter in "code", then the new string would be "ccocodcode", which is giving back "c", then "co", then "cod", and "code", and puts them all in the same string.
fu... | true |
a6d7e00ab8214a040c8d931c275d970d3cf57712 | JavaScript | remotebox/collaborate | /events_register/js/unbooked_toggle.js | UTF-8 | 583 | 2.53125 | 3 | [] | no_license | /**
* @file
* Contains js for the accordion example.
*/
(function ($) {
'use strict';
$(function () {
$('#showAvailable').on('click', function () {
let text = $('#showAvailable').html();
if (text === "Show available tutorials <span class='badge badge-aso-accent text-dark'>beta</span>") {
... | true |
1d2c91d453e8fdd1b1a915bec62ab244945c3c87 | JavaScript | SomyaRanjan588/HolidayPage | /src/pages/Gifapp2.js | UTF-8 | 1,427 | 2.75 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import axios from "axios";
import "../App.css";
import Card from "@material-ui/core/Card";
import CardMedia from "@material-ui/core/CardMedia";
import Button from "@material-ui/core/Button";
const API_KEY = "QPAHG63SJOS656c9KZzABkYCyThyA5Qw";
const Random = () => {... | true |
ca89ba1fe6c96e553995b0ba48354b13678083ef | JavaScript | future4code/Jacqueline-Canavarro | /semana2/funcoes-de-array/index.js | UTF-8 | 4,929 | 4.09375 | 4 | [] | no_license | // EXERCÍCIOS DE INTERPRETAÇÃO DE CÓDIGO
// 1) Leia o código abaixo:
// const usuarios = [
// { nome: "Amanda Rangel", apelido: "Mandi" },
// { nome: "Laís Petra", apelido: "Laura" },
// { nome: "Letícia Chijo", apelido: "Chijo" }
// ]
// const novoArrayA = usuarios.map((item, index, array) => {
//... | true |
839ce9cfa1a06c7d3c413db777191fce9e98172b | JavaScript | kitkat119/prime-my-past | /spec/printerSpec.js | UTF-8 | 673 | 3.046875 | 3 | [] | no_license | const Printer = require('../src/printer').Printer;
describe('Printer', function() {
var printer;
EXAMPLE_DATA = [[" ", 2, 3, 5, 7],
[2, 4, 6, 10, 14],
[3, 6, 9, 15, 21],
[5, 10, 15, 25, 35],
[7, 14, 21, 35, 49]]
beforeEach(function() {
... | true |
c49977471b6fcca099280bb3b43a0053eb992f5d | JavaScript | avnishsingh516/COVID-19-TRACKER | /src/util.js | UTF-8 | 2,080 | 2.6875 | 3 | [] | no_license | import React from "react";
import { Circle, Popup } from "react-leaflet";
import numeral from "numeral";
import { tooltip } from "leaflet";
export const sortData = (data) => {
const sortedData = [...data];
return sortedData.sort((a, b) => (a.cases > b.cases ? -1 : 1));
};
const caseTypeColors = {
cases: {
... | true |
85c5f25d35dceb01f51430eb9d7173f7e3704cae | JavaScript | evbogdanov/programming-skills-test | /009_password_checker/pass_check.js | UTF-8 | 539 | 3.078125 | 3 | [] | no_license | const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
})
const
N_ABC = 4,
N_123 = 2
const isValid = password => {
const matchABC = password.match(/[a-zA-Z]/g)
if (matchABC === null || matchABC.length < N_ABC) {
return fa... | true |
654bb374252ef887312e49c0eff589d924c8cea6 | JavaScript | vasekstebra/pb138-salary-statistics | /SalaryStatistics/SalaryStatistics-web/src/main/webapp/js/sectorServlet.js | UTF-8 | 5,068 | 3.109375 | 3 | [
"MIT"
] | permissive | var makeSet = function (data, property) {
var set = [];
for (var index in data) {
var entry = data[index];
set[entry[property]] = true;
}
var result = [];
for (var item in set) {
result.push(item);
}
return result;
};
var getSectorName = function (data, code) {
f... | true |
ebd6d2a222d4ef85c8b8f15536d1281e41b5fa91 | JavaScript | kmarman/put_book_in_self | /Book Self/script.js | UTF-8 | 1,315 | 3.21875 | 3 | [] | no_license |
let div = document.querySelector('div')
let heading = document.querySelector('h1');
let form = document.querySelector('form');
let nam = document.querySelector('#name');
let author = document.querySelector('#author');
let isbn = document.querySelector('#isbn');
let pub = document.querySelector('#pub');
let b... | true |
030a961d738314ad71ae4c5e5bd075688489e17b | JavaScript | maronean/MathWriter | /index.js | UTF-8 | 2,216 | 2.65625 | 3 | [] | no_license | let path = require('path');
let express = require('express');
let app = express();
let http = require('http').Server(app);
let io = require('socket.io')(http);
let request = require('request');
let dir = path.join(__dirname, 'public');
let MYSCRIPT_REST_ENDPOINT = 'https://cloud.myscript.com/api/v3.0/recogniti... | true |
31c2263b1032714e4a7555a51f64089f99dea886 | JavaScript | mikecabz/testnodejsdocker | /server.js | UTF-8 | 627 | 2.71875 | 3 | [] | no_license | const express = require('express')
const app = express()
const port = 5000
app.get('/info', (req, res) => {
console.log({ message: "log info" });
res.send('console.log!')
})
app.get('/warning', (req, res) => {
console.warn({ message: "log warning" });
res.send('console.warn!')
})
app.get('/error', (... | true |
7de40dacab59b2ebb0a84b2581f9528b3bfc9a68 | JavaScript | nithinmohantk/node-api-boilerplate | /src/library/crypto.js | UTF-8 | 806 | 2.515625 | 3 | [
"MIT"
] | permissive | import crypto, { pbkdf2Sync } from 'crypto';
const digest = 'sha512';
const iterations = 2048;
const keyLength = 32;
export default {
hash: async (password) => {
try {
const salt = crypto.randomBytes(16).toString('hex');
const hash = pbkdf2Sync(password, salt, iterations, keyLength, digest).toString... | true |
27fa6862491a7bb623909a6767f4c3e3e0fef882 | JavaScript | chrisschnaars/learning-p5js | /022-clock-4/js/sketch.js | UTF-8 | 2,114 | 3.828125 | 4 | [] | no_license | // 022: CLOCK TAKE 3
// three hands that turn on independent axis
var s; // second
var m; // minute
var h; // hour
var hh; // special hour normalizer
var hHand; // calclation for the minute hand
var mHand; // calculation for the minute hand
var sX; // calcualtiona for the second hand x position
var sY; // calculatio... | true |
5ac41781f8c11d6b5b9d292cd8846849fc826574 | JavaScript | jksjaz/Newzo | /src/api/api.js | UTF-8 | 351 | 2.84375 | 3 | [] | no_license | const apiKey = "ActOaOqPGflOkxwSdRPt6r2x9s1ohfCA"
const movieURL = "https://api.nytimes.com/svc/movies/v2/reviews/search.json?query="
export const fetchData = async (query) => {
try {
const res = await fetch(movieURL + query + "&api-key=" + apiKey)
const data = await res.json()
return dat... | true |
4a6923e0151426d126567b1dde5f16e084359d90 | JavaScript | adinfinit/diy-visuals | /04_interactions/04_collision.js | UTF-8 | 5,081 | 2.984375 | 3 | [
"Unlicense"
] | permissive | "use strict";
const canvas = document.getElementById("canvas");
/** @type {CanvasRenderingContext2D} */
const context = canvas.getContext("2d");
// set canvas size to the correct size
let screen = V(0, 0);
function onresize() {
screen.x = window.innerWidth;
screen.y = window.innerHeight;
canvas.width = ... | true |
445a7916c6e1731540181d2b7a9b82afa92f1007 | JavaScript | DownStatic/hogwarts-nyc-web-082718 | /src/components/Index.js | UTF-8 | 608 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import Tile from './Tile.js'
export default class Index extends Component {
constructor(props){
super(props)
}
getImagePrefix = (name) => {
let splitname = name.split(" ")
return splitname.map(word =>{return word.toLowerCase()}).join("_")
}
renderHogs =... | true |
c8c84a644d4de688970210611c7f64de38eb5f08 | JavaScript | spooks7er/TelerikAcademy | /06. JavaScript/TestJS/square/test2.js | UTF-8 | 841 | 3.703125 | 4 | [] | no_license | Function.prototype.extend = function(parent) {
var child = this;
child.prototype = parent;
child.prototype = new child(Array.prototype.slice.call(1, arguments));
child.prototype.constructor = child;
}
var Animal = {
name: 'noname',
// speak: function(food) {
// return 'I would like to e... | true |
139caf6ca27df6272e3ccf111841794dd88f5b4d | JavaScript | MrTi/SimpleAPI | /admin/js/simple-api-admin.js | UTF-8 | 742 | 2.578125 | 3 | [] | no_license | (function($) {
console.log('script inited ');
function uniquekey(length) {
if (!length) {
length = 32;
}
var key = '';
do {
key += Math.random().toString(36).substr(2, length);
} while (key.length < length);
return key.substr(0, lengt... | true |
362220e8610aec70102b5678be4e7c006cb377c2 | JavaScript | LucasAugustoBarros/treinamento | /tests/support/util/helpers/geral/geraCnh.js | UTF-8 | 2,932 | 3.0625 | 3 | [] | no_license | /**
* Arquivo: geraCnh.ts
* Data: 30/10/2018
* Author: Fernanda Ferreira
*/
const fs = require('fs');
let path = require('path');
let cnhGravado, data, toFile, stringFile;
class GeraCnh {
// Valida número da CNH gerado
IsValid(cnh) {
if (cnh == null || cnh.length != 11)
return false;
... | true |
4851d0686b854c4948fb4bcf9d660c0ffe8b2689 | JavaScript | westantenna/code | /2016oc/meme/sketch.js | UTF-8 | 1,517 | 2.84375 | 3 | [] | no_license | var data;
var blinkStrength=[];
var cadence=[];
var numBlinks=[];
var pitchAvg=[];
var sleepy=[];
var capturedAt=[];
var sittingPostureIndex=[];
var dataRowCount;
function preload(){
data=loadTable("001_ST_.csv");
}
function setup(){
createCanvas(144,1080);
frameRate(24);
colorMode(HSB, 360, 100, 100, 100)... | true |
eb0459093c737a9155461a5efa15de5cc45de710 | JavaScript | darvelo/6to5 | /test/fixtures/transformation/generators/for-of/exec.js | UTF-8 | 297 | 3.171875 | 3 | [
"MIT"
] | permissive | function *range(max, step) {
var count = 0;
step = step || 1;
for (var i = 0; i < max; i += step) {
count++;
yield i;
}
return count;
}
var gen = range(20, 3);
var values = [];
for (var value of gen) {
values.push(value);
}
assert.deepEqual(values, [0, 3, 6, 9, 12, 15, 18]);
| true |
5e9174930fd1a4642a47f7976ac56c77dde4a9b0 | JavaScript | maheshsabnis/reactjsfresh | /src/routingdemo/ContactComponent.jsx | UTF-8 | 485 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
class ContactComponent extends Component {
constructor(props) {
super(props);
this.state = {
message:'This is a Contact Component'
};
}
render() {
return (
<div className="container">
<h1>The... | true |
53f181edd4951c97a1680b5c10d159c933c4bd39 | JavaScript | Sense-Studios/VirtualMixerProject | /public/javascripts/src/addons/BPM.js | UTF-8 | 5,855 | 2.53125 | 3 | [
"MIT"
] | permissive | BPM.prototype = new Addon(); // assign prototype to marqer
BPM.constructor = BPM; // re-assign constructor
/**
* @summary
* BPM calculates beat per minutes based on a 'tap' function
* Tapped BPM Example on codepen:
* <a href="https://codepen.io/xangadix/pen/drqzPr" target="_blank">codepen</a>
*
* @descrip... | true |
b91da51c13f94e98b4636d4371605997a6311616 | JavaScript | byteshiva/es6-tuts | /functionalprogramming/day81/funcday81/index.js | UTF-8 | 362 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | const R = require('ramda');
function Rectangle(width, height) {
this.width = width;
this.height = height;
}
Rectangle.prototype.area = function() {
return this.width * this.height;
};
const square = new Rectangle(2, 2);
const hasin1 = R.hasIn('width', square); //=> true
const hasin2 = R.hasIn('area', square); ... | true |
f8a7b7f68bc471cf1a55e3a1df47cf32d0d1f970 | JavaScript | ESW1234/bom-shadow-dom-workshop | /calendar/index.js | UTF-8 | 1,405 | 3.1875 | 3 | [] | no_license | let monthDictionary = [
'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
class Calendar extends HTMLElement {
constructor(){
super();
let template = document.getElementById(`CalendarTemplate`);
let shadowRoot = th... | true |
2142f33ac0c0189cbfcd11f5eedf9543b537270d | JavaScript | Comfuner/dev | /styleg/js/modules/grid.js | UTF-8 | 22,607 | 2.734375 | 3 | [] | no_license |
(function() {
"use strict";
var modulesManager = (function md() {
var modules = {};
function get(moduleName, params) {
if (modules[moduleName]) {
return modules[moduleName].apply(null, params);
}
else {
console.error(module... | true |
905b3cdf654c145de4c2e623c6f4a68db1a1d882 | JavaScript | Dragomirc/Udemy | /CJSWDR/robofriends/src/redux/actions/get-robots.js | UTF-8 | 682 | 2.515625 | 3 | [] | no_license | import fetch from "fetch-retry";
import { ROBOTS } from "../constants";
export const requestData = () => ({
type: ROBOTS.GET_ROBOTS_REQUEST,
payload: true
});
export const requestDataSuccess = data => ({
type: ROBOTS.GET_ROBOTS_SUCCESS,
payload: data
});
export const requestDataError = errorMsg => ({
type:... | true |
108119a5419107affffef22137cbe5b25fff5004 | JavaScript | abyll/Pokemon-Showdown | /loginserver.js | UTF-8 | 6,288 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* Login server abstraction layer
* Pokemon Showdown - http://pokemonshowdown.com/
*
* This file handles communicating with the login server.
*
* @license MIT license
*/
'use strict';
const LOGIN_SERVER_TIMEOUT = 30000;
const LOGIN_SERVER_BATCH_TIME = 1000;
const http = require("https");
const url = requir... | true |
4ae811f8a4566049f322d67c69f8b528cfff4bcc | JavaScript | grovesNL/WHLSL | /Scripts/generate.mjs | UTF-8 | 2,239 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | import { log, commandLineArgs, getFileContents, exitProcess } from "../Source/misc/Helpers.mjs";
import { prepare } from "../Source/Prepare.mjs";
import { programToMSL } from "../Source/metal/MSL.mjs";
import { programToJSON } from "../Source/json/JSON.mjs";
import { programDescriptionToSPIRVAssembly, programObjectToSP... | true |
9d3875dcdf4a460140dc0e2f2bf84f67c11659f2 | JavaScript | MohammadMitwaly/js-perceptron | /Multi-Layer Perceptron/sketch.js | UTF-8 | 289 | 3.265625 | 3 | [] | no_license | const neuralNetwork = new NeuralNetwork(2, 2, 2);
const inputs = [1, 0];
function setup() {
createCanvas(400, 400);
// const output = neuralNetwork.feedForward(inputs);
// console.log(output);
neuralNetwork.backpropagation(inputs, [1, 0]);
}
function draw() {
background(0);
}
| true |
280587ea6a08ae91fb83bfb22feca8164cfc5b73 | JavaScript | sjaafar32/to-do-list | /src/priority.js | UTF-8 | 1,301 | 2.8125 | 3 | [] | no_license | import _ from 'lodash';
import sheet from './style.css';
const lowPriority = document.getElementById('low-priority');
const mediumPriority = document.getElementById('medium-priority');
const highPriority = document.getElementById('high-priority');
const priority = () => {
const projectPriority = document.createEl... | true |
c28443ff67ac56793682003708a90c7d275a00dc | JavaScript | belashjack/From_private_repo | /code-jam4-scoreboard/js/index.js | UTF-8 | 10,423 | 2.890625 | 3 | [] | no_license | const getSessionsData = fetch('https://raw.githubusercontent.com/belashjack/Code-jam4-scoreboard/master/sessions.json')
.then((response) => {
return response.json();
});
const getUsersData = fetch('https://raw.githubusercontent.com/belashjack/Code-jam4-scoreboard/master/users.json')
.then((response... | true |
689470952e45f69c913c244db647a5c0c51b772f | JavaScript | mandy6720/guild-app | /public/app/filters/orderby.filter.js | UTF-8 | 559 | 2.71875 | 3 | [] | no_license | (function() {
'use strict';
angular
.module('guildApp')
.filter('orderObjBy', orderObjBy);
/** @ngInject */
function orderObjBy() {
return function(input, attribute) {
if (!angular.isObject(input)) return input;
var array = [];
for(var objectKey in input) {
array.pu... | true |
0e62bda603923bed9eb527e101cb675462b3cb7a | JavaScript | kevinbai0/Bamboo-Studios | /src/utils/useMobileListener.js | UTF-8 | 706 | 2.515625 | 3 | [
"MIT"
] | permissive | import { useEffect, useState } from "react";
import * as theme from "./theme";
export default function useMobileListener() {
const [ isMobile, setIsMobile ] = useState(true);
useEffect(() => {
if (window.innerWidth >= theme.mobileSwitchWidth) setIsMobile(false);
}, [])
const resizeListener = ... | true |
33efd21243b02b2cb7b725dceb118656d77122c1 | JavaScript | ShyamKuga/Monkey-Game | /sketch.js | UTF-8 | 1,953 | 2.609375 | 3 | [] | no_license | var bananaImage,obstacleImage,obstaclegroup,background2,background1,score,monkey,monkeyImg,gameState,PLAY = 0,END = 1,ivisibleGround, bananaGroup;
function preload(){
obstacleImage = loadImage("stone.png")
bananaImage = loadImage("banana.png")
background1 = loadImage("jungle.jpg")
monkeyImg = loadImage("Monkey_01.pn... | true |
8cad96e71a7a00edb20aa730d5a61053e792425f | JavaScript | irosvall/1dv026-a2-the-gathering-web-scraper | /src/app.js | UTF-8 | 531 | 3.140625 | 3 | [] | no_license | /**
* The starting point of the application.
*
* @author Ida Rosvall <ir222gn@student.lnu.se
* @version 1.0.0
*/
import { Application } from './application.js'
/**
* The main function of the application.
*/
const main = async () => {
try {
// Parse the command-line (skip the first two argum... | true |
9f726a0da5830afdc61e16d3141baeecc55a3874 | JavaScript | alexiaruizq/simpsons-frontend | /app.js | UTF-8 | 1,068 | 3.234375 | 3 | [] | no_license | const FirstName = document.getElementById('firstname');
const SecondName = document.getElementById('secondname');
const LastName = document.getElementById('lastname');
const Age = document.getElementById('age');
const Description = document.getElementById('description');
const Photo = document.getElementById('photo');
... | true |
cdf005870ecf97f185f1e714c7c890cc2d45b5ce | JavaScript | Jbtyson/Pokemon-Purple | /front_end/statemachine.js | UTF-8 | 7,327 | 2.578125 | 3 | [] | no_license | function handleState(machine) {
machine.state.loop(machine);
}
function transition(machine, newstate) {
machine.state.exit(machine);
machine.state = newstate;
newstate.enter(machine);
handleState(machine);
}
function AuthState(gui) {
this.wait = new Text(gui, 400, 80);
this.wait.setText("Please Login fi... | true |
aaa850cf29618070c8f7038084b0485a4b783461 | JavaScript | lucymenefee/lucymenefee.github.io | /p5js/sketch3/sketch.js | UTF-8 | 268 | 3.0625 | 3 | [] | no_license | function setup() {
createCanvas(600, 600);
}
function draw() {
background(150);
for (var y = 0; y <= height; y += 50) {
for (var x = 0; x <= width; x += 50) {
fill(300, 300, 300);
circle(x, y, 30);
fill(255, 0, 0);
line(x, y, 300, 300)
}
}
} | true |
175043c22a1752e4e472f5517dec8388614556c3 | JavaScript | GreenImp/phonegap-file-service | /fileService.js | UTF-8 | 29,202 | 2.625 | 3 | [
"MIT"
] | permissive | /**
* Handles file transfers
*/
// TODO - check up-to-date documentation. It looks like we're using out-dated code - https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md
angular.module('greenimp.services', []).service('fileService', ['CordovaService', 'deviceService', '$log', '$q', function(CordovaS... | true |
ac1cbcc67db00514ed1833498f882530ddab6c8b | JavaScript | yuzilyu/Lab9 | /index.js | UTF-8 | 3,652 | 2.859375 | 3 | [] | no_license | class LabError extends Error {
constructor(message) {
super(message);
this.name = "LabError";
}
}
window.TrackJS && TrackJS.install({
token: "49093eaae19c4880bde0b89df60d03de"
// for more configuration options, see https://docs.trackjs.com
});
let calculateBtn = document.getElementByI... | true |
21a30f78d208ee47d30233bc1cce0795505d16d1 | JavaScript | jdavidferreira/notes-api | /src/controller/note.js | UTF-8 | 1,260 | 2.53125 | 3 | [] | no_license | const mongoose = require('mongoose')
const Note = mongoose.model('Note')
exports.findAll = async (_req, res) => {
try {
let notes = await Note.find({ user: res.locals.userId})
res.json(notes)
} catch (e) {
res.status(400).send(e)
}
}
exports.findById = async (req, res) => {
try {
let note = a... | true |
cb590c9f24d49bd125d39a6d586b74b2dd35a09a | JavaScript | NylonDiamond/bootprac | /questionmarks-server/src/UI/mainObjectsExample.js | UTF-8 | 1,182 | 3.453125 | 3 | [] | no_license | const app = new Vue({
el: "#app",
data: {//object full of objects example
Jesse:{
firstName: "jesse",
lastName: "skelton",
age: 27
},
Bobby: {
firstName: "bobby",
lastName: "shelly",
age: 43
}
},
compute... | true |
fe7e3360b17a76da23c952f52a6128b8f31db8a1 | JavaScript | shubhamgarg21156/ease-buy | /controllers/authController.js | UTF-8 | 3,053 | 2.671875 | 3 | [] | no_license | const User = require('../models/User');
const Cart = require('../models/Cart');
const Wishlist = require('../models/Wishlist');
const passport = require('../config/passport-local-strategy');
const authMailer = require('../mailers/auth_mailer');
// Funciton to create Creating random String to verify email //
const rand... | true |
721a3098886d222b53196285eb5646a5b0c499f5 | JavaScript | lpedavis/aula-bootstrap | /js/main.js | UTF-8 | 645 | 3.140625 | 3 | [] | no_license | const cep = document.querySelector("#cep")
const MostreData = (result)=>{
for(const campo in result ){
if(document.querySelector("#"+campo)){
document.querySelector("#"+campo).value = result[campo]
}
}
}
cep.addEventListener("blur", (e)=>{
let pesquisa = cep.value.replace("-",... | true |
7f9e66467e3927e39ba44d10c07e5a08d6019ab5 | JavaScript | arjunkesava/be-honest | /client/src/helpers/random.js | UTF-8 | 309 | 3.125 | 3 | [] | no_license | const generateRandom = (charLength = 9) => {
// Math.random should be unique because of its seeding algorithm.
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
// after the decimal.
return Math.random().toString(36).substr(2,charLength);
}
export default generateRandom;
| true |
80ce23d75ed820687e3b7e1f0dbcf64208b5ac22 | JavaScript | KunalMoharkar/newscolletor | /src/Contents.js | UTF-8 | 1,487 | 2.734375 | 3 | [] | no_license | import React from 'react'
class Contents extends React.Component {
constructor(props) {
super(props)
this.state={
country: this.props.country,
isLoaded : false,
items :[]
}
}
componentDidUpdate(prevProps){
if(prevProps.country !== this.props.country){
this... | true |
8b298e571ce5db199d9ba29831672bb383e90818 | JavaScript | sovanny/tele2-test | /src/components/Searchbar.js | UTF-8 | 3,152 | 2.546875 | 3 | [] | no_license | import React, { useRef, useCallback, useState, useEffect } from 'react';
import { debounceEvent, apiReq } from '../utils';
const Searchbar = ({ setResults }) => {
const formRef = useRef(null);
const [suggestions, setSuggestions] = useState([]);
const [selected, setSelected] = useState(-1);
const [suggestionSea... | true |
11ac2de79fd521732585ec0f0410b8a2d08337f6 | JavaScript | BruceWeng/Leetcode-JavaScript | /269. Alien Dictionary.js | UTF-8 | 3,549 | 4.15625 | 4 | [] | no_license | /**
There is a new alien language which uses the latin alphabet.
However, the order among letters are unknown to you. You receive a list of non-empty words
from the dictionary, where words are sorted lexicographically by the rules of this new language.
Derive the order of letters in this language.
Note:
You may as... | true |
4aa45d284985235e4456aee32903af51dc1a0b3b | JavaScript | lausmma2/PlanAppReact | /src/actions/securityActions.js | UTF-8 | 1,629 | 2.546875 | 3 | [] | no_license | import axios from "axios";
import { GET_ERRORS, SET_CURRENT_USER } from "./types";
import SetJWTToken from "../securityUtils/SetJWTToken";
import jwt_decode from "jwt-decode";
import { getUsersInfo } from './userActions';
import { getTripGroups } from './tripGroupActions';
//creates new user and send user to /confirma... | true |
e4c7d75216d2991e9c67504b734956b09a3ab07a | JavaScript | wcollins71/Work-Day-Scheduler | /Assets/script.js | UTF-8 | 2,360 | 3.625 | 4 | [] | no_license |
function addScheduleRow(times) {
// create a row
const row = $("<div>");
row.attr("class", "row");
// add first column element, hourly blocks, in "9am" format
const timeCol = $("<a>");
timeCol.attr("class", "col-sm-2 time-block hour");
const timeToDisplay = moment(times, "ha");
const t... | true |
a84e3722067157c57066597546438b9c66a22d99 | JavaScript | isiti/puntoUpaq | /upaq/upaqv3/cms/js/functions.js | UTF-8 | 23,172 | 2.71875 | 3 | [] | no_license | 'use strict'
// carga del doc.
$(document).ready(function () {
// Invocamos funciones.
sideBar(); // cambia icono en la barra lateral.
if(document.querySelector('#isDow').value =='dow' ){
changeSection('pedidos-dow');// muesto el inicio al ingresar al cms como user dow.
}else{
... | true |
73b8233e1c3459145b84affba3dd51e39e2573a7 | JavaScript | bryanSolares/CURSO-ANGULAR-AVANZADO | /Proyectos/03-backend-server/src/controllers/busquedas.controller.js | UTF-8 | 1,584 | 2.5625 | 3 | [] | no_license | const { response } = require("express");
const Usuario = require("../models/usuario.model");
const Hospital = require("../models/hospital.model");
const Medico = require("../models/medico.model");
const getTodo = async (req, res = response) => {
const busqueda = req.params.busqueda;
const regex = new RegExp(busque... | true |
2bc976f6fdfd63fa097a09c7f9b08ed91367ab49 | JavaScript | CamposBG/Portfolio_Page | /script.js | UTF-8 | 923 | 3.484375 | 3 | [] | no_license | // I created a custon attribute called data-mode in the htm to use it to change the theme
let theme = localStorage.getItem("theme");
if(!theme){
setTheme("light")
} else{
setTheme(theme)
}
let themeDots = document.getElementsByClassName("theme-dot")
for (let index = 0; index < themeDots.length; index++) {
... | true |
87cfac0b1dba78a42ffca94d4115611472fd066e | JavaScript | seanm329/actor-headshot | /js/photoGallery.js | UTF-8 | 935 | 2.703125 | 3 | [
"MIT"
] | permissive | function filterDataTitleByTagAttribute(id, tag, attr) {
var input, filter, collection, i, element;
input = document.getElementById(id);
filter = input.value.toUpperCase();
collection = document.getElementsByTagName(tag);
for (i = 0; i < collection.length; i++) {
element = collection[i];
if (element.ge... | true |
b7371683f1254ba8a51f699abe147f178133709b | JavaScript | AdePrieelle/react-shopping-cart | /src/App.js | UTF-8 | 3,378 | 2.78125 | 3 | [] | no_license | import React, { useState } from 'react';
import './styles/App.scss';
import Navbar from './components/Navbar';
import { Switch, Route } from 'react-router-dom';
import Home from './components/Home';
import Shop from './components/Shop';
import Cart from './components/Cart';
function App() {
const [order, setOrder] = ... | true |
5b82f14d92a0982e36e06e57f0f6edcfc4e545f7 | JavaScript | ravneetKaur2159/Algorithms | /Arrays/04.js | UTF-8 | 542 | 3.9375 | 4 | [] | no_license | // Maximum subarray Sum
let maximumSum = null;
const givenArray = [2, 4, 5, 0, -1];
maximumSubarrySum = (arr, startIndex, endIndex, max) => {
if(startIndex == endIndex){
return arr[startIndex];
}
let element1 = maximumSubarrySum(arr, startIndex, endIndex-1, max);
let element2 = maximumSubarryS... | true |
f5a94c25d9d3195e1994c25c829fa66cb3e8e7f3 | JavaScript | ing-bank/lion | /packages/ui/components/calendar/src/utils/createMultipleMonth.js | UTF-8 | 911 | 3.03125 | 3 | [
"MIT"
] | permissive | import { createMonth } from './createMonth.js';
/**
*
* @param {Date} date
* @return {{months: import('../../types/day.js').Month[]}}
*/
export function createMultipleMonth(
date,
{ firstDayOfWeek = 0, pastMonths = 0, futureMonths = 0 } = {},
) {
const multipleMonths = {
/** @type {{weeks: {days: import(... | true |
b8f4f5b451759bb9b2b2f123430912fa67d6ea8a | JavaScript | future4code/Elber-Sousa | /semana7/Labefy/src/components/lista.js | UTF-8 | 1,341 | 2.671875 | 3 | [] | no_license | import React from "react";
import axios from "axios";
import { axiosConfig, baseUrl } from "../parameters";
export default class ListaPlaylistPage extends React.Component {
state = {
playlists: []
};
componentDidMount() {
this.getAllPlaylists();
}
getAllPlaylists = async () => {
try {
con... | true |
69c20ad12e2d005aea5456950fcb8acc29a40231 | JavaScript | rbenites/TriviaGame | /assets/javascript/app.js | UTF-8 | 4,512 | 3.125 | 3 | [] | no_license | /*jshint esversion: 6 */
window.onload = function () {
var questions = [
{
question: "Who directed the Star Wars movies?",
guesses: ["Jules Verne", "JK Rowling", "Wally Russ", "George Lucas"],
answer: 3
},
{
question: "What species is Count Do... | true |
fe8e063e9d5fdb29af2717850221b2eacbc3622e | JavaScript | SaraJuarez/modulo-2-evaluacion-final-SaraJuarez | /_src/assets/js/main.js | UTF-8 | 6,277 | 3.328125 | 3 | [
"MIT"
] | permissive | "use strict";
const button = document.querySelector(".js-button");
const input = document.querySelector(".js-input");
const searchContainer = document.querySelector(".js-container-main");
const favMoviesContainer = document.querySelector(".js-fav-films-container");
const resetButton = document.querySelector(".js-reset... | true |
a8cfb4b44d789d433ccefc3a5be1159818b03e2d | JavaScript | bhaveshbs789/github-battle | /app/components/Popular.js | UTF-8 | 3,046 | 2.578125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import {fetchPopularRepos} from '../utils/api';
import Loading from './Loading';
function SelectLanguage({selectedLanguage,onSelect}){
var languages = ['All','JavaScript','Ruby','Java','CSS','Python'];
return (
<ul className='languages'>
... | true |
4d6f22e54c479c290170cc75d282950b1ad30589 | JavaScript | imskrishnan/fieldbuilder-react | /src/index.js | UTF-8 | 256 | 2.578125 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
import App from "./components/App";
ReactDOM.render(<App />, document.getElementById("root"));
// let myArr = { 1: "Santhosh", 2: "Krishnan" };
// myArr[1] = "Santhosh";
// console.log(myArr);
| true |
3e136d03246e3575e0a39970685d9a5d874b21f3 | JavaScript | lhanlhanlhan/visual-dm | /front/src/pages/fetchlocal.js | UTF-8 | 568 | 2.59375 | 3 | [] | no_license | import axios from 'axios';
// 获取地图资讯
let fetchOnline = function(operation, callback, errHandle) {
var url = "http://localhost:35010/" + operation;
// 发送请求:将数据返回到一个回到函数中
// 并且响应成功以后会执行then方法中的回调函数
axios
.get(url)
.then(function(result) {
// result是所有的返回回来的数据
// 包括了响应报文行
// 响应报文头
// 响应报文体
... | true |
3844655abeef1a1413e49237af164d76662bd120 | JavaScript | CosmicDNA/cli | /src/Wallet/create.js | UTF-8 | 1,327 | 2.71875 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const rls = require('readline-sync');
const { Wallet } = require('@ethereum-alarm-clock/timenode-core');
const { Util } = require('@ethereum-alarm-clock/lib');
const create = (program) => {
// Create web3
const web3 = Util.getWeb3FromProviderUrl(program.providers[0]);
let numberOfAccou... | true |
da675ef3feb21f63dd90cf5a8945097ec4cefcc6 | JavaScript | sethukumar0001/Algorithms-Javascript- | /pyramids.js | UTF-8 | 2,523 | 4.21875 | 4 | [] | no_license | //javascript looping pyramid
// 1234
// 1234
// 1234
// 1234
function Pyramid1() {
let rows = 5;
let cols = 5;
let output = "";
for (var i = 1; i < rows; i++) {
for (var j = 1; j < cols; j++) {
// output += j + '';
output = output + j + " ";
}
console.log(output);
output = "";
}... | true |
73971b524767a16c37640f54b4a4dd21aa98710e | JavaScript | GeoStefan/BlockchainMarketplace | /interface/src/pages/actors/ActorsPage.jsx | UTF-8 | 1,859 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from 'react';
import { getActors } from '../../components/ethereum/ethreum';
import './actors.css';
const ActorsPage = (props) => {
let [freelancers, setFreelancers] = useState([]);
let [evaluators, setEvaluators] = useState([]);
useEffect(() => {
async functi... | true |
37c293a69a9100e38efc8a0ee426d09bcfd8adc0 | JavaScript | Kazunori-Kimura/images2pptx | /lib/index.js | UTF-8 | 2,081 | 2.609375 | 3 | [] | no_license | // index.js
var fs = require('fs');
var path = require('path');
var officegen = require('officegen');
// PowerPoint
var pptx = officegen({
'type': 'pptx',
'onend': function(written) {
console.log('Finish to create a PowerPoint file.\nTotal bytes created: ' + written + '\n');
},
'oner... | true |
008520b4971a68f92dd8c7d4576e21c576511e41 | JavaScript | BlueInkAlchemist/bubble_shootah | /_js/game.js | UTF-8 | 1,768 | 2.53125 | 3 | [
"MIT"
] | permissive | // Updated 12/24/16 1758 EDT
var BubbleShoot = window.BubbleShoot || {};
BubbleShoot.Game = (function($){
var Game = function(){
var curBubble;
var board;
var numBubbles;
var MAX_BUBBLES = 70;
this.init = function(){
console.log("Init Loaded...");
$(".but_start_game").bind("click",startGame);... | true |
a9e6eb24f21ad47c79667f5af778983267a12064 | JavaScript | jaymeborges/javascript | /array/arrayMetodos.js | UTF-8 | 542 | 3.90625 | 4 | [] | no_license | const pilotos = ['Vetel','Alonso', 'Raikkoner','Massa']
pilotos.pop()// massa quebrou o carro!
console.log(pilotos)
pilotos.push('Verstappen')
console.log(pilotos)
pilotos.shift()// Remove o primeiro!
console.log(pilotos)
pilotos.unshift('Hamilton')
console.log(pilotos)
// splice pode adionar e remover elementos
/... | true |
a4344d85f01768363cb45d8561ccb5af7355c55e | JavaScript | lgensinger/isar | /app/factories/nest-factory.js | UTF-8 | 2,140 | 2.75 | 3 | [
"MIT"
] | permissive | var app = window.app;
var d3 = require("d3");
app.nestFactory = (function() {
return {
// nest data
nest: function(source, key) {
// simple 1-level nest
return d3.nest()
.key(function(d) { return d[key]; })
.entries(source);
},
// 1-level nest with sum
participant... | true |
c4e80f24e663b1ae6a47b179ffda4df693be6305 | JavaScript | julhanlon/Intersection-Observer | /practice_1/app.js | UTF-8 | 1,212 | 3.21875 | 3 | [] | no_license | let sections = document.querySelectorAll("section");
const options = {
root: null,
threshold: 0,
rootMargin: "0px 0px -150px 0px",
};
const renderSections = (num) => {
const main = document.querySelector("main");
return new Promise((resolve, reject) => {
for (let i = 0; i < num; i++) {
const secti... | true |
f4cc82fd93b8e4d1921b27d72f8a7bc460e984f2 | JavaScript | myoshiike/GuessNumber | /js/main.js | UTF-8 | 2,113 | 3.96875 | 4 | [] | no_license | 'use strict';
let guessCount = 1;
const maxCount = 7;
let randomNumber = Math.floor(Math.random() * 100) + 1;
const container = document.getElementById('container');
const numberInput = document.getElementById('number-input');
const submitButton = document.getElementById('submit-button');
const results = document.get... | true |
4f3082efb28e14c924351ec3bbe43739cfd6bcbb | JavaScript | Abascal-jorge/node-curso-js | /Api node con mysql/controllers/productos.js | UTF-8 | 1,901 | 2.6875 | 3 | [] | no_license | const dbConnection = require("../config/config");
exports.postProductos = async ( req, res ) => {
const datos = req.body;
if( Object.keys(datos).length === 0){
return res.json({
ok: false,
error: "Ingresa los datos especificados"
});
}
const connection = ... | true |
ce43b94eca69a9d29be59b96929ea6a722c4c927 | JavaScript | zama100/recetowin | /main.js | UTF-8 | 4,364 | 2.875 | 3 | [] | no_license | enchant();
window.onload = function() {
var game = new Core(1220, 820);
game.fps = 8;
game.preload("horse1.png", "finishLine.gif", 'bg.gif');
var Horse = enchant.Class.create(enchant.Sprite, {
initialize: function(x, y) {
enchant.Sprite.call(this, 102, 91);
this.x = x... | true |
08177563aa4fbd6b0d5deec105135381af175557 | JavaScript | kakhiG/Announcement | /front/src/components/ItemList.js | UTF-8 | 3,279 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
//import AnnouncementService from '../services/AnnouncementService'
import axios from 'axios';
const ItemList = (props) => {
const [items, setItems] = useState([]);
const [searchTitle, setSearchTitle] = useState("");
//const itemsRef = useRef();
... | true |