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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c23c2e6708d123506f5329a5fa7e441869750789 | JavaScript | 17Abh/react-hello-world | /src/Components/NameList.js | UTF-8 | 826 | 2.6875 | 3 | [] | no_license | import React from 'react'
import Person from './Person'
const NameList = () => {
const names = ["dragon", "zeref", "leon","dragon"]
const persons = [
{
id:1,
name:'dragon',
age:99,
skill:'instant kill',
},
{
id:2,
... | true |
f631d56d639c5f22bcf9dcd3a2f0fab808a40707 | JavaScript | Jeansidharta/steamgiftsAutoSubscriber | /background.js | UTF-8 | 4,914 | 2.59375 | 3 | [] | no_license | let operation = "";
let wasPageOpenedByUser = true;
let log = console.log;
let openedTabsCount = 0;
let closedTabsCount = 0;
let wasAutoOperation = false;
const maximumPoints = 300;
const minimumPoints = 100;
const CONTEXT_BACKGROUND = "background";
chrome.alarms.create("update user info", {"periodInMinutes": 10});
ch... | true |
ebf42c9745a6971b03bcab5c903cd42134ad28fb | JavaScript | DE1-Computing-2-2021/computing-2-coursework-anushanarayan2911 | /web-app/static/calendar.js | UTF-8 | 7,783 | 2.984375 | 3 | [] | no_license | import Ajax from "./ajax.js";
const monthsArray = [
"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"
];
const currentDate = new Date();
// get today's date
const currentYear = currentDate.getFullYear();
// get current year
const currentMon... | true |
8bbeb66f9b4e3788a3c65b4ee746f51af8dac7d3 | JavaScript | yamnikov-oleg/sea-battle-manager | /ships_placement_renderer.js | UTF-8 | 6,055 | 3 | 3 | [
"MIT"
] | permissive | $(function(){
// SHIPS PLACEMENT RENDERER
var AllPointsInRect = function(bnd) {
var points = [];
for (var i = bnd[0].i; i < bnd[1].i; i++) {
for (var j = bnd[0].j; j < bnd[1].j; j++) {
if (i < 0 || j < 0 || i >= FIELD_HEIGHT || j >= FIELD_WIDTH) continue;
points.push({ i: i, j: j });... | true |
759fa4cc40120b1dd028b5d428fa15835dc8edaf | JavaScript | mle4d/FuturamaReact | /src/services/FuturamaAPI.js | UTF-8 | 367 | 2.71875 | 3 | [] | no_license | export const getQuotes = (count = 5) => {
return fetch(`https://futuramaapi.herokuapp.com/api/quotes/${count}`)
.then(res => {
if(!res.ok) throw 'fuck it';
return res.json();
})
.then(quotes => {
return quotes.map(quote => ({
quote: quote.quote,
image: quote.image,
... | true |
71254e6925256c792be2d423392053c6e44918a6 | JavaScript | lmodin/algorithms | /flattenBinary.js | UTF-8 | 1,093 | 3.484375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {void} Do not return anything, mod... | true |
ee2c600b6704f6c202841cbb6b37afe18340158d | JavaScript | too-old-to-code/battleships | /initiateGame.js | UTF-8 | 1,357 | 2.578125 | 3 | [] | no_license | const makeGame = () => {
const player = 'p1'
const dimensions = [ getElmnt('width').value, getElmnt('height').value ]
let game = new Game(Game.generateUUID(), player, fb, deleteSelf)
game.setBoardDimensions(dimensions)
game.setPlayer1(true)
game.displayMessage('Waiting for opponent', 'rgba(0,14... | true |
745411c106e125fd65d84188833feba1a52acd08 | JavaScript | marcusthorstrom/LightControl | /main.js | UTF-8 | 1,718 | 2.796875 | 3 | [] | no_license | var express = require('express')
var path = require('path')
const child_process = require('child_process')
var app = express()
app.use('/angular', express.static(__dirname + '/node_modules/angular'));
app.use('/bootstrap', express.static(__dirname + '/node_modules/bootstrap'));
app.use('/angularApp', express.static(__... | true |
de3fab3d7ba647f27f5495a80887d84d1437523f | JavaScript | edupb3/js-courses | /exercicios/fundamentos/17-aumento-salario.js | UTF-8 | 960 | 4.15625 | 4 | [] | no_license | /**
* 17) Um funcionário irá receber um aumento de acordo com o seu plano de
trabalho, de acordo com a tabela abaixo:
Plano Aumento
A 10%
B 15%
C 20%
Faça uma função que leia o plano de trabalho e o salário atual de um funcionário e calcula e imprime o seu
novo salário. Use a estrutura switch e faça um caso default qu... | true |
cfb42d44f1e717146bcfda8a4b4fc705af734476 | JavaScript | rjmcguire/esparse | /src/Validate.js | UTF-8 | 6,857 | 2.921875 | 3 | [
"MIT"
] | permissive | import { isStrictReservedWord } from "./Scanner.js";
// Returns true if the specified name is a restricted identifier in strict mode
function isPoisonIdent(name) {
return name === "eval" || name === "arguments";
}
// Unwraps parens surrounding an expression
function unwrapParens(node) {
// Remove any paren... | true |
4d5164a4877a3c49f7005a20775e1a5a0523473f | JavaScript | ing-bank/lion | /packages/ui/components/tabs/test/lion-tabs.test.js | UTF-8 | 20,697 | 2.53125 | 3 | [
"MIT"
] | permissive | import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import sinon from 'sinon';
/**
* @typedef {import('../src/LionTabs.js').LionTabs} LionTabs
*/
import '@lion/ui/define/lion-tabs.js';
const basicTabs = html`
<lion-tabs>
<button slot="tab">tab 1</button>
<div slo... | true |
31de4cd427a80c7ede9b98ced2ff9066b3d644e2 | JavaScript | ashunitd/chat | /public/views/controllers/chatcontroller.js | UTF-8 | 795 | 2.515625 | 3 | [] | no_license | angular.module('chatController',[])
.controller('chatCtrl',function($rootScope){
var vm=this;
vm.newMessage=undefined;
vm.messages=[];
vm.ids=[];
var socket=io();
socket.on("recieved",function(msg,id){
console.log(msg);
$rootScope.$apply(function(){
vm.messages.push(msg);
vm.ids.push(id);
})
})
vm.s... | true |
3799d3dfe7540895ec51d5487505192126716a96 | JavaScript | Kd-bT/Digit-Recognition-App | /js.js | UTF-8 | 4,146 | 3.015625 | 3 | [] | no_license | // Canvases (temporary used for drawing circle mouse indicator)
var canvas;
var outerCanvas;
var ctx;
var outerCtx;
// Canvas dimension information
var imageLength = 28;
var scale = 20;
// Drawing variables
var lastMousePos;
var mousePos;
var mouseDown = false;
var userPen;
// Websocket
var websocket
function start... | true |
a931e36fe73af4900f55c89a3242cfd981f196ef | JavaScript | terror/420-4W6-AB | /Exercises/0.2-Node-Basics/async.js | UTF-8 | 238 | 3.34375 | 3 | [] | no_license | const getUserAsync = (id, callback) => {
setTimeout(() => callback(id), 2000);
}
getUserAsync(1, (id) => { console.log({ userId: id })});
getUserAsync(2, (id) => { console.log({ userId: id})});
const sum = 1 + 1;
console.log(sum);
| true |
905f32bacc1424d99a9ae51cf55c5fce58b8934e | JavaScript | martin-nazaryan/color-game | /src/hooks/useWon.js | UTF-8 | 709 | 2.875 | 3 | [] | no_license | import {useState, useEffect} from 'react';
export default function useWon(colorsData, selectedColor, maxCount) {
const [won, setWon] = useState(false);
useEffect(() => {
if (colorsData.length && !selectedColor) {
setWon(true);
for (let i = 0; i < colorsData.length; i++) {
if (!colorsData[... | true |
f7c5f6f72cb96586e7407be7ea30de2e0e646e14 | JavaScript | radrex/SoftuniCourses | /Programming Fundamentals/JS/09.Regular Expressions/Exercise/p03_SoftUniBarIncome.js | UTF-8 | 1,369 | 3.109375 | 3 | [
"MIT"
] | permissive | function solve(input = []) {
let customers = new Map();
for (let i = 0; i < input.length; i++) {
if (input[i] === 'end of shift') {
break;
}
let matches = input[i].matchAll(/%(?<customer>[A-Z][a-z]+)%[^|$%.]*<(?<product>\w+)>[^|$%.]*\|(?<count>\d+)\|[^|$%.]*?(?<price>\d+\.?\d+)\$/);
for (let... | true |
4925dd4e332f9654c58341035bf6fef60b4da97a | JavaScript | YIngChenIt/mini-koa | /context.js | UTF-8 | 444 | 2.5625 | 3 | [] | no_license | let context = {};
function defineGetter(property, key) {
context.__defineGetter__(key, function() { // getter
return this[property][key];
});
}
function defineSetter(property,key){
context.__defineSetter__(key,function(value){ // setter
this[property][key] =value;
})
}
defineGetter("request", "path");
... | true |
2dce64fd8388d2b97eb37e69b48ecba4ca009d07 | JavaScript | Projeto-VitaFit/VitaFit | /portal/js/portal.js | UTF-8 | 1,961 | 2.828125 | 3 | [] | no_license | function previewImagem() {
var imagem = document.querySelector('input[name=imagem]').files[0];
var preview = $('.foto-perfil');
var reader = new FileReader();
reader.onloadend = function(){
preview.attr("src", reader.result);
if (window.localStorage) {
localStorage.s... | true |
5dde66d8540538e65648679cd61ceec43b185c23 | JavaScript | naobaixingliming/newnewbank2018 | /2018newnewbank/web/详情页优化20180104/js/myubo.js | UTF-8 | 3,215 | 2.8125 | 3 | [] | no_license |
/**
* @param obj :object
* @param rate : 速度
* @param attr : 属性
* @param target :目标距离
* @param endFn : 回调函数(非必须)
*/
function doMove(obj, rate, attr, target, endFn) {
var rate = parseInt(getStyle(obj, attr)) < target ? rate : -rate;
clearInterval(obj.timer);
obj.timer = setInterval(function () {
... | true |
1f47d765a2ae30928aef8329ace68b6d29402297 | JavaScript | delian1986/JS-Core-May-2018 | /JS Apps/04. Async Programming/04. Students/script.js | UTF-8 | 1,673 | 2.90625 | 3 | [] | no_license | const baseUrl = 'https://baas.kinvey.com/appdata/kid_BJXTsSi-e/students';
const header = {'Authorization': 'Basic Z3Vlc3Q6Z3Vlc3Q'};
let loadStudents = $.ajax({
method: 'GET',
url: baseUrl,
headers: header
});
loadStudents.then(displayStudents);
loadStudents.catch(displayError);
function displayStudents(... | true |
93fb46d3630aeaebed1a8a4069ebd23d84b65580 | JavaScript | inadati-services/covid19-analytics.services | /nuxt/components/PieChart/data.js | UTF-8 | 1,118 | 2.625 | 3 | [] | no_license | export default ({ patient, sickbed_total }) => {
let re
if (patient > sickbed_total) {
re = [{
name: `患者数: ${patient}\n
病床不足: ${sickbed_total - patient}\n
${Math.round((patient / sickbed_total * 100) * 100) / 100}%`,
value: patient
}, {
... | true |
424943b3fc589e26aa47086b6c949751589c4c67 | JavaScript | martinbacs/DailyWeather | /wwwroot/js/site.js | UTF-8 | 1,601 | 2.59375 | 3 | [] | no_license | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
var southWest = L.latLng(52.500440,2.250475);
var northEast = L.latLng(70.742227,37.93... | true |
f841cbc4e7cea89dc530c6bfdbcf5c0196678649 | JavaScript | hrr18-captain-planet/Legit2.0 | /client/src/actions/addStudent.js | UTF-8 | 2,259 | 2.84375 | 3 | [
"MIT"
] | permissive | //Axios is essentially JQuery's AJAX simplified
//https://www.npmjs.com/package/axios
import axios from 'axios';
// Allows you to re-route the user
import { browserHistory } from 'react-router'
// Action types are held separately for modularity purposes
import * as types from '../constants/ActionTypes';
// Called be... | true |
526a880f9ae05a3215ed5c9b0e860d0f637b1603 | JavaScript | qingtu01/MOEA-Research-Project | /method/aemmt/aemmt.selection.js | UTF-8 | 2,524 | 2.53125 | 3 | [] | no_license | (function () {
'use strict';
function removeIndividualWithWorseMean(population, property) {
var means = _.map(_.map(population, property), _.mean);
var indexOfWorseMean = _.indexOf(means, _.max(means));
population.splice(indexOfWorseMean, 1);
}
function updateDominationTable(table, individual, max... | true |
e10a7e15a0e59968595480574f791f6a21eb219e | JavaScript | ghcshiwo/Data-Structrures-and-Angorithms | /1. JavaScript/1.2.1声明和初始化变量.js | UTF-8 | 312 | 3.953125 | 4 | [] | no_license | // 遵循 C++ 和 Java 等编译型语言的习惯,在使用变量前先对其进行声明
var number = 0
var str = 'hello'
var rate = 1.2
var bool = true
var name
console.log(number) //0
console.log(str) // hello
console.log(rate) // 1.2
console.log(bool) // true
console.log(name) // undefined | true |
378e9148f0a7d7d5d3185bf406704f9a568bcf32 | JavaScript | LiangSir-67/WeOCR | /pages/preImg/preImg.js | UTF-8 | 3,659 | 2.515625 | 3 | [] | no_license | //获取应用实例
var app = getApp()
Page({
data: {
src: '',
windowH: '',
windowW: '',
img_h: '',
img_w: '',
stv: {
offsetX: 0,
offsetY: 0,
zoom: false, //是否缩放状态
distance: 0, //两指距离
scale: 1, //缩放倍数
}
},
onLoad: function () {
// 分享按钮可用
wx.showShareMenu(... | true |
9212ea08a768c391de2c4b585e502bc29a300a10 | JavaScript | rajneeshksharma/ReactJs-Redux-Thunk-Hooks-Starterkit | /src/redux/actions.js | UTF-8 | 867 | 2.59375 | 3 | [] | no_license | const setUserAction = (userObj) => ({
type: "SET_USER",
payload: userObj,
});
const clearUserAction = () => ({
type: "CLEAR_USER",
});
const newUserToDB = (userObj) => (dispatch) => {
dispatch(setUserAction(userObj));
localStorage.setItem("user", JSON.stringify(userObj));
localStorage.setItem(
"token"... | true |
c650a6fd2b401ba2163d707d1f0e4b68cdb48a3c | JavaScript | brian-pow/yakitori-order-form | /src/components/Cart.js | UTF-8 | 846 | 2.59375 | 3 | [] | no_license | import React from "react";
import CartItem from "./CartItem";
const Cart = ({ items }) => {
//Calculate total price of cart items
const calculateTotal = () => {
let total = 0;
items.forEach((item) => {
let cost = item.quantity * item.cost;
total = total + cost;
});
return total / 100;
... | true |
d64a09d432f9e308c1bd0e1e9e5e09bcd56952f8 | JavaScript | kakasoo/fxjs | /src/reduce.js | UTF-8 | 791 | 2.53125 | 3 | [] | no_license | const curry = require("./curry");
const go1 = require("./go1");
const nop = require("./Lazy/nop");
const reduceF = (acc, a, f) =>
a instanceof Promise
? a.then(f(acc, a), (e) => (e === nop ? acc : Promise.reject(e)))
: f(acc, a);
const head = (iter) => go1(take(1, iter), ([h]) => h);
const reduce... | true |
22f9242a7047ddb14c53f5d18cfeff2d12d5ab28 | JavaScript | DanielKovalevich/Craft-Production-Paradigm | /dist/client/public/js/legoBuilder/builderInitScripts.js | UTF-8 | 3,743 | 2.828125 | 3 | [] | no_license | /**
* author: Daniel Kovalevich
* purpose: Created for research project with Dr. Aqlan of PSU
*/
'use strict';
/**
* ================================================================
* INITIALIZE SCENE AND STATE VARIABLES
* ================================================================
*/
if (!Detec... | true |
8eb4f312bead69f07384c614471ebda7970d3368 | JavaScript | urielscola/book-finder | /src/helpers/Menu.js | UTF-8 | 327 | 2.609375 | 3 | [] | no_license | export const toggleMenuBody = state => {
document.querySelector('html').style.overflowY = state;
document.body.style.overflowY = state;
if (state === 'hidden') {
document.ontouchmove = function(e) {
e.preventDefault();
};
} else {
document.ontouchmove = function(e) {
return true;
};
... | true |
0a10174551bbe6e2f3b1abc99ed9f26340f8acfe | JavaScript | npisciotti1/textract-server | /lib/text-extract.js | UTF-8 | 1,042 | 2.59375 | 3 | [] | no_license | 'use strict';
const Promise = require('bluebird');
const superagent = require('superagent-bluebird-promise');
const readFile = Promise.promisify(require('fs').readFile)
module.exports = (path) => {
//google vision config object - will also carry data, hence "body"
let body = {
requests: [
{
ima... | true |
8c3fdc7cb68a3f3c4e464b9ce632a8a7d949caf7 | JavaScript | ragnar-pwninskjold/chatroom | /public/main.js | UTF-8 | 1,483 | 2.890625 | 3 | [] | no_license | $(document).ready(function() {
var socket = io();
var input = $('input');
var messages = $('#messages');
var addMessage = function(message) {
messages.append('<div>' + message + '</div>');
};
var name = prompt("Please enter a name you wish to use");
$('#nick').append("Your current ... | true |
527d95cb1ab01e21f93aaf5549563bf29a7b4560 | JavaScript | Michieljoris/phantom-sitemap | /package.js | UTF-8 | 6,757 | 2.9375 | 3 | [
"MIT"
] | permissive | // This file is the source for constructing a `package.json` file.
// JSON is a wonderful interchange format, but due to the fact that the
// [JSON Specification](http://json.org) does not allow for comments, I find
// it horrid for self documenting examples.
//
// JavaScript allows for comments and inherently allows J... | true |
d5cb60b450e80ae0731d194e627241bb6e880ec2 | JavaScript | Automedon/Codewars | /6-kyu-part1/Simple Fun #79_ Delete a Digit.js | UTF-8 | 626 | 4.28125 | 4 | [
"MIT"
] | permissive | /*
Description:
Task
Given an integer n, find the maximal number you can obtain by deleting exactly one digit of the given number.
Example
For n = 152, the output should be 52;
For n = 1001, the output should be 101.
Input/Output
[input] integer n
Constraints: 10 ≤ n ≤ 1000000.
[output] an integer
*/
function del... | true |
480fbc9ec01f0cef3464d42a64ddc275b4927c74 | JavaScript | YuitoHashimoto/nomimon | /js/qrcamera.js | UTF-8 | 1,237 | 2.609375 | 3 | [
"MIT"
] | permissive | new Vue({
el: '#app',
data() {
return {
decodedContent: '',
errorMessage: ''
}
},
methods: {
onDecode(content) {
this.decodedContent = content
},
onInit(promise) {
promise.then(() => {
console.log('Successfully initilized! Ready for scanning now!')
... | true |
3c27c7ce2c257a042f32d768795d810f5ff1d7de | JavaScript | dlefebvre79/brewery-finder | /final-capstone/vue/src/services/BreweryService.js | UTF-8 | 2,447 | 2.578125 | 3 | [] | no_license | import axios from 'axios';
const http = axios.create({
baseURL: "http://localhost:8080"
});
export default{
list(brewerId){
if(brewerId != null) {
return http.get(`/brewery?brewerId=${brewerId}`);
} else {
return http.get('/brewery');
}
},
listByBrewer(brewerId){
return http.get... | true |
9ad8e6bd69cf12301a5ff1cc926122c598996b59 | JavaScript | roben/gutzeitgeier | /src/selectors/index.js | UTF-8 | 675 | 2.515625 | 3 | [] | no_license |
import { createSelector } from 'reselect'
const getWorkingHours = (state) => state.configuration.workingHours
export const getWorkingHoursPerDay = createSelector([getWorkingHours],(workingHours) => workingHours / 5)
export const getWorkingMsPerDay = createSelector([getWorkingHoursPerDay],(wh) => wh * 60 * 60 * 1000)
... | true |
08fef21dcb52626200da1b40c2323b54c3876873 | JavaScript | renzo4web/Frontend-Master | /JavaScript_The_Hard_PartsV2/04-Promises/Challenges.js | UTF-8 | 2,184 | 4 | 4 | [
"MIT"
] | permissive | // Challenge 1 ✔
function sayHello() {
setTimeout(() => {
console.log('Hello');
}, 1000);
}
// Uncomment the line below when ready
// sayHello(); // should log "Hello" after 1000ms
// Challenge 2 ✔
let promise = new Promise(function (resolve, reject) {
setTimeout(() => {
resolve('Resolve... | true |
a1975f51dff01f9b84948994f3d32f8348311d9a | JavaScript | LucSilveira/CursoTecnico_Senai-info | /Projetos_Front-end/Conteudo_JQuery/images/app.js | UTF-8 | 1,599 | 3.65625 | 4 | [
"MIT"
] | permissive | //Edpoint = Termo utilizado para uma URl que gera um resultado no web service
const CEP_ENDPOINT = "https://viacep.com.br/ws";
window.addEventListener('load', function(){
var inputCep = document.getElementById('inputCep');
//blur - Evento quando o campo perde o foco
inputCep.addEventListener('blur', funct... | true |
a9ed21d7588a073e2f70b35379a4b83556bc6856 | JavaScript | agustinvicchio/grupo11_jbike_S4 | /Controller/indexController.js | UTF-8 | 603 | 2.5625 | 3 | [] | no_license | fs = require('fs');
const controller = {
index : (req,res) => {
console.log("renderizando al index");
let archivoProductos = fs.readFileSync('productos.json', {enconding: 'utf-8'});
let productos;
if(archivoProductos == "")
{
console.log("lei un archivo vacio");
... | true |
73afc178ad00df26642a3009775f20e5a5ee9048 | JavaScript | anarch1986/react-contact-list | /src/components/LetterList/LetterList.js | UTF-8 | 962 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
import Letter from './Letter';
class LetterList extends Component {
constructor(props) {
super(props);
this.state = { choosenLetter: "" };
// Getting the refrence of the ContactList component for easier updating
this.contactList = React.cre... | true |
cb7eec73ae2cf7bb59184beb1b2f8b18fa7e679e | JavaScript | pbeardshear/Tycho | /examples/server_example.js | UTF-8 | 812 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// Server.js
//
// Represents a game server, using spine.js
var spine = require('./spine'),
Messages = require('./messages'),
World = require('./world');
spine.createServer({
// Set the max number of concurrent connections this server will accept
maxConnections: 1000,
// Set the valid message types that th... | true |
33d5b82aef457437a1704399dd268ca1672b5e4d | JavaScript | KittuJain/hospital | /test/hospital_records_test.js | UTF-8 | 1,734 | 2.515625 | 3 | [] | no_license | var lib = require('../own_modules/hospital_records');
var assert = require('chai').assert;
var fs = require('fs');
var dbFileData = fs.readFileSync('test/data/hospital.db.backup');
var hospital_records;
describe('hospital_records',function(){
beforeEach(function(){
fs.writeFileSync('test/data/hospital.db',dbFileDat... | true |
dc884c222ea863beca398839bdb35918c223f43a | JavaScript | runor-thoughtstudio/travis_api | /server/controllers/UserController.js | UTF-8 | 4,569 | 2.578125 | 3 | [] | no_license | import jwt from 'jsonwebtoken';
import dotenv from 'dotenv';
import User from '../models/User';
dotenv.config();
class UserController extends User {
constructor() {
super();
this.dataStructure = '';
}
signUp(req, res) {
const {
email, password, confirmPassword, dateOfBirth, fullName,
} = req.body;
if... | true |
c1c6f92f162b60ef5f7e9b9e09500f7e84aad455 | JavaScript | brick9527/ts_study_notes | /demo/lesson_10/demo4/index.js | UTF-8 | 2,232 | 2.65625 | 3 | [] | no_license | "use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... | true |
24a2032fc05436a5e387683b0d70f0276d4eaaff | JavaScript | allanroscoche/ton | /src/update.test.js | UTF-8 | 531 | 2.53125 | 3 | [] | no_license | const get = require("./update");
const funcionario = {
id: "123",
nome: "value2_updated",
idade: 20,
cargo: "value3"
};
describe("Testes consultar funcionario", () => {
test("deve consultar com id valido", async () => {
const handler = get.handler;
const params = { pathParameters: { id: funcionario.i... | true |
2e095747b17c859f066e7026cd30001383c7646a | JavaScript | matteomanca45/DADU_DesignConcept_2021 | /studenti/alfredocalosci/esempio.js | UTF-8 | 571 | 3.28125 | 3 | [
"CC0-1.0"
] | permissive | let w = 600;
let r = w/4; //raggio
let a = 0; //angolo
function setup() {
createCanvas(w, w);
colorMode(HSB); // r, G, B -> 0 - 255 // H 0-360
}
function draw() {
background(0, 0, 90);
//noFill();
let h = map (cos(a), -1, 1, 0, 360); // cos(a) va da 1 a -1 -> 0 - 360
fill(h, 80, 80);
circle(w/2, w/2, ... | true |
44873b5cee10a91e58ace65b0a57aff2c08cd465 | JavaScript | krzys-wszel/14.6---liczniki | /components/App.js | UTF-8 | 1,978 | 3.078125 | 3 | [] | no_license | var Counter = React.createClass({
getInitialState: function(){
return {
counter: 0
};
},
increment: function(){
this.setState({
counter: this.state.counter + 1
});
},
decrement: function(){
this.setState({
counter: this.state.counter - 1
});
},
getDefaultProps: function(){
co... | true |
efa388ac54058e218bc3df4244d8d17427c9a1ef | JavaScript | GuetarniWalid/myStraty_backend | /app/Controllers/Http/ChatController.js | UTF-8 | 1,147 | 2.59375 | 3 | [] | no_license | "use strict";
const Chat = use("App/Models/Chat");
const User = use("App/Models/User");
/**
* @memberof Controllers.Http
* @classDesc This is the Controller for routes that begin by "[Domain name]/api/v1/chat". Desserve data related to chat.
*/
class ChatController {
/**
* @description Gives all message of eac... | true |
653f66b2a481b4c47c3ae8429c7b0af1610530ed | JavaScript | sdamarao/mmcourses | /CLIONA/1/common/BTree.js | UTF-8 | 17,739 | 3.34375 | 3 | [] | no_license | Function.prototype.method = function (name, func)
{
this.prototype[name] = func;
return this;
};
function clsNodeType()
{
var Key = null;
var Value = null;
var Parent = -0;
var LeftChild = 0;
var RightChild = 0;
}
//
// Your basic binary-tree data structure
//
// Includes the standard stuff:
//
// Add ... | true |
c6a3452527d0c6f1e85266e6269ccd8da417d807 | JavaScript | Trikkster/discord.js-v12-tutorial-series | /ep 7 - lavalink music bot/bot/structures/Queue.js | UTF-8 | 2,729 | 2.640625 | 3 | [
"MIT"
] | permissive | const { TextChannel, MessageEmbed, UserFlags } = require("discord.js");
const { lavacordManager } = require("..");
const axios = require('axios').default;
const { msToHMS } = require('../utils')
const urlRegex = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);... | true |
f03431307bfbc00136769fed570ecc749831ca03 | JavaScript | MikeLimpus/CS50M | /2 React, Props, State/7-declarativeSlide.js | UTF-8 | 456 | 2.734375 | 3 | [] | no_license | const SLIDE = {
title: 'React is Declarative',
bullets : [
'Imperative vs Declaritive',
"The browser APIs suck",
'React allows us to write what we want and the library handles DOM manip',
],
}
function createSlide(slide){
return (
<div>
<h1> title={SLIDE... | true |
36da31e51bb945ae94fcb17e174a8bc6ff181c40 | JavaScript | T3ch0o/SoftUni-JS-Exercises | /JS Core/JavaScript Fundamentals/08. Lab - Strings and Regular Expressions/10. Match All Words.js | UTF-8 | 191 | 2.890625 | 3 | [] | no_license | function matchAllWords(text) {
let result = text.split(/\W+/).filter(e => e.length !== 0);
console.log(result.join('|'));
}
matchAllWords('_(Underscores) are also word characters'); | true |
4785b25b1924a923d621f914d36396c3c97ec050 | JavaScript | Jacksonlike/leetcode | /557.反转字符串中的单词-iii.js | UTF-8 | 339 | 3.25 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=557 lang=javascript
*
* [557] 反转字符串中的单词 III
*/
// @lc code=start
/**
* @param {string} s
* @return {string}
*/
var reverseWords = function (s) {
return s
.split(' ')
.reduce((pre, cur) => `${pre} ${cur.split('').reverse().join('')}`, '')
.trimStart();
};
// @lc code=end... | true |
5cf7a314d4e4a5576554043ed85ed3f2c478c63b | JavaScript | suntzudec/pomodoro | /src/js/alarm-clock/set-alarm/filter-event-functions.js | UTF-8 | 969 | 2.546875 | 3 | [] | no_license | export function forwardDirector(index, diff, base, cond){
return index + diff > base ?
cond
:
index + diff;
}
export function backwardDirector(index, diff, base, cond){
return index + diff < base ?
cond
:
index + diff;
}
export function valueLimitCheck(xdiff, ydiff){
return (Math.abs(xdiff) <= 35 &... | true |
dc330a991d03f269a54abbb99d6f1eeaf4dcc975 | JavaScript | aab11/Cordova-Clone | /src/plugins/geolocation.js | UTF-8 | 2,485 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /**
* navigator.geolocation
*/
navigator.geolocation.__proto__ = {
getCurrentPosition: function(geolocationSuccess, geolocationError, geolocationOptions) {
var successReference = geolocationSuccess;
var errorReference = geolocationError;
function errorCallback() {
var errorObject = new PositionError();
... | true |
a58879951cb4f858899a3d5e830b4005de3acf17 | JavaScript | calvinrempel/Battlefy_Exercise | /api_playground/src/getMatchDetails.js | UTF-8 | 2,363 | 2.78125 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const prompt = require('prompt');
exports.action = function(leaguejs) {
// Get the recent match info for summoner with given name, write to json file in 'output', and exit the process.
async function getAndDisplayMatchInfo(leaguejs, summonerName) {
... | true |
c423b0e5c9329deec322617fc333bc77cd4c0b0c | JavaScript | BaooLi/smartBI | /note/MVVM.js | UTF-8 | 11,071 | 3.515625 | 4 | [
"MIT"
] | permissive | /*
数据劫持: vue.js 则是采用数据劫持结合发布者-订阅者模式的方式,通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时发布消息给订阅者,触发相应的监听回调。
要实现mvvm的双向绑定,就必须要实现以下几点:
1、实现一个数据监听器Observer,数据劫持能够对数据对象的所有属性进行监听,如有变动可拿到最新值并通知订阅者
2、实现一个指令解析器Compiler,对每个元素节点的指令进行扫描和解析,根据指令模板替换数据,以及绑定相应的更新函数
3、实现一个Watcher,作为连接Observer和Compiler的桥梁,能够订阅并收到每个属性变动的通知,执行指令绑定的相... | true |
34553140ef392f5a684036e61e1d9c1ca587908c | JavaScript | cen4010-s2021-g11/CEN4010-Group-11 | /forum-topic-prototype/www/scripts/comments.js | UTF-8 | 4,502 | 2.53125 | 3 | [] | no_license | var comments = [];
var parent;
var currPostID;
document.querySelector("#createComment").addEventListener('click', function() {
console.log("clicked");
if(currUser){
createComment();
}else{
alert("Please sign in to use this feature!");
}
})
document.querySelector("#goBack").addEven... | true |
c25c8743ab0be30344fa1ac1ed8a511ee4dd4703 | JavaScript | sauravb-git/react-all-hook | /src/Move.js | UTF-8 | 502 | 2.890625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
const Move = () => {
const [x,setX] = useState(0)
const [y,setY] = useState(0)
const chageValue = (e) =>{
setX(e.x)
setY(e.y)
}
useEffect(() => {
window.addEventListener('mousemove',chageValue)
return() =>{
wi... | true |
4bf737cbaad21226255d402df6bfe91a134c47fc | JavaScript | gilberthaensel/uploadToFirebase | /assets/script.js | UTF-8 | 5,210 | 2.546875 | 3 | [] | no_license | // Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "AIzaSyDraFFr_DIqR9uoQWuzzXqZr4A2T_-ckhA",
authDomain: "task1-7c83d.firebaseapp.com",
projectId: "task1-7c83d",
storageBucket: "task1-7c83d.appspot.com",
messagingSenderI... | true |
541769b849f7bdf43078cd687d53e5b38efc4d65 | JavaScript | bfreud94/nbaplayercomparer | /nba-player-comparer-client/src/reducers/playerReducer.js | UTF-8 | 833 | 2.765625 | 3 | [] | no_license | import { GET_PLAYERS, ADD_PLAYER, REMOVE_PLAYER } from '../actions/types'
const initialState = {
players: [],
addedPlayers: []
}
export default function (state = initialState, action) {
switch (action.type) {
case GET_PLAYERS:
return {
...state,
players:... | true |
b96aa7e60a8a3d1a32971731fc5e8834f22bf1a4 | JavaScript | AnderbergE/SweetSecrets | /src/js/Services/storageService.js | UTF-8 | 3,852 | 2.78125 | 3 | [] | no_license | /**
* A service to handle storage functionality.
* Cache for client storage is either localStorage or associative array.
*
* NOTE: Since we might use associative array we can not use getItem or setItem
* from the localStorage API.
*
* Inspired by: https://github.com/agrublev/angularLocalStorage
*/
app.service('... | true |
3c35cdca95607efc1e817d2c4555a327aa5d944f | JavaScript | Per-hack/javascript-introduction | /javascript basics/closures.js | UTF-8 | 273 | 3.046875 | 3 | [] | no_license | function instructionGenerator () {
function multiplyBy2 (num){
return num * 2
};
return multiplyBy2
};
let generateFunc = instructionGenerator();
let result = generateFunc(3);
console.log(result);
//function data(num){
// return num;
//}
//data;
| true |
b7fc4d13bc00d9098d4df1f4181464d6c85b65d9 | JavaScript | Thisists1994/demo | /echo/js/detail.js | UTF-8 | 3,384 | 2.625 | 3 | [
"MIT"
] | permissive | console.log("我是详情页")
//获取路径参数
var parms = getUrlParms()
console.log("ID:" + parms.id)
//$('#prve').click(function(){
// router('tab');
//})
function getPlayList(id, callback) {
$.ajax({
type: "get",
url: "https://api.imjad.cn/cloudmusic?type=playlist&id=" + id,
success: function(data)... | true |
b8c8505a605f26f1d36c05dcaecec51d6d6ad32f | JavaScript | PabloFdez/codedown | /test/codedown.js | UTF-8 | 953 | 2.53125 | 3 | [
"MIT"
] | permissive | var assert = require('assert');
var process = require('child_process');
describe('codedown', function(){
it('should require a <lang> argument', function (done) {
process.exec('./codedown.js', function (err, stdout, stderr) {
if (!err) {
assert.equal(
[ 'usage: codedown <lang>'
... | true |
8dd79760bdc5ee48815b37eff3de1d2c88286a8b | JavaScript | pedrohojas/alamierda | /app/assets/javascripts/shits.js | UTF-8 | 2,317 | 2.53125 | 3 | [] | no_license | load = function() {
$.ajaxSetup({
dataType: 'json'
});
return $.get('/shits/random.json', function(data) {
shit = data;
return show_shit();
});
};
increment_current_by = function(num) {
current = (current + num) % shits.length;
if (current < 0) {
current = shits.length + current;
}
return current;
};... | true |
58745189caa85e80ba2ab335b6c050b2c175caaf | JavaScript | modisujeet/cuk_elms | /config/passport-local-strategy.js | UTF-8 | 1,994 | 2.59375 | 3 | [
"MIT"
] | permissive | const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const Admin = require('../models/admin');
// Authentication using passport
passport.use(new LocalStrategy({
usernameField : 'email'
},
function(email, password, done){
// find a user and establish i... | true |
66218297f5b9a4a588a3004f724ce897ed5a54da | JavaScript | morinoko/js-templates-template-engines-lab-cb-000 | /index.js | UTF-8 | 2,041 | 3.203125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function createPost() {
// Set up page with post
let postHTML = buildPost();
let page = buildPage(postHTML);
let commentsSection = buildCommentsSection();
// Add page to main HTML
let main = document.querySelector('main');
main.innerHTML += postHTML + commentsSection;
}
function postComment() {
// Get... | true |
21b03368cce7561a5fa37161150831414ca2bb06 | JavaScript | ElizaldeJE/6ees6ees6ees | /src/Bee.js | UTF-8 | 184 | 3 | 3 | [] | no_license | class Bee {
constructor() {
this.age = 5;
this.color = "yellow";
this.food = "jelly";
this.job = "Keep on growing"
}
eat() {
return 'Mmmmmmmmm jelly'
}
};
| true |
bf6ab67dcb391d3ba9c63bc1ad81d8999a77f6cf | JavaScript | LEDdyK/FromGitlabSE702-Project | /mindless/hci/static/hci/js/clicker.js | UTF-8 | 15,704 | 3.015625 | 3 | [] | no_license | 'use strict';
import Easing from './easing.js';
class GameShape {
constructor(x, y, colour, shapeType) {
this.x = x;
this.y = y;
this.colour = colour;
this.shapeType = shapeType;
this.visible = true;
this.transition = 1.0;
this.hoverTransition = 0.0;
}
}
... | true |
012cc58d6486d3c6df3d8d3daa578c03a34967b4 | JavaScript | monjedkhwees/monjed | /js/map.js | UTF-8 | 3,510 | 2.75 | 3 | [
"MIT"
] | permissive | var map;
var marker;
var infowindow;
var locations = [{
name: 'bairut',
lat: 33.893197,
lng: 35.501933
},
{
name: "Alrawshe",
lat: 33.887212,
lng: 35.473351
},
{
name: 'sanae',
lat: 33.893421,
lng: 35.490153
},
{
name: 'amircan unevercity',
... | true |
0ceb4f65dfd648905d975b1bd927d5e5254aec0a | JavaScript | borikas/checkText | /script.js | UTF-8 | 10,291 | 2.6875 | 3 | [] | no_license | function checkText() {
var res = '';
var textframe = $("#text").contents().find('.frameBody').text();
var lang = $("#language").val();
var text = removeTag(textframe);
var alphabet_kr = ' А а Б б В в Г г Д д Е е Ж ж И и Й й К к Л л М м Н н О о П п Р р С с Т т У у Ф ф Х х Ц ц Ч ч Ш ш Щ щ Ь ь Ю ю Я я'... | true |
d7b391aca60e490e0b17ac19b33695abaaf88a45 | JavaScript | abitravers1989/bowling-challenge | /spec/score_spec.js | UTF-8 | 2,292 | 3.25 | 3 | [] | no_license | describe("Score is stored correctly globally throughout game", function(){
var score
beforeEach(function(){
score = new Score();
bowling = new Bowling();
});
it("the total score starts as an empty array", function(){
expect(score.totalscore).toEqual([]);
});
it("calculates the score of a... | true |
6bbc776c5e8c9c981f877fd67597af719d8297b2 | JavaScript | bmarwane/Segments7Extract | /main.js | UTF-8 | 2,280 | 3.109375 | 3 | [] | no_license | var fs = require('fs');
var allLines = fs
.readFileSync('test.txt')
.toString()
.split('\n');
const numberPatterns = {
n_0: {
top: ' _',
middle: '| |',
bottom: '|_|',
},
n_1: {
top: ' ',
middle: ' |',
bottom: ' |',
},
n_2: {
top: ' _',
middle: ' _|',
b... | true |
70462b0de2a324fff12f07739ef8cf62cc13746b | JavaScript | mr-sandy/scribble | /src/common/__tests__/tiles.tests.js | UTF-8 | 3,428 | 2.8125 | 3 | [] | no_license | import * as tiles from '../tiles';
import { compareTiles, withoutTile, withoutTiles } from '../tiles';
import deepFreeze from 'deep-freeze';
describe('when comparing tiles', () => {
it('should return true when they match', () => {
const result = compareTiles(tiles.a, tiles.a);
expect(result).toEqua... | true |
4fe2ea3dedd015dd997df65ecd1839c2c4c48202 | JavaScript | JuanMelendres/ComputerGraphicsClass | /FirstParcial/7-0-hello-world-model-transform/js/main.js | UTF-8 | 3,493 | 2.96875 | 3 | [] | no_license | "use strict"
var canvas;
var gl; // WebGL context
var vertices;
var indices;
var shaderProgram;
function init()
{
// Init 3D model (the scene)
vertices = [ 0., 0.5, 0., // V0
-0.5, -0.5, 0., // v1
0.5, -0.5, 0. // V2
];
indices = [0, 1, 2];
// Init WebGL r... | true |
38be56b257375eaaa1ab08c44af38697b0cbfff8 | JavaScript | jejisrinivasa/first_app | /models/Person.js | UTF-8 | 412 | 2.53125 | 3 | [] | no_license | const mongoose = require("mongoose");
//schema is a model like 'CREATE TABLE' in the sql
const PersonSchema = mongoose.Schema({
firstname: {
type: String,
required: true,
},
lastname: {
type: String,
required: true,
},
date: {
type: Date,
default: Date.now,
},
});
module.exports = ... | true |
e41ea2cc4f08d21f29e0e574bbf29ddc7a027948 | JavaScript | roowahoo/React | /05-crud/src/TodoList.js | UTF-8 | 4,177 | 2.9375 | 3 | [] | no_license | import React from 'react'
export default class TodoList extends React.Component {
state = {
tasks: [
{
'id': 12345,
'title': 'Wash the car',
'done': true
}
],
newTaskTitle: '',
editedTaskTitle: '',
edite... | true |
e7219d69dad04c63b11f2940dfb321824af48fcd | JavaScript | nevadasrini/ThePreeminentPaninis | /public/js/account.js | UTF-8 | 2,171 | 3.03125 | 3 | [
"MIT"
] | permissive | const emailObject = document.getElementById('email');
const nameObject = document.getElementById('name');
const ageObject = document.getElementById('age');
const fieldObject = document.getElementById('field');
const skillsObject = document.getElementById('skills');
const bioObject = document.getElementById('bio');
cons... | true |
0fab8fca20fdfbf57f119dc30a3e5c2b1bb6d190 | JavaScript | Geosar1/Proyecto_Sena | /public/js/main.js | UTF-8 | 24,735 | 2.578125 | 3 | [] | no_license | //inputs Number
$(document).on('keypress', 'input[type=number],input[type=tel]', function () {
if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;
});
//input Text
$(document).on('keypress', 'input[type=text],input[type=password]', function (key) {
if ((key.charCode < 97 || key.charCode > ... | true |
addbd0ae186cd830ca5e0d53e7d835d1e8df34c6 | JavaScript | vinaysudani/task-manager-frontend-react | /src/components/UI/Pagination.js | UTF-8 | 2,375 | 2.703125 | 3 | [] | no_license | import { Pagination } from "react-bootstrap";
const AppPagination = (props) => {
const totalRecords = props.totalRecords;
const perPage = props.perPage;
const numberOfPage = Math.ceil(totalRecords / perPage);
const [, ...pages] = Array(numberOfPage + 1).keys();
const paginationClickHandler = (valu... | true |
b9794db905f71d870c20b561d13eb8d0c256eb64 | JavaScript | fpetre/Asteroids | /lib/gameView.js | UTF-8 | 4,012 | 2.828125 | 3 | [] | no_license | (function () {
if (typeof Asteroids === "undefined") {
window.Asteroids = {};
}
var GameView = Asteroids.GameView = function (gameCanvasEl, uiCanvasEl ) {
this.keyTriggers = {left: false, right: false, fire: false};
this.gameCtx = gameCanvasEl.getContext("2d");
this.uiCtx = uiCanvasEl.getContext... | true |
d8694c2fc7ba4416ffc3c8b063e67c31ff12da7e | JavaScript | liyaSileshi/breakout-game | /src/script.js | UTF-8 | 8,380 | 3.15625 | 3 | [] | no_license | /* eslint-disable max-classes-per-file */
/* eslint-disable no-shadow */
import Paddle from './paddle';
import Brick from './brick';
import Ball from './ball';
import Sprite from './sprite';
const canvas = document.getElementById('myCanvas');
class Background {
constructor(color = '#2E4053') {
this.color = colo... | true |
4b2896442f627688b708c4d399622b4f719ac585 | JavaScript | ERAllen94/Note-Taker | /apiRoutes.js | UTF-8 | 751 | 2.625 | 3 | [] | no_license | const router = require('express').Router();
const { newNote, deleteNotes } =require('./addedNotes')
const { notes } = require('./db/db.json')
const fs = require("fs");
router.get('/notes', (req, res) => {
fs.readFile('db/db.json', (err,data) =>{
console.log('what is data', JSON.parse(data))
res.json(JSON.... | true |
55c26a4376c9608086992f537e06b0c21cb1d297 | JavaScript | wahabalikhan/bobbys-desserts | /assets/js/app.js | UTF-8 | 1,033 | 2.796875 | 3 | [] | no_license | // smooth scroll
const aboutScroll = new SmoothScroll('.learn-more[href*="#about"]', { speed: 1000 });
const specialsScroll = new SmoothScroll('.specials[href*="#specials"]', { speed: 1000 });
const galleryScroll = new SmoothScroll('.gallery[href*="#gallery"]', { speed: 1000 });
const contactScroll = new SmoothScroll('... | true |
5144694e1cf36a806501ad00f1c5ce5fb5df740b | JavaScript | halain/react-giphy | /src/GifExpertApp.js | UTF-8 | 933 | 2.5625 | 3 | [] | no_license | import React, { useState } from "react";
import { AddCategory } from "./components/AddCategory";
import { GifGrid } from "./components/GifGrid";
//funcional component... Componente en base de funciones
export const GifExpertApp = ({defautCategory=["Breaking Bad"] }) => {
//const [categories, setCategories] = us... | true |
2ad379781587bbfdae0b85614d76e0c9f34370f8 | JavaScript | ROsmundson/online-se-pt-051721 | /02-js-functions/index.js | UTF-8 | 787 | 4.125 | 4 | [] | no_license | // function ourFancyFunction(number) {
// console.log(parameter);
// };
//
// const ourFancyFunction = () => {
//
// function someOtherFunction() {
// console.log("HIII!!!!")
// }
//
// return someOtherFunction
//
// };
//
// ourFancyFunction();
//
// someOtherFunction();
// const newReturn = ourFancyFunct... | true |
331b7f52548876d837a7dddf395d99b3971ae298 | JavaScript | J-McKinney/traintime | /assets/main.js | UTF-8 | 3,972 | 2.640625 | 3 | [] | no_license | $(document).ready(function () {
var datetime = null,
date = null;
var update = function () {
date = moment(new Date())
datetime.html(date.format('MMMM Do YYYY, h:mm:ss:S'));
};
datetime = $('#currentTime')
update();
setInterval(update, 1);
var config = {
ap... | true |
aa93f020816a493acfa6513eee9e72e41daf94ff | JavaScript | frabaglia/fcm-sw | /public/main.js | UTF-8 | 2,109 | 2.5625 | 3 | [] | no_license | /* Initialize Firebase */
var config = {
apiKey: "AIzaSyD5kTfMizzEukLFbZkth8i-PropUqgwB84",
authDomain: "upmaraton.firebaseapp.com",
databaseURL: "https://upmaraton.firebaseio.com",
projectId: "upmaraton",
storageBucket: "",
messagingSenderId: "456275715091"
}
firebase.initializeApp(config)
const messagin... | true |
67e1d05e3923848e5a15930239c56a662e012592 | JavaScript | d-murphy/AlgoReview2 | /BST.js | UTF-8 | 2,326 | 4 | 4 | [] | no_license | class Node {
constructor(val){
this.val = val;
this.left = null;
this.right = null;
}
}
class BinarySearchTree{
constructor(){
this.root = null;
}
insert(val){
let newNode = new Node(val);
if(this.root ===null){
this.root = newNode;
} else {
this.insertNode(this.root, ... | true |
a9dff5f7278a1f1dff365659da245737ee7bc707 | JavaScript | JanakiramanRamaiya/Search-and-Algorithm-Visualization | /sort.js | UTF-8 | 3,310 | 3.234375 | 3 | [] | no_license | function findMinNumberLocation(blockElements, min, n) {
return new Promise(async (resolve) => {
let minNumberIndex = min;
let blockElementAtMinIndex = blockElements[minNumberIndex];
blockElementAtMinIndex.classList.add("highlight");
for (let index = minNumberIndex + 1; index < n; index++) {
con... | true |
c599c62555fb384f7c1011d391c1116a595c8530 | JavaScript | RobertAMcCullough/OpenMats | /client/src/actions/index.js | UTF-8 | 5,848 | 2.59375 | 3 | [] | no_license | import axios from 'axios'
import { SCREEN_RESIZE, FETCH_TOTALS, FETCH_USER, OPEN_MODAL, REFRESH_MAP, INFO_WINDOW, SET_SEARCH_OPTIONS, SEARCH_OPENMATS, CREATE_OPENMAT, SHOW_OPENMAT, SEARCH_GYMS, SHOW_GYM, RESET_MAT_ID, CLEAR_PREVIOUS, UPDATE_OPENMAT, UPDATE_GYM, SORT_BY } from './types'
//stores the width of the curr... | true |
ce9a5f5be2f41a6b8e0a248547c3114b29de0054 | JavaScript | barcvilla/web_programming | /JavaScript-desde-0/Modulo1/clase-2/script2.js | UTF-8 | 6,102 | 4.34375 | 4 | [] | no_license | /**
* Strings
*/
function workingWithStrings()
{
let saludo = 'Bienvenidos a Escuela Digital';
//Propiedades
console.log(`Longitud de variable saludo: ${saludo.length}`);
//Metodos sin parametros
console.log(saludo);
console.log(`Eliminando los espacios en blanco: ${saludo.trim()}`);
con... | true |
daecc584f68338b5c1c3626101f9b260561a4c78 | JavaScript | goekboet/reactcal | /src/Calendar/StateFuncs/StateFuncs.js | UTF-8 | 1,356 | 2.75 | 3 | [] | no_license | import D from 'date-fns';
import _ from 'lodash';
const MonthLabel = date => D.format(date, 'MMMM YYYY');
const NextMonth = date => D.addMonths(date, 1);
const LastMonth = date => D.subMonths(date, 1);
const WeekLabel = date => D.format(date, '[v.]W MMMM YYYY');
const NextWeek = date => D.addWeeks(date, 1);
const Last... | true |
2f45145aa374af7c83559d1e7afda2e5817dac2b | JavaScript | debojeetjha10/video-chat-application-client-side | /src/components/Navbar/Navbar.js | UTF-8 | 2,378 | 2.6875 | 3 | [] | no_license | //this nis the navbar component
import React from 'react';
import './Navbar.css';
import teams_logo from './icon/teams.png'
import {Link} from 'react-router-dom'
import usr_logo from './icon/user.png'
class Navbar extends React.Component {
// constructing the class to handle the input in search field
//input a... | true |
69fc36aabceb5c7efa09fe1202993ae2bcbdb07b | JavaScript | yawnr/todo_list | /app/assets/javascripts/todo_store.js | UTF-8 | 2,133 | 3.03125 | 3 | [] | no_license | "use strict";
(function(root){
var TodoStore = root.TodoStore = {};
var _todos = [];
var _callbacks = [];
TodoStore.addChangeHandler = function(callback) {
_callbacks.push(callback);
};
TodoStore.removeChangeHandler = function(callback) {
var idx = _callbacks.indexOf(callback);
_callbacks.spl... | true |
954693e65093fbfa5d85363531011bb1ae5bf4a8 | JavaScript | perria/CursoIngresoJS | /1-EntradaSalida/jsEntradaSalida-9.js | UTF-8 | 401 | 3.5 | 4 | [] | no_license | /*Debemos lograr tomar el importe por ID ,
transformarlo a entero (parseInt), luego
mostrar el importe con un aumento del 10 %
en el cuadro de texto "RESULTADO".*/
function MostrarAumento()
{
var sueldo;
sueldo=document.getElementById('sueldo').value;
var resultado;
resultado=parseInt(sueldo)*0.1+parseInt(sueldo)... | true |
fcbe21efc3494f393a760961c995430f3eb51d86 | JavaScript | MyronTheDeveloper66/album-viewer | /Album Finder/app.js | UTF-8 | 1,737 | 3.328125 | 3 | [] | no_license | // Test input form
// const searchArtist = document.getElementById('search-artist');
// searchArtist.addEventListener('keyup', () => {
// console.log(searchArtist.value);
// });
// Init iTunes class
const itunes = new iTunes();
// Init UI class
const ui = new UI();
// Get Artist
// Event listener for ... | true |