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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5d547d4726df77f2ce642925c8852fa5f528a51e | JavaScript | tgutecht/uagc_assignment2 | /DateFormatting.js | UTF-8 | 2,865 | 3.40625 | 3 | [] | no_license | var DateFormatter = {
getShortTime: function(date){
var hours = date.getHours();
var minutes = date.getMinutes();
var meridiem = (hours < 12) ? "AM" : "PM";
return hours + ":" + minutes +" " + meridiem;
},
getLongTime: function(date){
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date... | true |
b203223ca9cfe14692b37592ace6fe05e7943717 | JavaScript | diogobruno91/Iniciando-com-js | /Aula 23/app.js | UTF-8 | 680 | 3.171875 | 3 | [] | no_license | function pegaNome(){
let nome = document.getElementById('nome').value;
document.getElementById('nomeInput').innerHTML = nome;
}
var btnTeste = document.getElementById('btnTeste');
btnTeste.addEventListener('click', function(){
let nome = document.getElementById('nome').value;
document.getElementById('nomeInput'... | true |
63395473a7c9b9a63d6e9a8c6dcbe6535680bdec | JavaScript | camelCaseStyle/webDevCourseUdemy | /rgb.js | UTF-8 | 4,073 | 3.46875 | 3 | [] | no_license | /*eslint-env browser*/
var colours = [];
var squares = document.querySelectorAll('.square');
var reset = document.querySelector('#reset');
var easyMode = document.getElementById('easy');
var hardMode = document.getElementById('hard');
var numberOfSquares = 6;
var easySelected = false;
var heading = document.querySelec... | true |
cab1dfa2844f18ee54ecdd7cdc12f9ecf5a72654 | JavaScript | LiangQianRan/beans-admin-plugin | /dist/utils/sleep.js | UTF-8 | 117 | 2.9375 | 3 | [] | no_license | export function sleep(time) {
return new Promise(function (resolve) {
return setTimeout(resolve, time);
});
} | true |
fdbf10ffb560781d599b7cca03b4a501ae6c043a | JavaScript | iamparasbhardwaj/ReactProjectFinal | /react-redux-client/src/components/Symptoms.js | UTF-8 | 5,541 | 2.5625 | 3 | [] | no_license | // ./react-redux-client/src/components/Symptoms.js
import React from 'react';
import { Alert,Glyphicon,Button,Modal } from 'react-bootstrap';
import { Link } from 'react-router';
import SymptomEditForm from './SymptomEditForm';
export default class Symptoms extends React.Component {
constructor(props){
super(pro... | true |
c55281831a1246ecf5d0b7b8b98780cabbc0a7a0 | JavaScript | otecvit/deliveryserv.pro | /app/src/reducers/dishes.js | UTF-8 | 2,140 | 2.5625 | 3 | [] | no_license | const initialState = [/*
{
key: "1",
idDishes: "1",
chName: 'Пицца Чикита',
chNamePrint: "Чикита",
chSubtitle: "супер пицца",
chPrice: "15.50",
chOldPrice: "20",
chDescription: "Пицца которую можно поглощать круглосуточно",
iCategories: "1",
enShow: ... | true |
4dd709f7347abc25f55ae80645bf8b9e697ae535 | JavaScript | ivanovaleksandr/group-corp-2 | /RomanKaluger/ToDoListLesson18/srcJs/toDoListScript.js | UTF-8 | 3,739 | 2.5625 | 3 | [] | no_license | import autosize from "autosize/src/autosize"
import './../scss/root.scss'
import config from './../config/serverConfig'
import moment from 'moment'
class ToDoListApp{
constructor() {
this.textArea = document.querySelector('.addString')
this.addBtn = document.querySelector('.addToDoBtn')
thi... | true |
cca78a56f521e8f6c68dd1b194aad7ebbcf6c6a8 | JavaScript | crcz25/textRecognition | /app/canvas.js | UTF-8 | 4,042 | 2.71875 | 3 | [] | no_license |
var canvasWidth = 224;
var canvasHeight = 224;
var canvasStrokeStyle = "white";
var canvasLineJoin = "round";
var canvasLineWidth = 20;
var canvasBackgroundColor = "black";
var canvasId = "canvas";
var clickX = new Array();
var clickY = new Array();
var clickD = new Array();
var... | true |
7b25b6e36cce7f454846edc29880c8eedb5d4177 | JavaScript | coponico/coderhouse-desafio-ecommerce | /src/components/Item/ItemQuantitySelector.js | UTF-8 | 3,043 | 2.609375 | 3 | [] | no_license | import {useState, useEffect} from 'react'
const ItemQuantitySelector = ({item, stock, initial, onAdd, onVariantSwitch}) => {
const [amount, setAmount] = useState(parseInt(initial))
const [showAddToCartButton, setShowAddToCartButton] = useState(true)
const incrementAmount = () => {
if (amount < par... | true |
7220f3ea2ec89036390ad7de50ce1cc55638f7b7 | JavaScript | eric-suh/weather | /src/utilities/timeUtils.js | UTF-8 | 940 | 3.140625 | 3 | [] | no_license | const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const getRegularTime = (militaryTime) => {
const hour = (militaryTime === 0 || militaryTime === 12) ? '12' : militaryTime % 12;
const suffix = (militaryTime >= 12) ? 'pm' : 'am';
return {
hour,
suffix
};
};
e... | true |
faab562e977c6c78d31b590256864e87a5cd8f23 | JavaScript | am20dipi/upfront-task-2 | /frontend/services/categoryApi.js | UTF-8 | 464 | 2.765625 | 3 | [
"MIT"
] | permissive | class CategoryApi {
static fetchCategoriesForSelect(e) {
if (e.target.matches('.dropdown')) {
fetch('http://localhost:3000/categories')
.then(resp => resp.json())
.then(json => json.data.map(({attributes}) => `<option value="${attributes.id}">${attributes.name}</o... | true |
121c9541d433d2fea9c7efc24aa3a54f09890dbf | JavaScript | web-designer-life/js_pro | /main.js | UTF-8 | 699 | 3.453125 | 3 | [] | no_license | var money = 1200;
var income = 'макдоналдс';
let addExpenses = 'Интернет, Такси, Коммуналка, Еда';
let deposit = true;
const mission = 2345;
const period = 3;
console.log(typeof(money));
console.log(typeof(income));
console.log(typeof(deposit));
console.log(addExpenses.length);
console.log('Период равен ' + period +... | true |
547e5f042d08d0624733d7b7159e576edf00fc7a | JavaScript | SimonHMP/hw3 | /src/components/Quote.js | UTF-8 | 795 | 2.703125 | 3 | [] | no_license | import React, { Component } from "react";
export default class Quote extends Component {
state = {
liked: "",
divStyle: ""
};
likeFunc = () => {
this.setState({ liked: true, divStyle: "green" });
this.props.addLikes();
//console.log(this.state.liked);
};
dislikeFunc = () => {
this.se... | true |
34034d5f82f147ab85881990a803bf04fe30dcfe | JavaScript | Vivian-96/JavaScript | /parseToFloat.js | UTF-8 | 970 | 3.203125 | 3 | [] | no_license | function parseToFloat()
{
var num1 = parseFloat("1234blue");
alert("将字符串1234blue通过parseFloat函数转换的结果是" + num1);
var num2 = parseFloat("0xA");
alert("将十六进制数字0xA通过parseFloat函数转换的结果是" + num2);
var num3 = parseFloat("22.5");
alert("将22.5通过parseFloat函数转换的结果是" + num3);
var num4 = parseFloat("22.34.... | true |
6aa1c86714addcc20745fc7945f0b36179c82c83 | JavaScript | kon-rad/Leetcode-Algorithm-Solutions | /Medium/16-3sum-closest.js | UTF-8 | 1,191 | 3.78125 | 4 | [] | no_license | /**
16. 3Sum Closest
Medium
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
Example:
Given array nums = [-1, 2, 1, -4], and target = 1.
T... | true |
8bbf1a255be474decb48f4b771c101c365c3d474 | JavaScript | sashayello/validation-package | /index.js | UTF-8 | 942 | 2.8125 | 3 | [] | no_license | 'use strict';
var validation;
var emailTest = function(email) {
var regExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regExp.test(email);
};
var nameTest = function(name) {
var regExp = /^([a-zA-Z ]){2,30}$/;
return regExp.test(name);
};
var phoneTest = function(phon... | true |
6f4454f595366f27c11307a36e29fe8f0b5796d3 | JavaScript | nigel-daniels/multipass | /javascript/js/test.js | UTF-8 | 2,124 | 2.65625 | 3 | [] | no_license | define(['node_modules/moment/moment', 'node_modules/crypto-js/sha1',
'node_modules/crypto-js/aes', 'node_modules/crypto-js/enc-hex',
'node_modules/crypto-js/enc-base64'], function( moment, SHA1, AES, HEX, Base64 ) {
var conf ={
name: '[Username]',
sso_id: '[Login/email]',
email: '[email]',
api_token: '[admi... | true |
e30e0a05a54217814ecd74103c1ad4a66a6067eb | JavaScript | freddywong/smiggles | /app/assets/javascripts/faces.js | UTF-8 | 448 | 2.984375 | 3 | [] | no_license | function showDefaultFace(defaultFace, faceElement) {
var faceId = faceElement.attr('id');
if(defaultFace === faceId) {
faceElement.show();
}
}
function showUpdatedFace(updatedFace) {
var face = $("#" + updatedFace)
face.fadeIn("slow")
}
function showReactionFace(reactionFace, updatedFace) {
var face =... | true |
da8ab9e7968bc49e4871e82aed3a3d2c7e270137 | JavaScript | Nazarii77/FL-11 | /FL11_HW15/homework/task2.js | UTF-8 | 368 | 3.96875 | 4 | [] | no_license | class Hamburger {
constructor(type, calories) {
this.type = type;
this.getCalories = () => calories;
this.setCalories = (value) => calories = value;
}
}
const myHumburger = new Hamburger('classic', 600)
console.log(myHumburger.getCalories()); // --> 600
myHumburger.setCalories(700);
co... | true |
775fdadd67d19d5f4d91324821a25c035e238c69 | JavaScript | anhle1476/trello-kanban-react-client | /src/reducers/securityReducer/securityReducer.js | UTF-8 | 1,198 | 2.609375 | 3 | [] | no_license | import { SECURITY } from "../type";
import jwt_decode from "jwt-decode";
import axios from "axios";
const initialState = {
token: "",
user: {},
};
const isTokenNotExpired = (expire) => {
const currentTime = Date.now() / 1000;
return currentTime < expire;
};
const setAxiosHeader = (token) => {
axios.default... | true |
eb330dad2acbd848e30181c3a43bb2552b3f7df9 | JavaScript | zxy-Jennifer/Algorithm-offer-JavaScript | /回溯法/131. 分割回文串.js | UTF-8 | 1,013 | 3.796875 | 4 | [] | no_license |
function partition(s) {
let len = s.length
let res = []
if(len<=0)return res
for(let i=1; i<=len; i++) {
let str = s.substr(0,i)
if(!isPalindrome(str))continue
let path = [str]// substr(i,j): 下标为i开始取,取j个元素
dfs(i, path)
}
return res
function dfs(index, path) ... | true |
5009a2888238c8703cd362c8d2c2c19a8a5ee5a3 | JavaScript | Abdulazis530/logic-training | /deretKaskus.js | UTF-8 | 908 | 3.953125 | 4 | [] | no_license | // function deretKaskus(n) {
// let arrTemp = [];
// let result = [];
// for (let i = 1; i <= n; i++) {
// arrTemp.push(i * 3);
// }
// for (let i = 0; i < arrTemp.length; i++) {
// if (arrTemp[i] % 6 === 0 && arrTemp[i] % 5 === 0) {
// result.push("KASKUS");
// } else if (arrTemp[i] % 5 ==... | true |
1a5d2ab8a5a79fa8d650722948c43a0402bc2e3c | JavaScript | coolieKi/week-8 | /src/components/CallAPI.js | UTF-8 | 2,841 | 2.546875 | 3 | [] | no_license | import { Line } from 'vue-chartjs'
import axios from 'axios'
export default {
extends: Line,
data: function () {
return {
datagroup:[],
datacollection: {
labels:[],
datasets: [
{
label:'',
data: [],
... | true |
ffa78822342fe589f44a556cfaf65e960d85d37a | JavaScript | thebrianmcconnell/Food-Fighters | /_js/myFirstGame.js | UTF-8 | 9,159 | 3.359375 | 3 | [] | no_license | // lovingly stolen http://www.lostdecadegames.com/how-to-make-a-simple-html5-canvas-game/
//and modified heavily
// Create the canvas
// Declares variables to hold the canvas object/API
// Create the canvas element
var canvas = document.createElement("canvas");
// Takes canvas and gets its context and puts that valu... | true |
c15e52ae040de1116ac02d0af3b8a022620325f7 | JavaScript | minalk24/Crystal-Collector-Game | /assets/javascript/game.js | UTF-8 | 2,824 | 4.25 | 4 | [
"MIT"
] | permissive | $(document).ready(function () {
//variable declare and initialize
var randomNumberPick;
var crystalNumbers = [];
var crystal1;
var crystal2;
var crystal3;
var crystal4;
var totalScore = 0;
var wins = 0;
var losses = 0;
//random number variable and loop for Computer guess
var randomEmptyArr = [];
for (v... | true |
6d5b30a7f52214277733a8a2343c7ac6ad641d03 | JavaScript | Dihsl1986/JS | /Discover/OperadoresDeString/throwAndTryCatch.js | UTF-8 | 253 | 3.5625 | 4 | [] | no_license | // Trow
function sayMyName(name = '') {
if(name === ''){
throw 'Nome é obrigatório'
}
console.log(name)
}
//Try...catch
try {
sayMyName('Diego')
} catch(e) {
console.log(e)
}
console.log('após a função de erro.')
| true |
2fc63c99b1cf6a819d6422d4dccb9e44839fd644 | JavaScript | gitter-badger/turtle.io | /src/page.js | UTF-8 | 365 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Gets an HTTP status page
*
* @method page
* @param {Number} code HTTP status code
* @param {String} host Virtual hostname
* @return {String} Response body
*/
TurtleIO.prototype.page = function ( code, host ) {
host = host && this.pages[host] ? host : ALL;
return this.pages[host][code] || this.pag... | true |
e696a5533dd71c895fd71d2301ab1340db3b8032 | JavaScript | JoshuaKornmayer/jsjqueryreviewday | /evenmore/evenmore6.js | UTF-8 | 1,036 | 3.96875 | 4 | [] | no_license | // function askNumber(){
// var n = prompt("Choose a number")
// var sumProduct = prompt("Do you want to compute the SUM or PRODUCT of 1 through your number 'n'? Type either SUM or PRODUCT in all CAPS.");
// var total = 0
// var prodTotal = 1
// for (var i = 0; i <= n; i++){
// if (sumProduct == 'SUM'){
// tota... | true |
2729a628eb8586123693cec949f09b528cc9c08e | JavaScript | christianlarwood/javascript_small_problems | /1.js_fundamentals_exercises/arrays/scratch_pad.js | UTF-8 | 816 | 4.875 | 5 | [] | no_license | // create an object exam, with a property numberOfQuestions that has a value of 10, a property maxScore that has a value of 100, and a property title that has a value of 'JS'.
// What are two ways to access the values of the properties? Bonus points for a third.
// Bonus points to create an object named hello that h... | true |
5d157de16a8b6b65cadafede8344c322560b2ac1 | JavaScript | htmelvis/react-special-calculator | /components/variationSelect.js | UTF-8 | 811 | 2.578125 | 3 | [] | no_license | var React = require('react');
var VariationSelect = React.createClass({
buildVariations: function(){
var options = this.props.options.map(function(variation, index){
return <option value={variation.price} data-items={variation.items} key={index}>
{variation.val}
</option... | true |
6da33a0e34d4222bba70356df5c8092fc080babf | JavaScript | sureshlodha/CoalizerVAA | /Coalizer/coalizerViz.js | UTF-8 | 7,300 | 2.84375 | 3 | [] | no_license | /* ----------------------------------------------------------------------------
File: MutilineChart.js
Contructs the Multi Line chart using D3
80 characters perline, avoid tabs. Indet at 4 spaces.
-----------------------------------------------------------------------------*/
//code to set the margins for the chart a... | true |
9a5ed49bbdac9d111f88a108248be1e90bbad74e | JavaScript | huanw415/pos_object | /pos_v2/src/model/cart-item.js | UTF-8 | 396 | 2.953125 | 3 | [] | no_license |
function cartItem(item, quantity){
this.item = item ;
this.quantity = quantity;
this.promotionQuantity = 0;
}
cartItem.prototype.getEverySaveMoney = function(){
var price = this.item.price;
return price * this.promotionQuantity;
};
cartItem.prototype.getEveryTotalMoney = function(){
var price = this... | true |
ba0359355c19b6fa2f1565ff1b96aa5bb4e1d732 | JavaScript | robsker/frontend-nanodegree-arcade-game | /js/app.js | UTF-8 | 3,844 | 3.75 | 4 | [] | no_license | // Now instantiate your objects.
// Place all enemy objects in an array called allEnemies
// Place the player object in a variable called player
var allEnemies = new Array();
// The active player
var player = new Player();
// Players that have made it to the top safely
var safePlayers = new Array();
// Arrays for so... | true |
34321449a018ab28146eb75fac790a9747c703ba | JavaScript | phamtuanit/myteam | /src/app/src/services/conversation.service.js | UTF-8 | 1,826 | 2.53125 | 3 | [
"MIT"
] | permissive | import Axios from "axios";
const Service = function service() {
this.path = "conversations/";
};
Service.prototype.getByUser = function (userName) {
if (typeof userName == "string" && userName) {
return Axios.get(this.path + `?user=${userName}`);
}
return Promise.reject("Data is invalid");
};
... | true |
cbfab33651e75c436a7e34028891bbde732e4995 | JavaScript | ds-1201/finalytics-front-1 | /src/screens/Trends/Trends.js | UTF-8 | 1,552 | 2.59375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import "./Trends.css";
import { Data } from "../../data";
import TrendChart from "../dashboard/components/Chart/TrendChart";
function getRandom(arr, n) {
var result = new Array(n),
len = arr.length,
taken = new Array(len);
if (n > len)
throw new Range... | true |
f501b73c2474e9739c103c05b63ef149887eb87c | JavaScript | SBALDOCK/notes | /lib/model/notes-collection.js | UTF-8 | 429 | 2.625 | 3 | [
"MIT"
] | permissive | const NotesModel = require('./notes-schema.js');
// make a collection
class NotesCollection {
create(text) {
const newNote = new NotesModel(text);
return newNote.save();
}
async delete(id) {
try {
await NotesModel.findByIdAndDelete(id);
} catch(err) {
return Promise.resolve(false... | true |
3e82fb0f14dd4dbeb6832005d4cffe813dcbe2b0 | JavaScript | YKG/nodeschool | /promise/e6.js | UTF-8 | 628 | 2.78125 | 3 | [] | no_license | var q = require('q'),
defer = q.defer();
function parsePromised(json){
//defer.promise.then(JSON.parse, null, json).then(null, console.log);
// defer.promise.then(console.log, null, json).then(null, console.log);
promise = defer.promise;
// promise.then(function(){
// JSON.parse(json);
// }).then(defer.resolv... | true |
fc8170379ab0fa85a35fad728e1d358bdbe3c713 | JavaScript | goelabhishek694/ES6 | /mapReduceFilter/filter.js | UTF-8 | 273 | 3.140625 | 3 | [] | no_license | let words=['spray','limit','elited','destruction'];
let nwords=[];
for(let i=0;i<words.length;i++){
if(words[i].length>5){
nwords.push(words[i]);
}
}
let nwords=words.filter(function(e1){
//true false
return e1.length>5;
});
console.log(nwords); | true |
be5106d4897e76ca02164432353271f558a9bf11 | JavaScript | HomeDing/WebFiles | /microsvg.js | UTF-8 | 1,796 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | // Micro charts implementation utilities.
//
// Copyright (c) by Matthias Hertel, http://www.mathertel.de
// This work is licensed under a BSD 3-Clause license.
//
// * 08.08.2020 rework.
/**
* Create a SVG element
* @param {SVGAElement} parentNode container node for the new element
* @param {string} tagName tagNa... | true |
e72d4d09977a35af01168cae261465c9e9c34967 | JavaScript | mark0322/xCharts | /charts/Heatmap /Heatmap.js | UTF-8 | 10,306 | 2.5625 | 3 | [] | no_license | import * as d3 from 'd3'
import { flatten } from '../../util/array'
const defaults = {
animation: true,
gap: 2, // block 间的间隙
padding: {
top: 100,
left: 80,
right: 150,
bottom: 20
},
barColor: '#20c1bd',
colorRange: ['#fff', '#20c1bd'], // heatmap 的颜色区间
labelColor: '#333',
label... | true |
0fa6b76d5e7f663c14ea806a10a29e725b01bee4 | JavaScript | bayan04/bayan04.github.io | /appple/main.js | UTF-8 | 1,653 | 2.828125 | 3 | [] | no_license | var i=0;
var i2=0;
var i3=0;
var img = document.getElementById('aus');
auss();
function auss() {
var n;
n = Math.floor(Math.random()*3+1);
$("#aus").css("left","1px");
$("#aus").css("top","1px");
switch(n){
case 1: {
img.src = "file:///C:/Users/%D0%91%D0%B0%D1%8F%D0%BD/Desktop/appple/img/black.png"; break... | true |
790656a170fccaa354e98be493d7ebaaeb2cb1d0 | JavaScript | anthonyamaro15/node-db2-project | /car-routes/carsRoute.js | UTF-8 | 1,385 | 2.578125 | 3 | [] | no_license | const express = require("express");
const db = require("./cars-schema");
const { validateId, validateBody } = require("../middlewares/validate");
const route = express.Router();
route.post("/", validateBody, (req, res) => {
db.add(req.body)
.then((car) => {
res.status(201).json(car);
})
.catch((er... | true |
ad39cedc3bbc9a5278ee387919145a275137f9f0 | JavaScript | matt-green1/overunder_frontend | /src/Components/GameShow.js | UTF-8 | 3,488 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from 'react'
import Question from './Question'
import { Button, Image, Card, } from 'semantic-ui-react'
import BabyAnimals from './GameAnimations/BabyAnimals'
import TechFacts from './GameAnimations/TechFacts'
import Athlete from './GameAnimations/Athlete'
import Art from './GameAnimations/Art'
import Cel... | true |
fd47cb7cce0be3274c9ce6691e2d8006ab497de3 | JavaScript | bjams/Pixel-Art-Maker | /designs.js | UTF-8 | 995 | 3.625 | 4 | [] | no_license | // grid generation based on input
function makeGrid() {
// storing necessary values
const pixelCanvas = document.getElementById('pixelCanvas');
const gridHeight = document.getElementById('gridHeight').value;
const gridWidth = document.getElementById('gridWidth').value;
// clearing grid upon clicki... | true |
1a99eb777627ccd713c5876f221a5812b75ebb9c | JavaScript | nilproject/NiL.JS | /TestSets/tests/sputnik/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js | UTF-8 | 490 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | /// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js
* @description RegExp - the thrown error is SyntaxError instead of RegExpError when the characters of 'P' do not have the syntactic form Pattern
*/
function testcase() {
try {
... | true |
cc9a459fed08fcddf5241609defb798a9fdbe3eb | JavaScript | jiayiliu/MLVis | /ROC/roc.js | UTF-8 | 4,616 | 3.390625 | 3 | [] | no_license | // Control parameters
var color1 = "blue"; // color for sample 1
var color2 = "green"; // color for sample 2
// Global variables
var n1; // number of sample 1
var n2; // number of sample 2
var xcut; // cutting position
var distance; // distance between two samples
var sample = new Array(); // array to store samples
v... | true |
a435d94bdd9a1f2274c42cab67fad9e578e91ebf | JavaScript | andy3520/simple-proof-of-work-simulator | /index.js | UTF-8 | 1,395 | 3.375 | 3 | [] | no_license | let startButton = document.getElementById("start");
startButton.onclick = () => {
startButton.disabled = true;
startButton.textContent = "Mining...";
start();
};
function start() {
let data = getData("data");
let complexity = getData("complexity");
mining(data, +complexity);
}
function mining(data, comple... | true |
f91563e8bc2d74a539369df2079b808d7aecae81 | JavaScript | eajith/Assignment1 | /config.js | UTF-8 | 676 | 2.859375 | 3 | [] | no_license | /*
*
*This file contain the environment settings
*
*/
var environemnts ={}
environemnts.staging = {
'httpPort':3000,
'httpsPort':3001,
'envName' :'staging'
}
environemnts.production = {
'httpPort' : 4000,
'httpsPort': 4001,
'envName' : 'production'
}
//Determine the environment
var curretEnv = typeof(proces... | true |
6c95b2beeb5a2af32b446e57c3ef26ae12cf97ef | JavaScript | jtefera/cms_react | /__mocks__/sendJson.js | UTF-8 | 813 | 2.546875 | 3 | [] | no_license | function sendJson({method, url, data, onLoad, onSuccess, onFailure}) {
console.log('czgz', data);
if(url === '/login') {
if (onLoad) {
onSuccess = onLoad;
onFailure = onLoad;
}
if(data) {
if(!data.username || !data.password) {
Promise.r... | true |
30afaa63a2f9b8eb9fda78c244275e9fcf614542 | JavaScript | Daivuk/ggj19 | /game/assets/scripts/map.js | UTF-8 | 3,502 | 2.5625 | 3 | [
"MIT"
] | permissive | var MAP_SIZE = 500
var CLOUD_CEILING = 40
var MAP_TEXTURE_SCALE = 0.1
var map = {
vb: null,
vertCount: 0,
texture: getTexture("grass.png"),
world: new Matrix()
}
function map_reset()
{
tanks = []
aas = []
tents = []
shots = []
smokes = []
explosions = []
load_entities()
}
... | true |
1ed0eb3a365cbd195b4fb2bb4262c9b81eb64470 | JavaScript | vicusb/etch-a-sketch | /script.js | UTF-8 | 2,336 | 3.359375 | 3 | [] | no_license | function changeSquares() {
let keepGoing = true;
while (keepGoing) {
n = Math.round(parseInt(prompt("How many squares per side do you want? Keep it under 100 please.", 8)));
if (n < 100) {
keepGoing = false;
}
}
document.documentElement.style.setProperty("... | true |
2bc14e927eb6fdb036da355e399cf69d1fbc4ea5 | JavaScript | tomkhughes/mongoWebScraper | /server.js | UTF-8 | 6,694 | 2.734375 | 3 | [] | no_license | var express = require("express");
var bodyParser = require("body-parser");
var logger = require("morgan");
var mongoose = require("mongoose");
// Our scraping tools
// Axios is a promised-based http library, similar to jQuery's Ajax method
// It works on the client and on the server
var axios = require("axios");
var c... | true |
2edc1af8ff554c7265e690477e05bbd535e744c4 | JavaScript | cmp88500/to-do-list | /js/scripts.js | UTF-8 | 2,784 | 3.484375 | 3 | [
"MIT"
] | permissive | // Business logic
/* Constructor function for Task objects. "name" parameter is the name of the task (string), "complete" parameter is a boolean value true or false. */
function Task(name, description, complete) {
this.shortName = name;
this.description = description;
this.status = complete;
}
// U... | true |
24a192b5a5b1e31335b61d094bcb1e3bd9ec3f7c | JavaScript | DCbryant/task | /PhantomJS/apply/Descreenshot.js | UTF-8 | 1,474 | 2.890625 | 3 | [] | no_license | var page = require('webpage').create();
// settings.userAgent:指定HTTP请求的userAgent头信息,上面例子是手机浏览器的userAgent。
page.settings.userAgent = 'WebKit/534.46 Mobile/9A405 Safari/7534.48.3';
// settings.viewportSize:指定浏览器窗口的大小,这里是400x600
page.settings.viewportSize = { width: 400, height: 600 };
page.open('http://slashdot.org', f... | true |
ffe5ac160892fdea64fbbbe9068fb0192cd03151 | JavaScript | rafaOrtega14/jwt-selfissuer | /lib/index.js | UTF-8 | 1,435 | 2.546875 | 3 | [
"MIT"
] | permissive | /*!
* jwt-selfissuer
* Copyright(c) 2017 Jose Antonio Gonzalez Robles
* MIT Licensed
*/
let parser = require('./auth_header')
let verify = require('./manager_jwt')
/**
* Handle response based on the token provided
*
* @param {string} key
* @param {object} redisClient
* @param {object} verification_options
*... | true |
d43e0c81e40a7b65a29da0d934bb793c4e13b315 | JavaScript | OpenDAWN/neuro | /lib/util/LFO.js | UTF-8 | 1,588 | 3.046875 | 3 | [
"MIT"
] | permissive | var AbstractNode = require('../AbstractNode');
/**
* An LFO utility for scaling oscillator output appropriately.
*
* The output of the LFO will be on the range [-scale, scale] where scale
* is the value provided in the options object.
*
* Assuming a sine-based LFO is connected to an AudioParam, the value of
* t... | true |
462c35b39a79e7c6b75351861a3c3b823014278c | JavaScript | jasminHadzialic/Repo18 | /ex06/src/index.js | UTF-8 | 420 | 2.9375 | 3 | [] | no_license | let rockStar = new Map();
rockStar.set("artist", "The Rolling Stones");
rockStar.set("song", "Angie");
rockStar.set("album", "Goats Head Soup");
rockStar.set("singer", "Mick Jagger");
let keys = [...rockStar.keys()];
let newRock = new Map();
for (key of keys) {
if (key[0] > 'a') {
newRock.set(key, rockSta... | true |
2e716e7f500b1ed2d835a47037c533d1f5f9c8b5 | JavaScript | NayrbEroom/portfolioGitControl | /javascript/oldsketchfiles/sketch.js | UTF-8 | 1,646 | 3.65625 | 4 | [] | no_license |
//assign it like a variable so you can do multiple sketches in one file
//it will also allow me to control the canvas with html/css
//instructions for assigning multiple sketches: http://www.joemckaystudio.com/multisketches/
// let canvasSketch1 = function(controller) {
// let testArray = [123,1415,1235,5686,1352]... | true |
f0716122979c8ddb3614bd78ea4fb01427e1602a | JavaScript | kontrec91/homework_js01 | /LECTION38(project1)/App.js | UTF-8 | 2,093 | 2.59375 | 3 | [] | no_license | import React, {useState} from 'react';
import logo from './logo.svg';
import './App.css';
const Header = (props) =>
<header>
{console.log(props)}
<img src={logo} className="App-logo" alt="logo" />
<p>
{props.children}
</p>
</header>
const MenuItem = ({service: {url, name}}) =>
<li>
<a href={u... | true |
dd128802ea01a84351173ea51d930bec7e704b87 | JavaScript | damiansk/lounge-visualization | /src/services/FileUploadService.js | UTF-8 | 1,014 | 2.546875 | 3 | [] | no_license | class FileUploadServiceClass {
constructor() {
this.fileReader = new FileReader();
this.result = {};
this.isError = false;
this.isLoaded = false;
this.onFileChange = this.onFileChange.bind(this);
this.getFile = this.getFile.bind(this);
// register FilerReader onload method
this.fileRea... | true |
f2f5a3d691555f3b075aa16facab8fbc48026e00 | JavaScript | shaack/cm-web-modules | /src/observe/Observe.js | UTF-8 | 9,418 | 2.96875 | 3 | [
"MIT"
] | permissive | /**
* Author and copyright: Stefan Haack (https://shaack.com)
* Repository: https://github.com/shaack/cm-web-modules
* License: MIT, see file 'LICENSE'
*/
const collectionMutationMethods = {
array: ["copyWithin", "fill", "pop", "push", "reverse", "shift", "unshift", "sort", "splice"],
set: ["add", "clear",... | true |
a26eba3844aa88ccb38ff5e12dd854699d6e1ae3 | JavaScript | hotpeperoncino/GraphDataFormatConverter | /dimacsreader.js | UTF-8 | 2,625 | 2.5625 | 3 | [
"MIT"
] | permissive | function edgeread(inputfile, cb) {
var linenumber = 0;
var error = false;
var llreader = require('line-by-line');
lr = new llreader(inputfile);
lr.on('error', function (err) {
// 'err' contains error object
error = true;
cb(err);
});
var indexmap = {};
var next_index = 0;
... | true |
b2b00e12ca9420874ebf8f5f87b4429760a68d3e | JavaScript | roydenlynch18/RoydenRAD | /public/javascripts/dataVisual.js | UTF-8 | 13,485 | 2.796875 | 3 | [] | no_license | var url = window.location.href;
var num = url.indexOf('classes/'); //get index of before classes
var courseClass = url.slice(num + 8);
console.log(courseClass);
//console.log(data.length);
var storedData = [];
queue()
.defer(d3.json, "../classesdata/" + courseClass)
.await(graphData);
var margin = {top: 30, r... | true |
9c477ef299ce9b6d4b1bc80bbac7cf348cbe3f0a | JavaScript | Sonatrix/country-list | /src/lookup.js | UTF-8 | 506 | 2.703125 | 3 | [
"MIT"
] | permissive | const search = (data, query) => {
const q = Object.entries(query);
return data.filter(
(d) =>
q.filter((v) => {
const prop = d[v[0]];
if (Array.isArray(prop)) return prop.indexOf(v[1]) >= 0;
return prop.toLowerCase() === v[1].toLowerCase();
}).length === q.length
);
};
... | true |
4328c96247344461e1274f9bbe6a85c81e9b13aa | JavaScript | unclezap/practice | /binomialGame.js | UTF-8 | 11,944 | 3.40625 | 3 | [] | no_license | function binomialCalculator(array) {
let hash = {}
for (let i = 0; i <= array.length; i++) {
hash[i] = 0
}
games(array, 1, 0)
function games(array, percentage, wins) {
if (array.length === 0) {
return hash[wins] += percentage
}
games(array.slice(1), pe... | true |
b8a3584baf08810226203376ddfe4c0838114085 | JavaScript | mharley12345/webapi-iii-challenge | /posts/postRouter.js | UTF-8 | 1,647 | 2.515625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | const express = require('express');
const UsersDB = require('../users/userDb.js')
const PostsDB = require('./postDb.js')
const router = express.Router();
router.get('/', (req, res) => {
PostsDB.get()
.then(posts =>{
res.status(200).json(posts)
})
.catch(err =>{
res.status(500).json({err... | true |
2debd27ef88a8198406b716ef2137c4f5f8f4d22 | JavaScript | devchea/nodeJS_notes | /nodeJS_notes.js | UTF-8 | 499 | 3.125 | 3 | [] | no_license | console.log(__filename)
//gets filename
console.log(__dirname)
//gets directory name
//
//how to export and import files and functions
const num = [1 , 2 , 3 ]
const people = ['me', 'you', 'others']
module.exports = {
num: num,// can also use num without key
users: people
}
//stuff.js contains ... | true |
bc01b69efac24909632d08386110436e870690aa | JavaScript | Rydez/SignalRApp | /SignalRApp/obj/Release/Package/PackageTmp/Client/Chat.js | UTF-8 | 4,138 | 2.796875 | 3 | [] | no_license |
var Chat = {
initialize: function (gameProxy) {
this.isChatting = false;
this._gameProxy = gameProxy;
// Leave this alone for resetting opacity
const constMinOpacity = 0.1;
this.constMinOpacity = constMinOpacity;
this.maxOpacity = 0.5;
this.minOpacity ... | true |
380ee46dfdff46dbc0a25491cd470a27ecee24a4 | JavaScript | Abby-Taylor/Week4Assignment | /index.js | UTF-8 | 1,568 | 4.75 | 5 | [] | no_license | //use template literals to write a function that takes firstName and
//lastName and returns 'firstName and lastName'
function printFullName(firstName, lastName) {
return `${firstName} ${lastName}`};
console.log(printFullName('Abby', 'Taylor'));
//write the same function as above as an arrow function with a diff n... | true |
35caf14826702e733f9332d4341fcd705ab2b199 | JavaScript | midastouchprd/js-philosophies | /netflix-chill.js | UTF-8 | 693 | 3.296875 | 3 | [] | no_license | You = {};
//a function that loops constantly asking for your consent
You.consent = function (person) {
if (capableOfConsent(this)){
return setInterval(consent(person), 0);
} else {
return false
}
}
function capableOfConsent (person){
if (person.age > 18 && person.sober === true && person.coerced === ... | true |
b6a5c23bae95fbb40613656761299b5287ecd066 | JavaScript | Adamfsk/jest-webgl-canvas-mock | /__tests__/classes/CanvasRenderingContext2D.beginPath.js | UTF-8 | 400 | 2.78125 | 3 | [
"MIT"
] | permissive | let canvas;
let ctx;
beforeEach(() => {
canvas = document.createElement('canvas');
ctx = canvas.getContext('2d');
canvas.width = 400;
canvas.height = 300;
});
describe('beginPath', () => {
it('should be a function', () => {
expect(typeof ctx.beginPath).toBe('function');
});
it('should be callable',... | true |
fa4b3b5aa50fd23ea06015f1ad386a4ec1188ea6 | JavaScript | dimolf345/room-homepage | /app.js | UTF-8 | 1,967 | 3.171875 | 3 | [] | no_license | const nav = document.querySelector('nav');
const toggler = document.getElementById('toggler');
const navLinks = document.querySelectorAll('.nav-links li a');
const pictures = document.querySelectorAll('picture');
const controls = document.querySelectorAll('.control');
const textContainer = document.querySelectorAll('.t... | true |
060eff478af876b7177dee051728b06731396d4e | JavaScript | JOsorio01/PruebasES6 | /src/js/model/pelicula.js | UTF-8 | 325 | 2.640625 | 3 | [] | no_license | class Pelicula {
constructor(year, name) {
this._year = year;
this._name = name;
}
//id get & set
get year() {
return this._year;
}
set year(y) {
this._year = y;
}
//tipo get & set
get name() {
return this._name;
}
set name(n) {
this._name = n;
}
}
export default Pelic... | true |
d15b4f9c2882c3c44e526d059bc3295e5271811c | JavaScript | tieutac1996/api-weather | /src/components/api/getTemp.js | UTF-8 | 252 | 2.78125 | 3 | [] | no_license | const URL =
"https://api.openweathermap.org/data/2.5/weather?appid=176eb9d535508235e116000ce82b167b&q=";
export default function getTemp(cityName) {
return fetch(URL + cityName)
.then((res) => res.json())
.then((result) => result.main);
}
| true |
d5f3ac6afa1392b226081ad1615881163ef038cd | JavaScript | jluis9/Arcade-Game | /js/app.js | UTF-8 | 2,857 | 3.125 | 3 | [] | no_license | var Enemy = function() {
this.bEnemy = [-150, 900];
this.cEnemy = [60, 140, 220];
this.speedRange = [150, 700];
this.sprite = 'images/enemy-bug.png';
this.reset();
};
Enemy.prototype.reset = function() {
var startPos = this.bEnemy[0];
this.x = startPos;
this.y = this.getRandomY();
... | true |
e3d463686d7d4755231c579bd2d3aa5eb504cf2b | JavaScript | GT0221/rock-paper-scissors | /script.js | UTF-8 | 2,756 | 3.828125 | 4 | [] | no_license | function startGame() {
const classImages = document.querySelectorAll('.images');
classImages.forEach(x => x.addEventListener('click', game));
}
function game(e) {
const playerSelection = e.target.id;
const computerSelection = computerPlay();
const result = playRound(playerSelection, computerSelecti... | true |
701c14b025e16e5fd5602ae44797c6997cadb2f3 | JavaScript | tobiasvinther/food-waste | /src/main/resources/static/recipe.js | UTF-8 | 1,069 | 2.703125 | 3 | [] | no_license | $(document).ready(function () {
$("#search-button").click(function () {
$.ajax({
type: "get",
url: "recipe.json",
dataType: "json",
success: function (data) {
if (data) {
var searchResult = "";
if (!$("#... | true |
80af7c621b766fb9b967bb9febb223b2e1498ed1 | JavaScript | donaldevine/ARIACA2 | /js/calculator.js | UTF-8 | 1,376 | 3.390625 | 3 | [
"MIT"
] | permissive | var Calculator = (function() {
// Private methods
var checkParams = function(){
if (isNaN(paramA)) {
throw new Error("Parameter A is not a number!");
}
if (isNaN(paramB)) {
throw new Error("Parameter B is not a number!");
}
};
// Private stuff up... | true |
41aaa4fd8c5b4d5202310d781538214ad8282634 | JavaScript | jyansol/side_project | /vanilla-redux/src/index.js | UTF-8 | 1,393 | 3.15625 | 3 | [] | no_license | import { createStore } from 'redux';
// action type
const WELCOME_MSG = '@action/welcomeMsg'
const BYE_MSG = '@action/byeMsg'
const INCREMENT = '@action/count'
// init state
const initState = {
// welcomeMsg: 'HI!',
// byeMsg: 'BYE!',
// inAndOut: false,
// guestName: '',
count: 0,
}
// reducer
// 상태랑 액션을 ... | true |
6ffe5f151e80777a509b762df036536b48f34d6e | JavaScript | Crizzooo/zombiez | /server/reducers/engine.js | UTF-8 | 710 | 2.53125 | 3 | [] | no_license | const TIMER_TICK = 'TIMER_TICK';
const ADD_PLAYER = 'ADD_PLAYER';
const GAME_PLAYING = 'GAME_PLAYING';
const RESET_ENGINE = 'RESET_ENGINE'
const resetEngine = () => ({
type: RESET_ENGINE
});
const gamePlaying = (gamePlaying) => ({
type: GAME_PLAYING,
gamePlaying
});
const initialState = {
gamePlaying: false... | true |
4328138122071c3a25257d337c4dcdfe390af638 | JavaScript | RedJupid/flappybird | /js/SceneManager.js | UTF-8 | 6,146 | 2.640625 | 3 | [] | no_license | (function(){
var SceneManager = window.SceneManager = function(){
//1表示欢迎屏幕,2表示教程,3表示游戏内容,4表示GameOver
this.sceneNumber = 1;
//场景管理器负责实例化东西
game.bg = new Background();
game.bird = new Bird();
game.land = new Land();
this.logoY = -48;
this.but... | true |
1ced5caf83d2322c45fadd19bbe05cabb0914496 | JavaScript | stoyek/BerthouYannis_6_19072021 | /back-end/controllers/vote.js | UTF-8 | 587 | 3.109375 | 3 | [] | no_license | function vote(userId, userChoice, sauce) {
let usersLiked = sauce.usersLiked;
let usersDisliked = sauce.usersDisliked;
switch (userChoice) {
case 1:
usersLiked.push(userId);
break;
case -1:
usersDisliked.push(userId);
break;
case 0:
if (usersLiked.find((u) => u === userI... | true |
aa2003033fa70f32ece33460f53c2fe56a596e7a | JavaScript | hooliaah/Bamazon-CLI | /bamazonSupervisor.js | UTF-8 | 3,312 | 3.0625 | 3 | [] | no_license | // require node packages
require('dotenv').config()
var mysql = require('mysql');
var inquirer = require('inquirer');
var Table = require('cli-table');
// connection to MySql database
var connection = mysql.createConnection({
host: process.env.DB_HOST,
port: 3306,
// get username and password from .env
... | true |
58f0bd5c1c2a4c148fa905769fe056605f7d4ab6 | JavaScript | mperrotBI/Capstone | /EventSpace/js/app.js | UTF-8 | 1,727 | 2.90625 | 3 | [
"MIT"
] | permissive | var title = document.getElementById("title");
var desc = document.getElementById("desc");
var price = document.getElementById("price");
var lo = document.getElementById("location");
var bed = document.getElementById("bed");
var bath = document.getElementById("bath");
var area = document.getElementById("area");
var stor... | true |
eaa6ce14a96f69c55c17542a5874e96be187f66e | JavaScript | konaho/js-learning | /js/w_sample_random.js | UTF-8 | 7,271 | 3.203125 | 3 | [] | no_license | /**
* ※複数人で同時にアクセスしたときに画像と画像シリーズの対応は一緒でないといけないので、
* ボタンと画像シリーズの関係は固定になるように、または1時間おきに固定になるように作り直す
* ※console.log()はすべて消すこと
**/
const IMG_PATH_BASE = "image/"; // 画像パスのベース
const DISPLAY_LIST = ["#numberSelect", "#typeSelect", "#displayImage"]; // 画面リスト
const REWARD_LIST = ["chicken", "potato", "drink"]; // ... | true |
00a44d544d53648c8a5c6f423a4e5929b8394dce | JavaScript | rathoregaurav/react-learning-mix | /src/ComponentLife.js | UTF-8 | 899 | 2.859375 | 3 | [] | no_license | import React from 'react';
class Mounter extends React.Component {
constructor(props) {
super(props)
this.value=10
this.state = {'count':0}
console.log("constructor")
}
intCount = (val) => {
this.setState(
{'count': this.state.count+val}
)
}
... | true |
287f016065b73af694395ceeddc08d2d44df16aa | JavaScript | arenignacio/odin-todo | /src/script/app.js | UTF-8 | 3,510 | 2.984375 | 3 | [] | no_license | import '../style/reset.scss';
import '../style/style.scss';
import item from './modules/TodoItem';
import Project from './modules/Project';
import sayHi from './modules/sayHi';
import subItem from './modules/Item';
if (module.hot) {
module.hot.accept();
}
const items = [
new item(2, 'Get to the Gym', new Date(1988... | true |
ab6a741eba06aef46ed3c2bfc9d58fcb2dc954f9 | JavaScript | maxassis/Maxwelb-Assis | /semana4/funcoes-de-array/controlador-de-despesas/script.js | UTF-8 | 1,281 | 3.640625 | 4 | [] | no_license | let array = []
let objeto = {}
var despesatotal = []
let maior = 0
function apertar1() {
let input = document.getElementById("desp1")
let input2 = document.getElementById("desp2")
let input3 = document.getElementById("desp3")
if (input.value === "" && input3.value === "") {
alert('Digite os ... | true |
8216f4d8b2670363d217eb8f821c7761a79da21e | JavaScript | petercollingridge/bloops | /js/src/simulations/sim-4.js | UTF-8 | 2,104 | 3.375 | 3 | [] | no_license | /**********************************************************************
* Simulation 4
*
* The Bloop4 creatures have genes to control size and metabolim.
* Larger creatures move slower, creatures with higher metabolism
* use more energy per tick, but can move faster.
**********************************************... | true |
0f3808392753f2011c5542a96f036ff0dda0ed70 | JavaScript | JeffreyAsuncion/CodingProblems_JavaScript | /js/freeCodeCamp008.js | UTF-8 | 929 | 4.375 | 4 | [
"MIT"
] | permissive | /*
FreeCodeCamp
JavaScript Coding Challenge #8: Repeat a string repeat a string
Repeat a given string `str`, `num` times.
Return an empty str if num is not a positve number
*/
// function repeatStringNumTimes(str, num){
// if (num <= 0) return "";
// return str.repeat(num);
// }
// function ... | true |
23aa4d88ffb486a4e86bc221d4527c119c62659c | JavaScript | LachlanMckellar97/PasswordGenerator | /passgen.js | UTF-8 | 3,068 | 3.671875 | 4 | [] | no_license | // DOM elements
var passwordEl = document.getElementById("password");
var passlengthEl = document.getElementById("passlength");
var includeLowerEl = document.getElementById("includeLower");
var includeUpperEl = document.getElementById("includeUpper");
var includeNumberEl = document.getElementById("includeNumber");
var... | true |
140304f7b8709a1f04e79f2872b1e56d672f0d0b | JavaScript | TAGraves/adventofcode2016 | /day5.js | UTF-8 | 991 | 3.421875 | 3 | [] | no_license | const input = 'reyedfim';
function md5(str) {
const crypto = require('crypto');
const hash = crypto.createHash('md5');
hash.update(str);
return hash.digest('hex');
}
function getPassword(input) {
let password = '';
let i = 0;
while (password.length < 8) {
const hash = md5(input + i... | true |
e1295f2479b9606e29f6e5727e1f4c8a485cf7b5 | JavaScript | jportillo8/SimonDiceJS | /1 FundamentosJS/switch.js | UTF-8 | 375 | 2.8125 | 3 | [] | no_license | var signo = prompt('Caul es tu signo')
switch (signo) {
case 'acuario':
console.log('Eres un acurio espectacular');
break;
case 'leo':
console.log('Eres un leo espectacular');
break;
case 'aries':
case 'ariés':
console.log('Eres un aries espectacular');
break;
default:
... | true |
11bdea1f8389e59139a63befc91d8c2a198beba7 | JavaScript | ReneIbanez/bootcamp-folder | /week 5/carosel/js/main.js | UTF-8 | 1,813 | 3.28125 | 3 | [
"MIT"
] | permissive | // user can click a back button and a foward button
// that is linked to my image folder
// i must set up var =attached to my img file
//so every click
// can slide threw images
// get shark images
var animals = ["img/anotherGreatWhite.jpg",
"img/greatWhiteOutWater.jpg",
"img/megalodonShark.jpg",
"img/megalodon... | true |
c53f977e6316ea89312b40f5be3ddc1b036cc0ed | JavaScript | hlecuanda/Apps-Script-PubSubApp-Library | /src/policyBuilder.gs.js | UTF-8 | 4,711 | 2.640625 | 3 | [] | no_license | /*
PubSubApp - policyBuilder.gs
Copyright (c) 2015 Spencer Easton
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless re... | true |
010f4478e4044ecfaa95e7ace8a57c3b7fd9e787 | JavaScript | account931/yii2_REST_and_Rbac_2019 | /web/js/wpress.js | UTF-8 | 6,524 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | (function(){ //START IIFE (Immediately Invoked Function Expression)
$(document).ready(function(){
//on change in dropdown list (list of all categories from DB WpressCategory), onchange redirects to the same page but with diffrent $_GET['category'] in order to let Controller select only articles with certain... | true |
077ea6e12d22133cf9a2a1e26158c76532e9cedf | JavaScript | putrialisyahm/ga-be-batch-9 | /oopInheritance.js | UTF-8 | 905 | 3.984375 | 4 | [] | no_license | class Human {
constructor(name, address) {
this.name = name;
this.address = address;
}
introduce() {
console.log(`Hi, my name is ${this.name}`);
}
}
// Create a child class from Person
class Programmer extends Person {
constructor(name, address, programmingLanguages) {
super(name, address); ... | true |
47a0d29ec67f013c1af2217fb66a2f2a55dab4ca | JavaScript | AgoraIO-Community/RTE-Innovation-Challenge-2020 | /SDKChallengeProject/【红鲤鱼与绿鲤鱼与驴】点解/src/ws.js | UTF-8 | 1,998 | 2.796875 | 3 | [
"MIT"
] | permissive | let ws = null;
const messageHandlers = new Map();
function getWsUri() {
const loc = window.location;
let wsUri = '';
if (loc.protocol === 'https:') {
wsUri += 'wss://';
} else {
wsUri += 'ws://';
}
wsUri += loc.host;
wsUri += '/ws';
return wsUri;
}
function registerMessageHandler(type, handler... | true |
59b8006cc2f72d209ec1186545ee264e32c7b838 | JavaScript | samadobrota/My-Wallet-V3 | /src/analytics.js | UTF-8 | 1,020 | 2.5625 | 3 | [] | no_license | 'use strict';
var assert = require('assert');
var API = require('./api');
var CryptoJS = require('crypto-js');
// If there is a problem with the analytics endpoint, the application should
// just proceed. Therefor we're not returning a promise in the methods below.
function postEvent(name, guid) {
assert(name, "E... | true |
a3eae7600673e2f064d25d03e401a03c8e9d7814 | JavaScript | KelvinRod9331/spaceinvaders | /missile.js | UTF-8 | 721 | 2.953125 | 3 | [] | no_license | function Missile(ship) {
this.x = ship.x;
this.y = ship.y - 10;
this.r = 30
this.power = 50
this.toDelete = false;
this.show = function(sprite) {
imageMode(CENTER);
image(sprite, this.x, this.y, 30 , 40);
};
this.remove = function() {
this.toDelete = true;
};
... | true |