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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2f2b02f03403bc29d4c5c4598274b4896850beaf | JavaScript | xyrholl/bitcampSemiProject | /HotelBlueMoon/WebContent/JS/roomList.js | UTF-8 | 2,324 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
var checkin = getParameterByName('checkin');
var checkout = getParameterByName('checkout');
var guest = getParameterByName('guest');
var hotelSeq = getParameterByName('hotelSeq');
var hotelName = getParameterByName('hotelName');
ajax(checkin, checkout, guest, hotelSeq,... | true |
316e561220fe0deea2911f309ddbc27825d05c91 | JavaScript | Efosaok/Events-Manager | /client/validations/addevent.validate.js | UTF-8 | 2,208 | 3.03125 | 3 | [] | no_license | import validator from 'validator';
const checkInvalidAddEventDetails = (req) => {
const errorMessage = [];
const {
name,
type,
center,
startDate,
endDate,
} = req;
const eventDetails = [name, type, center, startDate, endDate];
const matchingDetails = {
0: 'name',
1: 'type',
2:... | true |
813eb1ba1aeb9d01a081667313d99afa7de969b1 | JavaScript | HamzaConnection/SP-4 | /src/main/webapp/js.js | UTF-8 | 8,040 | 4.03125 | 4 | [] | no_license | /*
console.log("print");// log besked før den bliver skrevet
var message;
message = "hello";
console.log(message);
console.log(typeof message);
console.log(message.length);
document.getElementById("header").style.backgroundColor='red';
function myfirstfunction(p1,p2)
{
return "Argumentes= " + arguments[... | true |
b3d066f5d755cefe3f547b24581366a1ab82e473 | JavaScript | eliranshemtov/Comito-CrossPlatformMobileApp | /Algorithm_Server/manager.js | UTF-8 | 2,765 | 2.625 | 3 | [] | no_license | require('async');
var em = require("./emitter.js");
//listeners
em.on("enterQ",(item)=>{
// while(true){}
console.log('entered queue');
// q.push(item, function (err) {
// console.log('finished processing item');
// })
})
var cbError=function(err){
console.error("error:",err);
}
var q = async.queue(func... | true |
deedaa1365aa7d39c6eaa9ea3461cef3c52c9f51 | JavaScript | junhui/hubot-scripts | /dist/iced-coffee-weather.js | UTF-8 | 1,580 | 2.671875 | 3 | [
"MIT"
] | permissive | // Description:
// It's very important to know the cutoff date for switching from hot
// coffee to iced coffee. This script does just that.
// Dependencies:
// "cheerio": "0.7.0"
// Configuration:
// HUBOT_ICED_COFFEE_WEATHER_ID
// Commands:
// hubot is it iced coffee weather? - Display whether or not it's... | true |
100ab57010842f94c7e309b767dd4861711fc192 | JavaScript | murray-berkowitz/acme-products | /db.js | UTF-8 | 734 | 2.703125 | 3 | [] | no_license | const _ = require('lodash');
var productArray = [];
function add(product, ranking, photo){
productArray.push({'product':product, 'ranking':ranking, 'photo':photo, 'id':productArray.length});
}
function list(){
return _.cloneDeep(productArray);
}
function find(properties){
return _.cloneDeep(_.filter(productArray... | true |
39c788722ae662d5abd9ff349ed3a238b8f0b405 | JavaScript | PotatoSalads/LS-Data-Structures-I | /src/linked-list.js | UTF-8 | 1,440 | 3.671875 | 4 | [] | no_license | class LinkedList {
constructor() {
this.head = null;
this.tail = null;
// Do not modify anything inside of the constructor
}
addToTail(item) {
const node = {
value: item,
next: null
};
if (this.head === null) {
this.head = node; // pointer; not making a whole ... | true |
24f2c56f4b5894cbde733a718b7c25f6b8681227 | JavaScript | DeanDanger/Care-it | /app/app/fight.js | UTF-8 | 945 | 3.15625 | 3 | [] | no_license | class fight {
constructor(entity1, entity2){
this.entity1 = entity1;
this.entity2 = entity2;
var offense;
var defense;
}
fight(entity1, entity2){
while(entity1.getCurrentHP() > 0 && entity2.getCurrentHP() > 0){
if(entity1.getSpeedLevel() >= entity2.getSpeedLevel()){
offense = ... | true |
59e98660eacad5191b308337fd7f956e28bad6e2 | JavaScript | oneislandearth/mesh | /src/geometry/point.js | UTF-8 | 3,011 | 3.453125 | 3 | [
"MIT"
] | permissive | // Import the required math functions
import { acos, divide, dot, multiply, norm, subtract } from '@oneisland/math';
// Import the required geometry modules
import { Vector } from 'geometry/vector';
import { Plane } from 'geometry/plane';
// Import the required geometry utiliites
import { Angle } from 'geometry/utils... | true |
b064d351decb1fbd8a556fcedbe8d7d01ca75981 | JavaScript | jeremyosborne/javascript | /cs-ish/taskqueue.js | UTF-8 | 856 | 2.734375 | 3 | [
"MIT"
] | permissive | var q = {}
q.concurrency = 3
q._numRunning = 0
q._taskq = []
q._startTask = function (task) {
q._numRunning += 1
task(function () {
q._numRunning -= 1
q._run()
})
}
q._run = function () {
while (q._numRunning < q.concurrency && q._taskq.length) {
q._startTask(q._taskq.shift())
}
}
q.push = functio... | true |
c2caf6f0c74f4c1b6064ec1e35009e6fb2f3a806 | JavaScript | html546/node_learn | /05/code/crud-express/router.js | UTF-8 | 5,294 | 2.96875 | 3 | [] | no_license | /**
* router.js路由模块
* 职责:
* 处理路由
* 根据不同的请求方法+请求路径设置具体的请求处理函数
* 模块职责要单一,不要乱写
* 我们划分模块的目的就是为了增强项目代码的可维护性
* 提升开发效率
*/
var fs = require('fs');
var Student = require('./students')
// 这样也不方便
/* module.exports = function(app){
app.get('/students', function (req, res) {
// readFile的第二个参数是可选的,传入u... | true |
ac5205e8529ecd0c2d92f3caab388a3ef04c6cda | JavaScript | werneroi/gse | /customConfrim.js | UTF-8 | 4,333 | 2.875 | 3 | [] | no_license | var confirmCheck = false
var confirmModal = ""
var confirmId = ""
var confirmAnswer = ""
document.addEventListener('DOMContentLoaded', function () {
/* FOR TESTING PURPOSES*/
// openConfirm("Are you sure you want to delete this?")
})
const Confirm = {
open (confirmId,options) {
options = Object.as... | true |
83aa000864706498fcfc2ed0a9e82439607d9b4c | JavaScript | santijas/Proyecto-UNSAM-2021 | /proyecto-unsam-frontend/src/components/Login.js | UTF-8 | 1,948 | 2.515625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import { useHistory } from "react-router-dom";
import { LoginUsuario } from "../domain/usuario";
import { usuarioService } from '../services/usuarioService'
import { ErrorComponent } from './ErrorComponent'
export const Login = () => {
const [username, ... | true |
94ad8d381d686019e53ae52a1a35a92b4c800174 | JavaScript | MaxStupnitskyi/todo-react | /src/components/App/App.jsx | UTF-8 | 2,679 | 2.765625 | 3 | [] | no_license | import React from 'react';
import FilterPanel from '../FilterPanel/FilterPanel';
import Header from '../Header/Header';
import ListPanel from '../ListPanel/ListPanel';
import './App.sass';
export default class App extends React.Component {
state = {
tasks: JSON.parse(localStorage.getItem('tasks')) || [],
filter: ... | true |
5ad3f34a721cab631e930121b6ca08ce13b8a5a6 | JavaScript | FiveYellowMice/horobot | /lib/horo.js | UTF-8 | 5,739 | 2.875 | 3 | [
"MIT"
] | permissive | 'use strict';
const tgApi = require("./tg-api.js");
const emojiRegex = require("./emoji-regex.js");
class Horo {
constructor(iConfig) {
this.name = iConfig.name;
this.id = iConfig.id;
this.coolingSpeed = iConfig.cooling_speed || 10;
this.threshold = iConfig.threshold || 100;
... | true |
318528c53f962fa4cec644e7805987364884c674 | JavaScript | sebadorn/WebGL-Path-Tracing | /js/Camera.js | UTF-8 | 5,087 | 2.9375 | 3 | [] | no_license | "use strict";
var Camera = {
_center: new THREE.Vector3(),
_eye: new THREE.Vector3(),
_rot: new THREE.Vector2(),
_speed: CFG.CAMERA.SPEED,
_up: new THREE.Vector3(),
_updateCallback: null,
/**
* Initialize the camera.
* @param {Function} fn Function to call when the camera has an update.
*/
init: fun... | true |
151bf8b68fd76a1260ba57e27ee3faf128093964 | JavaScript | acdvorak/jquery.autosize | /src/jquery.autosize.js | UTF-8 | 12,575 | 2.71875 | 3 | [
"MIT"
] | permissive | /*!
* jQuery autoSize Plugin
* https://github.com/acdvorak/jquery.autosize
*
* Copyright 2014 Andrew C. Dvorak <andy@andydvorak.net>
* Released under the MIT license
* http://opensource.org/licenses/MIT
*/
(function(root) {
(function(_, $) {
var _toString = function(obj) {
return Object... | true |
724843e28060efeddba5db9933e1a5c66740485d | JavaScript | paul-juang/nodeapp | /public/js/getnum539.js | UTF-8 | 5,502 | 2.765625 | 3 | [] | no_license | const indx1 = 60, indx2 = 120
$(function() {
let loto539 = getNum539(num539)
console.log("loto539", loto539)
})
function getNum539(num539) {
let loto539 = []
let filterarr = num539.filter(obj => obj["date"] >= "2020/01/06")
let allDate = []
filterarr.forEach(obj => allDate.push(obj.date))
allDate.for... | true |
dd9ecb607f54e843605b74d2eae127ae28fd820f | JavaScript | hyden-tan/graduation-design | /src/assets/docs/scope.js | UTF-8 | 4,296 | 3.984375 | 4 | [] | no_license | export default {
title: '作用域规则',
cc: 2,
content: ` # C 作用域规则
任何一种编程中,作用域是程序中定义的变量所存在的区域,超过该区域变量就不能被访问。C 语言中有三个地方可以声明变量:
1. 在函数或块内部的局部变量
2. 在所有函数外部的全局变量
3. 在形式参数的函数参数定义中
让我们来看看什么是局部变量、全局变量和形式参数。
## 局部变量
在某个函数或块的内部声明的变量称为局部变量。它们只能被该函数或该代码块内部的语句使用。局部变量在函数外部是不可知的。下面是使用局部变量的... | true |
cb51b2dfe228072242f8af4eb5841469ac670b10 | JavaScript | jzapataherrera39/Ejercicios-de-node-js-mongo | /JavaScript/Conceptos-Basicos-Practica/ej23.js | UTF-8 | 244 | 3.734375 | 4 | [] | no_license | /**
* Ejercicio 23
Crear un documento con el nombre ej23.js
Declarar la variable nombre
Mostrar el valor de la variable de la siguiente forma:
console.log(nombreDeLaVariable, valor)
*/
let nombre = 'Ezequiel';
console.log('nombre, '+nombre); | true |
458f3f86696e19f62bb02f61bb90feff647a136b | JavaScript | dortega5185/node-api3-project | /users/userRouter.js | UTF-8 | 3,921 | 2.53125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | const express = require("express");
const router = express.Router();
const Users = require("../users/userDb");
const Posts = require("../posts/postDb");
router.post("/", validateUser, (req, res) => {
const newPost = req.body;
Users.insert(newPost)
.then((post) => {
res.status(201).json(post);
})
... | true |
4a1d1f31c21555c5609065aea8bfc68d1b2c7a3e | JavaScript | cryptobuks1/launchpool-contracts | /scripts/1_deploy_staking_tokens.js | UTF-8 | 1,115 | 2.71875 | 3 | [] | no_license | const _ = require('lodash')
const prompt = require('prompt-sync')();
async function main() {
const [deployer] = await ethers.getSigners();
console.log(
"Deploying Staking tokens with the account:",
await deployer.getAddress()
);
const initialSupplyRecipient = prompt('Initial supply recipient? ');
/... | true |
11c71983f35ea308b9de2cf116f52b1d7752718f | JavaScript | jamenamcinteer/voyageur | /src/actions/budgetCategories.js | UTF-8 | 2,852 | 2.625 | 3 | [] | no_license | import axios from "axios";
export const addBudgetCategory = budgetCategory => ({
type: "ADD_BUDGET_CATEGORY",
budgetCategory
});
export const startAddBudgetCategory = budgetCategory => {
return async dispatch => {
try {
const res = await axios.post("/api/budgetCategories", budgetCategory);
let b... | true |
c92738b26eba3f6af70d1a473e63aeffa7122b01 | JavaScript | OGreenwood672/Twitter-Map | /server.js | UTF-8 | 1,087 | 2.796875 | 3 | [] | no_license | var express = require("express");
var app = express();
var path = require("path");
var fs = require("fs")
const PORT = 6720; // Port to run on
if (process.argv.length < 3) { // Checks if min arguments are defined
throw Error("No map argument provided")
}
var map_name = process.argv[2]; // gets name of map ar... | true |
48ad65f4d578edefc959a08d5ea19248b2a4f2e8 | JavaScript | rez433/javascript | /product api/scripts/getLivsmedelsData.js | UTF-8 | 2,788 | 3.484375 | 3 | [] | no_license | let searchTable = document.getElementById("search-table");
// gömma searchTable
searchTable.style.display = "none";
const sokBtn = document.querySelector(".form > button");
// när en klickar på sokBtn anropa fetchData
sokBtn.addEventListener("click", fetchData);
// fetchData
// använde cors-anywhere proxy
function fe... | true |
532d309f3850f967ca0def4a1d3fbb64670b8881 | JavaScript | hcavalle/d3_presentation | /js/ol_vis.js | UTF-8 | 10,205 | 2.578125 | 3 | [
"MIT"
] | permissive | document.addEventListener("DOMContentLoaded", function() {
var data;
var Nodes = function(container, data){
this.container = container
this.container_group = container
.append("g")
.attr("class", typeof container.category == 'string' ? container.category+" ": "" + "node_parent")
.attr("wid... | true |
8be7b54733a8889b343bc59ad7d5f24f82fc707a | JavaScript | animetosho/Nyuu | /lib/util.js | UTF-8 | 2,057 | 2.890625 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | "use strict";
// for handling object keys case-insensitively
exports.getNCaseKey = function(obj, key) {
key = exports.getNCaseKeyIndex(obj, key);
if(key) return obj[key];
};
exports.getNCaseKeyIndex = function(obj, key) {
key = key.toLowerCase();
for(var k in obj) {
if(k.toLowerCase() === key)
return k;
}
};... | true |
9d1b44d6c1408f032d8e99d6eccb095b22f4198e | JavaScript | himalaya-31/himalaya-31.github.io | /js/index.js | UTF-8 | 1,476 | 2.625 | 3 | [] | no_license | $(document).ready(function () {
$(window).scroll(function () {
var body = $(this).scrollTop();
var windowWidth = $(window).width();
if (windowWidth <= 600) {
var personalTop = $("#startup").offset().top + $("#startup").outerHeight(true);
if (body > personalT... | true |
4afed994eca0cc821fe492fa7233a2ee2aaf2431 | JavaScript | BOULOU-Simon/Exercices-et-exemples | /012 - JS - Bouger des éléments du DOM/js/game.js | UTF-8 | 2,814 | 3.8125 | 4 | [] | no_license | var debugmode = true;
// global variables
var direction; // string : up right down left
var gameSpeed = playersize / 2;
var boardsize = 500; // size of the board in pixel
var playersize = 20; // size of the player in pixel
// DOM elements
var player = document.getElementById("player");
var board = document.getEle... | true |
93b7e8f2a8d592cbf99a349a37db4f0d610e4224 | JavaScript | KinoAR/img-compressor | /index.js | UTF-8 | 552 | 2.71875 | 3 | [
"MIT"
] | permissive | const fs = require("fs");
const path = require("path");
const sharp = require("sharp");
/*
* Allows you to compress an image to a lower quality file size within the src/ folder
* Author: Kino Rose
*/
const outDir = path.resolve("./out")
fs.readdirSync(path.resolve("src"))
.filter( filename => /\.jpeg|\.jpg|\.png|\... | true |
c5e3516f90b8b3f7e364e12b3f628348b9b3f417 | JavaScript | sunvisor/AutoSportCalendar | /index.js | UTF-8 | 674 | 2.6875 | 3 | [] | no_license | /**
* index.js
*
* Created by sunvisor on 2019-03-23.
*/
const AS = require('./crawler/autosport');
(async () => {
const crawler = new AS();
await crawler.openBrowser();
const year = 2019;
let result = [];
for (let month = 1; month <= 12; month++) {
const url = `https://www.as-web.jp/... | true |
f4524fc78dba958651281c7aef1aefd523c5f36c | JavaScript | abbasikov/bigmac | /src/App.js | UTF-8 | 2,037 | 2.609375 | 3 | [] | no_license | import React, { Component, useEffect } from 'react';
import './App.css';
import Loader from './Loader';
import Pricing from './Pricing';
import Error from './Error';
class App extends Component {
state = { loading: true, error: false };
fetchPricing = () => {
fetch('http://localhost:3001/')
.then((res) => res.... | true |
f6bdf40cea3b7dd38788093021ed6e60b59c2e5b | JavaScript | AndreasMagnvall/Social-media-page | /client/src/components/friendlist_component.js | UTF-8 | 1,118 | 2.515625 | 3 | [] | no_license | import React, {useState, useEffect, forwardRef, useImperativeHandle} from 'react';
import styles from 'Styles/friend_list_component.css';
import user from 'Network/user';
import FriendItemComponent from 'Components/friend_item_component';
type Props = {
user_id: string
};
function FriendListComponent(props: P... | true |
124a6187537ccf3adbf930b03d81e1815c0bd329 | JavaScript | mladen23/js6-mladen | /14_Funkcije/script.js | UTF-8 | 8,066 | 3.671875 | 4 | [] | no_license | let pr = 4;
let pr2 = 50;
if ( pr < 10 ) {
pr = "0" + pr;
}
if ( pr2 < 10 ) {
pr2 = "0" + pr2;
}
console.log (pr); // poziv funkcije log
console.log (pr2);
// Definicija / telo funkcije ( definicijom se NE IZVRSAVA funkcija )
function mojaFunkcija(){
console.log (`Zdravo svete!`);
}
console.log (`Text pr... | true |
99e69056f741bb9b33df320878fba39cc8b1d427 | JavaScript | enochdevelop/CheckersGame | /CheckersGameAtt/marbles.js | UTF-8 | 6,600 | 2.734375 | 3 | [] | no_license |
var bug;
var bugs = [];
var covers = [];
var cover_radius = 20;
var cover_xoffset = 25;
var cover_yoffset = 25;
var CoverCount = 4;
var MaxGoX = 5;
var MaxGoY = 5;
/*
dragElement();
function dragElement() {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
var a = document.getElementsByClassName("play");
... | true |
5b229d8251ab5b3bba9d54406decd0b619d9a3a9 | JavaScript | rgoede/webrtc-samples | /app/js/equalizer/10bar-equalizer.js | UTF-8 | 1,845 | 2.90625 | 3 | [] | no_license | var audioContext;
window.addEventListener('load', init, false);
function init() {
try {
// AudioContext
var analyser;
var equalizerCanvas = document.getElementById('equalizerCanvas');
var equalizerCanvasContext = equalizerCanvas.getContext("2d");
var gradient = equalizerC... | true |
780cd98509f7d86aa2598cdb4215cd909980953e | JavaScript | spencerNelson-dev/change-app | /src/App.js | UTF-8 | 2,879 | 3.25 | 3 | [] | no_license | import React from 'react';
import './App.css';
import Paper from '@material-ui/core/Paper'
import Grid from '@material-ui/core/Grid'
import TextField from '@material-ui/core/TextField'
import { Button } from '@material-ui/core';
import { Change } from './change'
function App() {
const [coins, setCoins] = React.useS... | true |
dc7af2881b0f7de89c34460a8ddf649bfafa2652 | JavaScript | dgkri/js-h3 | /logic.js | UTF-8 | 1,075 | 4.03125 | 4 | [] | no_license | /*All men are mortal
Socrates is a man.
Therefore, socrates is mortal.
*/
console.log('Check wether socrates is mortal or not ?');
//collection of item
let men = ['krishna', 'adi', 'socrates', 'arjun'];
let i = 0;
let l = men.length;
//loop for checking wether socrates is in the collection or not.
while(i < l){
... | true |
a1d40693b809376de033852cce9050013954bae5 | JavaScript | dilrubashowkat/React-practice | /js/reactjs.js | UTF-8 | 721 | 2.625 | 3 | [] | no_license | var Movie = React.createClass({
edit : function()
{
alert('editing comment');
},
remove : function()
{
alert('deleting comment');
},
render : function ()
{
return (
< div className= "container" >
<h3>{this.props.title}{" "}{this.props.author} </h3>
<button onClick={thi... | true |
346de1c9810437c28c9acae547be487426ac8253 | JavaScript | mhhf/memhub.io | /client/whitepaper/22_structure.js | UTF-8 | 2,633 | 3.875 | 4 | [] | no_license | md_22 = `
## 3 extended model
### 3.1 types
Did you notice what happened with Daves proposal? Didn't the organization initially agree to
decide on a name? And  clearly isn't one.
This can be solved by a **type** system: An organization can be restricted to an underlaying structure:
a set of types it will... | true |
86782b1d5eae16ed63c34bf6e0da56b325bd3b24 | JavaScript | bscrow/Orbital | /src/Components/Planning/Timeline/Node.js | UTF-8 | 6,253 | 2.515625 | 3 | [] | no_license | import React from 'react';
import Modal from 'react-modal';
import ReactTooltip from 'react-tooltip';
class Node extends React.Component {
constructor(props) {
super()
this.state = { moduleID: props.info.id, equivalent: props.info.equivalent, require: props.info.require, added: false, showModal:... | true |
1ca75732dfa76307c1fe8493bf112637d137dcdb | JavaScript | FredrikAugust/regme | /app/src/services/event/company.js | UTF-8 | 695 | 2.796875 | 3 | [
"MIT"
] | permissive |
export class Company {
/**
* @class Company
* @param {String} name - the company's name
* @param {String} site - url to the company's website
* @param {String} thumbnail - url to a thumbnail of the company logo
*/
constructor(name, site, thumbnail) {
/** @private */
this._name = name;
/*... | true |
b8f61a04ca44fe4c684faab1c33eb36069bf9d30 | JavaScript | fediaz3/RealTimeFlights | /src/components/Chat/InsertName.jsx | UTF-8 | 860 | 2.546875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react'
import ReactDOM from 'react-dom';
const InsertName = (props) => {
const [userName, setUsername] = useState('')
const mySubmitHandler = (event) => {
event.preventDefault();
// console.log("click final", userName)
props.sendData1(userNa... | true |
a0d81393102dbbbd7e09e309ccbb85c62daea1a0 | JavaScript | MitchellScottSandre/shopify-backend-application-w2019 | /models/product.model.js | UTF-8 | 1,810 | 2.703125 | 3 | [] | no_license | const productsFileName = '../data/products.json';
const cartsDataFileName = '../data/carts.json';
const utils = require('../utils');
function getProducts() {
const products = getProductsData();
return new Promise((resolve, reject) => {
resolve(products.filter(p => p.inventory_count > 0));
});
}
function get... | true |
7e5c3617d8fe49c1afc599a4f9f578bf6840e36d | JavaScript | AngelTrayanov/TechModule | /MidExamTest/DecemberEighteenEighteen/02Santa'sList.js | UTF-8 | 2,040 | 3.578125 | 4 | [] | no_license | function santaIsTrue(arr) {
let ourArr = arr.slice();
let listOfKids = ourArr.shift().split('&');
ourArr.pop();
for (let i = 0; i < ourArr.length; i++) {
let current = ourArr[i].split(' ');
let command = current[0];
if (command === 'Bad') {
//Bad {kidNam... | true |
0302389cd34bbc95442606700b58809548b67400 | JavaScript | drewml08/Note-Taker | /server.js | UTF-8 | 1,269 | 2.671875 | 3 | [] | no_license | const express = require('express');
const path = require('path');
const fs = require('fs');
const { v4: uuidv4 } = require('uuid');
const app = express();
const PORT = 3000;
var notes = JSON.parse(fs.readFileSync(path.join(__dirname, 'db/db.json'), 'utf8'));
app.use(express.urlencoded({ extended: true }));
app.use(... | true |
f318adadd02a02e1755555031f324decd70a6f29 | JavaScript | dgr993/Web-API-s---Assignment-4 | /javascript.js | UTF-8 | 6,473 | 2.9375 | 3 | [] | no_license | var welcomDiv = document.querySelector(".welcomePage");
var questionsDiv = document.querySelector(".questionsDiv");
var startBtn = document.querySelector(".startBtn");
var questionsH1 = document.querySelector(".questions");
var appendHere = document.querySelector(".appendHere");
var answerBtn = document.querySelector("... | true |
158cb4852b7cd86ddd78de7f6f06ef227269587a | JavaScript | anudeepkasturi/AsteroidsnStuff | /asteroids/lib/movingObject.js | UTF-8 | 541 | 3.40625 | 3 | [] | no_license |
function MovingObject(options) {
this.posX = options.pos[0];
this.posY = options.pos[1];
this.velX = options.vel[0];
this.velY = options.vel[1];
this.radius = options.radius;
this.color = options.color;
this.game = options.game;
}
MovingObject.prototype.draw = function(ctx) {
ctx.fillStyle = this.colo... | true |
a257d5ad8da666b3a75562f3df53fbf62f2ac855 | JavaScript | alejandrodob/rails-web-project-IH | /app/assets/javascripts/movie_list.js | UTF-8 | 1,115 | 2.859375 | 3 | [] | no_license | var movieList = function() {
self = {};
self.requestList = function(client) {
var movies = client.retrieveMovies();
return movies;
};
self.drawMovies = function(widget, client) {
var movies = self.requestList(client);
widget.draw(movies);
};
return self;
}();
... | true |
323a13cb33729718463e256d08b0897a59ef88c0 | JavaScript | iarlenaquiles/robo-consulta-cpf | /index.js | UTF-8 | 889 | 2.671875 | 3 | [] | no_license | // alvo: https://www.situacao-cadastral.com/
// objetivo: tirar print do resultado da consulta
const puppeteer = require("puppeteer");
let cpfConsultado = "986.108.960-80"; // cpf gerado na api 4devs
let cpfs = ["986.108.960-80", "626.974.070-30"]; // cpf gerado na api 4devs
const consultaCpf = async cpfs => {
for ... | true |
2f1fa4cdf93f40046ef1d80713a39fcc87bfabc5 | JavaScript | ro-savage/flexgrid | /css-creation-helper.js | UTF-8 | 802 | 2.75 | 3 | [
"MIT"
] | permissive | /* Helper scripts for generating percentage value names for css */
var fs = require('fs');
var total = 100;
var text = ""
var i = 0
for (; i <= total;) {
text = text + ".col-xs-"+i+"-offset, .col-"+i+"-offset {\r margin-left: "+i+"%;\r}\r\r"
i = i + 5;
}
// for (; i <= total;) {
// text = text + ".col-x... | true |
61988ca4a56a06da87dff4cf162b4e97cafcc097 | JavaScript | designstem/fachwerk | /src/components/layout/FTable.js | UTF-8 | 2,053 | 2.625 | 3 | [
"MIT"
] | permissive | import { isarray } from "../../../fachwerk.js";
import FMarkdown from "../internal/FMarkdown.js";
export default {
components: { FMarkdown },
description: `
A table, accepting data in \`:rows\` attribute, supporting multiple formats:
#### Array of arrays, no columns names
Column names are auto-generated.
<f-tab... | true |
b651368736f247966ff29353383afddd03dac4e3 | JavaScript | abbasali361/fire-auth | /src/App.js | UTF-8 | 4,502 | 2.609375 | 3 | [] | no_license | import React, { useReducer, useState } from "react";
import "./App.css";
import firebase from "firebase/app";
import "firebase/auth";
import firebaseConfig from "./firebase.config";
firebase.initializeApp(firebaseConfig);
function App() {
const [newUser, setNewUser] = useState(false);
const [user, setUser] = useS... | true |
f3e9ecbb5f5e6e788d921a66eea9b5b22af21da1 | JavaScript | telmarosario/ft2110-flappy-bird | /bird.js | UTF-8 | 1,203 | 3.46875 | 3 | [] | no_license | class Bird {
constructor(){
this.birdImage = new Image();
this.birdImage.src = "./images/flappy.png";
this.width = 40;
this.height = 40;
this.x = canvas.width / 6 ;
this.y = canvas.height / 2 ;
this.birdSpeed = 25;
}
drawBird = () => {
ctx.d... | true |
bc991e93376bf92459e6d4731d989c77764fb0f3 | JavaScript | zhentian-wan/functional-architecture-fs | /src/task/1.js | UTF-8 | 970 | 2.796875 | 3 | [] | no_license | const Task = require("data.task");
const fs = require("fs");
const _app = () =>
fs.readFile("./config.json", "utf-8", (err, contents) => {
console.log(err, contents);
if (err) throw err;
const newContents = contents.replace(/3/g, "6");
fs.writeFile("./config1.json", newContents, (err, _) => {
... | true |
aeb7ccafc374fc494899c65265f1781a52cdb4c1 | JavaScript | keremguventurk3123/personal-webiste | /src/components/screens/Projects.js | UTF-8 | 3,139 | 2.734375 | 3 | [] | no_license | import React from 'react';
import ProjectCard from '../ProjectCard';
import "../styles/Projects.css";
const Projects = () => {
const projects = [
{
name: "Free Pictures",
description: "This is a react-js application dedicated to finding copyright-free images to use for your website ... | true |
8e1804fb5e87d5c10adf5d57b4f340c16858a4f2 | JavaScript | alexgooner12/tasker | /client/src/components/identifyUser.js | UTF-8 | 1,951 | 2.65625 | 3 | [] | no_license | import React from 'react';
class IdentifyUser extends React.Component {
constructor(props) {
super(props);
this.state = {
email: '',
error: false
}
}
onChangeInput = (e, prop) => {
this.setState({
[prop]: e.target.value,
error: false
})
}
identifyUserBy... | true |
aca49d96fb2c6e51bb87713e8acb495787cb482c | JavaScript | gabrielrangel/bets-baron | /src/components/EventCard.js | UTF-8 | 647 | 2.78125 | 3 | [] | no_license | import {Market} from "./Market.js";
export function EventCard ({name, markets}) {
const [teamA, teamB] = name.split(' vs ')
const card = document.createElement('div')
card.classList.add('event-card')
card.classList.add('grey-hover')
card.appendChild( Object.assign(
document.createElement... | true |
ef9d5c132554573ea3449456ae5b5aaeb8e9cd02 | JavaScript | park0691/FrontEnd_LectureNote | /JavaScript/function1_1.js | UTF-8 | 374 | 4.34375 | 4 | [] | no_license | // 선언적 function
// 이름이 hello1 함수 선언
function hello1() {
console.log('hello1');
}
// function 표준 내장 객체
console.log(hello1, typeof hello1);
// 함수의 매개변수
// 함수를 호출할 때 값을 지정
function hello2(name) {
console.log('hello2', name);
}
// 함수의 리턴
function hello3(name) {
return `hello3 ${name}`;
} | true |
dcd5d83196e8131e968aa8c94aaa8e7b402865a8 | JavaScript | RU3YKat/password-generator | /assets/js/script.js | UTF-8 | 2,542 | 3.734375 | 4 | [] | no_license | // Assignment Code
var generateBtn = document.querySelector("#generate");
var upperCase = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
var lowerCase = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];... | true |
8d52767729c2d7833730c7f944f95ba5f433fc8a | JavaScript | Didoman87/JavaScriptTelerikAcademiHomeworks | /JSHomework5/IncreaseArrayMembers.js | UTF-8 | 160 | 3.453125 | 3 | [] | no_license | var arr, i, len, result;
arr = new Array(20);
for (i = 0,len = arr.length; i <= len; i+=1) {
arr[i] = i;
result = arr[i] * 5;
console.log(result);
} | true |
00ca6cf24098078534cee8cb6926feb8aa1a725a | JavaScript | Coder-Mehedi/Playing-with-react-context-hooks | /src/components/Noob/NoobDetails.js | UTF-8 | 462 | 2.53125 | 3 | [] | no_license | import React, { useContext } from 'react';
import NoobContext from '../../contexts/Noob/noobContext';
const NoobDetails = ({ name, age, noob }) => {
const noobContext = useContext(NoobContext)
const { noobs, setCurrent } = noobContext
const handleClick = e => {
console.log('clicked')
setC... | true |
811d65242bfe34c657f5881cf950a34f78cb4833 | JavaScript | Arihant416/css-practice | /cards2/app.js | UTF-8 | 315 | 2.921875 | 3 | [] | no_license | const cards = document.querySelectorAll('.card');
// console.log(cards);
cards.forEach((card) => {
card.addEventListener('click', function () {
dismantleAllActive();
card.classList.add('active');
});
});
const dismantleAllActive = () => {
cards.forEach((card) => {
card.classList.remove('active');
});
};
| true |
6751e23de2688daa841cef619d3b3f7df3d0187d | JavaScript | jlt9768/FinanceTracker | /server/controllers/Account.js | UTF-8 | 6,851 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | const nodemailer = require('nodemailer');
const models = require('../models');
// Set up nodemailer account requirements
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'financetracker.jlt@gmail.com',
pass: process.env.GMAIL_PASS,
},
});
const { Account } = models;
cons... | true |
2693253468c501e6003026e888c363b409ec4096 | JavaScript | Mwangzhi/Accumulate | /数据转换/1.js | UTF-8 | 1,579 | 3.09375 | 3 | [] | no_license |
var entry = {
a: {
b: {
c: {
dd: 'abcdd'
}
},
d: {
xx: 'adxx'
},
e: 'ae'
}
}
// 要求转换成如下对象
var output = {
'a.b.c.dd': 'abcdd',
'a.d.xx': 'adxx',
'a.e': 'ae'
}
function forMat(entry) {
let res = {}
... | true |
9eead2a0da7392df73f425bc79831eb25d85ff2c | JavaScript | thelac/protofit | /src/js/ixn/scaleTrace.js | UTF-8 | 5,453 | 2.84375 | 3 | [] | no_license | // NOTE: Everything in this file is scratch space and has not been refactored
// into something reasonable yet.
var scaleButton = document.getElementById('scale');
scaleButton.onclick = function() {
// TODO: Change 'on' to whether or not the object exists
data.mode.scale.on = !data.mode.scale.on;
if (data.mode.s... | true |
590fde3e1dab9e091ed9efcf9d91c3ccad77a92e | JavaScript | creynir/vuex-socketio | /src/tests/utils.test.js | UTF-8 | 1,759 | 2.59375 | 3 | [
"MIT"
] | permissive | import chai from 'chai';
import 'mocha-sinon';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import { normalizeString, toUppSnakeCase, __RewireAPI__ as utilsAPI } from '../utils/utils.js';
const expect = chai.expect;
chai.use(sinonChai);
describe('utils', function () {
describe('normalizeString'... | true |
65ef2a8f56927d91634ae833d6f2c831df604824 | JavaScript | meera-ramesh19/codewars | /8kyu/Function 3 - multiplying two numbers.js | UTF-8 | 184 | 2.953125 | 3 | [] | no_license |
Function 3 - multiplying two numbers
Implement a function which multiplies two numbers.
FUNDAMENTALS
// Write here your multiply-function
function multiply(a,b){
return a*b
}
| true |
21a102e660d06e200d796d99e365a20e145356e1 | JavaScript | Syed-Kashif-Bukhari/server-express | /26-07-2017/router/main.js | UTF-8 | 1,074 | 2.546875 | 3 | [] | no_license | // module.exports = function(app)
// {
// app.get('/',function(req,res){
// res.render('index.html')
// });
// app.get('/about',function(req,res){
// res.render('about.html');
// });
// }
// module.exports = function(app) {
// }
// module.exports= function(app) {
// }
// module.ex... | true |
92644d5f82eab337baec050aa73354d19a46a580 | JavaScript | Owl-of-Minerva/Flashcard-App | /public/js/pagination.js | UTF-8 | 4,237 | 3.1875 | 3 | [
"MIT"
] | permissive | var pages = parseInt($("#max_page").val());
var page = parseInt($("#current_page").val());
console.log(page + "/" + pages);
document.getElementById('pagination').innerHTML = createPagination(pages, page);
function createPagination(pages, page) {
var str = '<ul>';
var active;
var pageCutLow = page - 1;
... | true |
fdf1aa3b6c6ac3ccab966ee61778f0e56df742d3 | JavaScript | noahlange/Eigengrau-s-Essential-Establishment-Generator | /src/World/graveStone.js | UTF-8 | 4,668 | 2.78125 | 3 | [
"MIT"
] | permissive | // uses setup.createDeadNPC, setup.profile
setup.graveStone = {
create (town) {
console.log('setup.graveStone.create called...')
const grave = {
shapeSmall: gravestoneData.shapeSmall.random(),
shapeMedium: gravestoneData.shapeMedium.random(),
weaponType: gravestoneData.weaponType.random(),
... | true |
e0127684f61dffe8c1f03a4793f6aa0b55acd90b | JavaScript | shamim192/react_practice_LWS | /src/components/inheritance/Emoji.js | UTF-8 | 293 | 2.53125 | 3 | [] | no_license | import React from "react";
export default class Emoji extends React.Component{
addEmoji = (test, emoji) =>`${emoji} ${test} ${emoji}`;
render(override){
let text = 'I am the Emoji Component';
if(override) text = override;
return <div>{text}</div>
}
} | true |
ff3c4941f372da1d1929de27248066f88b952506 | JavaScript | rogerlog/rogerlog.github.io | /js/js_portfolio.js | UTF-8 | 1,893 | 3.21875 | 3 | [] | no_license | // Modo - Portfólio
// Executa a função e mostra todas as colunas
filterSelection("todos");
function filterSelection(c) {
var x, y;
x = document.getElementsByClassName("columnPort");
if (c === "todos")
c = "";
// Adicione a classe "show" (display: block) aos elementos filtrados
// e remov... | true |
015bf583fd7432963a4dda763f9f9172bca69fd6 | JavaScript | social-tours/front-end | /socialtours/src/components/MediaComponents/Credits.js | UTF-8 | 1,060 | 2.640625 | 3 | [] | no_license | import React, { Component } from "react";
import marked from "marked";
import * as S from "./CreditStyles";
const renderer = new marked.Renderer();
/**
* Method to render hyperlinks
* to open up in new tab/page
*/
renderer.link = (href, title, text) =>
`<a target="_blank" href="${href}" title="${title}">${text}<... | true |
d6677ee736fa66f24ce7215f38977986b79f7a0c | JavaScript | AlexPovoroznyuk/edc-blockchain | /fontface-pre-gen.js | UTF-8 | 5,415 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
let fs = require('fs');
const config = {
path: {
src: {
cssFontsFolder: 'src/css/fonts',
cssFontsFile: 'src/css/components/__fonts.css',
cssMainFile: 'src/css/main.css'
}
}
};
let templates = {
header: fontName => `
/* ${fontName}... | true |
6c0f54418220048a5fec2baa283c0793d6690b07 | JavaScript | AleksandarOynakov/js-fundamentals | /Basic Syntax, Conditional Statements and Loops Exercise/Login.js | UTF-8 | 525 | 3.296875 | 3 | [] | no_license | function login(data) {
let username = String(data.shift());
let password = username.split('').reverse().join('');
let tries = 0;
for (const passwordInput of data) {
if (passwordInput !== password && tries < 3) {
console.log('Incorrect password. Try again.');
tries++;
... | true |
377a6273dde2e5733c57b51eae2491b740d61ea8 | JavaScript | gustavocampanate/Desenvolvedor-M3 | /Teste/js/filtraProdutos.js | UTF-8 | 530 | 3.21875 | 3 | [] | no_license | function filtraProdutos(parametro) {
const textoFiltro = document.getElementById("filtro").value;
return textoFiltro != "" ? parametro.toUpperCase().includes(textoFiltro.toUpperCase()) : true;
}
function filtraNomeProduto(nome) {
}
function filtraCor(cor) {
return document.getElementById(cor).checked;... | true |
16c9febb313a5746c96cd55c11fcb405fa603990 | JavaScript | youlive789/speed_insight | /dashboard/bin/main/static/js/target.js | UTF-8 | 1,585 | 2.90625 | 3 | [] | no_license | $(document).ready(function() {
// 초기 수집 URL 리스트 화면 출력
$.ajax({
type:"get",
url:"/target/getTargetJson",
async:false,
success: function(e) {
var targetJson = JSON.parse(e);
if (targetJson.result) {
}
else {
var urls = targetJson["target"];
for (var idx = 0; idx < urls.length; idx++)... | true |
e52b14b8bb03a02947bc414f82c95f6cbb7ea868 | JavaScript | jennikins813/OnlineResume | /js/resumeBuilder.js | UTF-8 | 9,230 | 2.515625 | 3 | [] | no_license | var bio = {
"name" : "Jennifer Follero",
"role" : "Awesome FEND Web Developer",
"welcomeMessage" : "I'm an aspiring Front-End Web Developer looking for awesome opportunities.",
"biopic" : "images/jenfollero1.png",
"contacts" : {
"mobile": "323-123-4567",
"email": "jennikins813@yahoo.... | true |
f966e09f1c6b4c98e475d22d20bca1ca0ccc642f | JavaScript | satriyawicaksana/arkademy | /1.js | UTF-8 | 679 | 2.90625 | 3 | [] | no_license | const biodata = (name, age) => {
return {
"name": name,
"age": age,
"address": "Jl. Mastrip no 51 Blitar",
"hobbies": ["basket, movies"],
"is_married": false,
"list_school": [
{
"name": "ITS",
"year_in": 2012,
"year_out": 2016,
"major": "Informatics Engine... | true |
ba73a4bcddc320d5db2f026c633c3705348808d4 | JavaScript | freedomdebug/node-server-examples | /node-express-socketio/src/server/ioserver.js | UTF-8 | 3,606 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* socketio的一套测试程序
*/
import {
log,
} from '../util/debug';
export default function ioserverMixmin(io) {
// 连接的客户端数
let userCountOnline = 0;
// 连接的用户
const usersOnline = {};
function broadcast(socket, message) {
// 向其他用户发送消息
socket.broadcast.emit('broadcast', message);... | true |
c81e053886c6b876fc4c1f70cbe234b7f21abd5f | JavaScript | Paulhejia/ALG-25-class | /week07/跳跃.js | UTF-8 | 298 | 3.078125 | 3 | [] | no_license | function solution(nums) {
const n = nums.length;
let res = 0;
for(let i = 0; i < n ; ++i) {
if(i <= res) {
res = Math.max(res, i + nums[i]);
if(res >= n - 1) {
return true;
}
}
}
return false;
} | true |
a5a5b3a19f360c1522e46db662696a19500ef81e | JavaScript | Rfvanesveld/To-Do-API-Eindopdracht- | /Api-client.js | UTF-8 | 1,038 | 3.265625 | 3 | [] | no_license | const Url = `http://localhost:3000/`;
const log = console.log;
// GET FUNCTION //
const getData = async () => {
try {
const response = await fetch(`${Url}`, {
headers: {
"Content-Type": "application/json"
},
});
return response.json();
} catch (... | true |
f63c55aedc20860040dcb6932e52f1b649f1ca37 | JavaScript | eppineda/tic-tac-toe.jquery | /tictactoe.js | UTF-8 | 2,450 | 3.34375 | 3 | [] | no_license | var constants = {
"ready":"ready", "playing":"playing", "winner":"winner", "draw":"draw"
}
var TicTacToe = function() {
this.status = constants.ready
this.next = 'X'
this.turns = 0
this.coords = [
' ', ' ', ' ',
' ', ' ', ' ',
' ', ' ', ' '
]
this.coordsWinning = [... | true |
6e09eeaa523bd2638cdddc09d79f394590b70ed0 | JavaScript | dxe/dxe-discord-integration | /discord_api/DiscordApi.js | UTF-8 | 1,425 | 3 | 3 | [] | no_license | // Utility function to wrap results of network requestss
const result = async (fn) => {
try {
return { isSuccess: true, result: await fn() };
} catch (error) {
console.log(error);
return { isSuccess: false, error };
}
};
// try to add the role using the ID
// return true on success,... | true |
7011393bceb3c150a2b70d85589562d24d1497cf | JavaScript | t-kojima/practice-all-becomes-reduce | /src/keys.js | UTF-8 | 364 | 2.875 | 3 | [
"MIT"
] | permissive | Array.prototype.keys = function() {
const iterator = this[Symbol.iterator]();
let count = 0;
iterator.next = () => {
try {
return Array.from(this).reduce(
acc => (count < this.length ? { value: count, done: false } : acc),
{ value: undefined, done: true }
);
} finally {
c... | true |
77290cbe00bb3fcce2c956f986f232baeedac7a9 | JavaScript | jankney2/pitchvivid | /src/components/About/About.jsx | UTF-8 | 1,461 | 2.546875 | 3 | [] | no_license | import React from 'react'
export default function About() {
return (
// initial placeholder div here with some lorem ipsum
<div className='aboutContainer'>
<div>
<h1>Find the people who want to work with you.</h1>
<p>
We bring the r... | true |
770eda5d64a3d11286c87f2b50b95293e8b8ca26 | JavaScript | SeyyedMahdiHP/MyTeachingDiaries | /Puzzles/webS/math puzzles_problems_files/timedate.js | UTF-8 | 3,950 | 2.921875 | 3 | [] | no_license | // Copyright (c) 1999 - 2009 Sam Steingold <sds@gnu.org>
// This file is distributed under the GNU GPL (v2+).
// See <URL:http://www.gnu.org/copyleft/gpl.html> for further details.
function toSt(nn) { return (nn < 10 ? "0" : "") + nn.toString(); }
function date_string(da) {
var dd = new Date(da);
return dd.getFul... | true |
a99ff18b5cbf441deb1b74fe20b34d23b596cbd1 | JavaScript | IsraP/IPweb | /js/Apis/ye.js | UTF-8 | 71 | 2.859375 | 3 | [] | no_license | let a = 12;
let b = 7;
let c = (a*3>30?a-b>10:a+b>10);
console.log(c)
| true |
aad932ab87b351f854a0c2ffa23e172cf519f3d2 | JavaScript | ShandonFleming948/CART263 | /projects/project 1/js/script.js | UTF-8 | 9,087 | 3.296875 | 3 | [] | no_license | /**
Project 1 - Toxicity
Shandon Fleming
The code below runs a simulation in which the user has to use the keyboard controls to guide
a circle through an array of glowing circles to the other side without coming into contact with
too many of them.
*/
"use strict";
//array for the glowing circles
let glowingCircles =... | true |
a93417f21b5db10e628e4f84540666a0cfeed49d | JavaScript | github-php-mysql/coba-WebGame | /admin/wp-content/plugins/dw-hover-sound/assets/js/main68b3.js | UTF-8 | 530 | 2.765625 | 3 | [] | no_license | jQuery(document).ready(function($){
if (typeof dwhs_main !== "undefined") {
$(dwhs_main.dwhs_selector).mouseover(function(){
PlaySound("dwhs-audio");
});
$(dwhs_main.dwhs_selector).mouseout(function(){
StopSound("dwhs-audio");
});
}
function PlaySound(soundobj) {
var thissound=document.getEleme... | true |
8f9950d20937046ad67cb3a5a74ead38bcded724 | JavaScript | CeylinBrooks/auth-module-final-project | /pages/signinpage.js | UTF-8 | 582 | 2.640625 | 3 | [
"MIT"
] | permissive | "use strict";
const base64 = require("base-64");
require("axios");
require("superagent");
let signinEL = document.getElementById("signin");
console.log("FILE REACHED");
let signupEL = document.getElementById("signup");
signinEL.addEventListener("submit", (e) => signInHandler(e));
function signInHandler(e) {
e.preve... | true |
920487232deada1d1db2d54985265bdd7c758004 | JavaScript | codebrokerad/halloweenSnake | /index.js | UTF-8 | 5,636 | 2.953125 | 3 | [] | no_license | //sound
class AudioController {
constructor() {
this.bgMusic = new Audio('https://raw.githubusercontent.com/WebDevSimplified/Mix-Or-Match/master/Assets/Audio/creepy.mp3');
this.victorySound = new Audio("./Ta Da-SoundBible.com-1884170640.mp3");
this.gameOverSound = new Audio("./Crash-sound-effect.mp3");
... | true |
ae4f3fee1980535fe42b0c6f2630287fb0d54927 | JavaScript | bemtorres/vides | /app.js | UTF-8 | 1,171 | 3.0625 | 3 | [] | no_license |
//Version 0.2
// fetch send
function send(){
var code = document.getElementById('code').value;
var total = document.getElementById('total').value;
var tipo = document.getElementById('tipo').value;
// function uva(code,litros,n,tipo){
// this.code = code;
// this.litros = litros;
// this.n = n;
// this.tipo ... | true |
0b84c642b3b753cba5b7a405c48f58f1e7c6823d | JavaScript | marajita/Travel-Project | /assets/javascript/user.js | UTF-8 | 7,778 | 2.734375 | 3 | [] | no_license | // Initialize Firebase
var config = {
apiKey: "AIzaSyC3Bnvip6bvt2gN9kUa2FOiRvSaYfIisyk",
authDomain: "my-first-project-dca58.firebaseapp.com",
databaseURL: "https://my-first-project-dca58.firebaseio.com",
projectId: "my-first-project-dca58",
storageBucket: "my-first-project-dca58.appspot.com",
messagingSend... | true |
90b2f9d5dd20c312c0ad834f63cd1b01864f76e9 | JavaScript | pastelsky/mobx-promise | /src/index.js | UTF-8 | 2,660 | 2.84375 | 3 | [] | no_license | import { action } from 'mobx'
import isUsedAsDecorator from './isUsedAsDecorator'
export const PromiseState = {
FULFILLED: 'fulfilled',
PENDING: 'pending',
REJECTED: 'rejected',
}
function handlePromiseBind(promise, observableTarget, observableKey, callback) {
const observableProperty = observableKey ?
o... | true |
43273dac04e949a485751a3977d0533d410b29e2 | JavaScript | TomZD/tzqx | /tztf/src/main/webapp/static1/js/lib/gigis/plugins/typhoon/NamesLayer.js | UTF-8 | 943 | 2.625 | 3 | [] | no_license | define(function(require) {
/**
* 台风名称管理器
*/
return OpenLayers.Class({
/**
* 初始化
* @param {object} box 台风容器
* @param {string} klass 台风名称class
*/
initialize: function(box, klass) {
this.box = box;
this.namesLayerClass = klass || "tptxt";
},
/**
* 添加台风名
* @param {string} name 台风名称... | true |
14dc4cf06092d157e222438fc001a6d8eb6d55e7 | JavaScript | EstelleTian/userManagerForATOM | /app/reducers/onlineUserListReducer.jsx | UTF-8 | 4,573 | 2.71875 | 3 | [] | no_license | //在线用户--在线用户模块数据记录
const sortByFinalRefreshTime = (data) => {
data = data.sort((a, b) => {
var timeA = a.finalRefreshTime * 1;
var timeB = b.finalRefreshTime * 1;
if (timeA < timeB) {
return 1;
}else if (timeA > timeB) {
return -1;
}else{
r... | true |
b20104fd8d1bccdebe29889e33746bc51d2463b1 | JavaScript | sarthakm21/Frontend-To-do-list | /app.js | UTF-8 | 903 | 3.1875 | 3 | [] | no_license | var addBtn=document.getElementById('add');
var listItem=document.getElementById('addText');
var todoList=document.getElementById('tasks');
addBtn.addEventListener("click",function(){
var todoText=listItem.value;
if(todoText!==""){
listItem.value="";
var todo=document.createElement("LI");
var... | true |
d338dbac1f4107d8391517a82c41ac4cde34ffb3 | JavaScript | msarabia/scheduler3000 | /src/components/Scheduler/EventTime.js | UTF-8 | 1,161 | 2.71875 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { PropTypes } from 'react';
const DATE_FORMAT = 'ddd, MMM D';
const YEAR_FORMAT = 'ddd, MMM D, YYYY';
const TIME_FORMAT = 'ddd, MMM D, h:mm:a';
const TIME_YEAR_FORMAT = 'ddd, MMMM, D, YYYY, h:mm:a';
const propTypes = {
event: PropTypes.object.isRequired // TODO Shape
};
export def... | true |