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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0e076eb42e43a007b62ecd7bf1d401d088e9d3fb | JavaScript | djesmond/fsm | /src/util/fsm.js | UTF-8 | 642 | 2.640625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import node from '../elements/node';
const fsm = function fsm() {
return {
state: {
nodes: [],
links: [],
},
createNode(posX, posY) {
const newNode = node({ x: posX, y: posY});
this.state.nodes.push(newNode);
return newNode;
},
removeNode(node) {
this.state.nod... | true |
ba68f90386ff5807155361e8810f9197b38ba7a6 | JavaScript | dwightNgan/data-structure | /double-linked-list.js | UTF-8 | 1,728 | 4.15625 | 4 | [] | no_license | function Node (element) {
this.element = element
this.next = null
this.prev = null
}
function LinkedList (){
this.head = new Node ('header')
this.find = function find(item) {
let currNode = this.head
while(currNode.element !== item) {
currNode = currNode.next
}
return currNode
}
... | true |
be46285a3ae3933fff7f2d444530e6ce65c2b85b | JavaScript | Ikponwosae/sca_javascript_tasks | /week5/Cat.js | UTF-8 | 1,493 | 4.0625 | 4 | [] | no_license | /*WHAT THE CAT DOES :
instance properties:
-tiredness
-hunger
-loneliness
-happiness
instance methods:
-feed if tiredness is above 50%
-sleep
-pet
*/
//LAST EDITED ON 04-70-2020
let cat = {
name: 'happy-cat',
tiredness: 50,
hunger:50,
loneliness:50,
happiness: false,
feed: function (less, moree) {
l... | true |
b95f3c619c9f2804bc066567e4d28d56553271aa | JavaScript | Larence0401/tabatatimer | /src/App.js | UTF-8 | 4,483 | 2.8125 | 3 | [] | no_license | import './App.css';
import React, {useState, useEffect} from "react"
import Display from "./components/Display"
import Settings from "./components/Settings"
function App() {
const [initTime, setInitTime] = useState(250)
const [timeRemaining, setTimeRemaining] = useState(initTime)
const... | true |
8302ba198f767209c7b3647cc102e59aca79eac7 | JavaScript | ToVietNinh/NodejsK30 | /src/apps/models/user.js | UTF-8 | 616 | 2.609375 | 3 | [] | no_license | // Call the file which connected with MongoDB
const mongoose = require("../../common/database")();
//Use schema to describe the collection user
const userSchema = mongoose.Schema({
full_name : {
type: String,
default: null
},
email : {
type: String,
unique: true
},
p... | true |
3c5634edfa61c83e0b85aa4a3c344f87126a8a74 | JavaScript | ZetRC/ZYA | /script/modules/script.js | UTF-8 | 3,820 | 2.65625 | 3 | [] | no_license | $(document).ready(function(){
const loadProductsStripes=(()=>{
fetch('https://fakestoreapi.com/products')
.then(res=>res.json())
.then(data=>{
const getManProducts=data.filter(e=>e.category==="electronics")
const getWomanProducts=data.filter(e=>e.cate... | true |
f88c8bcfb41b5332687794680e85718346303694 | JavaScript | ramilssmusin/counterapp | /src/AddCounter.js | UTF-8 | 812 | 2.703125 | 3 | [] | no_license | import React, {useState} from "react";
function AddCounter(props) {
const [name, setName] = useState('');
const [count, setCount] = useState(0);
const onSubmit =() => {
props.onSubmit(name, +count);
setName('');
setCount(0);
}
return (
<div className='card'>
... | true |
b7817ad6ecfc40edc870dff58be2540480241c95 | JavaScript | liyuanrigen1978/React-HeiMa | /01.webpack-base/src/07.class-method.js | UTF-8 | 975 | 4.59375 | 5 | [] | no_license | // ES5
function Person (name, age) {
this.name = name
this.age = age
}
Person.height = 187
// 实例方法可以通过 prototype 访问到
Person.prototype.say = function () {
console.log('Person实例方法')
}
// 静态方法在 Person 构造函数 constructor 中,实例无法访问
Person.show = function () {
console.log('Person静态方法')
}
const p1 = new Person('lokit'... | true |
de9fcefb5633d9bf9acac3216b1bcf93579064bd | JavaScript | zapscribbles/11ty-boilerplate | /netlify/functions/pokedex.js | UTF-8 | 419 | 2.5625 | 3 | [] | no_license | const fetch = require('node-fetch')
exports.handler = async function(event, context) {
const eventBody = JSON.parse(event.body)
const POKE_API = 'https://pokeapi.co/api/v2/pokedex/'+eventBody.region
const response = await fetch(POKE_API)
const data = await response.json()
return {
statusCode... | true |
ad565a2b50e8d4c618c257d90084378e24f08ceb | JavaScript | sun-ok/WebBookstore | /src/components/Pages/MainPage.js | UTF-8 | 754 | 2.53125 | 3 | [] | no_license | import React from "react";
import BookCard from "../BookCard"
import Carousel from "../Carousel"
// import WelcomingImage from "../WelcomingImage"
let booksArr = [];
const NUM_OF_CAROUSELS = 5;
const carouselsTitles = [
"Best Sellers of " + new Date().getFullYear(),
"Best Sellers of " + new Date().getFullYear... | true |
9113d25f707657a5cf8e13bef272f0ec65985f52 | JavaScript | topliceanu/learn | /js/webauthn/public/javascripts/index.js | UTF-8 | 3,681 | 2.828125 | 3 | [
"MIT"
] | permissive | // Step zero in the webauthn flow.
// @param {String} email
// @param {String} username
// @return {PublicKeyCredentialCreationOptions} ret - see https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions
// @return {Uint8Array} ret.challenge - byte array be signed by the client.
// @return {Ob... | true |
b7aa9f5a2ff09e5157045a714f6a46aee3d1fb0e | JavaScript | hufei365/yxRequire | /packages/require/require.js | UTF-8 | 836 | 2.734375 | 3 | [
"MIT"
] | permissive | const modules = Object.create(null);
const loading = new Map();
const loaded = new Map();
const require = (id, callback) => {
let mod = modules[id];
console.log(modules);
if (!mod && !loading.has(id)) {
loading.set(id, true);
loadScript(id, callback);
} else {
callback(mod.expor... | true |
0c0d03ae98e3472dfbee50377d83bb8caed61207 | JavaScript | thsalsgh1234/Node_Works | /react-router/src/pages/bbs.jsx | UTF-8 | 1,122 | 2.71875 | 3 | [] | no_license | import React from "react";
import Qs from "query-string";
/*
match props 변수 사용
Router의 path : 변수명 형식을 만들어 두고
path/변수값 형식으로 요청을 하면
변수값이 : 변수명에 저장되어 Router로 보내진다.
Route 컴포넌트에서는 match를 매개변수로 받고
match.params.변수명 형식으로 문자열을 추출할 수 있다.
?변수=변수명 형식으로 요청을 하면
location.search props 변수에 ?부터 문자열형식으... | true |
56766db16548835bb844cb7291774139fcc251a5 | JavaScript | dotneet/yes-we-canvas | /src/client/three_context.js | UTF-8 | 3,932 | 2.921875 | 3 | [
"MIT"
] | permissive | import * as THREE from 'three'
export default class ThreeContext {
constructor () {
this.is3D = false
}
// 2D 描画用のシーンを作成する
// 平行投影カメラを使うのでZ座標の変化による表示サイズのスケールは行われない
init (width = 640, height = 480) {
let scene = new THREE.Scene()
scene.background = new THREE.Color(0xffffff)
let camera = new... | true |
6dad456e712f1ac3189ed1cab6ebd8d265139ab0 | JavaScript | bloussou/reactminesweeper | /minesweeper/src/Components/Game.js | UTF-8 | 9,547 | 3 | 3 | [] | no_license | import React from "react";
import Board from './Board';
import GameSetter from './GameSetter';
class Game extends React.Component {
constructor(props) {
super(props);
const bombNumber = 10;
const numRow = 8;
let gridGameResult = gridSetUp(numRow, bombNumber);
this.state = {
... | true |
b6f3f9e22be0c9732bc0af18ae8a7d5f80a77211 | JavaScript | lauramar6261/trek | /index.js | UTF-8 | 4,429 | 3.015625 | 3 | [] | no_license | const URL = 'https://trektravel.herokuapp.com/trips';
//
// Status Management
//
const reportStatus = (message) => {
$('#status-message').html(message);
};
const reportError = (message, errors) => {
let content = `<p>${message}</p><ul>`;
for (const field in errors) {
for (const problem of errors[field]) {
... | true |
108fd4fdc00b8a03f87525041c0827dff61f7f26 | JavaScript | dorktobes/recursion | /src/stringifyJSON.js | UTF-8 | 1,254 | 4.28125 | 4 | [] | no_license | // this is what you would do if you liked things to be easy:
// var stringifyJSON = JSON.stringify;
// but you don't so you're going to write it from scratch:
var stringifyJSON = function(obj) {
var returnStr = '';
//null case with break
if(obj === null){
return 'null';
}
//string case
if(typeof ob... | true |
af62df92deea3310d8a02b127231bc497f8b53e7 | JavaScript | JHerman2004/nodeCraftsman | /syncAsync/sync.js | UTF-8 | 447 | 2.71875 | 3 | [] | no_license | var http = require('http');
http.createServer(function(request,response){
console.log('Handling http');
response.writeHead(200,{'Content-Type': 'text/html'});
response.write('<b> Hello World </b>');
response.end();
var a;
for(var i=0;i<10000000000;i++){
a=i;
}
console.log('For loop finished');
... | true |
4505bb2daf64397ed9adfcf1a4d216d02fbfb7f9 | JavaScript | alexeveritt/modsyncr | /lib/full-sync.js | UTF-8 | 1,223 | 2.515625 | 3 | [
"MIT"
] | permissive | var packageFile = require('./package-file');
var process = require('process');
var spawn = require('child_process').spawn;
var path = require('path');
module.exports = function(detail, next) {
// filename of package file in the node_modules folder for the shared package
var pkgFilename = path.join(detail.nodeM... | true |
75f998080c04cf79f2c1f660d4786e69b0d190f8 | JavaScript | Gitarackur/MUSIC-PLAYER-APP-WITH-VANILLA-JS | /js/script.js | UTF-8 | 6,205 | 3.140625 | 3 | [] | no_license |
// Animating the banner with moving circles
var Canvas= document.querySelector(".banner");
console.log(Canvas);
var c = Canvas.getContext("2d");
function Flash(x, y, dx, dy, radius){
this.x= x;
this.y= y;
this.dx= dx;
this.dy= dy;
this.radius= radius;
this.draw= function(){
... | true |
d687296dc1cd2a255db6f47336bc7dd8e7e717fa | JavaScript | mattraykowski/songbuzz | /assets/js/controllers/player_controller.js | UTF-8 | 6,636 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
songbuzzApp.controller('PlayerController', ['$scope', '$interval', 'PlayerService',
/** @constructor
*
* This is the PlayerController.
*
* @param $scope
* @param $interval {object} Angular setInterval wrapper service.
* @param PlayerService
*/
function ($scope,... | true |
94e30118fbe73cfa259c9eafa5b721e6c99ab5ef | JavaScript | roseemmons/js101 | /lesson_3/easy_2.js | UTF-8 | 3,144 | 4.5 | 4 | [] | no_license | /*
** Question 1
** Given a string, return a new string that replaces every occurrence of the word
** "important" with "urgent":
*/
let advice = "Few things in life are as important as house training your pet dinosaur.";
advice.replaceAll("important", "urgent");
/*
** Question 2
** The Array.prototype.reverse method r... | true |
0800932e6671bbb32bfc5f4fc2f1fb66fb540529 | JavaScript | ctola91/social-network-BE | /routes/login.js | UTF-8 | 2,359 | 2.625 | 3 | [] | no_license | const express = require("express");
const { getUserByEmail } = require("../services/UserService");
const { getToken, isValidPassword } = require("../services/AuthService");
/**
* @swagger
* components:
* schemas:
* LoginForm:
* type: object
* properties:
* ... | true |
adf41b5d34f2f5c5203ddeb2f24b08fd5594ee1b | JavaScript | BrandonLRobinson1/DataStucturesReRun | /sprint-one/src/functional/queue.js | UTF-8 | 1,054 | 3.5625 | 4 | [] | no_license | var Queue = function() {
var someInstance = {};
// Use an object with numeric keys to store values
//how many items are currently in the que
var currentTotal = 0;
//how many things have been in the queue
var total = 0;
//whats in the front of the queue
var head = 0;
someInstance.enqueue = function(... | true |
528596818d969927fc434a0402f95fe7ab53faca | JavaScript | iic3585-2019/web-components-g4 | /components/star-rating.js | UTF-8 | 3,224 | 3.203125 | 3 | [] | no_license | (function() {
const template_star = document.createElement('template');
template_star.innerHTML = `
<style>
span {
cursor: pointer;
font-size: 30px;
color: #ffcc00;
font-family: monospace;
}
</style>
<span>☆</span>
`;
class StarIcon extends HTMLElement ... | true |
241b2377156145c7cee164311ca6a529629c222a | JavaScript | BlueStoneQ/BBQ | /node/throttle.js | UTF-8 | 1,287 | 3.5625 | 4 | [] | no_license | /**
* 节流函数 - 定时器版
* @param {*} fn
* @param {*} delay
*/
const throttle = (fn, delay = 300) => {
let timer = null;
return (...args) => {
const context = this;
if (timer) {
return;
}
timer = setTimeout(() => {
fn && fn.apply(context, args);
timer = null;
}, delay);
}
}
... | true |
b65f0e9bb4f33eb90b2ab543f4fc87feb0071829 | JavaScript | elonybear/social-attitudes | /src/components/App/Skits/MessageWindow.js | UTF-8 | 3,894 | 2.59375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import './css/window.css';
class Message {
constructor(type, author, text, delay) {
this.type = type;
this.author = author;
this.text = text;
this.delay = delay;
}
}
export default class MessageWindow extends React.Component {
constructor(props) {
super(props);
... | true |
8b1e77672768d800970289bf1c843cbd39142566 | JavaScript | dasp24/connect-four-game | /src/redux/helperFuncs.js | UTF-8 | 2,722 | 3.125 | 3 | [] | no_license | function addDisk(state, col) {
if (state.won !== false) return state
let row = 5;
while (state.board[row][col] !== null) {
row--;
if (row < 0) {
state.changePlayer = false;
return state;
}
}
state.board[row][col] = state.player;
state.changePlayer... | true |
cb15861a6ddaa7f3d260df6be3e5fce58816ebc2 | JavaScript | Hrishikesh-coder/JavaScript | /signup.js | UTF-8 | 305 | 3.1875 | 3 | [] | no_license | const uid = "abc123";
var name = "Hrishikesh Bhanja";
var email = "rubbish@123.com"
var pass = "123";
var confirm = "123";
// name = prompt("Enter your number");
console.log("Full Name is : " + name); //, also works in place of +
console.log(`
Name is : ${name}
email is : ${email}
password is : ${pass}... | true |
1e09d1b28d9327bba403446aaaca5b9791e0ce27 | JavaScript | manderly/sea-c11-javascript | /students/yuliyaz/oldestLivingFather.js | UTF-8 | 672 | 3.578125 | 4 | [] | no_license |
function oldestLivingFather(){
var oldestFather;
var highestAge = 0;
var fatherArray = function () {
var fathers = [];
for (var i = 0; i < people.length; i++) {
if (people[i].father){
var fatherName = people[i].father;
if (fathers.indexOf(fatherName) === -1) {
fathers.push(fatherName);
... | true |
c2970f283391c245397377462efa22c8c448142b | JavaScript | KorwynnWagstaff/TrainSchedule | /assets/js/main.js | UTF-8 | 2,587 | 2.515625 | 3 | [] | no_license | var name = '';
var destination = '';
var firstTrainTime = '';
var frequency = '';
var nextTrain = '';
var nextTrainFormatted = '';
var minutesAway = '';
var firstTimeConverted = '';
var currentTime = '';
var diffTime = '';
var tRemainder = '';
var minutesTillTrain = '';
var keyHolder = '';
var getKey = '';
var config =... | true |
0a1ea9251ad83e6caaa3fb10bf7998b36b6d8836 | JavaScript | luoanqi1993/JavaScript | /day06/js/base.js | GB18030 | 1,007 | 3.453125 | 3 | [] | no_license | /**
* Created by Administrator on 2017/8/7.
*/
function insertAfter(newElement,targetElement){
var parentNote = targetElement.parentNode;
if(targetElement==parentNote.lastElementChild){
parentNote.appendChild(newElement);
}else{
parentNote.insertBefore(newElement,targetElement.nextElementS... | true |
1b6329d3cca01f142e3c5e165d1e7604b484b8da | JavaScript | keyvanzz/w1 | /lotide/test/headTest.js | UTF-8 | 738 | 2.921875 | 3 | [] | no_license | const assert = require(`chai`).assert;
const head = require(`../head`);
describe("#head", () => {
it("should returns 1 for [1, 2, 3]", () => {
assert.strictEqual(head([1, 2, 3]), 1);
});
it("should returns '5' for ['5']", () => {
assert.strictEqual(head([5]), 5);
});
it("should returns '5' for ['5,... | true |
478835595458d6fb1a52d22ff2a1078136b24630 | JavaScript | tngan/jgine | /lib/jgine/js/classes/Scene.js | UTF-8 | 3,810 | 2.671875 | 3 | [] | no_license | /*
* jGine Scene class
*/
define([
"js/util",
"./Promise",
"./Funnel",
"require"
], function (
util,
Promise,
Funnel,
require
) { "use strict";
var WINDING_ORDER_CCW = 1,
WINDING_ORDER_CW = 2,
defaults = {
renderers: {
"Canvas/WebGL": {... | true |
91dac6ca15d2f81a85ded60b7002eed7013c9da0 | JavaScript | newcodesmith/music-and-cocktails-back | /routes/albums-routes.js | UTF-8 | 1,874 | 2.625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const queries = require('../db/albums-queries');
function isValidId(req, res, next) {
if (!isNaN(req.params.id))
return next();
next(new Error('Invalid ID'));
}
function validAlbum(album) {
const hasGenre = typeof album.genre == '... | true |
d6529c477ae1ab8623fa44738c2ae9784b1f234f | JavaScript | UrturnScience/Frontend | /mobileApp/components/emailAuth.js | UTF-8 | 3,626 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import {TextInput, StyleSheet, Text, View, Image, Alert } from 'react-native';
import firebase from 'firebase'
import {Container, Content, Header, Form,Input,Item,Button, Label} from 'native-base'
function emailIsValid (email) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(ema... | true |
3c1ce90685cd4ec49cca6b25f738e293f0b5ab59 | JavaScript | AnnaPG/PCIG | /PCIG/app/static/build/js/graphs.js | UTF-8 | 6,706 | 2.953125 | 3 | [] | no_license | // Updates a box plot with the given data
function Update_BoxPlot(div_id, data_arrays, labels, y_label, colors, boxpoints = 'outliers') {
// If all items in the first array are NULL, we have no data to display
if (data_arrays.every(x => x.every(y => y == null))) {
$('#' + div_id).html('<div class="alert... | true |
aa274eecd8bec0731aec0c4e38e84fc1393e42b0 | JavaScript | vlki/s-demagogem | /src/utils.js | UTF-8 | 873 | 3.078125 | 3 | [] | no_license | import padStart from 'lodash/padStart'
export const formatTime = seconds => {
const wholes = Math.floor(seconds)
const h = Math.floor(wholes / 3600)
const m = Math.floor((wholes % 3600) / 60)
const s = wholes % 60
let time = m + ':' + padStart(s + '', 2, '0')
if (h > 0) {
time = h + ':' + padStart(ti... | true |
1533cfa91ee8c35a20c0e0769a4eb4842442d53f | JavaScript | LCfP/Serious-Game-for-Kids | /src/models/classes/core/ordercore.js | UTF-8 | 698 | 3.015625 | 3 | [] | no_license | export default class OrderCore
{
/**
*
* @param {Product[]} products - List of products in this Order
* @param {int} time - Duration for Order to arrive
*/
constructor(products, time)
{
this.products = products;
this.initDuration = time;
this.time = time;
}
... | true |
acbe5a624c280a401727280a26b8e1d8ffb4e905 | JavaScript | NadejdaLukyanchenko/learnJS | /lesson1/index.js | UTF-8 | 2,490 | 3.484375 | 3 | [
"MIT"
] | permissive | class Game {
constructor([robot1,robot2]) {
const fabric = new Robo_Fabrica();
this.robot1 = fabric.create(robot1.type,robot1.name);
this.robot2 = fabric.create(robot2.type,robot2.name);
this.round = 0;
}
startGame() {
let notEnd = false;
do {
... | true |
8d7abc22ae45292c9d586cea33574b0a1b10ac84 | JavaScript | gdiccini/trybe-exercises | /b27/d1/mongo-version/index.js | UTF-8 | 1,199 | 2.703125 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const User = require('./model/User');
const app = express();
const PORT = 3000;
app.use(bodyParser.json());
app.get('/users', async(req, res) => {
const users = await User.getAllUsers();
return res.status(200).json(users);
})
app.ge... | true |
c02125f43a37af1e69a84fb3cdc06488cc0e4773 | JavaScript | ridhoimuhammad/phase0-week2 | /human.js | UTF-8 | 559 | 4.53125 | 5 | [] | no_license | // contoh constructor function
function Human(humanName, humanAge) {
this.name = humanName;
this.age = humanAge;
this.talk = function(otherHumanName) {
console.log('Hi, ' + otherHumanName + '!');
console.log('My name is ' +this.name);
console.log('I am ' + this.age + ' years old');
}
}
// me... | true |
f9da332b87f3c73078338a7be41b5dfea41fed76 | JavaScript | cweiler52/javascript-library | /1-JavaScript-Fundamentals/1-Grammar-and-Types/04-hoisting.js | UTF-8 | 213 | 3.328125 | 3 | [] | no_license | const one = 1
let two = 2
var three = 3
{
var four = 4
let five = 5
console.log(four)
console.log(five)
}
console.log(one)
console.log(two)
console.log(three)
console.log(four)
console.log(five) | true |
5d89fe3aa04ff11d0ef5edd6028b731af69453a6 | JavaScript | huytocdo/todo-list | /src/store/reducers/todos.reducers.js | UTF-8 | 2,939 | 2.6875 | 3 | [] | no_license | import * as actionTypes from './../actions/actionTypes';
import update from 'immutability-helper';
const initialState = {
todos: [],
filter: 'ALL',
loading: false,
error: false,
}
const addTodo = (state, action) => {
return update(state, {todos: {$push: [action.payload]}});
}
const removeTodo = (state, act... | true |
8d9faf3bf8bb12595cf45a68b2e1406b5389b723 | JavaScript | kongnyc/codewars_two | /number-from-str/main.js | UTF-8 | 586 | 4.09375 | 4 | [] | no_license | // Your task in this kata is to implement a function that calculates the sum of the integers inside a string. For example, in the string "The30quick20brown10f0x1203jumps914ov3r1349the102l4zy dog", the sum of the integers is 3635.
// Note: only positive integers will be tested.
function sumOfIntegersInString(s){
r... | true |
b5e7110675113bb37434458456b4122d59d13557 | JavaScript | Raduyno/EagleFall | /commands/setgame.js | UTF-8 | 646 | 2.546875 | 3 | [] | no_license | const main = ('./bot.js')
exports.run = function(client, message, args) {
let game = args.join(' ');
let ownerid = 216587031944364032
if (message.author.id !=ownerid) return message.reply('You are not a bot owner faggot...');
if (game.length < 1) return message.reply('You must specify a game to set!').catch(con... | true |
7296873deaa2177fab636ed055738f2f05964f0d | JavaScript | truancylounge/react-demo | /src/playground/redux-expensify.js | UTF-8 | 2,359 | 3.078125 | 3 | [] | no_license | const {createStore, combineReducers} = Redux;
// Actions
/*
ADD_EXPENSE
REMOVE_EXPENSE
EDIT_EXPENSE
SET_TEXT_FILTER
SORT_BY_DATE
SORT_BY_AMOUNT
SET_START_DATE
SET_END_DATE
*/
// Action generator for ADD_EXPENSE
const addExpense = ({description = '', note = '', amount = 0, createdAt = 0} = {}) => ({
type: 'ADD_EXP... | true |
de16fd7121256d5ff825af0eac4369a4860c5ded | JavaScript | LalitKumar234/Todo_list | /script.js | UTF-8 | 1,659 | 3.015625 | 3 | [] | no_license | console.log("todo list");
showTask();
let addTxt = document.getElementById("addTxt");
let addBtn = document.getElementById("addBtn");
let clrBtn = document.getElementById("clrBtn");
addBtn.addEventListener("click", function () {
addTxtval = addTxt.value;
if (addTxtval.trim() != 0) {
... | true |
095da9f27df002666ee6c0a39acae06cd4630672 | JavaScript | NET666/studentContent | /js/index.js | UTF-8 | 1,553 | 2.765625 | 3 | [] | no_license | new Vue({
el: "#app",
data: function() {
return {
userInfo: { // 添加用户信息
name: '',
gender: '',
wxNum: '',
birthday: ''
},
editObj: {
name: '',
gender: '',
wxNum: '',
birthday: ''
},
tableData: [{
name: '王小虎',
gender:'男',
wxNum:'404notFound',
birthday:'1... | true |
fcb6e1c9634cfdba145c327d59d34d19bdc3b672 | JavaScript | ahorrocks2/movieTicketJS | /js/scripts.js | UTF-8 | 1,960 | 3.6875 | 4 | [] | no_license | function Ticket(movie, time, age) {
this.movie = movie;
this.time = time;
this.age = age;
};
Ticket.prototype.cost = function() {
var total = 0
if (this.time < 5) {
total += 5;
}
else {
total += 10;
};
if (this.age === "Senior") {
total -= 2;
}
else if (this.age === "Child") {
t... | true |
e2b3922d3b14a7e20a91c854fb29c19577f69d47 | JavaScript | thisisbillall/MERN_demo | /client/src/components/SignUp.js | UTF-8 | 4,171 | 2.59375 | 3 | [] | no_license | import React, { useState ,useHistory} from "react";
const SingUp = () => {
// const history = useHistory();
const[user,setUser] = useState({
name: "",
email:"",
phone:"",
work:"",
password:"",
cpassword:"",
});
let name,value;
... | true |
be3d7a4bc8b88acb0dd6cb9df15a56bdd6c02b23 | JavaScript | tangbao920/vue-pra | /todo.js | UTF-8 | 3,378 | 2.859375 | 3 | [] | no_license | let vm=new Vue({
el:'#app',
data:{
todos:[
{
isSelected:false,
title:"睡觉"
},
{
isSelected:false,
title:"吃饭"
},
{
isSelected:false,
title:"打豆豆"
... | true |
a5050dbb666775b908104915df7c924f85bbf16f | JavaScript | msharaf1/JavaScript_Fundamentals | /randPtFiles/functionsPt.js | UTF-8 | 2,074 | 3.96875 | 4 | [] | no_license | //calculate tax amount.
function singleFiler(income){
// let taxRate = 0;
let totalTaxAmount = 1;//set it to 1 because of multiplication
if(income <0){
return false;
}//income must be greater than 1.
if (income > 0 && income <= 9525){
totalTaxAmount = (income * 10) /100;//10%
} e... | true |
6706f29146606ae74009a316f0d802e6d27220e3 | JavaScript | elizabethwidiasri/hacktivoverflow | /server/controllers/answer.js | UTF-8 | 1,250 | 2.59375 | 3 | [] | no_license | const Answer = require('../models/answer')
const Question = require('..//models/question')
class AnswerController {
static create (req, res, next) {
let theAnswer = {}
const userId = req.loggedUser._id
const { description, questionId } = req.body
Answer.create({ userId, questionId, description})
... | true |
d5542df51211b07f012f66be143ce818a752f5da | JavaScript | ashijain586/Mymusic | /player.js | UTF-8 | 3,086 | 2.9375 | 3 | [] | no_license | let audio = document.querySelectorAll('audio');
let songsList = document.querySelector('.rtdwn');
let playbutton = document.querySelector('#playbtn');
let pausebutton = document.querySelector('#pausebtn');
let progressBar = document.querySelector('#progress-bar');
audio = Array.from(audio);
let template = '';
audio.... | true |
21d5ec2ca883f63e745d6c1d58c8e0108368189b | JavaScript | nenanen/2IMV10-project6 | /src/road/SegmentFactory.js | UTF-8 | 1,561 | 2.75 | 3 | [] | no_license | import RoadSegment from "./RoadSegment";
import Segment from "./Segment"
import Point from "./Point";
import * as math from "mathjs";
import * as _ from "lodash";
import Angle from "./Angle";
export default class SegmentFactory {
static createRoad(segment, time, type, config) {
let metadata = _.defaults(... | true |
1ff6166d4d0ce4ad1a1bf0861792f484f57e19df | JavaScript | iliyamiroshnichenko/goit-js-module-06 | /js/06-2/1-reduce.js | UTF-8 | 3,208 | 3.875 | 4 | [] | no_license | /*
* Array.prototype.reduce()
* Поэлементно перебирает оригинальный массив
* Возвращает что угодно!
* Заменяет все на свете, но использовать нужно с умом!
*/
const numbers = [5, 10, 15, 20, 25];
const total = numbers.reduce(function (accum, number) {
return accum + number;
}, 0);
console.log(total);
// Считаем ... | true |
5e99e6a9677b33d9f4f3bf53f35a532f83951488 | JavaScript | ikanberjalandidarat/Tokenization-JWT | /en_in_coding.js | UTF-8 | 2,154 | 2.8125 | 3 | [] | no_license | import * as assert from 'assert';
const header = {
alg: 'none'
};
const payload = {
sub: "user123", // contoh username
session: "ch72gsb320000udocl363eofy", // ini contoh aja
name: "Pretty Zhafira",
lastpage: "/views/settings" // ini bisa juga dari /views/index.html, aslinya serah sih.
};
// URL... | true |
3a563bf3f8a17ce84deb78c30efc164a5b94008c | JavaScript | thisistaimur/Course | /02-Programming-Basics/2020-09-09-Strings-Revisited_Intro-Math/exercises/b - repetition/comparisons.js | UTF-8 | 1,733 | 4.03125 | 4 | [] | no_license | // source: https://www.w3schools.com/js/exercise_js.asp?filename=exercise_js_comparisons1
//console.log("Choose the correct comparison operator to alert true, when x is greater than y.");
x = 10;
y = 5;
<<<<<<< HEAD
console.log(x>y); // <- CHANGE THERE
=======
console.log("x > y: " + (x > y) ); // <- CHANGE THERE
>>>>>... | true |
cc4be52d41450df2970a12097cb9c4957d4ff342 | JavaScript | Jacob-Friesen/functional-js-talk | /firstClassFunctions.js | UTF-8 | 1,010 | 4.4375 | 4 | [
"MIT"
] | permissive | console.log('Original fib function:');
var fib = function(n) {
if (n < 2) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
console.log(fib(2));
console.log(fib(40));
// The original memoize function:
// var memoize = function(callback) {
// var results = {};
// return function(n) {
/... | true |
9e0474716af185e4add4f72ffeddeb4e9ce3e6a8 | JavaScript | michelaqyteza/Profile-Generator | /src/template.js | UTF-8 | 3,762 | 3.125 | 3 | [] | no_license | function generateHtml(managers, engineers, interns) {
totalEngineers = engineers.length;
totalInterns = interns.length;
totalCards = totalEngineers + totalInterns + 1;
//let manager = generateHtml(manager[0].manager, manager[0].managerId, manager[0].manageEmail, totalCards);
return `<!DOCTYPE html>... | true |
78eec251e54909400acc49bc585b75b24d5148bf | JavaScript | yehgen/CSE154 | /Creative Projects/cp3-ajax-yehgen/index.js | UTF-8 | 4,572 | 3.359375 | 3 | [] | no_license | /**
* Name: Generous Yeh
* Date: October 30, 2019
* Section: CSE 154 AH
* TA: Valerie Remaker
*
* This is the index.js for my taco website which adds functionality to my generate buttons and
* also displays certain elements after specific interactions.
*/
"use strict";
(function() {
const BASE_URL = "https:... | true |
f5f8db1a93041695b9185642d9c0b80bbda40bff | JavaScript | Ledvis/modern-javascript | /booklist-ES6/app.js | UTF-8 | 1,003 | 2.96875 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', Store.displayBooks);
// Event listeners
document.querySelector('#book-form').addEventListener('submit', function(evt) {
evt.preventDefault();
const title = document.querySelector('#title').value;
const author = document.querySelector('#author').value;
const isbn =... | true |
6e13503df2885a7c4de917afb6b4470cbb8ba5a1 | JavaScript | Pasoul/jview-weapp | /dist/common/mixins/observer/behavior.js | UTF-8 | 2,944 | 3.203125 | 3 | [] | no_license | /**
* 小程序setData(data, function() {})
* 转换成链式调用
* setAsync(this, data).then()
*/
function setAsync(context, data) {
return new Promise(resolve => {
context.setData(data, resolve);
});
}
;
export const behavior = Behavior({
created() {
if (!this.$options) {
return;
}
... | true |
d29df92f0bf5b7d51648fcc056cbd3e04fd91daf | JavaScript | sow4063/toyprob | /Documents/dev/javascript/toyprob/test/duplicateArguments_test.js | UTF-8 | 329 | 2.625 | 3 | [] | no_license | var assert = require('chai').assert;
var solution = require('../js/duplicateArguments.js');
describe("Duplicate Arguments", function(){
it("Basic Tests", function(){
assert.equal( solution(1, 2, 3), false );
assert.equal( solution(1, 2, 3, 2), true );
assert.equal( solution('1', '2', '3', '2'), true );
... | true |
66dcc58db01603713fbb173010d53b5e34d5b66e | JavaScript | OEvgeny/webgl-photowall | /src/scene.js | UTF-8 | 2,463 | 2.65625 | 3 | [] | no_license | var Three = require('three')
var tex = require('./resources').textures
var _ = require('./util')
var view = require('./view')
var xLen = 12
var yLen = 7
var scene = new Three.Scene()
var raycaster = new Three.Raycaster()
/**
* Create grid of the photos xCount x yCount.
*
* @param {Number} xCount
* @param {Number... | true |
2a5096f3d691258eca077e031e207661e1286ff1 | JavaScript | timburns1/unit-4-game | /assets/javascript/game.js | UTF-8 | 2,447 | 3.546875 | 4 | [] | no_license | $(document).ready(function(){
// create a random number to start the game. The numbers will be between 19 and 120
let random=Math.floor(Math.random()*101+19)
// apply the random number to the compNumber id.
$('#compNumber').text(random);
// using math.flood and math.random for each crystal
let num1= Math.floo... | true |
182360ef279b07bab2f769f327b80a8e05cfbb64 | JavaScript | sloan-holzman/bpi | /techinterview/src/Randomize.js | UTF-8 | 861 | 3.234375 | 3 | [] | no_license | import React, { Component } from 'react';
class Randomize extends Component {
constructor(props) {
super(props);
this.state = {
numbers: [22, 14, 3, 4, 37, 6, 7, 81, 9, 10]
};
this.randomize = this.randomize.bind(this);
}
randomize(e) {
e.preventDefault();
let arr = this.state.numb... | true |
2f2ca49f0be6f99ec9d952b586b91735e6ad0ca2 | JavaScript | Nickolas-git/RESPONSIVE-WEB-DEVELOPMENT | /Cap3/Aula8/script.js | UTF-8 | 281 | 2.828125 | 3 | [] | no_license | window.onload = function(){
var oRetangulo = document.getElementById("retangulo")
oRetangulo.onmouseover = function(){
oRetangulo.style.backgroundColor = "#008000"
}
oRetangulo.onmouseout = function(){
oRetangulo.style.backgroundColor = ""
}
} | true |
47be7d0184742d3a6dfc8eb1392eabc49561253f | JavaScript | kadyvre/Tech-Project-for-Scott | /app/assets/javascripts/nightmode.js | UTF-8 | 184 | 2.59375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
var button = $('.night-mode-button');
var container = $('.content');
button.click(function() {
container.toggleClass('-nightmode');
});
}); | true |
392aac83d9a0754973e7871cc3e835e08554c370 | JavaScript | rolandpoulter/js-class-di | /src/Class/prototype/initialize.js | UTF-8 | 295 | 2.859375 | 3 | [] | no_license | /*!
### Class.prototype.initialize(definition, traits...);
1. definition - String, Function, Object.
2. traits... - String, Function, Object.
Returns a Function.
*/
Class.initialize =
Class.prototype.initialize = function () {
return Class.construct.apply(this.constructor, arguments);
};
| true |
1c286c5ce866d5778fa5fb654c32420ff7ee0b5d | JavaScript | NataliaZinovskaya/it-academy-js | /homework17/script.js | UTF-8 | 3,303 | 2.953125 | 3 | [] | no_license | const WIDTH = 520;
const HEIGHT = 340;
const LINE_WIDTH = 1;
const RACKET_WIDTH = 20;
const BALL_SIZE = 20;
const RACKET_HEIGHT = 100;
const YELLOW = '#ffff00';
const RED = '#ff0000';
const BLACK = '#000';
const STEP = 5;
const DEGREE = 1.05;
const tennisCont = document.querySelector('.tennis-container');
... | true |
cf13ea6affcc094bc0a3986363f7a8e933e7f619 | JavaScript | ertprs/Estudo | /Glass/Vue/_Compartilhado/Servicos/Imagens.js | UTF-8 | 677 | 2.671875 | 3 | [] | no_license | var Servicos = Servicos || {};
Servicos.Imagens = (function (http) {
const API = '/api/v1/imagens/';
return {
/**
* Recupera os dados para exibição de imagem no controle de exibição.
* @param {?number} idItem O identificador do item que contém a imagem.
* @param {?string} tipoItem O tipo do it... | true |
e052d941119c47a2a3cb51c4ef210f41277c97b0 | JavaScript | riyadattani/airport_JS | /spec/AirportSpec.js | UTF-8 | 2,808 | 2.953125 | 3 | [
"MIT"
] | permissive | 'use strict';
describe("Airport", function() {
var airport;
var plane;
beforeEach(function() {
airport = new Airport();
plane = jasmine.createSpyObj('plane', ['land', 'takeoff']);
});
it('has no planes by default', function() {
expect(airport.hangarList()).toEqual([]);
})
describe("plane l... | true |
7a4fdd1f932236a35931ef304e51df06dc869284 | JavaScript | liuwenru/Front-end | /有好货页面/id_1908022/demo/lianxi.js | UTF-8 | 3,339 | 2.953125 | 3 | [] | no_license | const PROPERTY_SYMBOL = Symbol('property');
const ATTRIBUTE_SYMBOL = Symbol('attribute');
const EVENT_SYMBOL = Symbol('event');
const STATE_SYMBOL = Symbol('state');
export default class Carousel{
constructor(config){
this[PROPERTY_SYMBOL] = Object.create(null);
this[ATTRIBUTE_SYMBOL] = Object.create(null);
th... | true |
ea5efa1c31fa4fde253cf8243714f845da3d84d3 | JavaScript | Kerv917/smart-magic-cards-master | /js/index.js | UTF-8 | 2,557 | 3.609375 | 4 | [] | no_license | let cards = [];
const lookSuit = [[], [], [], []];
const suits = ["hearts", "spades", "diamonds", "clubs"];
const cardsWrapper = document.querySelector(".cards-wrapper");
const buttonsWrapper = document.querySelector(".btn-wrapper");
const buttons = ["Shuffle", "Show/Hide", "Magic"];
function createCards() {
for (le... | true |
5a4ad14d4ce9cacf5a44e00e9a2d751fb97e9fc6 | JavaScript | Omen4/starouarz | /starwars.js | UTF-8 | 3,183 | 2.890625 | 3 | [] | no_license | let iCarrousel = 0;
let carrousel = ['./img/Coruscant.png', './img/Naboo.jpg', './img/Tatooine.jpg' ];
let charactersList = [];
let url = 'https://swapi.dev/api/people/';
let characterData = '';
let isPrevioused = false ;
let isTimedIgnored = false;
function renderCarrousel(){
let imgAffichee = $('#carrousel im... | true |
9c039a79ad50b0fc9697331b74b03854edc8af64 | JavaScript | jennifer-yoo/ajax-discussion-question-nyc01-seng-ft-071320 | /src/index.js | UTF-8 | 1,624 | 3.546875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | const fullname = document.getElementById("fullname");
const button = document.getElementsByClassName("btn btn-primary")[0]
document.addEventListener("DOMContentLoaded", () => {
console.log("CONTENT LOADED!");
});
function getData() {
fetch("https://randomuser.me/api/")
.then (res => res.json())
.then (json =>... | true |
0a953e75f8f04c63930f36eb79b3eb33ef5abc5a | JavaScript | sauravverma02262/Readable | /readable/src/Store/CategoriesReducer/Categories.js | UTF-8 | 421 | 2.625 | 3 | [
"MIT"
] | permissive | import { FETCH_CATEGORY } from '../../Constants'
const initialState = {
Categories: [],
currentCategory: ''
}
function CategoriesReducer(state = initialState, action) {
switch (action.type) {
case FETCH_CATEGORY: {
return {
...state,
Categories: action.payload.categories && action.paylo... | true |
b3541a82a4b64795952676f02c18781945c77055 | JavaScript | avis-a/191201-kekstagram-21 | /js/preview.js | UTF-8 | 3,384 | 3 | 3 | [] | no_license | 'use strict';
(function () {
// Применение эффекта для изображения
let effects = document.querySelectorAll(`.effects__radio`);
let imgPreview = document.querySelector(`.img-upload__preview`);
let effectLevelValue = document.querySelector(`.effect-level__value`);
let sliderPin = document.querySelector(`.effe... | true |
af0734cea19cdf6484dec34192245160fba31100 | JavaScript | mfathin111999/jaya | /public/js/custom.js | UTF-8 | 397 | 2.59375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function ucwords(str) {
str = str.toLowerCase();
str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
});
return str;
};
$('.datePicker').daterangepicker({
singleDatePicker: true,
startDate: moment().startOf('hour'),
endDate: moment().startOf(... | true |
aa6af3ff2236aff921756bd92a39aacc3dd3bd0e | JavaScript | GALubenov/SoftUni-Software-Engineering | /JS basics-april.2020-Lab-and-Exercise/Exam-2-3.05.2019/safari.js | UTF-8 | 1,027 | 3.65625 | 4 | [] | no_license | function safari(args) {
let budget = Number(args[0]);
let fuel = Number(args[1]);
let day = args[2];
let fuelPrice = 2.10 * fuel;
let sum = fuelPrice + 100;
let finalSum = 0;
if (budget > sum) {
if (day === "Saturday") {
finalSum = sum - (sum * 0.10);
consol... | true |
5f65e429bfaf78b384cebeb181a88ffef99e1fe1 | JavaScript | FbW-E01/pb-operators-logical-ronniejuan | /logic.js | UTF-8 | 2,315 | 4.5 | 4 | [] | no_license | // # Programming Basics: Logical Operators
// These exercises are aimed at making you familiar with logical operators. **Print all your checks to the console. Make sure that you are using the *correct* logical operator.**
// 0. Declare two variables: `isDogBetter` with the value of `true`, and `isCatBetter` with the ... | true |
57628f8aa7785583edb2c03ebdd85a286cde8ec4 | JavaScript | duytrantlu/FA-assignment-duytm2 | /algorithm-day03.js | UTF-8 | 885 | 3.65625 | 4 | [] | no_license | //bài 1: Search and ReplaceIncomplete
function myReplace(str, before, after) {
var index = str.indexOf(before);
if (str[index] === str[index].toUpperCase()) {
after = after.charAt(0).toUpperCase() + after.slice(1);
}
str = str.replace(before, after);
return str;
}
//console.log(m... | true |
3823273cd29edbe3d5b6e0f4f51da1ec7fd11609 | JavaScript | ocordova/frontend-clean-architecture-vue | /src/core/domain/entities.js | UTF-8 | 508 | 2.640625 | 3 | [] | no_license | export class User {
id = undefined
name = ''
email = ''
gender = ''
status = ''
createdAt = ''
updatedAt = ''
constructor(data) {
Object.assign(this, data)
}
nameFirstLetter() {
return this.name.substr(0, 1)
}
}
export class Pagination {
limit = 0
page = 0
pages = 0
total = 0
... | true |
2db488d703e68ed3c306bf0d58e9d0e71b73d944 | JavaScript | karankaw/nodeJsKida | /youtube/express_server.js | UTF-8 | 343 | 2.75 | 3 | [] | no_license | const express = require('express')
app = express()
app.listen(3000);
console.log("Express Server Listening!!!");
app.get('/', function(req, res) {
res.send("<h1> Hello</h1>")
// res.write("<h2> World</h2>") // Does not work
res.end// This Works, its coincidence that it is having same name as http Serve... | true |
d217dc96d56c490347aad1d84aff7d5c59d54f89 | JavaScript | asirko/sportJS | /mock/auth.middleware.js | UTF-8 | 1,812 | 2.84375 | 3 | [] | no_license |
const TOKEN_VALIDITY_IN_MINUTES = 30;
const BEARER = 'Bearer ';
exports.getUserId = getUserId;
exports.middleware = middleware;
function middleware (req, res, next) {
// check authorization to come in
// make sure user is allowed to that route (white listed)
if (!isWhiteList(req) && !authorizationIsValid(req.... | true |
2287ec6e27dd9d0a3eb1fa74c8ada4b1a488f479 | JavaScript | Addi-sys/todolist | /js/main.js | UTF-8 | 1,885 | 4.1875 | 4 | [] | no_license | // "To Do" script for website
// Declare array variable
let todoList = [];
// add listener for filter checkbox
let checkbox = document.querySelector("input[name=filter]");
// ToDo function
const addItem = () => {
// recieve input from HTML
let todo = document.getElementById("itemInput").value
// decl... | true |
e2c9fe4da238bfe968457a9d691fe274d47aa5fc | JavaScript | DavidBarbosa425/CursoJS | /Node/Aula08/server.js | UTF-8 | 688 | 2.8125 | 3 | [
"MIT"
] | permissive | const express = require('express');
const app = express();
app.use(
express.urlencoded(
{
extended: true
}
)
);
app.get('/', (req, res) => {
res.send('<form action="/" method="POST"> Nome do cliente: <input type="text" name="nome"> <button>Olá mundo</button> </form>');
});
app... | true |
c8e1c20a42c53afe3ec5cf1dcf00a1e2b9158f5c | JavaScript | jlndstrom/fretify | /script.js | UTF-8 | 1,839 | 3.8125 | 4 | [] | no_license | const notes = [
["E"],
["F"],
["F#", "Gb"],
["G"],
["G#", "Ab"],
["A"],
["A#", "Bb"],
["B", "Cb"],
["C"],
["C#", "Db"],
["D"],
["D#", "Eb"]
];
const formalNumbers = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th"];
const ... | true |
0343c488023f3773f5fc5b3dab132772b5de4322 | JavaScript | pilisipeter/0415 | /04.17/Feladat1/script.js | UTF-8 | 127 | 3.421875 | 3 | [] | no_license | let variable = 12;
let myVariable = false;
if (myVariable === false) {console.log('The Condition has been evaluated to true')}
| true |
b9fa768581f8c70ce09e13dd2e71bd22becc96df | JavaScript | pranavg000/p5js | /flappyBird/ga.js | UTF-8 | 634 | 3.515625 | 4 | [] | no_license |
function nextGen(){
calcFitness();
for(let i=0;i<TPop;i++){
birds[i] = pickOne();
}
console.log('Nex Gen');
backupBirds = [];
}
function pickOne(){
let index = 0;
let r = random(1);
while(r > 0){
r= r - backupBirds[index].fitness;
index++;
}
index--;
let bird = backupBirds[index];
let chi... | true |
a386d4fa103f109d48c412fb37940ae9279b3393 | JavaScript | huixiangming/webnode | /menu/main.js | UTF-8 | 2,929 | 2.609375 | 3 | [
"MIT"
] | permissive | var $menubar = function(){
var $bar = $('<div class="notepad-menubar"></div>');
var menuData,
menus = [];
var menuOpen = -1;
function createMenuTitle() {
var $titles = $('<ul class="menu-title"></ul>');
for(var i=0; i<menuData.length; i++) {
var $title = $('<li... | true |
abebdd5d1b3f948c6092ec4d23b9edb1c387b78a | JavaScript | edgar971/software-daily | /client/src/components/Select.jsx | UTF-8 | 3,863 | 2.546875 | 3 | [] | no_license | import React, {PropTypes} from 'react';
import Input from './Input';
import _ from 'lodash';
const Select = React.createClass({
propTypes: {
id: PropTypes.string,
onOptionClick: PropTypes.func.isRequired,
options: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.any.isRequired,
label: Pro... | true |
b7ab2c3c5748be2856d42d0f4f57926d0927947d | JavaScript | chukiweb/Barras | /js/main.js | UTF-8 | 5,874 | 3.234375 | 3 | [] | no_license |
let game = function() {
let time = 30;
let movBola = 10;
let movBarra = 20;
/* Medidas del tablero */
let width = document.getElementById("wraper").clientWidth ;
let heigth = document.getElementById("wraper").clientHeight;
let controlGame;
let pla... | true |
c4b176f007909b170447421ab02680bbd580d2a6 | JavaScript | kangju/JsTimer | /js/datetime.js | UTF-8 | 268 | 3.234375 | 3 | [] | no_license | function updateDate(){
var dt = new Date();
$("#date").html( dt.getHours() +":"+ addZero(dt.getMinutes()) + ":" + addZero(dt.getSeconds()));
}
function addZero(num){
return ("0"+num).slice(-2);
}
function startTimer(){
setInterval("updateDate()",1000);
} | true |
a1600a701af44735ece015ad920750348db9f2ed | JavaScript | edouarobin/intramuros-demo | /src/redux/commerces/reducer.js | UTF-8 | 2,589 | 2.609375 | 3 | [] | no_license | // @flow
import {
enhanceReducer,
enhanceDefaultState,
} from 'redux-async-actions-factory';
import actionTypes, { asyncActionsNames, storeName } from './actionTypes.js';
import { forEach, cloneDeep } from 'lodash';
export const defaultState: CommercesStoreType = {
...enhanceDefaultState(asyncActionsNames),
... | true |
ddc8407963222ca63a328c9d6deff2e028a86d47 | JavaScript | jathpr/jsAppExample | /src/zeros.js | UTF-8 | 663 | 4.09375 | 4 | [] | no_license | /* Создадим массив с десятью случайными элементами от 0 до 100;
Напишем инструкцию, которая будет заменять все “0” на строку “zero”;
Выводим полученный массив в консоль.
прим. [12, 53, “2zero”, 18, 22, “1zerozero”, 43, 57, “5zero”, 1]; */
const arr = new Array(100);
for (let i = 0; i < arr.length; i++) ... | true |
3b78763f39e508e5b5ec8c9c3c61f14ccc7d056b | JavaScript | eunseokOh/copuz | /.svn/pristine/c6/c6dd405547496f20db67aeae5338632bfb0a8e24.svn-base | UTF-8 | 9,577 | 2.515625 | 3 | [] | no_license | $(document).ready(function(){
// setTile -> defaultTile -> tiles -> update
var ROWS = 2; // 퍼즐 열 갯수
var COLS = 2; // 퍼즐 행 갯수
var curLevel =1;
var isFirst = true;
var oriLocationList = [];
var oriIdList = [];
var mClosestId = -1; // most closest id
var width = 0; // 원본 영상의 넓이를 입력하기 위해 선언
var height = 0; // 원... | true |
eb1443db814f081daa7d6f90fdd715431fafaea8 | JavaScript | Manadin/FineKnight | /TestHTMLProjekt/TestHTMLProjekt/js/menu.js | UTF-8 | 1,376 | 3.21875 | 3 | [] | no_license | // Purpose of this file:
// 1. Display instructions to the player
// 2. Call play state.
var menuState = {
// The create function is a standard Phase function.
create: function(){
// Add the game name label on the screen.
var nameLabel = game.add.text(80, 80, 'Controls!',
... | true |