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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2e36c73dfb4c1a4f960b434c3125eadf3e800f2e | JavaScript | jferza/LeetCode-Submissions | /MaximumSubarray.js | UTF-8 | 455 | 3.125 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var maxSubArray = function(nums) {
let curMax = -Infinity;
let curSum = 0;
for(let i = 0; i < nums.length; i++){
curSum = 0;
for(let j = i; j < nums.length; j++){
curSum += nums[j];
if(curSum ... | true |
67accd65bd51bb733793edb0b76f09c515d7ac7e | JavaScript | ElenaG518/react-context-translate | /src/contexts/LanguageContext.js | UTF-8 | 844 | 3.265625 | 3 | [] | no_license | import React from 'react';
// For values that get shared we can use any type of valid javascript
// value (string, array, object, number, etc)
// the consumer and Provider components are created automatically when we create a new context object.
//here we are exporting a new context object and giving it an intiia... | true |
19cc0fb59a78f49d4077eac08e294a301328b935 | JavaScript | NikodemMarek/sokoban | /src/objects/box.js | UTF-8 | 1,641 | 3.078125 | 3 | [] | no_license | /**
* @module box
*/
import { BOARD_DIMENSIONS } from '../constants.js'
/**
* Przechowuje informacje o pudełku i pozwala na wykonywanie operacji na nim.
* @name module:box#Box
*/
export default class Box {
/**
* Przyjmuje i zapisuje do zmiennych informacje o pudełku.
* @param {module:index#Position... | true |
d12f8554c5ae330118007930b1542e49f56ce98a | JavaScript | hpstream/node_all | /files/files.js | UTF-8 | 2,207 | 2.59375 | 3 | [] | no_license | /**
* Created by hp on 2018-01-02.
*/
var path = require('path')
var http = require('http');
var fs = require('fs');
//网络爬虫的基本原理
// http.get('http://m10.music.126.net/20180102193840/2477f47cda62dd9711220454f70e4d52/ymusic/f92c/217d/0b04/dcd03bbe6fa0d90d9c6558b16a95f234.mp3',(res) =>{
//
// var data = "";
// res.s... | true |
f76df1a0131ead9fe2c6615572c082ef12f4c3fb | JavaScript | vijay010498/js-and-node.js | /node/class2/real-notes-app/services/auth.js | UTF-8 | 769 | 2.625 | 3 | [] | no_license | const {scrypt, randomBytes} = require('crypto');
const {promisify} = require('util');
const {Buffer} = require('buffer');
const scryptAsync = promisify(scrypt)
class Password {
static async toHash(password) {
const salt = randomBytes(8).toString("hex");
const bufTemp = (await scryptAsync(password... | true |
9cb973eaf1ec39ab8d17fe03d20fc8cf179fd0b5 | JavaScript | FloatingFowl/Mathpad | /app/static/js/gistadd.js | UTF-8 | 623 | 2.546875 | 3 | [] | no_license | var addGist = (function () {
var create = function () {
var str = document.getElementById("t1").value;
str.trim();
str = str.replace(/</g, '< ').replace(/>/g, ' >').replace(/\n{2,}/g, '\n').replace(/ +/g, ' ');
if (str.length == 0) {
alert("Heading should have some value.");
return;
}
var data =... | true |
096bb1ea25edee39bd7d59102099a34f817ab8e5 | JavaScript | abhinavramkumar/simplilearn-auth-test | /src/components/SelectUsername/index.js | UTF-8 | 2,111 | 2.65625 | 3 | [] | no_license | import { useAuthDispatch } from 'components/AuthContext';
import React, { useState } from 'react';
import { toast } from 'react-toastify';
const selectUsername = async (body) => {
try {
const response = await fetch("/api/auth/select-username", {
method: "post",
headers: {
"content-type": "app... | true |
17976c9aa59b9b8564cc7912e1599d3980657bc0 | JavaScript | dpshka/crypto_dashboard_test | /src/helpers/generic.methods.js | UTF-8 | 2,555 | 3.171875 | 3 | [] | no_license | import { matchPath } from 'react-router-dom';
/**
* @name @matchDynamicRoute
* @description match the dynammic path with the current page path
* @requires Current defined route object
* @returns Boolean (True if matched)
* */
export const matchDynamicRoute = route => {
const pathname = window.location.pathname;... | true |
44dee06b8702ef94af67514e7e146d501ef34f6c | JavaScript | IvanLiaskovski/Tajam | /src/js/script.js | UTF-8 | 3,677 | 2.90625 | 3 | [] | no_license | "use strict";
function selectElement(el) {
return document.querySelector(el);
}
function selectElements(el) {
return document.querySelectorAll(el);
}
//Nav Toggle
selectElement(".nav-toggler").onclick = function () {
selectElement(".nav-container").classList.toggle("active");
this.classList.toggle("... | true |
f17f06c0c37c6741af39d61083633e314dc962bf | JavaScript | jmanek/reddittv | /tv.js | UTF-8 | 4,809 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | $(function() {
setupIframe();
buildSubredditList();
setSubreddit(getCurrentSubreddit(), false);
// window.onhashchange = playVideo
$('#skipNextArrow').mouseup(function() {
setVideo((parseInt(getCurrentVideoID()) + 1).toString());
$('.carousel').carousel('next');
});
$('#skipPrevArrow').mouseup(function() {... | true |
1deb9abd33fce43f81fadbee994893e95adaa4ce | JavaScript | brielgah/Proyectos_Tecnologias_Para_La_Web | /Proyecto_01/form.js | UTF-8 | 13,809 | 2.828125 | 3 | [] | no_license | var nombre = document.getElementById('nombre');
var ap_paterno = document.getElementById('ap-paterno');
var ap_materno = document.getElementById('ap-materno');
var telefono = document.getElementById('telefono');
var celular = document.getElementById('cel');
var error = document.getElementById('error');
var boleta = doc... | true |
7baf57f0827d4d515a45880443c1a00c37452c06 | JavaScript | S17cis526/bootstrap-Reedfrost | /script.js | UTF-8 | 993 | 2.734375 | 3 | [] | no_license | $('#the_button').on('click', function(){
alert("Hi");
});
$('#show_modal').on('click', function(){
$('#my_modal').modal();
});
$('#close_modal').on('click', function(){
$('#my_modal').modal('hide');
});
var displayMessage = function(message, type){
var html = '<div id="javascriptMessage"... | true |
d42635770c964a287c72c914f0f0d7ee80e9a49f | JavaScript | Bhupendrasimha/myown | /src/article/reducer.js | UTF-8 | 859 | 2.609375 | 3 | [] | no_license | import * as actionTypes from './actionTypes';
import { initialState } from './constants';
export default function (state = initialState, action) {
const { type, payload } = action;
switch (type) {
case actionTypes.SET_ARTICLE:
return setArticle(state, payload);
// case actionTypes.... | true |
d77d0a0d93b05580b573394d34e74b27f1ec1934 | JavaScript | ctc-oss/cognizen-founding-fathers-demo | /js/templates/C_MultipleChoiceImage.js | UTF-8 | 12,188 | 2.71875 | 3 | [] | no_license | /*!
* C_MultipleChoiceImage
* This class creates a template for multipleChoice type questions.
* Must be added to the template switch statement in the C_Engine!!!!!!!!!!!
* VERSION: alpha 1.0
* DATE: 2013-6-05
* JavaScript
*
* Copyright (c) 2013, CTC. All rights reserved.
*
* @author: Philip Double, doublep... | true |
b25f72883fd57fc6416e9b84f31734cf71e9cc78 | JavaScript | teddarcuri/arcuriv | /app/components/canvas-scene.js | UTF-8 | 5,269 | 2.578125 | 3 | [] | no_license | import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function() {
// Scene Elements
var container,
camera,
scene,
renderer,
theme,
group;
// Mouse Position
var mouseX = 0,
mouse... | true |
1d38c1a77a62591ee1e4fe1a48c78312975533dd | JavaScript | tmjnrta/sprint | /app/Services/CodeGenerator/PatternManager.js | UTF-8 | 1,521 | 2.671875 | 3 | [] | no_license | 'use strict'
const DefaultPattern = require('./Pattern/DefaultPattern')
const PatternContract = require('./Pattern/PatternContract')
class PatternManager {
constructor(config) {
this.config = config
this.establishedDriver = {}
this.sourceDrivers = {
default: this.createDefaul... | true |
9b7449e1aa925f908306e6687d15159c75f7f92b | JavaScript | AnslyK/Obilan | /back-end/controllers/pizza/pizzaOrder.js | UTF-8 | 1,076 | 2.515625 | 3 | [] | no_license | async function addPizzaOrder(req, res) {
const { idPlayer, idPizza, nb } = req.body;
/*TODO: Ajout du pseudo à la place de "idPlayer"
et requête pour avoir l'id */
const DoesPizzaExist = 'SELECT idPizza FROM pizza WHERE idPizza=?';
con.query(DoesPizzaExist, idPizza, function(err,result) {
... | true |
c732633ad7a34b0702cd1b10b35ccbe04da8ad8e | JavaScript | jeffhou/realm-of-wu | /app.js | UTF-8 | 8,442 | 2.734375 | 3 | [] | no_license | const pug = require('pug')
const compiledView_Inventory = pug.compileFile('templates/inventory.pug');
const compiledView_Combat = pug.compileFile('templates/combat.pug');
const compiledView_Map_Location = pug.compileFile('templates/map-location.pug');
const express = require('express')
const app = express()
function ... | true |
5f8c324fa5ee658e08a3bda0bcafaf2c51a519d0 | JavaScript | cristianprochnow/eloquent-javascript-exercises | /program-structure/script.js | UTF-8 | 1,283 | 3.90625 | 4 | [
"MIT"
] | permissive | console.log('[#1] > first exercise...')
let word = '';
for (let masterCounter = 1; masterCounter <= 7; masterCounter++) {
word += '#'
console.log(word)
}
console.log('[#2] > second exercise...')
for (let masterCounter = 1; masterCounter <= 100; masterCounter++) {
if ((masterCounter % 3 === 0) && (masterCount... | true |
853e65f1557b88f82e48f94aba1ddaa37bf8d101 | JavaScript | ngokscofield/projectWeb | /LTW.TracNghiemOnline_Version2/WebContent/js/validate.js | UTF-8 | 524 | 2.921875 | 3 | [] | no_license | function validate(){
var password = document.getElementById("password");
var confirm_password = document.getElementById("confirm_password");
//alert(password.value);
//alert(confirm_password.value);
var warningPassword = document.getElementById('warningPassword');
if(password.value != confirm_password.value){
c... | true |
118f144dfc9e31e19cebfae52c54eee0666bc8b1 | JavaScript | Psihosomatika/ProjectMesto | /src/Card.js | UTF-8 | 1,857 | 2.84375 | 3 | [] | no_license | import {popupImg2} from './PopupImage.js';
import {popupProfile2} from './PopupProfile.js';
export default class Card{ //класс создающий карточку
constructor(name,link){
this.cardElement = this.createCard(name,link);
}
createCard(name,link){// будет создавать DOM-элемент карточки
//создание ст... | true |
ea4f2f198f17eed58c67f8e54a6c8b399d7be0aa | JavaScript | jeffry88/jeff-blog-admin | /static/js/Routers.js | UTF-8 | 1,011 | 2.6875 | 3 | [
"MIT"
] | permissive | // 页面加载完不会触发 hashchange,这里主动触发一次 hashchange 事件
window.addEventListener('DOMContentLoaded', onLoad);
// 监听路由变化
window.addEventListener('hashchange', onHashChange);
// 路由视图
var routerView = null;
function onLoad() {
routerView = document.querySelector('#content_body');
onHashChange();
}
// 配置路由,路由变化时,根据路由渲染对应 ... | true |
574f4c4221fb8b9cd079f405010f4b9a45205f10 | JavaScript | Nur-Mohammed/javaScript-Assignment | /Assignment.js | UTF-8 | 1,212 | 3.90625 | 4 | [] | no_license | // Problem-1
// ==============================================
function feetToMile(feet) {
if (feet < 0) {
return "Distance cannot be negetive value";
} else {
var mile = feet * 0.000189394;
return mile;
}
}
// Problem-2
// ==============================================
function w... | true |
61ba0e29f9e8978e85024c77a01ae12a0fe21236 | JavaScript | greatmetis/frontendMentor-challenge-interactivePricingComponent.github.io | /script.v1.js | UTF-8 | 2,655 | 3.34375 | 3 | [] | no_license | /** Version: script.v1 */
/* This is the original script I wrote, while through the process of learning, my skill was improving. Also,I would like to be proficient at prototyping in JS, so I challenge myself to write another version- script.v2-.*/
// this is the toggle to switch between yearly and monthly billing
... | true |
5e2cc9cc69a25af6343e86f65e51f89f5de05fa3 | JavaScript | raghunandan15102009/time-app | /sketch.js | UTF-8 | 240 | 2.59375 | 3 | [] | no_license | var form,state;
function setup(){
createCanvas(1200,400);
form=new Form();
state=new State();
database=firebase.database();
}
function draw(){
display();
}
function display (){
form.display();
state.display();
} | true |
9a4652cdb3a61e7c1b3650716bf49ea94c2d072f | JavaScript | Westerdals/pro104-eksamen-Gruppe42 | /JS/main.js | UTF-8 | 19,013 | 2.890625 | 3 | [] | no_license | let feedValues;
let feedSwitch = 0;
let feedColumn;
let editTaskID;
let tempTask;
var quoteArray = [
"To plant a garden is to believe in tomorrow. - Audrey Hepburn",
"Watching something grow is good for morale. It helps us believe in life. - Myron S. Kaufman",
"Don't judge each day by the harvest you reap,... | true |
d98d28fac7cba6780d6ddc0fd08f5fea31e48005 | JavaScript | nickbrandt/gitlab-ui | /src/utils/breakpoints.js | UTF-8 | 469 | 2.609375 | 3 | [
"MIT"
] | permissive | export const breakpoints = {
xl: 1200,
lg: 992,
md: 768,
sm: 576,
xs: 0,
};
const BreakpointInstance = {
windowWidth: () => window.innerWidth,
getBreakpointSize() {
const windowWidth = this.windowWidth();
const breakpoint = Object.keys(breakpoints).find((key) => windowWidth > breakpoints[key]);
... | true |
a2a9a354485cd2c51f9d1fa042991c477a1896bd | JavaScript | rodrigo-b-silva/NodeApp_Apostila | /src/routes/users.js | UTF-8 | 890 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive | //módulos
const express = require('express');
const routerUser = express.Router();
const User = require('../models/users');
//importa e instancia o UsersController
const UsersController = require('../controllers/users');
const userController = new UsersController(User);
//rota para lista de usuarios
routerUser.get('... | true |
77bac2e1df97cebb32d612e1d5ee6667c4a1b2cc | JavaScript | JasonHungRD/ithome_ironman_2020 | /day-35/testing/download-testing.js | UTF-8 | 761 | 2.53125 | 3 | [] | no_license | const downloadUtil = require('../../day-36/utils/downloadUtil');
const url = 'https://download.jetbrains.com/webstorm/WebStorm-2020.2.4.exe';
const url2 = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTVQXnzYOCmMJwf5mCE6cqxk_rhbwgxzebgkA&usqp=CAU';
const dest = './downloads/WebStorm.exe';
const dest2 = './do... | true |
f0e5eb1b64321df6cd66d7733779e122e0688956 | JavaScript | kmahaley/Web_dev_CS5610 | /MyWebsiteStarterPages/experiments/CSS_Week7 with JS/jquery_7_1.js | UTF-8 | 902 | 2.828125 | 3 | [] | no_license | $(function () {
/*getting data from txt file to alert*/
$.get('../Week7/story.txt', function (data) {
alert(data);
});
$("#display_text").load('../Week7/story.txt');
/*trying various display properties*/
$('#slide_t').click(function () {
$('.try_property').slideToggle('slow')... | true |
8e036e38e55fc20d003665ec769383d80260e3bc | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/12cdbe8b7223def5be72226e955f7602.js | UTF-8 | 399 | 2.78125 | 3 | [
"MIT"
] | permissive | load("201224b0d1c296b45befd2285e95dd42.js");
// While eval code is running, findScripts returns its script.
var g = newGlobal();
var dbg = new Debugger(g);
var log;
g.check = function () {
log += 'c';
var frame = dbg.getNewestFrame();
assertEq(frame.type, "eval");
assertEq(dbg.findScripts().indexOf(fr... | true |
c98ab77028686b0a8e327ce7c174242da4269c34 | JavaScript | kevinlimantoro/codewars-solution | /playingWithDigits.js | UTF-8 | 276 | 3.25 | 3 | [] | no_license | function digPow(n, p){
var origin = p;
var arr = n.toString().split('');
var res = arr.reduce((total,current) => {
total += Math.pow(current,p++);
return total;
},0);
return res / n === origin ? res/n : -1;
}
console.log(digPow(89,1)); | true |
20db29a04370010d980da948abc51d4bb3f061c3 | JavaScript | cbonaco1/final_project | /frontend/components/errorMessages.jsx | UTF-8 | 961 | 2.53125 | 3 | [] | no_license | var React = require('react');
var ErrorStore = require('./../stores/errors');
var ErrorMessages = React.createClass({
getInitialState: function() {
return { messages: ErrorStore.getMessages() };
},
//listen to ErrorStore
componentDidMount: function() {
this.listenerToken = ErrorStore.addListener(this... | true |
9e4d7e92fc6534afed8fe52d88a95ae16446458d | JavaScript | jalbersh/exercism | /javascript/scrabble-score/scrabble-score.js | UTF-8 | 606 | 2.8125 | 3 | [] | no_license | var values = {'A':1, 'E':1, 'I':1, 'O':1, 'U':1, 'L':1, 'N':1, 'R':1, 'S':1, 'T':1,
'D':2, 'G':2,
'B':3, 'C':3, 'M':3, 'P':3,
'F':4, 'H':4, 'V':4, 'W':4, 'Y':4,
'K':5,
'J':8, 'X':8,
'Q':10, 'Z':10}
functio... | true |
f8cbb4f48db5397e0b9c44c7dca4f4a13b98986b | JavaScript | scbowler/Firebase-Angular-Example | /script.js | UTF-8 | 2,964 | 2.96875 | 3 | [] | no_license | var sgtApp = angular.module('sgtApp', ['firebase']);
// Directives
// Creating a directive named fb-bind that allows for direct editing
sgtApp.directive("fbBind", function(studentService) {
return {
restrict: "A", // The directive will be used as an attribute only
scope: {
fbValue:... | true |
287c9433b01c7c2193ab151babfdb67a0f674a1e | JavaScript | msergeant/sudoku-hint-machine | /src/js/SudokuPencilMarks.js | UTF-8 | 2,736 | 2.9375 | 3 | [
"MIT"
] | permissive | var SudokuPencilMarks = {
create: function(sudokuBoard){
var board = sudokuBoard.values();
var rawMarks = [];
function removeElement(array, value){
var index = array.indexOf(value);
if(index > -1){
array.splice(index, 1);
}
}
function eliminateRowValues(values, row){
... | true |
695f3bc41abf8f0cdc6c86aeda3a5f2b08dbf2a9 | JavaScript | horkage/nodeschool | /promise-it-wont-hurt/multiple_promises.js | UTF-8 | 520 | 2.859375 | 3 | [] | no_license | var q = require('q')
var defer1 = q.defer()
var defer2 = q.defer()
var util = require('util')
function all(promises) {
var internalPromise = q.defer()
var counter = 0
promises[0]
.then(++counter)
.then(console.log)
promises[1]
.then(++counter)
.then(console.log)
if (counter == 2) {
in... | true |
9fecd07a9ef2c1eb68bd22d16d0c94d30996545b | JavaScript | indalipaul2008/PROJECT-27 | /bob.js | UTF-8 | 489 | 2.5625 | 3 | [] | no_license | class Bob{
constructor(x,y,radius){
var options = {
isStatic:false,
restitution: 1,
friction:0,
density:7.2,
}
this.body = Bodies.circle (x,y,radius,options)
//this.body = Bodies.circle (x,y,25,options)
this. radius = radius
World.add(world... | true |
cbb36fa286fe03724101ac7138cc303e94c4964d | JavaScript | honath/no-talking-timer | /script.js | UTF-8 | 4,054 | 3.921875 | 4 | [] | no_license | /**
* Get the primary element ".wrapper" from the page
* Hide the element on load, to be toggled in later use
*/
const browserDisplay = document.querySelector(".wrapper");
browserDisplay.style.display = "none";
/* Grab timer element from page */
const displayTime = document.querySelector("#time-remaining");
/* "Cl... | true |
df5f8153235ba6090f52ced88789c74804e8660e | JavaScript | jd-buzz/coffeekraken | /effect/text-intro/src/js/slideIn.js | UTF-8 | 1,040 | 2.859375 | 3 | [
"MIT"
] | permissive | import __whenInViewport from '@coffeekraken/sugar/js/dom/whenInViewport'
import __querySelectorLive from '@coffeekraken/sugar/js/dom/querySelectorLive'
/**
* @name slideIn
* @namespace text-intro
* @type Function
*
* Init the listener for the "slide-in-" intro to work
* Supported slides animati... | true |
828c691be699d3641323f8b5c889dee5d1120b4d | JavaScript | gloomyline/blog-app | /msgpack.js | UTF-8 | 942 | 2.609375 | 3 | [] | no_license | /**
* 以下是测试msgpack
* 将json.object数据转换成二进制提高数据在网络中传输速率
*/
var msgpack = require('msgpack5')() // namespace our extensions
, a = new MyType(2, 'a')
, encode = msgpack.encode
, decode = msgpack.decode
// msgpack注册
msgpack.register(0x42, MyType, mytipeEncode, mytipeDecode)
// console.log(encode({ 'hello':... | true |
4ccb917e4078ca085ce08374faae543ca71e4e5d | JavaScript | helsingborg-stad/styleguide | /source/js/form/conditions.js | UTF-8 | 2,300 | 2.90625 | 3 | [
"MIT"
] | permissive | class Conditions {
constructor(form) {
form && this.init(form);
}
init(form) {
const groups = form.querySelectorAll('[conditional-target]');
const conditionalElements = form.querySelectorAll('[conditional]') && Array.from(form.querySelectorAll('[conditional]')).map(element => eleme... | true |
2a4936af7cf1fc022381f38bd876df56e914bbb1 | JavaScript | rynxr/demo-parselov | /demo-parselov.js | UTF-8 | 14,595 | 2.765625 | 3 | [] | no_license | var fs = require('fs');
var zlib = require('zlib');
var util = require('util');
var as_json = process.argv[4] == "-json";
var input = fs.readFileSync(process.argv[3], {
"encoding": "utf-8"
});
zlib.gunzip(fs.readFileSync(process.argv[2]), function(err, buf) {
var g = JSON.parse(buf);
////////... | true |
a6925c63fab4d8478be50e83fdbb7b0aa5a4797e | JavaScript | golfyos/tea-bot | /tea-admin/src/components/Command.js | UTF-8 | 1,707 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
import { Button } from "reactstrap";
import {HOST} from "../config/config"
import axios from 'axios'
import "../styles/Command.css";
const CALL_SEND_SUMMARY = HOST+"/api/v1/summary"
const CALL_SEND_HOWTO = HOST+"/api/v1/howto"
class CommandScreen extends Component {
state... | true |
1dd7fb80d4c367b3580b540e866a0b3f20a1afe1 | JavaScript | nazarko310/JS_aditional | /lessons5/main.js | UTF-8 | 4,754 | 3.453125 | 3 | [] | no_license | // Реалізовуємо свій компютерний магазин.
// ===
// Необхідно реалізувати базовий клас комютера. Який має лише параметри:
// Оперативна память.
// Потужність процесора. (цифра від 0 до 1000)
// Назва.
// В кожного компютера має бути метод включання.
// ===
// Від базового компютрера треба реалізувати ноутбу... | true |
92d22a7e6626370963bd66e4cd8b95fb00e4ccbe | JavaScript | munshiprodip/air-chat | /src/redux/reducers/chatReducer.js | UTF-8 | 1,329 | 2.546875 | 3 | [] | no_license | const initialState = {
chatOpen: false,
allConversations: [],
activeConversation: {},
receiver: {},
messages: [],
newMessages: [],
};
const chatReducer = (state = initialState, action) => {
switch (action.type) {
case "SET_ALL_CONVERSATION": {
const newState = {
...state,
allCon... | true |
622d5934fb8de9d3546e19452ad5b690602a5628 | JavaScript | TheLightningStrikes/tweetbot-for-discord | /src/helpers/logger.js | UTF-8 | 3,764 | 2.765625 | 3 | [] | no_license | const config = require("../config/"+(process.env.CONFIG_FILE || "config"));
const fs = require('fs');
const {resolve} = require("path");
const datetime = new Date(Date.now());
const date = datetime.toLocaleDateString().replace(/\//g,'-');
const time = `${datetime.getHours()}h${datetime.getMinutes()}m${datetime.getSeco... | true |
f4b32f769f47d22c159392f29a4abeafe3e3f8ec | JavaScript | nanpatur/twatt | /client/assets/js/twatt.js | UTF-8 | 2,236 | 2.84375 | 3 | [] | no_license | $(document).ready(function(){
getTimeline()
});
$('#timeline').click(() => {
getTimeline()
})
let getTimeline = () => {
$.ajax({
url: 'http://localhost:3000/twatt/',
method: 'GET',
dataType: 'JSON',
success: function(result){
console.log(result);
if(result.error){
$("#div-con... | true |
589378f8b0c3e05a462b85124074c5fc558f6adf | JavaScript | admarket14/grocerieslistapp-abhisheksingh98 | /grocery-list/controller/login.js | UTF-8 | 936 | 2.875 | 3 | [] | no_license | const userList = JSON.parse(localStorage.getItem('userList'));
const userName = localStorage.getItem('userName');
const itemList = JSON.parse(localStorage.getItem('groceyItem'));
console.log(userList,userName);
if(userName === null || userList=== null || itemList===null){
localStorage.setItem('userName','');... | true |
7f556f62f443bdac62c547a27e431dc5bfbc9304 | JavaScript | chandankrishnan/weather | /controller/index.js | UTF-8 | 2,732 | 2.625 | 3 | [] | no_license | /**
* define require module
*/
var express = require('express'),
router = express.Router(),
request = require('request'),
moment = require('moment'),
geocode = require('google-geocode')
showtimes = require("showtimes"),
cricapi = require("node-cricapi");
geocode.setApiKey('AIzaSyAvYqMsQQRVHfJNmWcXnzqN... | true |
ad03c4cbf1bc78d4d3c9ba0a41195b94d9931802 | JavaScript | grokit/grokit.github.io | /kiyoshi_ni_shokuhatsu/src/engine/ESGameController.js | UTF-8 | 2,970 | 2.515625 | 3 | [
"MIT"
] | permissive | class ESGameController extends EngineStepBase {
constructor() {
super();
this._console = Factory.getConsole();
this._world = Factory.getWorld();
this._levels = Factory.getLevels();
this._camera = Factory.getCamera();
this._permanentState = Factory.getPermanentState();... | true |
fc335926cbdf44cca3d20d7c82b4252d8b494971 | JavaScript | TIzkon/Ejercicios | /plantillas.js | UTF-8 | 627 | 3.734375 | 4 | [] | no_license | 'use strict'
//Platillas de texto
/*
Con las comillas invertidas podemos concatenas el texto y dividirlo y asi hacer platillas como he hehco abajo y pra introducirle las variables usamos el $ y lo metemos entre {} para la plantilal usamos <h1></h1>,<h2></h2>,<h3></h3>,...
y para mostrarlo en la pantalla usamos el docu... | true |
d24ca3c92f6df001270c44216f3200589a13dc24 | JavaScript | mnovinger/spyder | /src/spyder-head.js | UTF-8 | 1,422 | 2.625 | 3 | [] | no_license | var Spyder = {};
(function() {
function time(t) {
if (!t) {
t = new Date().getTime();
}
return t - SPYDER_PAGE_START_TIME;
}
Spyder = {
data: {
timings: {},
dom: {}
},
start: function(id, type) {
var timings = this.data.timings;
if (!timings[id]) {
... | true |
0e909f247e31e319cbd0fd26ae44c8c4ebab8679 | JavaScript | wangscript007/eventjs | /tests/unittest/test_callbacklist_basic.js | UTF-8 | 10,636 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | // eventjs library
// Copyright (C) 2019 Wang Qi (wqking)
// Github: https://github.com/wqking/eventjs
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LIC... | true |
794a541943aa398be367a3313843e3010fdaae57 | JavaScript | dmitrykosykh/chess-simulator | /src/components/App.jsx | UTF-8 | 7,454 | 2.703125 | 3 | [] | no_license | import React from 'react';
import {
COLOR, Chessboard, MOVE_INPUT_MODE, INPUT_EVENT_TYPE,
} from 'cm-chessboard';
import _ from 'lodash';
import Chess from '../chess';
import DialogColorSelection from './DialogColorSelection';
import DialogLevelSelection from './DialogLevelSelection';
import Game from './Game';
impor... | true |
a135436fa108df69dc198cfd70a8ce277969a80e | JavaScript | Cycling74/n4m-examples | /routeServer/js/message_broker.js | UTF-8 | 2,066 | 2.953125 | 3 | [
"MIT"
] | permissive | // --------------------------------------------------------------------------
//
// message_broker.js : given a message, transmit it to any registered
// listeners. Keep track of attachments, and kill
// any listeners that go 'dead'.
//
// ----------------------------------------... | true |
d24a131d2fd158883e0a7a276c589ec64429944f | JavaScript | gaearon/redux-optimist | /src/index.js | UTF-8 | 4,233 | 2.96875 | 3 | [
"MIT"
] | permissive | 'use strict';
var BEGIN = 'BEGIN';
var COMMIT = 'COMMIT';
var REVERT = 'REVERT';
// Array({transactionID: string or null, beforeState: {object}, action: {object}}
var INITIAL_OPTIMIST = [];
module.exports = optimist;
module.exports.BEGIN = BEGIN;
module.exports.COMMIT = COMMIT;
module.exports.REVERT = REVERT;
functio... | true |
0f6d23434ab0ac2855c8880fb88ab3d1438f153f | JavaScript | bojanstef/todo-api | /server.js | UTF-8 | 4,648 | 2.78125 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const _ = require('underscore');
const db = require('./db.js');
const app = express();
const PORT = process.env.PORT || 3000;
var todos = [];
var todoNextId = 1;
app.use(bodyParser.json());
app.get('/', function(request, response) {
resp... | true |
c7d255be1d568d22246cb02f061467b39a718435 | JavaScript | jon-lin/HurricaneDataViz | /lib/createTrendlines.js | UTF-8 | 1,844 | 3.171875 | 3 | [] | no_license | //Resources used to create best fit line were:
//http://bl.ocks.org/benvandyke/8459843
//https://www.varsitytutors.com/hotmath/hotmath_help/topics/line-of-best-fit
let lineProperties = {
'allHurricanes': [
allHurricanes, "allHurricanes", "darkgreen"
],
'majorHurricanes': [
majorHurricanes, "majorHurricane... | true |
f7a29f7ef097d17869c65e5be885fd2d9419c663 | JavaScript | forward-c1903l/forward-c1903l | /Tran/Tran-index.js | UTF-8 | 1,973 | 3.453125 | 3 | [] | no_license | let arrowLeft = document.getElementById("arrow-left"); // lấy mũi tên qua trái
let arrowRight = document.getElementById("arrow-right");// lấy mũi tên qua phải
let slide = document.querySelector(".carousel-item");//lấy khu vực carousel-item
console.log(arrowLeft)
console.log(slide)
let arrayColor = ['black', 'blue'... | true |
1fcb98833fb4ad7cafb0baf3cf568acc9b42f69e | JavaScript | MrGuojunwei/webSocket | /client/src/main.js | UTF-8 | 2,797 | 2.53125 | 3 | [] | no_license | /*
* @Description: 客户端脚本
* @Author: 郭军伟
* @Date: 2019-12-04 15:12:29
* @lastEditTime: Do not edit
*/
require('./chart.css');
const $ = require('jquery');
const io = require('socket.io-client');
const socket = io('ws://localhost:3001');
let username = null, password = null;
let clickCount = 0;
// 登录
$('.login-b... | true |
7b998a2877313a899090801838bac20b3a7ed34e | JavaScript | impactbyte-learn/course-web-fullstack-solution | /api-project-1/level-3/index.js | UTF-8 | 2,082 | 3.84375 | 4 | [] | no_license | //LEVEL 3 WITHOUT ASYNC
// fetch("http://api.github.com/users/muhammadhaekal/followers")
// .then(response => {
// return response.json();//response.json() is asynchronous
// })
// .then(response => {
// response.map((res, index) => {
// document.getElementById("github-followers... | true |
abc4768695f30088f9b891600a66bb85c40fa6a4 | JavaScript | AIUshedo/core-engineering | /engineering-22/week-3/control-flow/main.js | UTF-8 | 688 | 3.21875 | 3 | [] | no_license | var moneyInMyPocket = prompt("How much money do you have?");
var drinksHadSoFar = prompt("How many drinks have you had?");
var freeCrisps = prompt("Are the crisp free?");
//important line above
if (moneyInMyPocket > 10 && drinksHadSoFar < 3 ) {
console.log("Another drink, please!");
} else if (moneyInMyPocket >= 5 ||... | true |
784fb176bbdacdf4b7afb654cab376b2393a5c15 | JavaScript | whoisryosuke/ryosuke-gatsby-blog | /gatsby-node.js | UTF-8 | 5,583 | 2.515625 | 3 | [
"MIT"
] | permissive | /**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
const path = require(`path`);
const { createFilePath } = require(`gatsby-source-filesystem`);
const createPaginatedPages = require("gatsby-paginate");
/**
* Custom Webpack config
*
* Adds aliases for paths (... | true |
2f8aac76b03f9744ae26d4d0bf52d2517dd1d420 | JavaScript | aniolg/git_test | /JS/Lletres/ex_fase1.js | UTF-8 | 527 | 3.703125 | 4 | [] | no_license |
//FASE 1
var nomArray = ["A", "N", "I", "O", "L", " ", "G", "O", "M", "E", "Z", " ", "J", "A", "R", "Q", "U", "E"];
var numLletres = 0;
function mostrarNom() {
var i = 0;
var nomString = "";
for (i = 0; i < nomArray.length; i++) {
if (nomArray[i] != " ") {
nomString += nomArray[i]... | true |
4946aba0923d68bd838ddcf336a4070083f74309 | JavaScript | MartinGorupicZG/IMPERIA-EXTENSION | /Imperia Online_files/google_charts.js | UTF-8 | 3,162 | 2.65625 | 3 | [] | no_license | var chart = {
show: tryToDrawCharts
};
function tryToDrawCharts() {
var dataJsonColumn;
var resource = $("#res-type-charts").val();
$.get(
"generate_chart_colums.php",
{ resType: resource },
function (data) {
dataJsonColumn = JSON.parse(data);
var options... | true |
9cd7749df8adb5a2a103d5b5127821e0cd1737d1 | JavaScript | siddacool/theft | /theft/scripts/sys-var.js | UTF-8 | 8,527 | 2.78125 | 3 | [
"MIT"
] | permissive | /*System Variables*/ ;
var nav = document.querySelector('nav'),
toggle = document.querySelector('#toggle').querySelector('a'),
back = document.querySelector('#back').querySelector('a'),
logo = document.querySelector('#logo').querySelector('a'),
mainContainer = document.querySelector('#mainContainer'),
... | true |
7936ae9233ae26138560e518c388a550b0eea73e | JavaScript | tikritel/ASimpleApi | /useriddetails.js | UTF-8 | 984 | 2.71875 | 3 | [] | no_license | const db = require('./connection');
const useriddetails = {
getAllUseriddetails:function(){
//const that = this;
return new Promise(async (resolve, reject)=>{ //fat arrow functions encompass the surrounding object's context ("this")
const q = 'select * from useriddetails';
try{
const result = await this.... | true |
c2dddbefaa29d05791bf790fe201e53ee3b8fc34 | JavaScript | Angelsmart/shop | /vue-shop/src/api/index.js | UTF-8 | 1,373 | 2.6875 | 3 | [] | no_license | import axios from 'axios';
//export 会把当前模块的变量放在一个对象里导出
// * as T 把变量放在一个有命名(例如:T)对象里,as后面是对象名字 *表示所有的
//axios.defaults.baseURL = 'http://localhost:3000';
//拦截器
axios.interceptors.response.use(function (response) {
return response.data;
}, function (error) {
return Promise.reject(error);
});
// axios 返回... | true |
7a1b7e5f998348f356800e61e3bf9b43b61f3ad6 | JavaScript | CyrilYXR/pre-pos | /practice/section-1/practice-2.js | UTF-8 | 377 | 3.25 | 3 | [] | no_license | 'use strict';
function collectSameElements(collectionA, collectionB) {
var result=[];
for(let i=0; i<collectionA.length; i++){
for(let k=0; k<collectionB.length; k++){
for(let j=0; j<collectionB[k].length; j++){
if(collectionA[i]==collectionB[k][j]){
result.push(collectionA[i]);
... | true |
bda1f2f9336f66032e22bb613a5aff410486beb1 | JavaScript | Jalexx08/myShop | /backend/controllers/auth.js | UTF-8 | 960 | 2.515625 | 3 | [] | no_license | const { response } = require("express");
const bcrypt = require("bcrypt");
const User = require("../models/user");
const { gnerateJWT } = require("../helpers/generate-jwt");
const login = async (req, res = response) => {
const { email, password } = req.body;
try {
const user = await User.findOne({ email });
if... | true |
cc9370aa5d5e7f46177fd7562fc4a4d1f0c165b1 | JavaScript | MrHus/build-your-own-promise | /promise-ide/src/examples/then-chain-error-in-then.js | UTF-8 | 370 | 2.984375 | 3 | [] | no_license | const code = `
const p = MadPromise(resolve => {
setTimeout(() => {
resolve(42)
}, 2000);
});
p.then(v => v * 2)
.then(age => ({
name: 'Maarten Hus',
age
}))
.then(person => {
return x / 20;
})
.then(person => {
LOGGER.info(person);
})
.catch(error => {
LOGGER.error(error.mes... | true |
095f4530176a0bbb0a3bf2248967221ffc2f684d | JavaScript | SpringBoot-Microservices-Vol/react-client | /src/components/services/CandidatesService.js | UTF-8 | 660 | 2.625 | 3 | [] | no_license | import {API} from "../utils/API";
export function addCandidateToCategoryName(candidate, categoryName) {
API.get('categories').then(({data}) => {
let category = data.find(data => data.name = categoryName);
console.log(category);
candidate.categoryDTO = category;
API.post('candidates'... | true |
3f7b6e177bdfd8827cc30c095788d033f5c0030f | JavaScript | IgorYunusov/Mega-collection-cpp-1 | /代码逆袭——超实用的Node.js代码段/chapter04/ch04.buffer.concat/lib/parse-header-string.js | UTF-8 | 602 | 2.8125 | 3 | [] | no_license | /**
* Created by KING on 2015/3/17.
*
* parse-header-string.js
*/
/**
* exports parse function
* @param data
* @returns {*}
*/
exports.parse = function parse(data) {
var lines = data.toString('ascii').split("\n");
var cut, name, host;
for (var i=0, len=lines.length; i < len; i++) {
cut = lin... | true |
0a8b75297c8215c0f9aeb5aeddcf50e15984db85 | JavaScript | yhpf/basic-javascript | /js/p4-basic-events.js | UTF-8 | 413 | 2.890625 | 3 | [] | no_license | // Mouseover, Click and Load
function message(msg)
{
document.getElementById('output').innerHTML = msg + " event";
}
// Change style
function closeMe(){
x=document.getElementById("magic");
x.className="closed";
}
function openMe(){
x=document.getElementById("magic");
x.className="open";
... | true |
c8550fe5113225e1fe743a6b56eb426b2cff8bd9 | JavaScript | codewithgauri/HacktoberFest | /folders/JSGame/coin.js | UTF-8 | 506 | 3.3125 | 3 | [] | no_license | const wobbleSpeed = 10;
const wobbleDistance = 0.1;
function Coin(initialPosition) {
this.basePosition = this.position = initialPosition.plus(new Vector(0.2, 0.1));
this.size = new Vector(0.6, 0.6);
this.wobble = Math.PI * 2 * Math.random();
}
Coin.prototype.type = 'coin';
Coin.prototype.act = function(s... | true |
83ba54b82a7928db3a4b533de1599aac979cea05 | JavaScript | RyzorBent/budget-app-react | /src/components/BudgetMeter.js | UTF-8 | 1,211 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import { Meter } from "grommet";
class BudgetMeter extends Component {
state = {};
render() {
let expensePercentage = this.props.percentage;
let incomePercentage = 100 - expensePercentage;
let expenseColor = '';
let incomeColor = '#7caeff';
if (in... | true |
a47676fa7c56cba4c77bd17f859bc3358b939ab5 | JavaScript | jenny241093/JS-Core | /01.JS Fundamentals/16.Exam Preparation 2/02.ATM Machine/solution.js | UTF-8 | 1,828 | 3.109375 | 3 | [] | no_license | function solve(input) {
let insertedCash = 0;
let totalCashInATM = 0;
let banknotes = [];
input.forEach(element => {
if (element.length > 2) {
banknotes.push(...element);
banknotes = banknotes.sort((a, b) => b - a);
insertedCash = element.reduce((a, b) => a ... | true |
e9f736fae59af241cbe98f92a0bb756eee872b81 | JavaScript | Iyata/church_app | /view/js/home.js | UTF-8 | 908 | 2.90625 | 3 | [] | no_license |
//message text fields validation
function validateForm(){
var a = document.forms['compose_message']['sender'].value;
var b = document.forms['compose_message']['message'].value;
var x = document.forms['compose_message']['csv_list'].value;
var y = document.forms['compose_message']['dbcont... | true |
a708c6edc2679de2f5a72a51bdffcf64f859c3e7 | JavaScript | takeonfaith/cyphersProject | /src/Components/CentralPlateComponents/LeftSide.js | UTF-8 | 2,518 | 2.515625 | 3 | [] | no_license | import React from 'react'
import Switch from './Switch';
import ThemeToggle from './ThemeToggle';
import '../../Styles/LeftSide.css'
function LeftSide(props) {
function changeCypher(event){
props.cypherCallBackFunc(event.target.value);
}
function changeAction(event){
props.actionCallBackFunc(event.... | true |
a2cd9603645e8c3617e26edf04e4e53fb79e0372 | JavaScript | Bhaswati-Saha/react-express-heroku | /profile.js | UTF-8 | 593 | 2.515625 | 3 | [] | no_license | const handleProfileGet=(req,res,db)=>{
const {id}=req.params;
//let found=false;
db.select('*').from('users').where({id})//here also response after selecting
.then(user=>{
if(user.length)
{
res.json(user[0]);
}
else
{
res.status(400).json('Not found');
}
})
.catch(err=>res.sta... | true |
8ca9484630701d114780986c2dc962a73b162352 | JavaScript | surstrommed/javascript-tasks | /cw-searchAndReplace.js | UTF-8 | 571 | 3.109375 | 3 | [] | no_license | function myReplace(str, before, after) {
let arr = str.split(" ");
let check = before.toLowerCase();
let index = arr.indexOf(before);
if (index > 0) {
if (before[0] === before[0].toUpperCase()) {
after = after[0].toUpperCase() + after.slice(1);
arr[index] = after;
} else if (before[0... | true |
81b5fd3fd3c77951260c1c6fd047265ff65e7b07 | JavaScript | DariaGapeeva/cupcake-task | /src/redux/tableReducer.js | UTF-8 | 2,069 | 2.515625 | 3 | [] | no_license | const TABLE_SET_VALUES = "TABLE_SET_VALUES";
export const TABLE_SET_VALUES_FIRST = "TABLE_SET_VALUES_FIRST";
export const TABLE_SET_VALUES_POLL = "TABLE_SET_VALUES_POLL";
const initialState = {
markets: [
{
id: 1,
name: "First",
rates: {
"RUB/CUPCAKE": 0,
"USD/CUPCAKE": 0,
... | true |
5b282aacaec96e3166610bcb3bdcf33b1dd972a3 | JavaScript | zacharyehren/hangman | /app/scripts/services/WordFactory.js | UTF-8 | 616 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | (function() {
function WordFactory($http) {
const WordFactory = {};
WordFactory.retrieveWord = function(){
var retrieveWord = {
method: 'GET',
url: 'http://localhost:3000/new_game'
};
return $http(retrieveWord).then(function successCallback(response) {
WordFactory.... | true |
1aedf55afc9c5d16bd6eb0cb0e88a1fdaf83dc28 | JavaScript | Schultzz/work | /dataGen/views/javascript/dataHandler.js | UTF-8 | 741 | 2.75 | 3 | [] | no_license | $(document).ready(function(){
$("#search").click(function(){
performSearch()
});
});
function performSearch(){
var amount = $("#amount").val();
console.log(amount);
var data = $("#data").val();
console.log(data);
$("#tbody").html("<tr></tr>");
$.ajax({
type: "GET",
url: "... | true |
f0eb5e0d0ecacc7d9184be90fbc1e120c86ec2a4 | JavaScript | SharifCoding/intro-express-testing | /controllers/deleteShoppingList.js | UTF-8 | 549 | 2.671875 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
function deleteShoppingList(req, res) {
// request URL route will look like: /shopping-lists/:filename
const filename = req.params.filename;
// fs.writeFile takes two arguments: the file path; and a callback function;
fs.unlink(path.join(__dirname, 'shopp... | true |
3d32d0c4af029d1957ea20a6bd588c10a2393da4 | JavaScript | Miaamen/LeetCodeByJS | /easy/Q58.js | UTF-8 | 986 | 4.125 | 4 | [] | no_license | /*58. 最后一个单词的长度*/
/*给定一个仅包含大小写字母和空格 ' ' 的字符串,返回其最后一个单词的长度。
如果不存在最后一个单词,请返回 0 。
说明:一个单词是指由字母组成,但不包含任何空格的字符串。
示例:
输入: "Hello World"
输出: 5*/
/*方法一*/
var lengthOfLastWord = function(s) {var lengthOfLastWord = function(s) {
s = s.replace(/ *?$/g,'');//去掉行尾的空格的正则表达式
var x = s.split(" ");
if(x.length == 0){
... | true |
fcdfdbe4b041c1048039ea6df97e4784330e969a | JavaScript | cihm/Node.js-Reference | /2/dictionary.js | UTF-8 | 156 | 2.8125 | 3 | [
"MIT"
] | permissive | var dictionary = {
fred: 'good',
chuck: 'bad',
wesley: 'well',
charles: 'great',
frankie: 'cool'
};
console.log(dictionary['chuck']);
| true |
0feca5ef6260958f1ddaec09e084f38c94bc4080 | JavaScript | v3xx3d/Code-Samples | /dd/character.js | UTF-8 | 5,485 | 2.9375 | 3 | [] | no_license | var charskin = 'stick';
//STAND STATES
var stand_right_state = new Image();
stand_right_state.src = '/dd/images/skins/' + charskin + '/stand_right.png';
var stand_left_state = new Image();
stand_left_state.src = '/dd/images/skins/' + charskin + '/stand_left.png';
//RUN STATES
var run_right_state = new Image();
run_rig... | true |
7b43c41ccd533b27cb7695dd36df714e1981c995 | JavaScript | MigHerCas/weather | /app/assets/scripts/Details.js | UTF-8 | 1,648 | 2.71875 | 3 | [] | no_license | import $ from 'jquery';
import Current from './modules/Current';
import Forecast from './modules/Forecast';
$( document ).ready(() => {
let current = new Current();
current.call();
let forecast = new Forecast();
setTimeout(checkFavourite(), 2000);
// Favourite icon event
let favIcon = $(".info... | true |
c03b6d0558846bc6cdb44cd2075a01652424c3f2 | JavaScript | clauinger/JSDraw | /RectCutArrayPen.js | UTF-8 | 6,541 | 2.546875 | 3 | [] | no_license | /*jshint esversion: 6 */
/*jshint asi: true */
/*jshint expr: true */
import {
Public
} from './Public.js';
import {
RectCutShapePen
} from './RectCutShapePen.js';
import {
PenConstruct
} from './PenConstruct.js'
import {
LineArrayPen
} from './LineArrayPen.js'
const {log} = console
export class RectCutAr... | true |
ec007cc0d2e148f666550b0440a0c28ac02a6a1a | JavaScript | RoLezcano/Calories | /main.js | UTF-8 | 2,486 | 2.5625 | 3 | [] | no_license | const app = Vue.createApp({
data() {
return {
selectedProduct: 0,
totalCalories: 0,
products: [ {product: 'Seleccione el producto', calories: 0},
{product: 'Acelga', calories: 0.16}, {product: 'Almendra', calories: 7}, {product: 'Arroz', calories: ... | true |
41bdbf67dff9b2a867ddc0031eadb4e19ef7d52a | JavaScript | mrxcs/CodingChallenges | /Coderbyte/Easy/LongestWord.js | UTF-8 | 409 | 3.328125 | 3 | [] | no_license | function LongestWord(sen) {
sen = sen.match(/[^_\W]+/g).join(' '); // Negate anything that is not a word char, including underscore.
var words = sen.split(" ");
var biggest = words[0];
for (let word of words) {
if (word.length > biggest.length) {
biggest = word;
}
}
return big... | true |
edd3333fb25d95d50b25630f94ee8584e697a8a8 | JavaScript | baleevskiy/memoza | /lib/index.js | UTF-8 | 3,771 | 2.609375 | 3 | [
"MIT"
] | permissive | const _ = require('lodash');
const crypto = require('crypto');
const Cache = require('./cache');
let contexts = [];
const memCache = {};
let recordings = 0;
/**
* Wraps function's callback and returned promise.
*
* @param {Function} fn - Function to wrap.
* @param {Array} args - Function arguments.
* @param {Func... | true |
52df1dd8a50bcdd8133d2f568ee1850453d01a13 | JavaScript | kdolan28/ACA_WEB101_KYLE_DOLAN | /LandingPage/cookie-clicker/cookie.js | UTF-8 | 2,370 | 3.25 | 3 | [] | no_license | var cookiecount = 0;
var autoClick = 0;
var farms = 0;
var multiplier = 1;
function update() {
document.getElementById("text").value = cookiecount;
document.title = cookiecount + " Cookies";
document.getElementById("amountMultiplier").innerHTML =
"Multiplier Upgrade x" + (multiplier + 1);
document.getEleme... | true |
eaede9e623fc9307c9498606be10e89a1777bc16 | JavaScript | jyy945/leaflet | /Leaflet-master/src/core/Events.js | UTF-8 | 8,937 | 3.25 | 3 | [] | no_license | import {Class} from './Class';
import * as Util from './Util';
/*
* @class Evented
* @aka L.Evented
* @inherits Class
*
* A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user click... | true |
fac2b38783ed38125f520c952801a6cf0793c3b3 | JavaScript | JoaoBoll/InstaCall | /Admin/JS/login.js | UTF-8 | 5,221 | 2.765625 | 3 | [] | no_license |
function loginADM() {
var testeEmail = $('#loginMenu').val();
var testeSenha = $('#senhaMenu').val();
if (testeEmail != "" && testeSenha != "") {
jQuery.ajax({
type: 'POST',
url: './Conexao/Login/loginAdm.php',
datatype: 'json',
data: {loginMenu: $... | true |
532d41c39b0721ca7b28ae72618fa868185c1d4b | JavaScript | dionyziz/bouncing-ball | /model.js | UTF-8 | 744 | 3.109375 | 3 | [] | no_license | function integrate() {
const dt = 1
if (typeof ball === 'undefined') {
return
}
ball.position.x += ball.velocity.x * dt
ball.position.y += ball.velocity.y * dt
if (ball.position.x + ball.radius > 1
|| ball.position.x - ball.radius < 0) {
ball.velocity.x = -ball.velocity.x... | true |
90972721a1de657cb7ca500db03dceb804f1a91f | JavaScript | xFeliinee/Dataprocessing | /Homework/Week6/linkedviews.js | UTF-8 | 11,984 | 2.953125 | 3 | [] | no_license | /**
* Name: Feline Benavides
* Student number: 11035358
* This files creates a clickable world map. If there is data from the land that
* is clicked on, a barchart will be made and updated. The map is from
* https://datamaps.github.io/ (see also README)
**/
d3v5.json("HPI_data.json").then(function (data) {
"... | true |
240602e2c4b42e0348e803ad2f3f53d9acf81320 | JavaScript | jschlot/swarm | /app/modules/gameview/selectors.js | UTF-8 | 3,828 | 2.75 | 3 | [
"MIT"
] | permissive | import * as stories from '../stories';
import { NAME, VIDEO, TITLE, DESCRIPTION, AUTHOR } from './constants';
// UTILS
const containsAll = (arr1, arr2) => arr2.every(arr2Item => arr1.includes(arr2Item));
const sameMembers = (arr1, arr2) => containsAll(arr1, arr2) && containsAll(arr2, arr1);
// ROOT = GAME VIEW
const ... | true |