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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e07d6e053dd930bd664cd969eac29a3591572130 | JavaScript | IlyaSenkevich19/iTechArtLab | /weather-app/weather-app/src/components/Day.js | UTF-8 | 1,074 | 2.796875 | 3 | [] | no_license | import React from "react";
const Day = props => {
const temp = props.lists.main.temp;
const description = props.lists.weather[0].description;
const humidity = props.lists.main.humidity;
const icon = props.lists.weather[0].icon;
const iconURL = `http://openweathermap.org/img/w/${icon}.png`;
cons... | true |
99d9db5c4f30d78eef57566b3196f9bd7cade142 | JavaScript | aribecker/reddit-app | /src/api/index.js | UTF-8 | 890 | 2.53125 | 3 | [] | no_license | /**
* client-server processing
*/
//import _items from './items.json'
import axios from 'axios'
import _ from 'lodash'
const TIMEOUT = 100
function getPostsFromData(data) {
return _.map(
data.children,
post => {
const {
id,
title,
author,
created_utc,
thumbna... | true |
62da45129996f99769555e48c156d9afb6048082 | JavaScript | olena-ageyeva/fleet-commander-pixi | /_old/game/_old/functions.js | UTF-8 | 5,209 | 3.359375 | 3 | [] | no_license | // ENGINE AND UTIL FUNCTIONS
import { fleet, universe } from "./main";
import { Ship } from "./ship";
import { Star } from "./star";
// CENTER THE RENDER VIEW IN THE FRAME
export function centerView(coords, centerShip) {
if (lockShip === true) {
canvasWrapper.style.transition = `none`;
} else {
canvasWrap... | true |
a5131a149223ae692c73e75e37965daee9549ecd | JavaScript | B2BT/mybatisplus | /supermarketstatic/js/login_ajax.js | UTF-8 | 1,156 | 2.671875 | 3 | [
"MIT"
] | permissive |
/**
* 登录事件
* @returns {boolean}
*/
function login(){
//获取页面数据
let userName = $.trim($("form input[name=username]").val());
let userPassword = $.trim($("form input[name=password]").val());
if(userName===""){
$("form table tr:eq(0) td span").html("用户名不能为空");
return false;
}
if(userPassword===""){
$("f... | true |
a732a47b45c25ad33da128ddf5831ec609801617 | JavaScript | lucasgreenwell/node-api2-project | /posts/postsRouter.js | UTF-8 | 3,457 | 2.671875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | const express = require("express");
const db = require("../data/db");
const router = express.Router();
//returns array of every post
router.get("/", (req, res) => {
db.find()
.then(posts => {
res.status(200).json(posts)
})
.catch(err => {
console.log(err);
res.status(500).json({ err... | true |
441a2cf5242f515417a9f3ea03a183eb26383b51 | JavaScript | kb1ngram4/AlarmSystem | /src/util/public.js | UTF-8 | 438 | 2.625 | 3 | [] | no_license | export class Public {
constructor(){
}
/**
*
* @param {路由数组} list
* @returns 扁平化数组
*/
static genRouter(list){
let routesArr = [];
list.map((item)=>{
let obj = {...item};
console.log(obj);
delete obj.children
routesArr.push(obj);
if(item.children){
rou... | true |
5931005b5e5e221e17bf0182ff02ecb03965f956 | JavaScript | FinGet/vue-element-tools | /src/utils/storage.js | UTF-8 | 576 | 2.65625 | 3 | [] | no_license | export function isObject (val) {
return val !== null && typeof val === 'object';
}
export function setItem (key, val) {
if (isObject(val)) {
localStorage.setItem(key, JSON.stringify(val));
} else {
localStorage.setItem(key, val);
}
}
export function getItem (key) {
var val = localStorage.getItem(key);
try ... | true |
11231f5b4f05caccd67a864c3c0ad0bb1b3a8016 | JavaScript | gdp953456352gh/webassignment | /tools/testmap.js | UTF-8 | 218 | 2.65625 | 3 | [] | no_license | var t1 = new Date().getTime();
var a= "2017-05-20T09:00:29Z";
var d = new Date(Date.parse(a));
console.log(Date.parse(d));
console.log(t1-d);
var a= "Typhoon Gay (1992)";
var b= a.replace(/ /g,"+");
console.log(b);
| true |
bfc1ae59a12ff844a52104f0d274985be5d9ce4c | JavaScript | tiy-dallas-july-2016-fee/little-api-assignments | /day-19-dragonlance/public/script.js | UTF-8 | 616 | 2.921875 | 3 | [] | no_license | console.log('write code here!');
var $theTable = $('#the-table');
function dataRetrieved(data) {
console.log('the data', data);
console.log(data.characters.length);
for (var i = 0; i < data.characters.length; i++) {
console.log(data.characters[i]);
var html =
'<tr>' +
'<td>' + data.charac... | true |
66a57769546606efd26bbf15812caa66b6557d1f | JavaScript | georgezhu211/rock-paper-scissors | /scripts/main.js | UTF-8 | 3,294 | 3.859375 | 4 | [] | no_license | 'use strict';
// receive input from user
function playerPlay() {
// return rock paper or scissors
return prompt('Please enter Rock, Paper, or Scissors: ').toLowerCase();
}
// randomly select rps as computer
function computerPlay() {
let random = Math.floor(Math.random() * 3);
// return rock paper or scissors
... | true |
ac150bd3b85e38877e19de9119b342c01829ef24 | JavaScript | pie-framework/pie-lib | /packages/math-input/src/keypad/keys-layout.js | UTF-8 | 292 | 2.71875 | 3 | [
"ISC"
] | permissive | import * as _ from 'lodash';
/**
* Sort additional keys.
*
* Expects an array of rows.
* @param {} keys
*/
export const sortKeys = (keys) => {
// add any missing rows
_.times(5 - keys.length, () => {
keys.push([]);
});
const out = _.zip.apply(null, keys);
return out;
};
| true |
8346c9d26ff5fe09fc54fb5ca91d53a1cc61907b | JavaScript | bawdeveloppement/nodejs-experimentation | /homework#2/hut/lib/helpers.js | UTF-8 | 3,304 | 3.03125 | 3 | [] | no_license | /**
* Helpers for various task
**/
// Dependencies
var { hashSecret, twillio } = require("./config");
var crypto = require('crypto');
var https = require('https');
var querystring = require('querystring');
const { config } = require("process");
// Container for all the helpers
var helpers = {};
helpers.hash = fun... | true |
a31e94d7d2722af6be4b35fef19114517432b1ef | JavaScript | LuciaGuerrero/nombrecool | /blog_app/src/components/Blog.js | UTF-8 | 2,321 | 2.734375 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import axios from 'axios';
import Card from './Card'
import SearchRecipe from './SearchRecipe'
import ModalRecipe from './ModalRecipe'
import Navbar from './Navbar';
function Blog (){
const URL = 'https://www.thecocktaildb.com/api/json/v1/1/search.php?s='
const [se... | true |
5220c9a8981b0595096910ee9da47e721e33a928 | JavaScript | jiangshanmeta/meta | /src/1540.can-convert-string-in-k-moves.1647/solution.js | UTF-8 | 637 | 3.21875 | 3 | [
"MIT"
] | permissive | /**
* @param {string} s
* @param {string} t
* @param {number} k
* @return {boolean}
*/
var canConvertString = function (s, t, k) {
if (s.length !== t.length) {
return false;
}
const diffMin = new Array(26);
for (let i = 1; i < 26; i++) {
diffMin[i] = i - 26;
}
for (let i = 0... | true |
fbc91cc56aac23a6fb36c9d7a39f84353f355a2a | JavaScript | kbalubam/kevin-baluba-emporium | /public/js/scrollEmporium.js | UTF-8 | 437 | 2.796875 | 3 | [] | no_license | let titrePosition = document.querySelector("h1").offsetTop;
let header =document.querySelector("header");
let enTe= document.querySelector(".en-te");
window.addEventListener("scroll", ()=>{
if(window.scrollY>= titrePosition){
enTe.setAttribute("style", "display :flex; align-items : center");
... | true |
db111eb410e0b0b440e48e5a777fb5a4a209fd09 | JavaScript | markcooper37/dontbeboard-frontend | /src/add-game/AddGame.js | UTF-8 | 9,569 | 2.53125 | 3 | [] | no_license | import Nav from '../components/nav';
import './addgame.css'
import Footer from '../components/footer.js';
import {
BrowserRouter as Router,
Link,
useLocation
} from "react-router-dom";
import React, { Component } from 'react';
import { withRouter } from 'react-router'
export class AddGame extends React.... | true |
8d692a45f14f11fcf9ddd7135a652c75c3fc13dd | JavaScript | DKareep/JS_Tut | /js/script8.js | UTF-8 | 846 | 3.53125 | 4 | [
"MIT"
] | permissive | // function expressions
function f(i) {
"use strict";
return i * i;
}
// not used if its single time execution
var f = function (i) {
"use strict";
return i * i;
};
f();
//(function(){})()
(function (i) {
"use strict";
return i * i;
})(2);
// (function(){}())
(function (i) {
"use strict";... | true |
94d8935d9ba3be6a4cae1a7c3e8ae2b1e1e6bc9c | JavaScript | Yamikur0/FE | /EXEJS_5_Lights/public/js/sitescrip.js | UTF-8 | 1,252 | 3 | 3 | [] | no_license | // const light = document.querySelectorAll('.light');
// let arrcl = ["white","red","yellow","lime","aqua","fuchsia"];
// function randomColor() {
// light.forEach(element => {
// const colorChange = getRandomInt(0, arrcl.length);
// element.style.background = arrcl[colorChange];
// });
// s... | true |
c1d98ef219f77ec5ffc5710b12d08df25857aa59 | JavaScript | vikramsinhghatge/MLAPortfolioAutomationServices | /services/login.service.js | UTF-8 | 1,910 | 2.609375 | 3 | [] | no_license | var User = require('../models/user.model');
var moment = require('moment');
var jwt = require('jsonwebtoken');
var config = require('../config');
exports.authenticateUser = async function(user){
var username = user.username,
password = user.password,
loginTimeStamp;
try{
var oldUser = ... | true |
2d6c75ff9d9c91b9d3e033b1e697822cd09e5098 | JavaScript | yogsoy/simplemessage | /node/simplemessage.js | UTF-8 | 3,003 | 2.59375 | 3 | [] | no_license | const http = require(`http`);
const fs = require(`fs`);
const chalk = require(`chalk`);
const url = require(`url`);
const siteDirectory = `../`;
const storageLocation = `/smbshare/simplemessage`;
http.createServer(function(req,res) {
if (req.method == `POST`) {
console.log(`Someone tried to send a post!`... | true |
248e8ea7c50ee8b8998be494aa1b5111ea0a729c | JavaScript | yucongxx/2018 | /20181113/延迟加载案例pratice/js/pratice.js | UTF-8 | 1,531 | 2.765625 | 3 | [] | no_license | data.push(...data);
let temp = ``;
data.forEach(d => {
temp += `<li index=${d.img}>
<img alt="">
<span>${d.title}</span>
<span>${d.time}</span>
<span>${d.price}</span>
<span>${d.hot}</span>
</li>`;
});
list.innerHTML = tem... | true |
9191e054c3482f1b91ca5594c34d7159880a7f53 | JavaScript | lishulongVI/leetcode | /javascript/37.Sudoku Solver(解数独).js | UTF-8 | 3,933 | 4.15625 | 4 | [
"MIT"
] | permissive | /*
<p>Write a program to solve a Sudoku puzzle by filling the empty cells.</p>
<p>A sudoku solution must satisfy <strong>all of the following rules</strong>:</p>
<ol>
<li>Each of the digits <code>1-9</code> must occur exactly once in each row.</li>
<li>Each of the digits <code>1-9</code>&nb... | true |
ba229e8b8f5c2129f9d2e9509b0bf069cd0ca560 | JavaScript | floflor/Doogle | /client/src/components/create/create.jsx | UTF-8 | 3,235 | 2.625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { getTemperaments } from '../../actions/actions';
import { connect } from 'react-redux';
import Styles from './create.module.css';
import { Link } from 'react-router-dom';
function Create({ getTemperaments, temps }) {
useEffect(() => {
getTemperam... | true |
8daac32e1885ee5a405cbf163534fbcb085a2616 | JavaScript | consistent-loser/chatApp | /server.js | UTF-8 | 2,311 | 2.609375 | 3 | [] | no_license | const express = require('express');
const http = require('http');
const app = express();
const PORT = process.env.PORT || 5000;
const server = http.createServer(app);
app.use(express.static('public'));
app.get('/', (req, res) => {
res.sendFile(__dirname + '/public/index.html');
});
const io = require('socket.io... | true |
25798ad868d4da6d63c85f99d42262e57a790796 | JavaScript | DevJessParker/ecommerce-platform | /src/store/state.js | UTF-8 | 1,537 | 2.765625 | 3 | [
"MIT"
] | permissive | let initialState = {
categories: [
{ genre: 'Fantasy', favorites: 0 },
{ genre: 'Science Fiction', favorites: 0 }
],
books: [
{ title: 'Atlas Fallen', author: 'Jessica Pierce', genre: 'Science Fiction', img: '../lib/RickyAtlasFallen.jpg', favorites: 0},
{ title: 'Mimic', author: 'Jessica Pierce', ... | true |
24cae1e409d96009ffa8899a3e4c5a124a3f9f74 | JavaScript | tsuyopon/javascript | /AsyncAwait/sample1.js | UTF-8 | 1,978 | 4.5 | 4 | [] | no_license | // PromiseとAsyncAwaitの記述の違いを確認するプログラムです。
/////////////////////////////////////////////////////
// Promiseを使った場合
/////////////////////////////////////////////////////
const promise1 = (num) => {
return new Promise(resolve => {
resolve(num + 1)
})
}
const promise2 = (num) => {
return new Promise(re... | true |
cc12dcb16776a17ae9c6f7afaa451a4e6dc58520 | JavaScript | rcholvin/ctc-hw2 | /index.js | UTF-8 | 1,018 | 2.59375 | 3 | [] | no_license | $(document).ready(function(){
//INSERT CODE HERE
//QUESTION 1
function Dog(){
}
Dog.prototype.bark = function(){
return "woof";
};
function ShibaInu(){
Dog.call(this);
}
ShibaInu.prototype = new Dog();
ShibaInu.prototype.constructor = ShibaInu;
ShibaInu.prototype.bark = function(){return "much wow very ... | true |
9512614504e1a37477312831673dc42ca693757a | JavaScript | petpusin/CPE207_lab4 | /public/main.js | UTF-8 | 5,190 | 3.25 | 3 | [] | no_license |
const Myform = document.querySelector('#my-form');
class Contact {
constructor(sub, mas, name, gen, phone, email) {
this.sup = sub;
this.mas = mas;
this.name = name;
this.gen = gen;
this.phone = phone;
this.email = email;
}
}
class UI {
static displayContact() {
const contacts = ... | true |
e2bbe2d94dd0a207761c96d21f84c88c5f2a6806 | JavaScript | GJSayers/downit | /dev/answer-feedback2.js | UTF-8 | 911 | 2.953125 | 3 | [] | no_license | $(document).ready(function () {
const quizOption = document.getElementsByClassName(".quiz-option");
const options = Array.from(document.getElementsByClassName(".quiz-option"));
let answerValue = document.getElementsById("#correct_answer.value");
let correctAnswer = (answerValue --- quizOption.value =... | true |
d3d78902c85696bb1f39d0e17c74d9d489dc81d9 | JavaScript | casperjureskog/BMI_Challange | /spec/PersonSpec.js | UTF-8 | 1,096 | 3 | 3 | [
"MIT"
] | permissive |
describe("Person", function() {
var person;
beforeEach(function() {
person = new Person({weight: 90, height: 186, metric1: "Metric"});
imp_person = new Person({weight: 198, height: 2, foot1: 6, metric1: "imperial"});
});
it("should have weight of 90kg", function() {
expect(person.weight).toEqual(... | true |
3c12e80a01880627c4121064e0e476f031e537d2 | JavaScript | apshea24/Bamazon | /bamazonManager.js | UTF-8 | 4,584 | 2.78125 | 3 | [] | no_license | const mysql = require("mysql");
const inquirer = require("inquirer");
const chalk = require("chalk");
const cTable = require("console.table");
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: "root",
database: "bamazon_db"
});
connection.connect(f... | true |
0743b5f40cebcb7a01e286b6a8f4a5531f099ffb | JavaScript | nedimmehuljic/Repo10 | /ex01/src/index.js | UTF-8 | 300 | 3.03125 | 3 | [] | no_license | // Only change code below this line
var myPet = {
species: "Pit Bull",
name: "Roky",
legs: 4,
friends: [ "Micky", "John" ]
};
function myFunction(myObj){
return myObj;
}
// Oncly change code above this line
console.log(myFunction(myPet));
module.exports = { myPet, myFunction }; | true |
71c95d96a5f6ea7cf3c82d58a817d3707b9abb4e | JavaScript | deepakmench18/Day38_JavaScript | /FunctionalProblem/PrimePalindrom.js | UTF-8 | 649 | 3.578125 | 4 | [] | no_license | function checkPalindrom(n)
{
var temp = 0;
var digit = 0
var rev = 0;
temp = n;
while(n>0)
{
digit= n%10;
rev=rev*10+ digit;
n=parseInt(n/10);
}
if(rev == temp)
{
console.log("Number is Prime and Palindrome");
}
else
{
console.log("And Not Palindrome");
}
}
function checkprime(... | true |
dfdac83d8db2901e3bb68d97905c0962be90ee42 | JavaScript | ducntnd/ducntnd.github.io | /todo-app/index.js | UTF-8 | 1,145 | 2.59375 | 3 | [] | no_license | const express=require('express');
const mysql = require('mysql');
const app=express();
const conn = mysql.createConnection({
host : 'localhost',
user : 'root',
password: '',
database: 'todoapp'
});
//hoặc
conn.connect((err)=> {
//nếu có nỗi thì in ra
if (err){ throw err;}
//nếu thàn... | true |
6f305cd6a252b6a19b0055448c7af893338799d2 | JavaScript | JJVvV/react-redux-saga-typescript-guide | /tools/component.js | UTF-8 | 2,189 | 2.515625 | 3 | [] | no_license | /******************************************
* Author : Alex Liu
*******************************************/
// component button -t ./src/component
let path = require('path')
let program = require('commander')
let { addFiles, removeFiles, addTestEntry, removeImportFromTest} = require('./utils/file')
let createFolde... | true |
58abfa7919d0ae65e5bb8e2c014c67d96e19203a | JavaScript | forlandev/your-memo | /src/reducers/edit.js | UTF-8 | 1,271 | 2.53125 | 3 | [] | no_license | // lib
import { getItem } from 'lib/utils/listLocalStorage';
// actions
export const CHANGE_TITLE = 'CHANGE_TITLE';
export const CHANGE_CONTENT = 'CHANGE_CONTENT';
export const SUBMIT_MEMO = 'SUBMIT_MEMO';
// action creators
const changeTitle = (title) => ({
type: CHANGE_TITLE,
payload: {
title,
},
});
con... | true |
a923745b3d3e055136a5720e742c26b3254b639e | JavaScript | brandonlogan/webgl_tests | /js/main.js | UTF-8 | 4,071 | 2.609375 | 3 | [
"MIT"
] | permissive | function webGLStart() {
var canvas = document.getElementById("gl_canvas");
loadPly("");
initWebGL(canvas); // Initialize the GL context
// Only continue if WebGL is available and working
if (gl) {
gl.clearColor(0.0, 0.0, 0.0, 1.0); // Set clear color to black, ful... | true |
420ec61c16eec2efdb069caef3b4707f95561f8b | JavaScript | jenlee-tech/chinese-restaurants-map | /src/App.js | UTF-8 | 2,992 | 2.671875 | 3 | [] | no_license | import React, { Component } from "react";
import "./App.css";
import Map from "./component/map";
import SquareAPI from "./API";
import SideBar from "./component/SideBar";
import ErrorBoundary from "./component/ErrorBoundary";
class App extends Component {
constructor() {
super();
this.state = {
venues:... | true |
c710db9beea538ccd5cf52c7542d83903f034c88 | JavaScript | Kanemzi/Drawing-Game | /controllers/notification.js | UTF-8 | 1,498 | 2.84375 | 3 | [] | no_license | var types = {
ERROR: 0,
INFO: 1,
SUCCESS: 2
}
/*
Constructeur de notification
*/
function Notification(type, text)
{
this.type = type
this.text = text
}
/*
Ajoute une notification, dans la liste des notifications de l'utilisateur
*/
function add(req, type, text)
{
if (! req.session.not... | true |
c7a8334a43a58871b9f7635b4b68e19192322b99 | JavaScript | craciunmarian/legendary-fiesta | /public/scripts/home/home.js | UTF-8 | 588 | 2.90625 | 3 | [] | no_license | // updating max date dynamically
let today = new Date();
let mm = today.getMonth() + 1; //January is 0!
let yyyy = today.getFullYear();
for (let i = 0; i < 3; i++) {
if (mm == 1) {
mm = 12;
yyyy--;
}
else mm--;
}
if (mm < 10) {
mm = '0' + mm
}
today = yyyy + '-' + mm;
fetch('/api/que... | true |
3801e3a29ab5cbb8892cc56ed7ee2730b58c0d9b | JavaScript | alekskardo/ucimo-algoritme | /40-rekurzija/racunanje/saberi-cifre.js | UTF-8 | 225 | 3.0625 | 3 | [] | no_license | function saberiCifre(n) {
if (!n) return 0
let str = String(n)
let prvaCifra = Number(str[0])
let ostatak = str.substring(1, str.length)
return prvaCifra + saberiCifre(ostatak)
}
console.log(saberiCifre(23425493))
| true |
b24d48828af0a987b2870dcb3cb5423b8c6a295d | JavaScript | gersonvargas/diseno_web_investigacion_1 | /EjercicioCompleto/js/JsPrincipal.js | UTF-8 | 3,018 | 2.65625 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$("#divSuccess").hide();
table = $('#example').DataTable(); //Inicializamos el datatable
$('[data-toggle="tooltip"]').tooltip(); //Todos los elementos de este tipo mostrarán un tooltip
$('.datepicker').datepicker();
$('#example tbody tr td').on("click","but... | true |
10fc8466e8089da6cfda02de38d4e19c4b253b6f | JavaScript | bhoodream/react-chameleon | /src/adaptFrontColorToBackColor.js | UTF-8 | 2,073 | 2.625 | 3 | [] | no_license | import { getColorObjFromRGBAString } from './utils';
import {
COLOR_VAL_MAX,
READABLE_LUM_DIFF,
READABLE_TRY_LIMIT,
READABLE_ALPHA,
LUM_STEP
} from './Const';
const getLum = c => {
const R = 0.2126;
const G = 0.7152;
const B = 0.0722;
const A = 255;
const P = 2.2;
return R... | true |
43b2d2b279c94727bb569ecbcc190318a58c351a | JavaScript | chipvlz/node-cryptochange | /app/src/js/timeleft.js | UTF-8 | 1,199 | 2.78125 | 3 | [] | no_license | function addMinutes(date, minutes) {
return new Date(date.getTime() + minutes * 60000);
}
module.exports = () => {
if ($('.order__timeleft').length > 0) {
var order = new Date($('.order__timeleft').data('date')),
lifetime = $('.order__timeleft').data('lifetime')
var now = new Date()... | true |
b730387aa72553edfd4802d23ebe76f40bfe6d75 | JavaScript | angeloanan/vanillaMCDiscordLink | /test/death.test.js | UTF-8 | 8,561 | 2.828125 | 3 | [
"MIT"
] | permissive | /* eslint-env jest */
const { deathParser } = require('../regex')
describe('Minecraft Gamepedia Deaths', () => {
// Arrows
it('Arrow 1', () => {
const message = 'Player was shot by Arrow'
expect(deathParser.exec(message)).toEqual(expect.arrayContaining([message]))
})
it('Arrow 2 - Entity', () => {
... | true |
8798be942beef8411da45955214c64c0ca5c87df | JavaScript | rimoslav/devconnector | /client/src/actions/authActions.js | UTF-8 | 2,514 | 2.6875 | 3 | [] | no_license | import axios from "axios";
import setAuthToken from "../utils/setAuthToken";
import jwt_decode from "jwt-decode";
import { GET_ERRORS, SET_CURRENT_USER } from "./types";
// Register User
// Radimo async akciju, vadimo podatke sa backend-a, cekamo odgovor, i onda dispatch-ujemo. za to nam dolazi thunk middleware. doda... | true |
8b14f7bd3a2ce6498e32c05601362e589e73f33d | JavaScript | svenportlandoregon/html-word-counter | /src/utils.js | UTF-8 | 1,263 | 3 | 3 | [] | no_license | const fs = require("fs");
const path = require("path");
/**
* Creates an array of URLs separated by line breaks
* @param {String} filePath Accepts a absolute path to text file
* @return {Array} Array of URL strings
* TODO: change parseUrls to accept
*/
const parseUrls = filePath => {
const urlArr = []... | true |
068a44cc5d65d8efdfc5d11be5bb953aac33a473 | JavaScript | Jannyju/Myspace | /data_communication/events.js | UTF-8 | 204 | 2.78125 | 3 | [] | no_license | const Event = require('events').EventEmitter;
let ev=new Event();
// 1. listening (received)
ev.on('msg',function(a,b,c){
console.log('get the message:',a,b,c);
})
//2. send
ev.emit('msg',12,5,88)
| true |
109cdaf94d6f1bc8ed2ef48642ab6b94c92ae2a7 | JavaScript | jeremiahd/TTA_Student_Projects | /3_JAVASCRIPT/js/Basic_Javascript_6.js | UTF-8 | 1,069 | 3.546875 | 4 | [] | no_license | function Vehicle(Make, Model, Year, Color) {
this.Vehicle_Make = Make;
this.Vehicle_Model = Model;
this.Vehicle_Year = Year;
this.Vehicle_Color = Color;
}
var Jack = new Vehicle("Dodge", "Viper", 2020, "Red");
var Emily = new Vehicle("Jeep", "Trail Hawk", 2019, "White and Black");
var Erik = new Vehicle("Ford", "Pi... | true |
6ecbf4b2dee768ddc3b5f8b9e72d8c21dcbc1cd6 | JavaScript | yuanlili123/engine-test-game | /out/preView.js | UTF-8 | 5,302 | 2.609375 | 3 | [
"MIT"
] | permissive | /*
window.onload = () => {
var canvas = document.getElementById('test_canvas') as HTMLCanvasElement;
var context2D = canvas.getContext("2d");
// context2D.fillStyle = "#0000FF";
context2D.strokeStyle = "#FF0000";
var myStage = new DisplayObjectContainer;
var itemRender = new DisplayObjectConta... | true |
16a8917bdd0a2c5f6d4fc32c1a623f4e77ff9e1b | JavaScript | txchen/babel-nodeserver | /src3/utils.js | UTF-8 | 280 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict'
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms))
}
export default {
magic() {
return 'es6'
},
async fooTask() {
return 'es7'
},
async getUserCount() {
await sleep(500)
return Math.floor(Math.random() * 10 + 1)
}
}
| true |
6bd03240330d97b18e61d513cfca1ab72a30592a | JavaScript | arm22/alexa-shareminders | /build/schema.js | UTF-8 | 914 | 3.109375 | 3 | [] | no_license | //Builds the intent schema
//Takes parameter model object
//
//Returns a schema object
module.exports = function(model) {
//Get intents from model param
//Instatiate schema object
var intents = model.intents;
var intent_schema = {
"intents": []
};
//Loop through all intents
for (var intent of intent... | true |
4e148d9558231a2be27aa87c29b6ed3583356f85 | JavaScript | caetanomarcus/adivinhador-de-cpf | /script.js | UTF-8 | 1,425 | 3.734375 | 4 | [] | no_license | // VARIÁVEIS GLOBAIS
let btn = document.querySelector('button');
let text = document.querySelector('p');
let input = document.querySelector('input');
function sendValue() {
cpf = input.value;
if (cpf.length == 9) {
calcularDigitos(cpf);
calcularDigitos(cpf);
} else {
alert('Você ... | true |
cf5b61df12d0f7e8b193343eaf3fcee902f39c77 | JavaScript | deaceroro/tareas_por_haer | /por-hacer/por-hacer.js | UTF-8 | 1,369 | 2.8125 | 3 | [] | no_license | const fs = require('fs')
const colors = require('colors')
let listadoPorHacer = []
const cargaDB = () =>{
try{listadoPorHacer = require('../db/data.json')}
catch (e){listadoPorHacer = []}
}
const crear = (id,descripcion) =>{
cargaDB()
let porHacer = {
id,
descripcion,
completado: false
}
listadoPor... | true |
8c785da6c74df1a48553bc252856db1b03842092 | JavaScript | DenysBabi/JSbase_Babii | /HW3/js/task3.js | UTF-8 | 835 | 4.1875 | 4 | [] | no_license | // 3. Создать многомерный массив, размер массива получить от пользователя. Каждый нечётный элемент массива заполнить подмассивом со значением 'odd', а чётный - 'even'.
// Размер каждого вложенного массива - 3.
// Для массива размером 3
// ['odd', 'odd', 'odd'] // 1й элемент
// ['even', 'even', '... | true |
a996a37cfea3d35a5376abe3894a191d51505601 | JavaScript | jcderry5/shared | /javascript/quiz_commands.js | UTF-8 | 973 | 3 | 3 | [] | no_license | questions = {
"q1" : ["q-1v","q-1a","q-1r"],
"q2" : ["q-2v","q-2a","q-2r"],
"q3" : ["q-3v","q-3a","q-3r"],
"q4" : ["q-4v","q-4a","q-4r"],
"q5" : ["q-5v","q-5a","q-5r"],
}
background_color = {
'v' : 'v_box',
'a' : 'a_box',
'r' : 'r_box',
}
function myFunction(question, answer, color)
{
var answers =... | true |
269e3ea1fae514a1d97e70cef9309e5ce96b0453 | JavaScript | Jbaham1/codeup-web-exercises | /js/external.js | UTF-8 | 1,245 | 4.21875 | 4 | [] | no_license | "use strict";
console.log("Hello from external JavaScript");
alert("Welcome to my Website!")
var color = prompt("What is your favorite color?");
alert("Great, " + color + " is my favorite color too!")
//Exercises 1
var a = prompt("Please input a number");
var b = a++;
var c = ++a;
alert("Your number is " + a + "!" + " ... | true |
8808d581be12bdcd987b5f084f14bef4f22079a9 | JavaScript | jmikkola/DOM-to-HAML | /dom_to_haml.js | UTF-8 | 2,300 | 3.15625 | 3 | [] | no_license | var walk = (function() {
function showId(tag) {
return tag.id ? '#' + tag.id : '';
}
function showClasses(tag) {
var classes = "";
for (var i = 0; i < tag.classList.length; i++) {
classes += "." + tag.classList[i];
}
return classes;
}
function sh... | true |
f4bc2ecbd039b98a485df173cc9788399cafb383 | JavaScript | freewind-demos/kotlin-invoke-new-demo | /src/main/resources/hello.js | UTF-8 | 105 | 2.890625 | 3 | [] | no_license | function Hello(name) {
this.hello = function() {
console.log("Hello, " + name + "!");
}
} | true |
88a67b7850bc6b73e2a3d533574b5c6d32cf603f | JavaScript | rE97/nodeschool.io-solutions | /promise-it-wont-hurt/08-values-and-promise.js | UTF-8 | 183 | 3.09375 | 3 | [] | no_license | 'use strict';
function attachTitle(name) {
return `DR. ${name}`;
}
let promise = new Promise((resolve, reject) => {
resolve('MANHATTAN');
})
.then(attachTitle)
.then(console.log); | true |
e6f50ef3221dd200029b27fb8e23e77a91d14e74 | JavaScript | tina-pet/base-apparel_challenge | /index.js | UTF-8 | 604 | 2.9375 | 3 | [] | no_license | 'use strict';
const inputElm = document.querySelector('input');
const regEmail = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-z]{2,4}$/;
const isValid = (event) => {
const errorMsg = document.querySelector('.error-message__hide');
const iconErr = document.querySelector('.error-icon');
if (!regEmail.test(inputElm.va... | true |
83b66499af91cfaaf8a24295343961164a7753f8 | JavaScript | mattsainson/footprint | /assets/javascript/itinerary.js | UTF-8 | 8,511 | 2.5625 | 3 | [] | no_license |
var itineraryObj = {
itineraryUpdate: false,
doRefresh: function (snapshot) {
var row = $('<div>');
var key = snapshot.key;
console.log('key', key);
row.attr({ class: 'row itinerary-data-row', id: key });
var editDiv = $('<div>');
editDiv.attr({ class: 'col-m... | true |
329cfc3133d61d4f04f95f215858bd16ad1ee163 | JavaScript | hernandba/datawarehouse | /frontend/scripts/locations/locations_main.js | UTF-8 | 7,843 | 2.78125 | 3 | [] | no_license | const sessionCredentials = JSON.parse(sessionStorage.getItem('sessionCredentials'));
let userProfile, userToken;
let modal = document.querySelector('.modal')
let addNewRegionBtn = modal.querySelector('#addNewRegionBtn')
let SaveNewRegionBtn = modal.querySelector('#saveNewRegionBtn')
let allLocationsContainer = docume... | true |
0b263425a254b7a3b004925a760f4d4e56307427 | JavaScript | AAI-USZ/FixJS | /input/100+/after/a5247c5f5f133e303f1bce145c47f246d13d1c6f_0_1.js | UTF-8 | 10,974 | 2.515625 | 3 | [
"MIT"
] | permissive | function LEMval(alias)
{
// first find out whether it is using a suffix
var str = new String(alias);
var varName = alias;
var suffix = 'code'; // the default
/* If passed a number, return that number */
if (str == '') return '';
newval = str;
if (LEMradix === ',') {
newval = ... | true |
15db56eae665d9dba5d1cfb3412e74a32c77fef6 | JavaScript | lkarper/trelloyes-2 | /App.js | UTF-8 | 3,630 | 2.640625 | 3 | [] | no_license | import React from 'react';
import List from './List';
import './App.css';
class App extends React.Component {
state = {
STORE: {
lists: [
{
id: '1',
header: 'First list',
cardIds: [ 'a', 'b', 'e', 'f', 'g', 'j', 'l', 'm' ],
},
{
id: '2',
... | true |
df6830b42a223202efb7bad744c93b3fac45f351 | JavaScript | jeasoncues/curso-javascript | /js/fetch-api-randomuser.js | UTF-8 | 778 | 3.09375 | 3 | [] | no_license | var contenido = document.querySelector('#contenido');
function traer(){
fetch('https://randomuser.me/api/')
.then(data => data.json())
.then(data => {
//obtenemos con resultado acedemos a los usuarios
console.log(data.results[0]);
contenido.innerHTML = `
<img ... | true |
c97db8ace8ba0ed59d30ba0a566c2146debaccfc | JavaScript | drosenbaum5/rps-DOM-Manipulation | /script.js | UTF-8 | 2,102 | 3.640625 | 4 | [] | no_license | let playerWins = 0;
let playerLosses = 0;
let computerWins = 0;
let computerLosses = 0;
let ties = 0;
let rounds = 0;
const rps = ["rock", "paper", "scissors"];
// Start the game
function startGame() {
console.log(rounds);
let btns = document.querySelectorAll(".btn");
console.log(btns);
btns.forEach(function... | true |
7aa6189acb2f46103f4216225a9e76ca6120083b | JavaScript | mgvoz/BarFile | /client/src/reducers/items.js | UTF-8 | 669 | 2.5625 | 3 | [] | no_license | import {
FETCH_ALL_ITEMS,
FETCH_ONE_ITEM,
EDIT_ITEM,
SAVE_ITEM,
DELETE_ITEM,
} from '../constants/actionTypes';
const reducers = (items = [], action) => {
switch (action.type) {
case FETCH_ALL_ITEMS:
return action.payload;
case FETCH_ONE_ITEM:
return items.map((item) =>
item._id === action.payload.... | true |
6e19301cba62cd61ff7b80178d0cf0918fcff1c7 | JavaScript | OlehMytlovych/money-keeper-webAp | /js/main.js | UTF-8 | 6,585 | 3.3125 | 3 | [] | no_license | let beginCalcButton = document.querySelector('#start'),//the button which launches the app
// display ouputs in the right block of the page
budgetValue = document.querySelector('.budget-value'),
dayBudgetValue = document.querySelector('.daybudget-value'),
levelValue = document.querySelector('.level-valu... | true |
812b133ec8b76c9a667d70f263ff2ad779e92b05 | JavaScript | learnuidev/kaboom | /site/pub/guide/26.js | UTF-8 | 2,705 | 3.140625 | 3 | [
"MIT"
] | permissive | // TALK: The cause is we're `add()` ing pipes after the score lable is `add()` ed. By default objects added later will appear on the top.
// TALK: We can solve this by using the layer system
// TALK: Define layers with `layers()`, we only need 2 layers here, a game layer and a UI layer, the second argument is the defau... | true |
228eef4830546b765bede45ee9798c7090b9ffcf | JavaScript | sidneykingsley/DAT405 | /04-Color Coordinates/sketch.js | UTF-8 | 1,592 | 2.9375 | 3 | [] | no_license | var backgroundColor;
var isOverRectangle;
function setup()
{
createCanvas(400, 400);
backgroundColor = color(255,200,255);
noStroke();
}
function draw()
{
background(backgroundColor);
if (mouseX >= 0 && mouseX <= 200 && mouseY >= 0 && mouseY <= 200)
{
fill(255,0,0)
rect(0,0,200,200)
}
else if... | true |
10b117eb4b4b528454dcf9cac94c4e09bc752bb3 | JavaScript | spartfin/Nerds | /js/script.js | UTF-8 | 3,157 | 2.703125 | 3 | [] | no_license | var write = document.querySelector(".modal-button");
var popup = document.querySelector(".write-to-us");
var close = popup.querySelector(".modal-close");
var names = popup.querySelector("[name=name]");
var form = popup.querySelector("form");
var email = popup.querySelector("[name=e-mail]");
var textarea = popup.querySe... | true |
48311681ae659300b96506b9acc196b56b70e8bc | JavaScript | tequilaNiu/react-runtime-editor | /src/SandBox.jsx | UTF-8 | 1,062 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from "react";
import _debounce from "lodash/debounce";
import { createEditor } from "./util";
// import MonacoEditor from "react-monaco-editor";
function SandBox() {
const viewRef = useRef(null);
const runtimeRef = useRef(null);
const [code, setCode] = useState(`
... | true |
2d35102111895f35a1332ddd899472804683c0b1 | JavaScript | BilalPasta/MeetUpPlanner | /signup.js | UTF-8 | 1,465 | 2.578125 | 3 | [] | no_license | function labelcreate(elemt){
document.getElementById(elemt.placeholder).innerHTML=elemt.placeholder;
// elemt.placeholder='';
}
// Initialize Firebase
var config = {
apiKey: "AIzaSyAyyqbS1S8KWytJOIW8ZAddlmUIczJzGwU",
authDomain: "meet-f4387.firebaseapp.com",
databaseURL: "https://mee... | true |
5e1ee925b139a00796d52023892c07a842d04913 | JavaScript | mak-spectrum/profwell | /course/public/javascripts/tabs.js | UTF-8 | 823 | 2.71875 | 3 | [
"MIT"
] | permissive | jQuery(document).ready(function() {
/* TABS : START */
var tabContents = jQuery(".tab-content").hide();
var tabs = jQuery("ul.tabs li");
var activeTab = jQuery(".tab-content.active");
if (activeTab.length > 0) {
activeTab.show();
} else {
tabs.first().addClass("active... | true |
23e07961df46f6bb12dab70fb75ee42c2ba658ce | JavaScript | gowlg/lab-custom-terraform-provider | /api/api/controllers/instances.js | UTF-8 | 3,634 | 2.859375 | 3 | [] | no_license | 'use strict';
let idGenerator = 0
function getId() {
return idGenerator++;
}
let instances = [
{
id: getId(),
name: "Hi",
memory: 300,
type: "t2.nano",
private: false,
tag: "Srizzling rulez"
},
{
id: getId(),
name: "Gophers",
memo... | true |
f99f02658a9bf236b91e90aae0123fc80552739e | JavaScript | sclshu3714/Framework-Electron-CSharp | /WinformServers/AppView/extends/suop/js/index.js | UTF-8 | 5,613 | 2.671875 | 3 | [] | no_license | window.weather=null;
(function ($){
$("#close").on("click",function(){
var currwin =require('electron').remote.getCurrentWindow();
currwin.close();
});
window.initTime = new Date();
window.bgIndex = 0;
initCenter();
function padLeft(h){
return h>=10?h:"0"+h;
}
... | true |
d470ebc3351ac359e0f89dcd15debe1ad5e1eb1e | JavaScript | MontealegreLuis/edeco | /edeco.mx/scripts/jquery/plugins/jquery.map.js | UTF-8 | 1,967 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Class for pages add property and update property
*
* @author LMV <luis.montealegre@mandragora-web.systems>
* @copyright Mandrágora Web-Based Systems
* @version SVN: $Id$
*/
(function($) {
$.googleMap = function (address, mapContainerId) {
if (GBrowserIsCompatible()) { ... | true |
71e422ec009d7fcd4c9b09d97bf0b6eb1b4ea722 | JavaScript | ajedkrap2/Tugas_20_JS | /index.js | UTF-8 | 406 | 3 | 3 | [] | no_license | function tugas20(){
var string = 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don\\\'t look even slightly believable.'
var nul = null;
match1 = string.match("are");
match2 = string.match("wo... | true |
33a4d5ffd5991b2d31c8f20410b93775a357303a | JavaScript | yuta0306/tic-tac-toe | /main.js | UTF-8 | 618 | 3.265625 | 3 | [] | no_license | const CELLS = document.getElementsByClassName("cell");
let active_cell;
for (cell of CELLS) {
cell.addEventListener('click', function(e) {
if (this.classList.contains("active")) {
this.innerHTML = '○';
this.classList.remove("active");
this.classList.add("player")
... | true |
24475e13d4c511857b3a5ed16dfda1a399e3b4f5 | JavaScript | enterpriseih/paint | /index.js | UTF-8 | 3,262 | 3.359375 | 3 | [] | no_license | var canvas = document.getElementById('canvas')
function drawcanvas (){
var ctx = canvas.getContext('2d');
ctx.lineWidth = 1; //设置线宽
/*
1. 设置网格的大小,gridSize用于确定网格之中的线之间的间隔
2. 获取Canvas的宽度width、高度height,用于计算x轴、y轴需要绘画的条数
3. 采用遍历的方式,绘画x轴的线条
4. 采用遍历的方式,绘画y轴的线条
*/
// 1. 设置网格大小
var girdSize = 50;
... | true |
6f39a5991f160b5873ec19f2f1b8c008eb49a67b | JavaScript | FlyaginAS/Lodash | /array/16nth.js | UTF-8 | 390 | 4.25 | 4 | [] | no_license | /*
* Gets the element at index n of array. If n is negative, the nth element from the end is returned.
*var array = ['a', 'b', 'c', 'd'];
_.nth(array, 1);
// => 'b'
_.nth(array, -2);
// => 'c';
*
*
* */
const nth=(arr, n)=>{
return n>0 ? arr[n] : arr[arr.length+n];
};
let array = ['a', 'b', 'c'... | true |
c8adb0403763e7ba38036e5a79f52e7e60859603 | JavaScript | Ediversion/ReactSite | /src/index.js | UTF-8 | 688 | 2.765625 | 3 | [] | no_license | import React from 'react'
import ReactDom from 'react-dom'
import './index.css'
import { books } from './books'
import Book from './Book'
// JSX rules:
// return single element
// div / section / article or Fragment
// use camelCase for html attributes
// className instead of class
// close every element
// formatting... | true |
3a65646ed12a6a5a55e1af00d711cd55026281b7 | JavaScript | jennyjean8675309/dc-web-062518 | /31-DOM-challenge-lab-review/challenge.js | UTF-8 | 2,425 | 3.40625 | 3 | [] | no_license | const counter = document.getElementById('counter')
const minus = document.getElementById('-')
const plus = document.getElementById('+')
const heart = document.getElementById('<3')
const pause = document.getElementById('pause')
const form = document.getElementById('comment-form')
const comments = document.getElementById... | true |
31067f2b4bbca0eafe52878866c61a99556ab117 | JavaScript | jhkim988/ProgrammingLearn-NodeSNS | /routes/post.js | UTF-8 | 4,670 | 2.59375 | 3 | [] | no_license | const path = require('path');
const express = require('express');
const multer = require('multer'); // form 태그의 enctype = "multipart/form-data", express.json(), express.urlencoded()가 해석을 못한다. multer가 해석해준다.
const {
Post,
Hashtag,
User
} = require('../models');
const {
isLoggedIn
} = require('./middlewar... | true |
8eddbe00feee2e6eedb59c09a2a188b8c5438add | JavaScript | xiao------xiao/school-bus | /school bus/Chief/pages/home/attendance/attendance.js | UTF-8 | 1,140 | 2.75 | 3 | [] | no_license | var date = require('../../../utils/util.js')
Page({
data:{
date:'',
week:'',
currentTab:0
},
onLoad: function() {
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var date = year + '年' + month + '月' + day +... | true |
b758750620dda4084ceb01ed6643d377ebf93e75 | JavaScript | gnkarn/p5js-course | /p5jsProy_AI1_sales_lexicographic/sketch.js | UTF-8 | 1,267 | 3.90625 | 4 | [] | no_license | // lexicographic permutations
// https://www.quora.com/How-would-you-explain-an-algorithm-that-generates-permutations-using-lexicographic-ordering
// buac TODAS LAS permutaciones en orden , comenzando desde el numero dado y buscando el siguiente
let vals = [0,1,2,3,4,5,6];
let endArray = [];
function setup() {
crea... | true |
353bc6b9f15abd6454e10a3197960d42079542ff | JavaScript | atom-minimap/minimap | /spec/canvas-layer-spec.js | UTF-8 | 2,815 | 2.78125 | 3 | [
"MIT"
] | permissive | "use strict"
process.env.NODE_ENV = "test"
const CanvasLayer = require("../lib/canvas-layer")
describe("CanvasLayer", () => {
let [layer] = []
beforeEach(() => {
layer = new CanvasLayer()
layer.setSize(100, 300)
})
it("has two canvas", () => {
expect(layer.canvas).toBeDefined()
expect(layer... | true |
4fc7adeed4622c1ada2c6fab4114ef516eeffea9 | JavaScript | parth-p29/YearView | /Static/JS/button.js | UTF-8 | 395 | 2.765625 | 3 | [] | no_license | function goals(){
const add = document.querySelector('.add-button button');
if (add.innerHTML === "Add Pictures") {
document.getElementById('add-pics').style.display="flex";
add.innerHTML = "Close";
}
else if (add.innerHTML === "Close") {
document.getElementById('add-pic... | true |
ebab008f032bf4899761241cc81429ce5f51f573 | JavaScript | edave64/protojazz | /protojazz.js | UTF-8 | 8,261 | 3.40625 | 3 | [
"MIT"
] | permissive | // protojazz 0.8 (c) 2011 EDave
// protojazz is freely distributable under the terms of an MIT-style license.
// For details, see the protojazz project page: http://edave64.github.com/protojazz/
(function ($) {
$.protojazzVersion = "0.8";
var func = 'function'; // used for compression
// $.extend
... | true |
06c5bfb8bc6f015f48d141062ef384e85c962898 | JavaScript | jakcar/voting-system | /public/client.js | UTF-8 | 1,833 | 2.8125 | 3 | [] | no_license | /* eslint-disable no-shadow */
/* eslint-disable no-undef */
const socket = io()
socket.on('districtVotes', data => {
let north = data[0]
let south = data[1]
const alVoteCountN = document.querySelector('#alvotesn')
const spVoteCountN = document.querySelector('#spvotesn')
const saVoteCountN = docu... | true |
ae792bdcf3f355a7813df1e6bd8f5813597fdf99 | JavaScript | pmichelotti/game-engine | /static/js/app/interaction/engine/InteractionEngine.js | UTF-8 | 5,455 | 2.9375 | 3 | [] | no_license | define(
[ 'interaction/InteractionTypes' ],
function( InteractionTypes ) {
var KEY_EVENT_INTERACTION_TYPE = 'key-event';
var InteractionEngine = function( options ) {
options = options || {};
var self = this;
this.game = null;
... | true |
3ebb65bb9ca5757f1e189870d9aeee575b7f8793 | JavaScript | aniketbumbc/Problem-Practice | /Code/Other Practice Code/test.js | UTF-8 | 991 | 3.828125 | 4 | [] | no_license | console.log(aVar); // undefined
console.log(aLet); // causes ReferenceError: aLet is not defined
var aVar = 1;
let aLet = 2;
function outer() {
var a = 10;
var b = 20;
function inner() {
var c = 43;
console.log(b, aLet);
}
inner();
}
outer();
function add(a) {
return (b) => {
return (c) =>... | true |
a2cac03fcd13fb547bc8d91d15b8a280ad074e65 | JavaScript | didimitrov/Algo | /SortingAlgorithmsDemo/JavaScript Advanced/01. Functions and function expressions/04.addingNumbers.js | UTF-8 | 394 | 3.765625 | 4 | [
"MIT"
] | permissive | var add = (function () {
var sum = 0;
function inner(increment) {
sum += increment;
return add;
}
inner.toString = function () {
return sum;
};
return inner;
})();
console.log("Problem 4. Adding numbers using functions.");
var addTwo = add(2);
console.log(addTwo);
con... | true |
5dcf3f6b0bb4b62b78cbcf56e19609bffd1e868d | JavaScript | gustavomarquezinho/javascript | /study/dev-aprender/concepts/013/script.js | UTF-8 | 477 | 4.125 | 4 | [
"MIT"
] | permissive | // -- 013 - Operadores Lógicos -------- //
/*
• Operadores Lógicos
- AND (&&), OR (||), NOT (!)
*/
let infoAge = true, infoCard = true;
let infoStatus = infoAge && infoCard;
console.log(infoStatus);
infoCard = false;
infoStatus = infoAge && infoCard;
console.log(infoStatus)
infoStatus = infoAge || inf... | true |
a6e182b37231757bcd841535fd3ebf30af4e1cdc | JavaScript | cdpadilla42/blog-api-frontend | /src/index.js | UTF-8 | 1,831 | 3.53125 | 4 | [] | no_license | // A reminder to make your JS Modular here. You will need seperate functions for seperate pages, I would imagine. This is your first multipage effort, afterall. Good Luck!
const body = document.querySelector('.content');
// Data Retrieval
async function getContent() {
const response = await fetch('http://localhost:... | true |
349673d5e9d54393ca0129fe0b906f84f27756e3 | JavaScript | SimonFalkeid/SimonFalkeid.github.io | /snaker/snaker.js | UTF-8 | 2,960 | 3.125 | 3 | [] | no_license | //@ts-check
class Keys {
static keys = new Set();
static za = document.addEventListener("keydown", Keys.mark)
static zb = document.addEventListener("keyup", Keys.unmark);
static mark(e) { Keys.keys.add(e.key); }
static unmark(e) { Keys.keys.delete(e.key); }
static any() { return Keys.keys.size ... | true |
c76ae627cd0f2553d2fe0741e0d5fbe598b74905 | JavaScript | 4Juice/Array-s | /main.js | UTF-8 | 815 | 3.046875 | 3 | [] | no_license | const btn1 = document.getElementById("btn");
const input = document.getElementById("input1");
const firstdeletebtn = document.getElementById("fisrt-delete-btn");
let firstdelete = [];
btn1.addEventListener("click", () => {
let i=0;
if (input.value.length > 0){
firstdelete.push(input.value,);
... | true |
dee65b551fe78063fa9404c4986fc4f0efc38210 | JavaScript | shabegger/xactjs | /src/util/gcd.js | UTF-8 | 431 | 3.375 | 3 | [
"MIT"
] | permissive | 'use strict';
// Euclidean algorithm
export default function gcd(a, b) {
if (!Number.isInteger(a) || !Number.isInteger(b)) {
throw new Error('Input must be an integer');
}
if (a === 0 || b === 0) {
throw new Error('Input must be non-zero');
}
a = Math.abs(a);
b = Math.abs(b);
if (a < b) {
... | true |
939f9c095209201803783f3703da4c6ac191ea61 | JavaScript | badmark/squareup | /js/theme-switcher.js | UTF-8 | 2,988 | 3.109375 | 3 | [
"MIT"
] | permissive | class ThemeSwitcher {
constructor() {
this._localStorage = window.localStorage;
this._buttonThemeSwitch = document.querySelector('#button-theme-switch');
this._buttonImageThemeSwitch = document.querySelector('#button-image-theme-switch');
this._themeModes = config.getThemeMode();
this._themeModesArr = [];
... | true |