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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2cae0d08606c111a1d0ba46e5a522f96d3ace0f3 | JavaScript | dgonca/genwebs | /main.js | UTF-8 | 5,503 | 3.453125 | 3 | [] | no_license | //step 1 - getting reference to form inputs
//get a reference to the each of the of inputs within the form element.
//pull out children within a form using a shortcut
var submitForm = document.getElementById("RF-1");
var firstNameInput = submitForm.elements["first-name"]; //this works because we are looking inside of... | true |
a72d40172bbb20e99656bf968eae1c33eab9f632 | JavaScript | Filomaster/DrMario | /scripts/utility.js | UTF-8 | 809 | 3.21875 | 3 | [] | no_license | "use strict";
// Debug variable, to hide all console logs etc
var DEBUG = true;
// Useful methods
let Utility = {
// Method for generating random int. I've already used it in previous projects.
getRandomInt: (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() *... | true |
51a12e2ba2fb59c8f122348fa0fff29781d3f0c9 | JavaScript | rezamatrix/Lifil | /js/m.js | UTF-8 | 3,591 | 2.515625 | 3 | [
"MIT"
] | permissive |
function select(nummnue)
{
if(nummnue==1){
document.getElementById('idl').setAttribute('style','visibility: visible;');
document.getElementById('idl').removeAttribute('hidden');
} else{
document.getElementById('idl').setAttribute('style','visibility: hidden;');
document.getElementByI... | true |
f21de14d9b584fbc89d32f39e1b51480df43a67e | JavaScript | yilangli/Tic-tac-toe | /ultimate/view/view.js | UTF-8 | 6,815 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* Created by lyl_cs on 2016/10/16.
*/
var player1={"name":" ","marker":" ","playNum":1};
var player2={"name":" ","marker":" ","playNum":2};
var currentPlayer=player1;
var allPlayers=new Array();
var tables=new Array();
var currentBoard=null;
var newGame=false;
$(document).ready(function(){
getAllPlayers();
... | true |
d2540e6b07a8c6b1f03d0d9fbaf991112dc54f71 | JavaScript | ahdinosaur/frame-hop | /hop.js | UTF-8 | 1,485 | 3.03125 | 3 | [
"MIT"
] | permissive | "use strict"
var through = require('through2')
// Slices a stream of frames into a stream of overlapping windows
// The size of each frame is the same as the size o
function createHopStream(opts) {
if (opts.frameSize == null) {
throw new Error("Frame size not given")
}
var frameSize = opts.frameSize
if (... | true |
6065f824b5096981e764a0969d833b5dee1a22f0 | JavaScript | kareemalsawah/PhysicsSimulatorServer | /public/js/waves/objects.js | UTF-8 | 16,826 | 3.171875 | 3 | [] | no_license | //Miscellanous Objects
/*
Notes:
There are multiple coordinate systems used:
Real-Coords: represents coords that are used in the simulation
SimulationCanvas-Coords: representes coords that are used to draw elements on the simulation canvas
GraphCanvas-Coords: represents coords that are used to draw elements on t... | true |
9cb8bb3a943889ba118f4d1f668b700710aa0bad | JavaScript | ArtemLavrentii/p-t-task | /src/data/Game.js | UTF-8 | 1,333 | 3 | 3 | [] | no_license | import Snake from 'data/Snake';
import EventEmitter from 'events';
export default class Game extends EventEmitter {
constructor(world) {
super();
this.timerID = -1;
this.gameEnded = false;
this.world = world.makeCopy();
this.onTimer = () => this.endGame();
}
createSnake() {
if (this.snak... | true |
a188bbaac3304a8710818f175e2d1118327b75d0 | JavaScript | misterpatate/BePulseServer | /modules/defis.js | UTF-8 | 2,211 | 2.75 | 3 | [] | no_license | var fs = require("fs");
var Promise = require('promise');
var file = "db/defis.db";
exports.initDefis = function(){
// si la base existe on la supprime
if(fs.existsSync(file)){
fs.unlink(file);
}
var sqlite3 = require("sqlite3").verbose();
// création de la base
var db = new sqlite3.Database(file);... | true |
2c8fa9bbf7ee3c5ec1acaaf4ab938261364f05c4 | JavaScript | Andy026/listaTareas | /js/app.js | UTF-8 | 2,684 | 4 | 4 | [] | no_license | //llamo a los elementos del html necesarios
let formulario = document.querySelector('#formTareas');
let tarea = document.querySelector('#tarea');
//creo un array vacio donde voy a poner las tareas
let tareas = [];
//les agrego un eventListener al input y form
formulario.addEventListener('submit', guardarTarea);
tarea.a... | true |
706cb8b2bcfb2fabaa9a52802f9616ed1b6fb9b5 | JavaScript | StudioZut/conditional-sticky | /con-stick.js | UTF-8 | 547 | 2.890625 | 3 | [] | no_license | <script>
<!--
// This checks how much space is below #footer.
var elem = document.getElementById('footer');
var footspace = window.innerHeight - elem.offsetTop + elem.offsetHeight;
// "Wrap that sticky". Should add a class instead of styling the element. Also needs to recheck on window resize. Probably other... | true |
eaa41e535ae9e72baef360a29552c47aa163ea30 | JavaScript | rishi-menon/Uno-Multiplayer | /sMainMenu.js | UTF-8 | 12,180 | 2.765625 | 3 | [
"MIT"
] | permissive |
///// Public data.. Gets set in Init
let io;
let gameCache;
let gameObj;
///// Local Data
//Map of room code to player objects
let mapRoomCodeToPlayers = new Map();
let mapSocketIdToRoomCode = new Map();
const nMaxRoomsAllowed = 50;
const nMaxPlayersPerRoom = 8;
///////////////////////////////////... | true |
13cb61411ab7f0c50f49b4177e0c8c8d54a97c04 | JavaScript | chunrichi/CqClass-v2 | /Yum/signIn/index.js | UTF-8 | 7,359 | 2.890625 | 3 | [] | no_license | /**
* 登录函数
* 用来第一次使用的用户登录信息,并将部分信息保存到数据
*
* 保存的信息涵盖:
* 1. 姓名
* 2. 性别
* 3. 专业
* 4. 学号
* 5. 年级
* 6. 课表信息
*
* @param string uid 用户学号
* @param string pwd 教务处密码
* @param string term 当前学期代号 49为2018年下学期(此数据基本固定)
*
* @return dict(Object)
* messageStatus bool 是否获取成... | true |
a7504109eadd8c5557395015bc727334f2d2932c | JavaScript | gajus/flow-runtime | /packages/flow-runtime/src/__tests__/__fixtures__/ParameterizedFunctionType/typeParametersWithFunctionArguments.js | UTF-8 | 523 | 2.578125 | 3 | [
"MIT"
] | permissive | /* @flow */
import type TypeContext from '../../../TypeContext';
export function pass (t: TypeContext) {
function fn(a) {
const T = t.typeParameter("T");
let _aType = t.function(t.return(t.flowInto(T)));
const _returnType = t.return(t.array(T));
t.param("a", _aType).assert(a);
return _return... | true |
052482f625561881a470ecc660f2aac5a2dfa1e8 | JavaScript | KeanuInterone/ShanasSourdough | /backend/controllers/users.js | UTF-8 | 1,371 | 2.515625 | 3 | [] | no_license | const experss = require('express')
const router = experss.Router()
const passport = require('passport')
const User = require('../models/User')
const bcrypt = require('bcrypt')
const jwt = require('jsonwebtoken')
router.post('/login', function (req, res, next) {
passport.authenticate('local', { session: false }, ... | true |
f81fb594a09e8e757b123a4491f8eefb23f53c63 | JavaScript | lichard49/lime-olleyball | /ball.js | UTF-8 | 667 | 3.453125 | 3 | [
"MIT"
] | permissive | function Ball(x, y) {
this.x = x;
this.y = y;
this.xVelocity = 0;
this.yVelocity = 0;
}
Ball.prototype.bounce = function() {
this.xVelocity = 0;
}
Ball.prototype.tick = function(floorY) {
this.x += this.xVelocity;
this.y += this.yVelocity;
if(this.y > floorY-15) {
this.y = floorY-15;
this.yVelocity = -1*... | true |
4375a1edc83a3ea8d7bdeff37d3f1cf5e123efc3 | JavaScript | redux-saga/redux-saga | /packages/core/__tests__/interpreter/base.js | UTF-8 | 3,615 | 2.859375 | 3 | [
"MIT",
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | import * as is from '@redux-saga/is'
import { createStore, applyMiddleware } from 'redux'
import sagaMiddleware from '../../src'
import * as io from '../../src/effects'
const last = (arr) => arr[arr.length - 1]
const dropRight = (n, arr) => {
const copy = [...arr]
while (n > 0) {
copy.length = copy.length - ... | true |
ad0abcd603c70e24ba25fd076a41997831de6abf | JavaScript | mohamedhabibwork/whatsapp | /socket/Clients.js | UTF-8 | 630 | 2.796875 | 3 | [] | no_license | class Clients {
clients = [];
constructor(clients = []) {
this.clients = clients;
}
all() {
return this.clients;
}
getById(id) {
return this.clients.filter(c => c.id === id)[0] || null;
}
getByIndex(index) {
return this.clients[index] || null;
}
... | true |
8be2c279e9a21a86251fe9683f429a6165957067 | JavaScript | nwthomas/code-challenges | /src/lambda-school/week-3/js-II/js-II.js | UTF-8 | 3,291 | 4.40625 | 4 | [
"MIT"
] | permissive | /*
Good morning! You're going to write a function that invokes a callback.
The function which your function will invoke as a callback is already written: titleMfrYearString.
The function you will be completing is called whoMadeWhatWhen.
INPUT (three parameters):
an array: arr,
a string: mfrStr - for "manufacturer s... | true |
0714645d396768196469d3700e5a6fbb28baee99 | JavaScript | bergsans/division-by-zero | /src/game-logic/common.js | UTF-8 | 4,046 | 2.609375 | 3 | [] | no_license | import { compose } from '../utilities';
import getImageData from '../renderers/image-data';
import { PLAYER_FACES_LEFT } from '../constants';
const { spriteSheet } = getImageData();
export const isAHit = (firstBody, secondBody) => (
firstBody.x < secondBody.x + secondBody.w
&& firstBody.x + firstBody.w > secondBo... | true |
aaee4a671e0a13b4c67d69b1ad8f1e3020213299 | JavaScript | Yippina/Prueba-Js | /Prueba3.js | UTF-8 | 426 | 2.9375 | 3 | [
"MIT"
] | permissive | import { parsePhoneNumberFromString } from 'libphonenumber-js'
const phoneNumber = parsePhoneNumberFromString('+12133734253')
phoneNumber.format("NATIONAL") === '(213) 373-4253'
phoneNumber.format("INTERNATIONAL") === '+1 213 373 4253'
phoneNumber.format("RFC3966") === 'tel:+12133734253'
// Aliases
phoneNumber.forma... | true |
3820f5685df7eb7ebf515870c18b1fb3e47a2e7c | JavaScript | arodriguezbonmati/RickAndMortyFB | /src/App.jsx | UTF-8 | 1,951 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
import cloneDeep from "clone-deep";
import "./App.css";
import Character from "./Components/Character";
import FilterSection from "./Components/FilterSection";
import "./Components/Styles.css";
class App extends Component {
state = {
info: {
... | true |
d52c606fed0e134540d6ae160e7d403c5b1cb72a | JavaScript | Q3333/TIL | /D3.js/190722/D3/WebContent/js/pie4.js | UTF-8 | 2,372 | 3.359375 | 3 | [] | no_license | window.addEventListener("load",function(){
var svgHeight = 240; // SVG 요소의 높이
var svgWidth = 320; //SVG 요소의 넓이
var dataSet = [50,30,12,5,3]; //데이터 셋, 비율을 나타냄
var color = d3.scaleOrdinal(d3.schemeCategory10); //D3.js가 준비한 표준 색
/*
* var colorScale_1 = d3.schemeCategory10;
* var colorScale_2 = schemeCateg... | true |
1897f82c4927fb03c710b268af1517fadb3f4cb8 | JavaScript | Yevych/GeekHub | /Home-23/assets/scripts/main.js | UTF-8 | 1,501 | 2.59375 | 3 | [] | no_license | (function ($) {
//Hamburger menu
jQuery(document).ready(function () {
jQuery('.js-burger-menu').on('click', function () {
jQuery(this).toggleClass('active')
jQuery('body').toggleClass('open-menu')
})
initMenu()
function initMenu () {
jQuery('.js-burger-menu').removeClass('active... | true |
d6ed12b919797cb4af9f352c73f19b72a8f7eef1 | JavaScript | mattnmcintosh/pick-a-card-bot | /bot.js | UTF-8 | 4,867 | 2.796875 | 3 | [] | no_license | const Discord = require('discord.io');
const fs = require('fs');
const auth = require('./auth.json');
const mod = require('./mod.json');
const missingCardNotification = 'Card is either not available or already taken.';
const { modUserId } = mod;
const bot = new Discord.Client({
token: auth.token,
autorun: true,
})... | true |
ee9cc39152002410689fb28ca09c0c8029f20ffb | JavaScript | kroneman/google-apps-script--app-localization | /src/cache.js | UTF-8 | 2,829 | 3.125 | 3 | [] | no_license | const path = require('path');
const fse = require('fs-extra');
const crypto = require('crypto');
const defaultCacheFile = path.join(__dirname, './.cache.json');
const has = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
/**
* - Creates a cache object in memory when process is running
* - Uses default... | true |
b68761d688bdafd73f043c87b6804b2b230129f8 | JavaScript | PatriciaLoboTejedor/ejercicios-de-adalab | /modulo-2/modulo-2-leccion-02-intro-a-la-programación-2/modulo-2-leccion-02-ejercicio-01-trasteando/main.js | UTF-8 | 84 | 2.65625 | 3 | [] | no_license | "use strict";
const patri = 8;
const rosa = 7;
console.log(patri + rosa);
| true |
834eb45fc886218518b24708fead370b924e6aa8 | JavaScript | shawnpanda/Donacious | /js/testing.js | UTF-8 | 918 | 3 | 3 | [] | no_license | <script type="text/javascript">
function initialize() {
var geocoder = new google.maps.Geocoder();
var address = "500 College Avenue, Swarthmore PA, Pennsylvania 19081";
geocoder.geocode({'address': address},function(results,status){
if (status == google.maps.GeocoderStatus.OK) {
// console.log(res... | true |
26a03242b10aa6dcbc559b3f93af6883ac2b748b | JavaScript | leonardobelilomessias/Bemkivy | /teste.js | UTF-8 | 397 | 2.90625 | 3 | [] | no_license | var links =[]
/*for(i=1;i<100;i++){
}*/
let url ='viacep.com.br/ws/01001000/json/'
let ajax = new XMLHttpRequest();
ajax.send()
for(i=1;i<100;i++){
ajax.open('GET',url)
ajax.onreadystatechange=()=>{
if(ajax.status ==200 && ajax.readyState ==4){
links.push(`Requisição via ajax ${ajax... | true |
e252e6290a1c4702f84c3660c7ba565e3452ad84 | JavaScript | FabbyD/netflix-boo | /scripts/views/signin_view.js | UTF-8 | 1,618 | 2.90625 | 3 | [
"MIT"
] | permissive | /******************************************************************************
* File: signin_view.js
* Desc: View when a user signs in
* Author: Fabrice Dugas
* Date: 10/01/2018
*****************************************************************************/
function SignInView() {
console.log('Entering SignInV... | true |
7f858562761ff087bfbdd7520a19930988d5ee71 | JavaScript | avinashkpai12/JS-assignment1 | /LargestOfFive.js | UTF-8 | 219 | 3.515625 | 4 | [] | no_license | var arr = [21,12,78,34,45];
var i;
var greatest = arr[0];
var temp;
for(i=0;i<arr.length;i++){
if(arr[i] > greatest){
greatest = arr[i];
}
}
console.log("greatest = " + greatest); | true |
35687184a2cfa023ca2baabb73287273dcf78ab8 | JavaScript | Nisseboy/Sanafanafanefbox | /Snake.js | UTF-8 | 1,334 | 3.1875 | 3 | [] | no_license | class Snake {
constructor(length, x, y) {
this.body = [];
for (let i = 0; i < length; i++) {
this.body.push(new Segment());
}
this.head = this.body[0];
this.head.x = x;
this.head.y = y;
this.a = random(TWO_PI);
this.c = [floor(random(255)), floor(random(255)), floor(random(255))]... | true |
4ee15a0889645f71beeeb2f4e78f144959abcd7b | JavaScript | dogandpony/sushi-bazooka | /js/lib/History.js | UTF-8 | 2,288 | 2.6875 | 3 | [] | no_license | var Sushi;
(function (Sushi) {
"use strict";
var Events = Sushi.Events;
var Util = Sushi.Util;
var History = function (options) {
this.id = Util.uniqueId();
this.options = Util.merge({}, History.DEFAULTS, options);
this.isListening = false;
this.validateOptions();
};
History.DEFAULTS = {
type: "h... | true |
7d7f51fd3e297d347a9bd4543ced004ee56eaf1e | JavaScript | marcuspousette/fullStackMac--old | /imports/ui/components/d3-charts/bar-chart/Bar_chart.js | UTF-8 | 3,743 | 2.59375 | 3 | [] | no_license | import d3 from 'd3'
import './Bar_chart.html'
import './Bar_chart.css'
import { data } from '/imports/api/data/barChartData.js'
let properties;
Template.Bar_chart.onRendered(() => {
let category = 1;
properties = setupBarChart(data, 'bar-chart-container', category);
properties = update(data, properties, category... | true |
1320c088a6b13a1e674116a46cc89f4b123f5450 | JavaScript | amyyi/phoneBook | /dist/js/container/SelectBar.js | UTF-8 | 1,565 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
const countryLists = [
{ countryEN: 'null',
countryCH: '國家'
},
{ countryEN: 'taiwan',
countryCH: '台灣'
},
{ countryEN: 'china',
countryCH: '中國'
},
{ countryEN: 'japan',
countryCH: '日本'
},
]
export default class SelectBar extends React.PureCompon... | true |
106b73a635aa6a09fa56d29cdabdd324ca5a86b1 | JavaScript | Sahana-Lawrence/ICS2O-Unit2-05-HTML | /index.js | UTF-8 | 381 | 3.453125 | 3 | [] | no_license | // JavaScript File
// variables assigned to calculate the area of a square or rectangle
function Area(){
var base = document.getElementById("base");
var height = document.getElementById("height");
var basevalue = base.value;
var heightvalue = height.value;
var result = (basevalue*heightvalue);
var divresult = document... | true |
97ecd81ce3366232edffdb1874ae46709dce32a4 | JavaScript | Samantha-Nguyen/Tic-Tac-Toe | /script.js | UTF-8 | 4,366 | 4 | 4 | [] | no_license | const boxes = Array.from(document.getElementsByClassName('box'))
const playText = document.getElementById('playtext')
const board = document.getElementById('gameboard')
const spaces = []
const PLAYER_1 = 'X'
const PLAYER_2 = 'O'
let currentPlayer
let count = 0
// This counts how many times the game board is clicked an... | true |
af0e3fe2af36959ab80682e9b3bea4793a706504 | JavaScript | Magic-Bing/xk | /Public/common/js/casmenu/casmenu.js | UTF-8 | 7,291 | 2.9375 | 3 | [] | no_license | /**
* 联动插件
*
* @edit 2016-10-28
* @author zlw
*/
;(function(win) {
//插件名称
var linkage = {};
linkage.each = function(arr, fn) {
var i = 0, len = arr.length;
for (;i < len; i++) {
if (fn(i, arr[i]) === false) {
break;
}
}
};
linkage.... | true |
f714f3239ee6451cd279cffa4d7ecb1da2252245 | JavaScript | eskhio/cronba | /backup.js | UTF-8 | 4,009 | 2.734375 | 3 | [] | no_license | const path = require('path');
const folders = require('./folders');
const logger = require('./logger');
const fileSystem = require('./filesystem');
const BackupFile = require('./backupfile');
const fs = require("fs");
/**
* A backup process
* @class Backup
*/
class Backup {
/**
* Creates an instance of Backup.
... | true |
3d05494d95df3aa8fa1d4f4ddfee3e05d640e8ac | JavaScript | jpenna/telebot2 | /server/db/model/chat.js | UTF-8 | 1,739 | 2.546875 | 3 | [] | no_license | /* eslint func-names:off, comma-dangle:off */
const { mongoose } = require('../mongoose');
const _ = require('lodash');
const chatSchema = mongoose.Schema({
chatId: {
type: Number,
required: true,
unique: true,
},
chatType: {
type: String,
required: true,
},
firstname: String,
lastname... | true |
a5ac8ad06a7d0fac09d42a77a9dbf74d30ab6e1d | JavaScript | mattmiller85/tournament-hub-web | /src/modules/tournamentReducer.js | UTF-8 | 825 | 2.609375 | 3 | [] | no_license | //@ts-check
const initialTournamentState = { tournamentList: [], searchResults: [] };
export default (previousState, action) => {
switch(action.type) {
case 'USER_TOURNAMENT_LIST_ACTION':
return { ...previousState, tournamentList: action.tournamentList };
case 'TOURNAMENT_SEARCH_RESULTS... | true |
b15d099a6a04a1c6fd5cf0e8cdd4cf8c860100eb | JavaScript | timkuijsten/node-stream-array | /test/5.js | UTF-8 | 764 | 2.703125 | 3 | [
"MIT"
] | permissive | var test = require('tape')
, streamify = require('..')
, concat = require('concat-stream')
;
test('async, non-blocking', function(t) {
var s = streamify(['1', '2', '3']);
var i = 0;
s.on('data', function(item) {
i++;
});
process.nextTick(function() {
t.equal(0, i, 'should emit... | true |
bea9a177d5f141e7373fd2c8f54d4e1cf6a29a50 | JavaScript | medha-kulkarni/react-sttp | /src/refsDemo/CounterUsingRef.js | UTF-8 | 829 | 3.03125 | 3 | [] | no_license | import React, { useRef, useState } from "react";
import "./CounterUsingRef.css";
function CounterUsingRef() {
const counterRef = useRef(0);
const [, forceRenderer] = useState(false)
let incrementCounter = () => {
counterRef.current = counterRef.current + 1;
forceRenderer((x) => !x)
console.log(count... | true |
6d722f0a46075c2a70ac8dfdb0b673ad4eac8a62 | JavaScript | xiongxiaochao/xiangmu2 | /src/js/login.js | UTF-8 | 6,317 | 2.5625 | 3 | [] | no_license | $(function(){
/*
login: 1.点击选项卡切换区域
2.账号密码登录 -- 在数据库找到完全匹配的账号密码
登陆成功跳转首页
3.短信登陆
*/
// 1.点击选项卡切换区域
$('.mem_logtab .quyu1').click(function(){
$(this).addClass('cur').siblings().removeClass('cur');
$('.loginmethod1').css({'display' : '... | true |
88b608b7f2b37737a63eccf3bdc4fa0d4df43a3d | JavaScript | stonefollari/astroapp | /public/javascript/AstroAppEngine/Objects/Earth.js | UTF-8 | 8,108 | 2.765625 | 3 | [] | no_license | /**
* This class will Create the earth and its need objects.
*
* Author Francis Perez Last Updated: 12/7/2019
*/
import Dot from "./Dot.js";
import Pipe from "./Pipe.js";
import Horizon from "./Horizon.js";
import SphereObjectPositioner from "../Libs/SphereObjectPositioner.js";
export default class Earth {
TE... | true |
1087543d7d27503729eeb07a0e4a010c1e083272 | JavaScript | quanla/static-wordpress | /src/server/resolve-content.js | UTF-8 | 678 | 2.671875 | 3 | [] | no_license | function createResolveContent(...contentGenerators) {
return async (url) => {
for (let i = 0; i < contentGenerators.length; i++) {
let contentGenerator = contentGenerators[i];
let contents = await contentGenerator();
for (let i = 0; i < contents.length; i++) {
... | true |
e5443629937414fa078b1f65fe4cf0ec84cdb188 | JavaScript | macandrew6/algorithm-research | /search_insert.js | UTF-8 | 1,022 | 4.3125 | 4 | [] | no_license | /*
Given a sorted array and a target value, return the index if the target is
found.If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Example 1:
Input: [1, 3, 5, 6], 5
Output: 2
Example 2:
Input: [1, 3, 5, 6], 2
Output: 1
Example 3:
Input: [1, 3,... | true |
e582d3388bbd8293a64512cb0d4d38559672b526 | JavaScript | anvytran-dev/ProgrammingChallenges | /all-star-code-challenge-#22.js | UTF-8 | 908 | 4.40625 | 4 | [] | no_license | //Create a function that takes an integer argument of seconds and converts the value into a string describing how many hours and minutes comprise that many seconds.
//Any remaining seconds left over are ignored.
//Note:
//The string output needs to be in the specific form - "X hour(s) and X minute(s)"
//For example:... | true |
130bd2d643c91bb13a4cb23591b13e40fc464643 | JavaScript | seamus-quinn/autocomplete | /index.js | UTF-8 | 2,023 | 3.296875 | 3 | [] | no_license | class Node {
constructor(value = null) {
this.value = value;
this.children = {};
this.completedWord = null;
}
}
class Trie {
constructor() {
this.root = new Node()
this.count = 0;
this.suggestionArray = [];
}
insert(word, node = this.root, array = []) {
word = word.toLowerCase();... | true |
0657a0d71e65919b0e167f593fb293011e8315fd | JavaScript | driftAbout/08-rest-http | /lab-kevin/lib/storage.js | UTF-8 | 2,158 | 2.578125 | 3 | [] | no_license | 'use strict';
const debug = require('debug')('http:storage-constructor');
const storage = module.exports = {};
const memory = {};
storage.create = function(schema, item){
return new Promise((resolve, reject) => {
debug('#New item');
if(!schema || !item) return reject(new Error('Cannot create a new item; S... | true |
fada4b7c4479d57470687bf0a420c2a062f67165 | JavaScript | JerryPan2718/BreakingIce | /backend/util.js | UTF-8 | 1,896 | 3.109375 | 3 | [
"MIT"
] | permissive | /*
Collection: Collection of Key/Value pairs
Document: Key - How you will access this data later. Usually username
Data: Value - JSON object of data you want to store
*/
function writeDocument(db, collection, document, data, cb) {
try {
db.collection(collection).doc(document).set(data).then((writeResult) =... | true |
3ce46db3395775c304fe85d107974814f6e273ca | JavaScript | arbuthnott/SailsTest | /testApp/assets/js/custom/mySockets.js | UTF-8 | 2,081 | 2.921875 | 3 | [
"MIT"
] | permissive | /******************************************
*
* MY ATTEMPT TO CONNECT SOME SOCKETS, ULP!
*
******************************************/
// The automatically-created socket is exposed as io.socket.
// Use .on() to subscribe to the 'hello' event on the client
io.socket.on('hello', function gotHelloMessage (data) {
//co... | true |
521e3ecfaf7fd23fa746bf028b32c7da843a3b70 | JavaScript | nagarjunCode/players | /Untitled-1.js | UTF-8 | 748 | 3.296875 | 3 | [] | no_license | str = 'asss' //output 3 => aba len => 7
var len =str.length;
var hash = {};
var biggest = str[0];
function main(){
for(var i =1; i< len;i++){
for(j=0;j<len-i;j++){
var subStr = str.substr(j,i+1);
if(hash[subStr] === undefined)
hash[subStr] = 1;
else
... | true |
04ff792a1a111a439d91c7ebc3206409f5141c70 | JavaScript | hlawerd/nodejswpg | /js/index120.js | UTF-8 | 281 | 3.296875 | 3 | [] | no_license | const students = [];
students[0] = 'Hugo',
students[1] = 'Nicolas',
students[2] = 'Harpreet',
students[3] = 'Jessica',
students[4] = 'Mario',
students[5] = 'Ashey';
for (let index = 0; index < 5; index++) {
console.log(`index ${index}, ${students[index]}`);
}
| true |
8f3a226488466b3e66f1453782aad91d209041a8 | JavaScript | Presnia/constructor-weblayout-nd | /js/main.js | UTF-8 | 11,569 | 2.625 | 3 | [
"MIT"
] | permissive | const burgerButton = getElement('button', ['menu-button']);
const wrapperHeader = getElement('div', ['header']);
/* const setFavicon = (favImage) => {
const headTitle = document.querySelector('head');
const favicon = document.createElement('link');
favicon.setAttribute('rel', 'shortcut icon');
favicon.... | true |
14477d6ab99ba5cf98309fb986c0b185ad0b3f07 | JavaScript | bmonteve/WeatherApp | /script.js | UTF-8 | 4,110 | 3.375 | 3 | [] | no_license | var tab = 0;
//function to get the weather for the city searched
function getWeather(city) {
var queryURL = "https://api.openweathermap.org/data/2.5/forecast?q=" + city + "&units=imperial&APPID=db9b79a42e674bfb91782df53b8c0084";
//creates an AJAX request to the weather API for a 5 day forecast
$.get(q... | true |
f9722af4fe1a80357976e6b6761d859169b2b056 | JavaScript | 8790fahad/bits-his | /src/components/Pharmacy Module/HospitalRegistration.js | UTF-8 | 7,117 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | import React, { Component } from "react";
import { Table, Form,Button,Input,Col,Row,FormGroup} from 'reactstrap';
import Map from './Map'
class HospitalRegistration extends Component {
state={
facilityNo : ' ',
facilityName: '',
facilityAdress: '',
contactPerson : '',
email : '',
phoneNumber... | true |
f117ef3762394f38cc5728859064a4466457c2f5 | JavaScript | dzhurley/codevember | /sketches/fast.js | UTF-8 | 1,500 | 2.640625 | 3 | [] | no_license | const THREE = require('three');
global.THREE = THREE;
const canvasSketch = require('canvas-sketch');
const { rangeFloor } = require('canvas-sketch-util/random');
const sketch = ({ context }) => {
const renderer = new THREE.WebGLRenderer({
canvas: context.canvas,
});
renderer.setClearColor(0);
const sce... | true |
9900b43a560334a4b3a4baed02cb3fc0cdc971ec | JavaScript | Ashutosh102/Dev_Music_player | /js/script.js | UTF-8 | 8,792 | 2.921875 | 3 | [
"MIT"
] | permissive | const wrapper = document.querySelector(".wrapper"),
musicImg = wrapper.querySelector(".img-area img"),
musicName = wrapper.querySelector(".song-details .name"),
musicArtist = wrapper.querySelector(".song-details .artist"),
playPauseBtn = wrapper.querySelector(".play-pause"),
prevBtn = wrapper.querySelector("#prev"... | true |
f6b9c14712f307bf0103bf0bc6b454a802dbf004 | JavaScript | Henery002/studying-logs | /0806-NodeJs-01/7-exer.js | UTF-8 | 567 | 2.609375 | 3 | [] | no_license | /********练习-创建静态Web服务器*********/
var http=require('http');
var server=http.createServer();
server.on('request',function(){
console.log('WebServer服务器接收到了一个请求消息...');
var url=require('url');
console.log(url);
//console.log(request.parse());
response.statusCode=200;
response.setHeader('Content-Type','text/html;char... | true |
1872edc17b1055965545c135f6408da6d4f2600e | JavaScript | ToyinOtak/crown-marketplace | /app/assets/javascripts/facilities_management/beta/procurement/confirmation_of_signed_contract.js | UTF-8 | 569 | 2.609375 | 3 | [
"MIT"
] | permissive | $(function () {
$("#contract-signed-yes").on("click", function (e) {
if (e.target.checked) {
$("#contract-signed-yes-container").removeClass("govuk-visually-hidden");
$("#contract-signed-no-container").addClass("govuk-visually-hidden");
}
});
$("#contract-signed-no")... | true |
7c442a96ad4af29e801556ea98ebfe30f40e42d5 | JavaScript | JS-LIU/liveXCX | /store/entity/TimeManager.js | UTF-8 | 2,527 | 3.078125 | 3 | [] | no_license | /**
* Created by Liudq on 2019-07-24
*/
export class TimeManager {
constructor() {
this.activeTime = [];
}
// 将时间转换为时间戳 ("yyyy-mm-dd hh:mm:ss")
static convertToTimeStampBySec(date) {
return new Date(date).getTime() / 1000;
}
// 当前时间戳
static currentTimeStampBySec() {
return parseInt(new Dat... | true |
cd05a725a17a3525301196f2ab70a998bf4447f4 | JavaScript | tsaiminnie/movie-database | /movie/src/pages/PageSingle.js | UTF-8 | 2,567 | 2.578125 | 3 | [] | no_license | import { useEffect, useState } from 'react';
import { useParams, Link } from 'react-router-dom';
import useGlobal from '../globals/globalState';
import MovieCard from '../components/MovieCard';
import isFav from '../utilities/isFav';
import tv from '../images/tv.png';
const PageSingle = () => {
const [globalStat... | true |
7f38a7967cb22d8a1e225212664a0b510598c5fd | JavaScript | parentnode/manipulator | /src/beta-u-timeline.js | UTF-8 | 2,709 | 2.6875 | 3 | [
"MIT"
] | permissive | u.timeline = function(node) {
node._timeline_future_actions = [];
// at timestamp, do action
node.atDo = function(timestamp, action, id) {
id = id || "";
this._timeline_future_actions.push({"timestamp":timestamp, "action":action, "id":id});
}
node.playTimeline = function(_options) {
var speed = 1;
var ... | true |
62e740fbb0e08d3c6e06260769be0bb12d9a0eb2 | JavaScript | RAHEL77/final-project-fe | /src/components/User/Login.jsx | UTF-8 | 1,240 | 2.625 | 3 | [] | no_license | import React, { useState } from "react";
import {apiLogin} from '../../api/userApi';
import {useHistory} from 'react-router-dom';
const Login = () => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const history = useHistory();
const onLogin = async(e) => {
e.preve... | true |
f1bd95a1d6c1d0c0c03602028fa2647805382d90 | JavaScript | AngelVillavicencio/Miniprojects | /CRONOMETRO/script.js | UTF-8 | 701 | 3.46875 | 3 | [] | no_license | console.log("hola");
let seg = 0;
let min = 0;
let hours = 0;
let init;
let state = 0;
const counter = document.querySelector(".counter");
const start = document.getElementById("start");
const stop = document.getElementById("stop");
start.addEventListener("click", () => {
if (state == 0) {
init = setInterval(co... | true |
45df8daf47e313aa6b449882233a0cbc2eb25820 | JavaScript | zhangxuan1997/canvas-test | /src/Particle-demo/animateStep/logic.js | UTF-8 | 4,378 | 2.9375 | 3 | [
"MIT"
] | permissive | var animate = (function(w){
var dots = [],DOT_SIZE =1.3;
var Dot = function(x,y,vx,vy,tox,toy,color){
this.x=x;
this.y=y;
this.vx=vx;
this.vy=vy;
this.visible = false;
this.nextox = tox;
this.nextoy = toy;
this.color = color;
this.globleDown = false;
this.gravity = Math.random()*3+6.8;
this.set... | true |
2a1e7314a3bf8bd0e43002b4ab6e4d73d317a210 | JavaScript | gitKad/adventofcode | /2017/me.js | UTF-8 | 2,952 | 3.265625 | 3 | [] | no_license | 'use strict'
var Promise = require('bluebird')
const Passphrase = require('./passphrase.js')
const JumpInstructions = require('./jumpInstructions.js')
class Me {
constructor() {
}
// Day 6 stuff
countRedistributionCycles(memoryArea) {
do {
memoryArea.redistribute()
}
while(!memoryArea.has... | true |
85f737002e777ea31ee9ae3ad62830a622ab7f91 | JavaScript | shree214ram/DSA | /Algorithms/Dynamic Programming(33)/Palingdrome/Count All Palimdrome Subsequence/sunnyLatestCode20Dec2022.js | UTF-8 | 816 | 3.578125 | 4 | [] | no_license | //11:40
//count all plaingdrome in subsequence
let str = "abcb";
const DP = new Array(str.length+1)
//set for length 1
for(let i=0;i<DP.length;i++){
DP[i] = new Array(str.length+1).fill(0) //first error
}
//set for length 1
for(let i=0;i<DP.length;i++){
DP[i][i] = 1
}
//console.log(DP);
//set for length 2
fo... | true |
a70d3d4c7db3872623ae2a704a52171442dd4925 | JavaScript | imclab/Skybox | /engine/src/visuals/pane.js | UTF-8 | 877 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* @fileoverview A rectangle visual
* @author Tony Parisi
*/
goog.provide('SB.Pane');
goog.require('SB.Visual');
SB.Pane = function(param) {
SB.Visual.call(this, param);
this.param = param || {};
}
goog.inherits(SB.Pane, SB.Visual)
SB.Pane.prototype.realize = function()
{
SB.Visual.prototype.realiz... | true |
7abc96c871e0da694fca953e038d6c2c9180c1cc | JavaScript | FilWisher/www-simulate | /src/pages/tour.js | UTF-8 | 4,242 | 2.671875 | 3 | [
"MIT"
] | permissive | const clone = require('clone')
const draw = require('js-network-vis')
const config = require('../config.js')
const handlers = require('../handlers.js')
// TODO: add other algorithms
const data = {
'one': require('../../data/tour.json')
, 'simple': require('../../data/tour_simple.json')
, 'accept': require('../../da... | true |
523be20d7b39ac391ccaee3581720fabbeb5f8c9 | JavaScript | liuxinqiong/myblog-template | /src/js/pager.js | UTF-8 | 4,636 | 2.734375 | 3 | [] | no_license | /**
* Created by sky on 2017/6/15.
*/
(function ($) {
var ms = {
init: function (target, args) {
return (function () {
ms.fillHtml(target, args);
ms.bindEvent(target, args);
})();
},
//填充html
fillHtml: function (target, args) ... | true |
dc5e1896d19bbc4b6cfafd5cf7c94421bf58eb80 | JavaScript | MonalisaGit/JavaScriptExample | /JavaScriptBasics/mainrectangle.js | UTF-8 | 202 | 2.53125 | 3 | [] | no_license | var CalculationClass=require("./rectangle").rectangle
var recobj=new CalculationClass(5,7);
recobj.insert(10,5);
recobj.calculateArea(result);
function result(result){
console.log("area is"+result);
}
| true |
c62106be69fefa49bf24a6f80376fcd2440ddfb3 | JavaScript | manikanta-ac/my-projects | /SPANJobPortal/WebContent/java script/registerValidate.js | UTF-8 | 3,184 | 2.671875 | 3 | [] | no_license | function validate()
{
document.getElementById("fname_msg").innerHTML="";
document.getElementById("lname_msg").innerHTML="";
document.getElementById("emailid_msg").innerHTML="";
document.getElementById("password_msg").innerHTML="";
document.getElementById("repassword_msg").innerHTML="";
... | true |
91092877ce425691f5d9a5f8501f741588e30a89 | JavaScript | DanielleRodewald/sever-side-scripting | /02-Console/new.js | UTF-8 | 441 | 4.21875 | 4 | [] | no_license | // Simple console.log using Node.js and terminal/bash.
// * Inside the new.js file use JavaScript create 4 variables
//that log your name, age, favorite quote, and gender.
// * Then run the program using Node in your terminal/bash window.
const name= "Danielle";
const age= 21;
const fav= "The only way to get ahead... | true |
d687fbf97b26518e1c18699a8bf0089b735613bb | JavaScript | palacios25/ExamenIII | /Fifo.js | UTF-8 | 429 | 2.53125 | 3 | [] | no_license |
function prioridadFifo(){
if(this.prioridad === 1){
this.inicio = 0;
this.inicio = new Nodo;
if (this.prioridad === 1){
this.inicio = this.inicio;
this.inicio.siguiente = new Nodo;
if(this.prioridad === null){
this.inicio = new... | true |
411f761cf56cf617f8ee04822ce6506716c08247 | JavaScript | minimo/FlyHigh | /src/BackGround.js | UTF-8 | 1,511 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* BackGround.js
* 2015/02/12
* @auther minimo
* This Program is MIT license.
*
*/
(function() {
tm.define("flyhigh.BackGround", {
superClass: tm.display.CanvasElement,
speed: 0,
bg1: null,
bg2: null,
init: function() {
this.superInit();
//バックグラウンド
this.bg1... | true |
4fa0cc4ed052a94a70182d5fed2c54edb084ed68 | JavaScript | isaacwagithub/todo-app | /src/scripts.js | UTF-8 | 5,918 | 2.9375 | 3 | [] | no_license | var $ = require('jquery');
$(document).ready(function(){
//Making a GET Ajax request
$.ajax({
url:"/tasks",
method:"GET",
contentType:"application/json",
success:function(response){
if(response.length==0){
$('form.output-form').hide();
$('ul.no-tasks-ul').append('<li>'+'You currently dont have a... | true |
42d17308fdb7c5f9a180f159fb0a16bff925093a | JavaScript | iwebwork/noMercado | /app/appcorporativo/js/login.js | UTF-8 | 1,267 | 2.96875 | 3 | [
"MIT"
] | permissive |
function login(){
var userEmail = document.getElementById("email_field").value;
var userPass = document.getElementById("password_field").value;
//window.location = "index.html";
firebase.auth().signInWithEmailAndPassword(userEmail, userPass).catch(function(error) {
// Handle Errors here.
var errorCod... | true |
e1937a9d38c09326b68bdf250e244f228f4dc18a | JavaScript | aalonzolu/Pianana | /index.js | UTF-8 | 909 | 2.84375 | 3 | [
"MIT"
] | permissive | var five = require("johnny-five");
five.Board().on("ready", function() {
var piezo = new five.Piezo(3);
this.pinMode(0, five.Pin.ANALOG);
var LEVEL = 1020;
this.analogRead(0, function(l) {
if(l>=LEVEL)
{
piezo.play({tempo: 150,song: [[ "c4", 1 ],]});
console.log("C");
}
});
this.a... | true |
ff91882109de7b4f11605a2976027dc736038e21 | JavaScript | muhammedashraf9244/javascript | /Codewars solutions/two-to-one.js | UTF-8 | 396 | 3.625 | 4 | [] | no_license | //https://www.codewars.com/kata/5656b6906de340bd1b0000ac
function longest(s1, s2) {
var strArray,outArray;
//Sort array by charcters and number by using sort()
strArray = (s1+s2).split('').sort();
outArray = [];
for(var i=0;i<strArray.length;i++) {
if (outArray.includes(strArray[i])) {
}else{
... | true |
0063218ae9ce5867cdcc2fa3965bfbfaa869486b | JavaScript | BytingBucs/SteveJanusz | /Chapter7/Twitter/tweet_counter.js | UTF-8 | 1,812 | 2.828125 | 3 | [] | no_license | var ntwitter = require("ntwitter"),
redis = require("redis"),
credentials = require("./credentials.json"),
redisClient,
twitter,
counts = {};
// twitter object
twitter = ntwitter(credentials);
//redis client
client = redis.createClient();
client.mget(["awesome", "cool", "rad", "gnarly", "groovy"], function(err,... | true |
604290a1414c5a1c08b7fad1de6d12af8259cfb1 | JavaScript | JesusGarciaNavarro/JavaScript | /Ejemplo02/index02.js | UTF-8 | 1,143 | 3.828125 | 4 | [] | no_license | // Clase Coche
function Coche(modelo,marca,color,estado) {
this.modelo = modelo;
this.marca = marca;
this.color = color;
this.estado = estado;
}
// Los métodos los ponenmos con prototype
Coche.prototype.arrancar = function() {
this.estado = 'arrancado';
console.log(this.estado);
};
// Clase Turismo
function Turi... | true |
fcb227483fbd57cd5ac0f7e5105677a806fe95c6 | JavaScript | Benji-c-Ohanu/Character-Count | /test.js | UTF-8 | 364 | 3.25 | 3 | [] | no_license | function countChars(obj){
var maxLength = 25;
var strLength = obj.value.length;
if(strLength > maxLength){
document.getElementById("charNum").innerHTML = '<span style="color: red;">'+strLength+' out of '+maxLength+' characters</span>';
}else{
document.getElementById("charNum").innerHTML = strLeng... | true |
b5d4c882497a817b0ce1750d0078afc9feffbc8d | JavaScript | vadimshift/movies-explorer-frontend | /src/components/MoviesCardList/MoviesCardList.js | UTF-8 | 2,712 | 2.578125 | 3 | [] | no_license | import './MoviesCardList.css';
import MoviesCard from '../MoviesCard/MoviesCard';
import Preloader from '../Preloader/Preloader';
import { useState } from 'react';
function MoviesCardList(props) {
let moviesCount;
let newMoviesCount;
if (props.displayWidth > 1088) {
moviesCount = 12;
newMoviesCount = 3;... | true |
d94ae34aea27b47f8fd236de753c61cd320cb88f | JavaScript | darrendaz/food-react-redux | /src/redux/actions/restaurantsActions.js | UTF-8 | 1,319 | 2.625 | 3 | [] | no_license | export const fetchRestaurants = () => dispatch => {
return fetch("http://localhost:3001/restaurants")
.then(res => res.json())
.then(restaurants =>
dispatch({ type: "FETCH_RESTAURANTS_SUCCESS", payload: restaurants })
)
}
export const fetchRandomRestaurant = restaurant => {
return {
type: "RA... | true |
f8f2625a9f57a1c9adbf8bce2b51e00f9629a213 | JavaScript | blake-haas/GasCalculator | /js/main.js | UTF-8 | 566 | 2.96875 | 3 | [] | no_license | $(function() {
CalculateGallons();
});
function CalculateGallons(){
var priceOfGas = parseFloat($("#priceOfGas").val());
var cubRewardsAmount = parseFloat($("#cubRewards").val());
var milesPerGallon = parseInt($("#milesPerGallon").val());
var milesDriven = parseInt($("#milesDriven").val());
var newPriceOfGas = ... | true |
790bce00dcd6cb879b59cf43a423d2a46eae791e | JavaScript | Vialoraine/Project-2 | /controllers/helpers.js | UTF-8 | 327 | 2.640625 | 3 | [
"MIT"
] | permissive | exports.validateCreateItemRequest = (body) => {
let errs = ""
if (body.description == null || body.description == "") {
errs += "invalid description "
}
if (body.price == null || isNaN(body.price)) {
errs += "invalid price "
}
if (errs.length > 0) {
throw new Error(errs)
... | true |
db81cd3190a701107438678e1f05c7fd6a4d0370 | JavaScript | astanton/astanton.github.io | /card_pairs/main.js | UTF-8 | 9,768 | 2.703125 | 3 | [] | no_license | Poker = (function($) {
var TOTAL_CARDS = 5;
var TOTAL_PLAYERS = 3;
var PAIR_THRESHOLD = .9;
var SUIT_STRING = '{suit}';
var CARD_STRING = '{card}';
var cardBaseURL = "http://h3h.net/images/cards/{suit}_{card}.svg";
var suits = ['spade', 'heart', 'diamond', 'club'];
var cards = ['2', '3',... | true |
4ea08ae1b01ef5a117c9235fb85897f2dbbd0c70 | JavaScript | lfares/sokoban-game | /js/modules/element.js | UTF-8 | 2,097 | 3.4375 | 3 | [] | no_license | class Element {
constructor(value, position) {
this.value = value;
this.position = position;
this.imgSrc = this.parseValueToImgSrc(this.value);
this.name = this.parseValueToName(this.value);
}
/**
* Gets and Sets
*/
getX() {
return this.position[0];
... | true |
a7fca8041f5c1d8579e93225cc57f5a4538a0891 | JavaScript | dierat/hrr7-Apollo | /server.js | UTF-8 | 3,578 | 2.640625 | 3 | [] | no_license | ///////////
// SET UP
///////////
var express = require('express');
var app = express();
var mongoose = require('mongoose');
var morgan = require('morgan'); // log requests to the console (express4)
var bodyParser = require('body-parser'); // pull information from HTML POST (express4)
var me... | true |
d3ee9025db7f4acc1ec2fa11c4b2f352e534dbaa | JavaScript | dapangchi/stampcircles | /js/colorblender.js | UTF-8 | 5,406 | 2.953125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <script type="text/javascript">
// Thanks to Steve Champeon (hesketh.com) for explaining the math in such a way that I could
// understand it and create this tool
// Thanks to Roberto Diez for the idea to create the "waterfall" display
// Thanks to the Rhino book, I was able to (clumsily) set up the Color object
var c... | true |
9f595d85f6d3d35111eba06ea9388ff18fb0a854 | JavaScript | wonderffle/minesweeper | /src/timer.js | UTF-8 | 1,297 | 3.21875 | 3 | [] | no_license | import React, { Component } from 'react';
class Timer extends Component {
constructor(props) {
super(props);
this.state = {
seconds: 0,
minutes: 0,
hours: 0,
};
}
addSecond() {
if (this.state.seconds === 59) {
this.setState({seconds: 0}, () => this.addMinute());
} els... | true |
9007c2edd0e28f6a7ae8fa90d4efe002e05f0c06 | JavaScript | teamiovska/ContactApp | /src/Components/Contact.js | UTF-8 | 1,920 | 2.671875 | 3 | [] | no_license | import React from 'react';
export class Contact extends React.Component{
constructor(props){
super();
this.state ={
fullName: "",
phone: null,
email: "",
}
}
inputChangeHandler = (event) => {
this.setState({
[event.target.name... | true |
a60f940afa8ca1435394e6341e32a9904bacee09 | JavaScript | mukeshrana90/members | /client/src/components/common/Input.js | UTF-8 | 1,209 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react'
export default class Input extends Component {
// Label
hasLabel() {
if (this.props.label) {
return (<label>{this.props.label}</label>)
}
}
// Placeholder
hasPlaceholder() {
if (this.props.placeholder) {
retu... | true |
ce7ed918b07265a60e170386e6f2fbd9940a559c | JavaScript | Topxue/Workflow | /new-gd-form-render/utils/index.js | UTF-8 | 1,493 | 2.90625 | 3 | [] | no_license | /*
* @Author: caohao
* @Date: 2020-11-10 15:53:47
* @LastEditors: caohao
* @LastEditTime: 2020-11-10 16:10:15
* @Description:
*/
/**
* 金额转大写
* @param {string\number} str
*/
export function number_chinese(str) {
var num = parseFloat(str)
var strOutput = '',
strUnit = '仟佰拾亿仟佰拾万仟佰拾元角分'
num += '00'
var... | true |
9524443b501f2bd935193949106293d43f0d64dc | JavaScript | phfront/moods | /src/store/index.js | UTF-8 | 1,697 | 2.515625 | 3 | [] | no_license | import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
mood: "neutral",
joke: "",
improvingProgress: 0,
improvingMood: "sad"
},
getters: {
getMood: state => state.mood,
getImprovingProgress: state => state.improvingProgress,
getImprovi... | true |
6d0c2a7b6fafa3f6284eaea5d93a6d1c338a3f2c | JavaScript | sa-filipe/velocidade-netflix | /index.js | UTF-8 | 3,767 | 2.5625 | 3 | [] | no_license | var myVar = setInterval(myTimer, 1000);
function myTimer() {
const header_content = document.querySelector("div.PlayerControlsNeo__progress-control-row");
const header_center = document.querySelector("div.PlayerControlsNeo__progress-control-row > center");
if (header_content) {
var vid = document.querySelect... | true |
f14ef8ab25e239667a1a4ad4568bb4a61818359e | JavaScript | RodrigoRVSN/imersaoAlura | /ImersaoAlura/aula_02/script.js | UTF-8 | 269 | 3.390625 | 3 | [] | no_license | var opc = prompt('Qual evolução você deseja?:\n1 para Pichu\n 3 Para Raichu');
if (opc == 1) {
document.write("<h2> Pichu </h2>");
}
else if (opc == 2) {
document.write("<h2> Raichu </h2>");
}
else
document.write("<h2> Continue com o Pikachu :D </h2>");
| true |
a31430a039d77b51d1a640dcfe29b2592cc08921 | JavaScript | dendoesit/React-table-menu | /src/Contact.js | UTF-8 | 5,439 | 2.5625 | 3 | [] | no_license | import React, { Component } from "react";
import '../node_modules/react-bootstrap-table/css/react-bootstrap-table.css'
import '../node_modules/bootstrap/dist/css/bootstrap.min.css'
import '../node_modules/react-bootstrap-table/dist/react-bootstrap-table-all.min.css'
import Modal from './Modal.js'
class Contact exten... | true |
2532bfab7cebabad3bf57dfe1b3e4e39ea9c7976 | JavaScript | ChaitanyaKrishnaPappala/BulkPhoneCalling | /server/controller.js | UTF-8 | 2,980 | 2.78125 | 3 | [] | no_license | const axios = require('axios')
const uuid = require('uuid')
const {STATUSES, SUNDIAL_API_SERVER_URL, WEBHOOK_URL} = require('./constants')
const apiServer = axios.create({baseURL: SUNDIAL_API_SERVER_URL})
let count = 1
let NUMBERS = [{status: STATUSES.IDLE, value: '13018040009', unique_id: uuid.v4()},
{status: STATU... | true |