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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2eacb5cfc03d877e7527afcf53532ee3144ce534 | JavaScript | nkvch/fancy-weather | /client/src/modules/render_modules/switchDegrees.js | UTF-8 | 1,482 | 2.859375 | 3 | [] | no_license | export default (appData) => {
const holder = document.getElementById('switch-degrees-holder');
holder.innerText = '';
const switchDeg = document.createElement('div');
switchDeg.className = 'btn-group';
switchDeg.role = 'group';
const csButton = document.createElement('input');
csButton.... | true |
e7a1bb46b50a8097f82405def46e80b8735391bb | JavaScript | wajahatabbas27/React-State-Assignment | /src/Room.js | UTF-8 | 1,036 | 3 | 3 | [] | no_license | import React, { useState } from 'react';
import './Room.css';
function Room() {
let [light, setLight] = useState(true);
let [temp, setTemp] = useState(72);
return (
<div className={`room ${light ? "on" : "off"}`}>
The light is {light ? "on" : "off"}
<br />
<butto... | true |
be8c8e8aa7b625d1510dccbc8a369727d5f4aebd | JavaScript | amanini/formacao-javascript-mestre-jedi | /missao-estelar/primeira-missao/amanini/js/js.js | UTF-8 | 240 | 2.5625 | 3 | [] | no_license | //deaclaração de variaveis
var missao = "Missão estelar JS em execução";
function eventoOnload(){
console.log("Evento onload disparado");
}
function eventoOnclick(){
console.log("Missão estelar realizada com sucesso");
} | true |
692143c54981ad286fe0ff9cb7a019a8a17ba37d | JavaScript | yan050/zuzuzu | /commands/fun/8ball.js | UTF-8 | 1,157 | 2.734375 | 3 | [] | no_license | const Discord = require('discord.js')
const config = require('../../config.json')
const emoji = require('../../emoji.json');
module.exports = {
name: "8ball",
description: "Bertanya Kepada 8ball",
category: "fun",
aliases: ["ask"],
run: async (bot, message, args) => {
let userArray = message.content.split(... | true |
ab6ed96d26d227a688c49828b118918a2f0f895a | JavaScript | ramemandi/gatsby-dipra-master- | /src/classes/MemberCompany.js | UTF-8 | 1,012 | 2.59375 | 3 | [
"0BSD"
] | permissive | import get from "lodash/get";
import { ContactInfo } from "./ContactInfo";
import { HyperLink } from "./HyperLink";
import { Img } from "./Img";
/**
* @class
* Object that represents member company
*/
export class MemberCompany {
/**
*
* @param {Object} node - result of NodeMemberCompanyFields
*/
const... | true |
36a4388b264a7d1a98478e04938c0b560127d141 | JavaScript | xalumok/web-project | /static/scripts/get-progress.js | UTF-8 | 903 | 2.765625 | 3 | [
"MIT"
] | permissive | $(document).ready(function()
{
var socket = new WebSocket('ws://127.0.0.1:8047');
socket.onmessage = function(event) {
let object = JSON.parse(event.data);
if (object.progress >= 0 && object.progress < 100)
{
$("#"+object.id+".progress-block").show();
$("#"+objec... | true |
f9b000e720f87aad19c4d6453129c761e359e309 | JavaScript | hxyalee/Algorithms | /invertBST.js | UTF-8 | 1,007 | 3.65625 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {TreeNode}
*/
// invert a tree in a way that left is right and right is left
var invertTree = function(root) {
if(root == null)
... | true |
cb3e44ea3126327d618b2f5f131d19e0f0fbbe97 | JavaScript | alexasalois/personal-projects | /cart345-2019/js/script.js | UTF-8 | 508 | 2.859375 | 3 | [] | no_license | // CART 345: Final Project
//
// by Alexandra Salois
//
var nameInput;
function changePage(page) {
console.log(page);
$("#page"+page).css('display', 'none');
page++;
$("#page"+page).css('display', 'block');
console.log(nameInput);
}
function saveName(name) {
nameInput = document.getElementById("name").val... | true |
571610754479071e4734c6cd5b5af21319adf57b | JavaScript | yurylunev/315573-pixel-hunter-2 | /js/components/game/game-model.js | UTF-8 | 1,612 | 2.6875 | 3 | [] | no_license | import {INITIAL_GAME} from "../../utils/game-data";
import {isFinalQuestion, getNextLevel} from "../../data/game-levels";
import {getCurrentQuestion, getQuestions} from "../../data/game-questions";
import {decreaseLives, isDead} from "../../data/game-lives";
import {addAnswer} from "../../data/game-score";
import {isTi... | true |
99fcd0d110845c2ee22fc66676a7425179e4647e | JavaScript | Caesar73/cobble | /src/function/pin.js | UTF-8 | 4,718 | 3.125 | 3 | [] | no_license | /**
* @file 定位元素
* @author zhujl
*/
define(function (require, exports, module) {
'use strict';
/**
* 解析配置中的横坐标值,可选值有以下几种:
*
* left (等价于 0%)
* center (等价于 50%)
* right (等价于 100%)
* xx% (百分比)
* xx (纯数字)
*
* @inner
* @param {Object} options
* @p... | true |
f734257b25fc4a7b08bace95a877e4b5b5bbbb76 | JavaScript | chilno/storyTime | /server/models/user.js | UTF-8 | 1,398 | 2.703125 | 3 | [] | no_license | var mongoose = require('mongoose');
var bcrypt = require('bcryptjs');
var Schema = mongoose.Schema
var userSchema = new mongoose.Schema({
fname: {
type: String,
required: [true, "Frist Name can't be empty"]
},
lname: {
type: String,
required: [true, "Last Name can't be empty"]
},
... | true |
9a78f788c58cd81759cacf1354b4c63c3a3a8bdc | JavaScript | pgmgent-2021-students/pgm-2 | /1pgm-a/week-1/college/oop.js | UTF-8 | 3,600 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | // OOP
// With constructor function
// Describe a person
function Person (firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
this.sayHello = function () {
return `Hi I'm ${this.firstName} ${this.lastName}`;
};
};
// Make an instance of the class Person
const person1 =... | true |
7435d5f218731a3307e40e871ade3d967df0ef5a | JavaScript | marcelosantosferreira/mortgagecalculatorangularjs | /test/unit/controllers/mortgagecontroller.js | UTF-8 | 2,959 | 2.640625 | 3 | [] | no_license | describe('Controller: mortgageController', function () {
// load the controller's module
beforeEach(module('mortgageCalculatorApp'));
var mortgageController, scope, filter;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope, mortgageFunctions) {
... | true |
44751e803b37d7e75f12f85baaaed02f27967d14 | JavaScript | lukassr/tesis-magister | /public/javascripts/traslucentType.js | UTF-8 | 4,192 | 2.703125 | 3 | [] | no_license | //var adjusted_width = limitant * 940
var adjusted_width = 1400;
//var adjusted_height = limitant * 626
var adjusted_height = 1000;
var pathData = "../images/type/";
var selectedYearFront = "2017";
var selectedYearBack = "2016";
var opacitySelected = 0.5;
function startVis(selectedYearFront, selectedYearBack, opaci... | true |
14e1343d1724bb9a48f7f0ecdeb54a99bcd01ede | JavaScript | Asystems0/MarkIt | /assets/js/tasks/getTasksByCategories.js | UTF-8 | 1,950 | 3 | 3 | [] | no_license | async function getTasksByCategories (category) {
const options = {
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
},
};
try {
const res = await fetch(`/tasks/${category}`, options);
const json = aw... | true |
139a9afdbd3d49db56f514c0447e085cd779bc3d | JavaScript | KholaH/chaos-game | /js/chaos.js | UTF-8 | 3,927 | 3.203125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
// varaiblea creation and initialization
var canvasAspectRatio = 5/4;//2 / Math.sqrt(3);
var canvas = document.getElementById('chaosCanvas');
var canvasCtx = canvas.getContext('2d');
var width = null;
var height = null;
var centerX = null;
var centerY = nu... | true |
fbfaef9bd4a8699afa9715b13da8aa4675f68e9b | JavaScript | StandyMerizier/codeWarsSolutions | /organiseDuplicateNumbersInList.js | UTF-8 | 1,146 | 4.25 | 4 | [] | no_license | //Sam is an avid collector of numbers. Every time he finds a new number he throws it on the top of his number-pile. Help Sam organise his collection so he can take it to the International Number Collectors Conference in Cologne.
//
//Given an array of numbers, your function should return an array of arrays, where each ... | true |
e64de8d783d740fb3afec762ff0065a0f2cc2089 | JavaScript | simiaquantum/simiaquantum.github.io | /serve_script.js | UTF-8 | 1,648 | 3.015625 | 3 | [] | no_license | // Store vars
var emojis = null;
// Define Renderers
// 'Location' column renderers
function renderLocation(location, $cell) {
const emoji = renderEmojis(location[0].countryFlag, $cell);
return `${location[0].city} ${emoji}`;
}
// Render emojis on load
function renderEmojis (shortcode, cellRef, $cell) {
let ret... | true |
0e2af494b3f0a493b95104eade723e9c2017efe1 | JavaScript | finitem/pig | /src/honeynet_web/honeywall/static/js/index.js | UTF-8 | 11,428 | 3.015625 | 3 | [] | no_license | /*
*index.js
*
*for index.html, for plotting chart in upper row and handling
*row clicks on main table
*
*/
/*
*Flot driven dynamic plot
*/
function plotChart() {
var jsonTrafficPoints = getTrafficPoints();
var allPackets = [];
var highPackets = [];
var mediumPackets = [];
var lowPackets = ... | true |
b6a96168979d85085c8583bfe205f2e72ae9e0f1 | JavaScript | nrotonda/js-high-low | /highlow.js | UTF-8 | 2,023 | 3.734375 | 4 | [] | no_license | //reference to the readline-sync library
const rs = require("readline-sync");
//variables for the basic gameplay loop
let startingNum = 0;
let aiNum = 0;
let playerStrikes = 0;
let playerPoints = 0;
//functions for logic control
function getRandomNum() {
return Math.floor(Math.random() * 100);
}
function getAINum(... | true |
0e9f6c999f56ab10aa6ccf8a3fbd1f89047ebfc5 | JavaScript | nwesthoff/code39-yt-scan | /src/js/main.js | UTF-8 | 2,181 | 2.625 | 3 | [] | no_license | jQuery(document).ready(onDocReady);
function onDocReady () {
console.log('jQuery done');
initScan();
}
var code;
var lastResult;
function initScan(){
Quagga.init({
inputStream : {
name : "Live",
type : "LiveStream",
constraints: {
facingMode: "environment",
},
target: document... | true |
67ff08bcd5fbc90ffbb61a8f616e59546d807b4e | JavaScript | Stv171/UI.Library | /src/js/lib/ajax-content.js | UTF-8 | 6,374 | 2.59375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
ToDo: modify to support variations
data-ajax-form:
---------------
Example 1: with submit button
<div data-ajax-form="MyAjaxContentBody">
<form action="/new-cars/data/cars-in-stock" method="get">
<label for="State">Location</label>
<select name="numbers">
<option value="">Choose a ... | true |
400def0803c14597b78486000a120c2faec8dedb | JavaScript | mikeqle/mern_feb_2021 | /w1d2/04_chaining/function_chaining.js | UTF-8 | 2,110 | 4.5625 | 5 | [] | no_license | //------------------------------------------------------------------------------
// this is a special case where you CANNOT use an arrow function
// it MUST have its own context to call the "new" keyword
// typescript will suggest you convert this to a class instead of a function
// it will require a constructor
... | true |
3e42719e0abeb35f348433f54297051bb879f328 | JavaScript | leandersonti/Ini_vuejs | /js/app.js | UTF-8 | 896 | 2.5625 | 3 | [] | no_license | const vm = new Vue({
el:"#app",
data:{
produtos:[],
produto: false
},
filters:{
FormatPreco(preco){
return preco.toLocaleString("pt-BR", {style:"currency",currency:"BRL"});
},
maiuscula(valor){
return... | true |
45da2552ef1b088e9baeaf48c995d2964211642d | JavaScript | dengsongchang/LianFa.ShopPlatform | /代码/static/LianFaPlatformAdmin/public/js/validate.js | UTF-8 | 6,558 | 2.859375 | 3 | [
"MIT"
] | permissive | var Validate = {
//为空校验
emptyValidate: function (ele, msg, defaultValue) {
var ele = Common.getJqueryObj(ele);
var value = $.trim(ele.val());
var defaultValue = defaultValue || "";
if (value == "" || value == defaultValue) { //未输入值或者是默认值
Common.showInfoMsg(msg, ele);
... | true |
ef6130c2c7bb684cf4081fdbbe64eaba3f2670b9 | JavaScript | GerardRodes/RiojaSlider | /src/js/riojaslider.js | UTF-8 | 23,701 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* RiojaSlider 0.1v
*
* Copyright 2016, Gerard Rodes https://github.com/GerardRodes
*
* Released under the MIT license - http://opensource.org/licenses/MIT
*/
/*
Inserts svg icons to structures following this pattern
[data-social-links] Wrapper attribute
|-> [data-name] Link element attribu... | true |
5759aebdfd215c8d9245d8f2ccf22fc0ac13031e | JavaScript | kaiasahite/readMe-generator | /Develop/index.js | UTF-8 | 2,047 | 2.953125 | 3 | [
"Unlicense"
] | permissive | const inquirer = require("inquirer");
const fs = require("fs");
const util = require("util");
const writeFileAsync = util.promisify(fs.writeFile);
const promptUser = () =>
inquirer.prompt([
{
type: "input",
name: "title",
message: "What is your project title?",
},
{
type: "input"... | true |
793d3db53c2b37b22d50379f0cc496aee7c7c415 | JavaScript | GW2Treasures/gw2treasures.com | /legacy/wvw-crawler/lib/Crawler.js | UTF-8 | 1,154 | 2.640625 | 3 | [
"MIT"
] | permissive | const Api = require('gw2api-client').default;
class Crawler {
constructor() {
this.updateCallback = () => {};
this.started = false;
this.interval = 0;
this.api = new Api();
this.update = this.update.bind(this);
}
onUpdate(callback) {
this.updateCallback = c... | true |
cee53e961b8f59cdf91b0889e8b0082beff29330 | JavaScript | daviduffy/reversi | /src/services/localStorage.js | UTF-8 | 917 | 2.609375 | 3 | [] | no_license | const databaseName = 'reversi';
export const getDB = () => new Promise((res /* rej */) => {
const prevJSON = window.localStorage[databaseName];
let storedState;
try {
storedState = JSON.parse(prevJSON);
} catch (err) {
// console.log('no stored state');
storedState = {};
}
// console.log({ stor... | true |
a99be23ba353dbb1d05b94d238c4917e116c6a83 | JavaScript | AbhiGames10/Newton | /sketch.js | UTF-8 | 1,456 | 3.078125 | 3 | [] | no_license | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint = Matter.Constraint;
var roofObject;
var rope1, rope2, rope3, rope4, rope5;
var bob1, bob2, bob3, bob4, bob5;
//Create multiple bobs, mulitple ropes varibale here
function setup() {
cre... | true |
c3edb3b8d93b19fc8a47fe9920813ec862062a6d | JavaScript | orlando-paredes-hamsho/tic-tac-toe | /test/player-test.js | UTF-8 | 1,979 | 2.9375 | 3 | [] | no_license | import chai, { expect } from 'chai';
import make_player from '../src/factories/make-player';
let player;
describe('Player', () => {
context('Creating a player', () => {
context('Player gets created correctly', () => {
beforeEach('Create player', () => {
player = make_player('x');
});
... | true |
14582b6b5995d10733a8d2831bb2ddeefe1b1938 | JavaScript | Avaddov/DevInstitute | /Week2/Day5 - Projects/Projects/calc.js | UTF-8 | 1,068 | 4.15625 | 4 | [] | no_license | // function(add){}
// function(multiply){}
// function(subtract){}
// function(divide){}
let calcDisplay = document.getElementById("display"); //html source
// console.log(calcDisplay) //
let calcstr = "";
//fetches the info from the HTML to make the buttons function upon being clicked.
function buttonclick(btn) {
c... | true |
51d82f61c7e01e5cb796cf3bfb5a87f7bc0a6609 | JavaScript | hrharder/js-ntl | /paradigm.js | UTF-8 | 2,336 | 2.734375 | 3 | [] | no_license | function openConnection(rootUrl, id, key){
const connection = new BigchainDB.Connection(
rootUrl,
{
app_id : id,
app_key : key
});
return connection;
}
function keyPair(){
const pair = new BigchainDB.Ed25519Keypair();
return {
'pub' : pair.publicKey,
'priv' : pair.pri... | true |
9c78012b563691512b21194edc9cd8aa2b56cb69 | JavaScript | LILITA91/tasklist | /lesson.js | UTF-8 | 1,134 | 3.578125 | 4 | [] | no_license | window.addEventListener("load", function(){
let tasklist=[];
const name= document.getElementById("text");
const description=document.getElementById("txtarea");
const button=document.getElementById("btn");
class Task{
constructor(name, description){
this.name=name;
this.description=descript... | true |
c10d68ea5b6e5bea88f13000c760d575081a81b3 | JavaScript | PierreVelluet/FunHistory_back | /.history/services/countries/index_20210729101026.js | UTF-8 | 699 | 2.734375 | 3 | [] | no_license | //Read
const { Country } = require("../../models/Countries");
exports.create = (req, res) => {
// Validate request
if (!req.body.name) {
res.status(400).send({ message: "Content can not be empty!" });
return;
}
// Create a Tutorial
const country = new Country({
name: req.b... | true |
e7ee30f4efe8a1687e328fc6556fee8721e8be14 | JavaScript | Darktangent/node | /Notes-App-2019/notes.js | UTF-8 | 1,887 | 3.234375 | 3 | [] | no_license | const fs=require('fs')
const chalk=require('chalk')
//getting notes function
const getNotes=()=>{
return ( 'Your notes' )
}
const readNote=(title)=>{
const notes=loadNotes();
const note=notes.find(note=>{
return note.title===title
})
if(note){
console.log(chalk.inverse.green(note.title))
console.l... | true |
25da0ffd725c8f418c631509790c0f45c3119257 | JavaScript | corvinofrancesco/enterpriseGL | /enterpriseGL-client/src/main/javascript/core/ui/MouseSelector.js | UTF-8 | 1,612 | 2.984375 | 3 | [] | no_license | /**
* This class manage the input of mouse on graphic element
* @param camera object with information of current position of point of view
* @param plane graphical object with
*/
EntGL.MouseSelector = function(){
this.camera = EntGL.Graphics.camera;
this.plane = EntGL.Graphics.plane;
this.objects = En... | true |
212559f142b10d3fc9cf16ee47a35068ee3f2bed | JavaScript | syscover/pulsar | /public/plugins/phpjs/functions/strings/substr_replace.js | UTF-8 | 1,118 | 3.015625 | 3 | [
"MIT"
] | permissive | function substr_replace(str, replace, start, length) {
// discuss at: http://phpjs.org/functions/substr_replace/
// original by: Brett Zamir (http://brett-zamir.me)
// example 1: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0);
// returns 1: 'bob'
// example 2: $var = 'ABCDEFGH:/MNRPQR/';
// example ... | true |
d175624c2afcd957596b26fd99f9bc7ee4c34892 | JavaScript | vmrch/more-angular | /jqui/js/script1.js | UTF-8 | 1,681 | 3 | 3 | [] | no_license | (function() {
var eventUtility;
alert(option.value);
var form = document.getElementById("theForm");
button = form.myButton,
textbox = form.myTextbox,
select = form.dayOfWeek,
color = form.color,
textarea = form.myTextArea;
eventUtility.addEvent(form,"submit", function(evt) {
ev... | true |
230200ecace7d708400cb7f014deba96f35e2134 | JavaScript | ussama130/js | /app.js | UTF-8 | 5,011 | 3.78125 | 4 | [] | no_license |
// num = 2
// for ( var loopCount=1 ; loopCount<=20 ; loopCount=loopCount +1) {
// prompt(num + " x " + loopCount + " = " + num*loopCount)
// }
// var polititianName = prompt("ENter your fav polititian?")
// if (polititianName == 'zardari')
// {
// alert("ek zardari sub par bhari")
// }
// else... | true |
675fd052f966899df24f67b54433654c71ed5384 | JavaScript | fabiokr/simple-scrum | /public/javascripts/tickets.js | UTF-8 | 1,027 | 2.578125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
formSpecifics();
});
function formSpecifics() {
showPrioritySlider();
showEstimativeSlider();
}
function showPrioritySlider() {
$('input#ticket_priority')
.attr("readonly","readonly")
.attr('tabindex', '')
.after('<br/><span class="slider clearfix" id... | true |
81ddde07734b5cf295d1664d4c6dfe24aa4496ce | JavaScript | shymaSane/connect-mern- | /server/utils/profileFormValidation.js | UTF-8 | 905 | 2.734375 | 3 | [] | no_license | //validate prfoile
const validator = require('validator');
module.exports = (req, res, next) => {
let {bio, rules, websites} = req.body
let errors = {};
//validate aginest null and undefined
if(bio === null || bio === undefined) {bio = ""}
if(rules === null || rules === undefined) {rules =... | true |
d7f6dd2e9076594b108347940d38d2dc8ada20b7 | JavaScript | alexpate/www | /js/theme-toggle.js | UTF-8 | 937 | 3.078125 | 3 | [] | no_license | function changeColorScheme(newColorScheme) {
localStorage.colorScheme = newColorScheme;
document.body.dataset.theme = newColorScheme;
return;
}
function toggleColorScheme() {
const newColorScheme = localStorage.colorScheme === 'dark' ? 'light' : 'dark';
return changeColorScheme(newColorScheme);
}
const the... | true |
f737029374d1d8de3eebfb51aa1e4bd1abdbc1a0 | JavaScript | greenfox-velox/fabicspeter | /week-09/day-01/01.js | UTF-8 | 451 | 2.578125 | 3 | [] | no_license | 'use strict'
var http = require('http');
var server = http.createServer(function(req, res) {
var path = req.pathname;
res.writeHead(200, {'Content-Type': 'text/plain'});
var currentDate = new Date();
var minutes = currentDate.getMinutes();
var hours = currentDate.getHours();
var seconds = currentDate.get... | true |
03b9bbc08cbee9608e1cb4534b3b2876838b9b4d | JavaScript | SmilingJey/ha-keksobooking | /js/form.js | UTF-8 | 4,248 | 2.59375 | 3 | [] | no_license | 'use strict';
(function () {
var MinPriceForType = {
bungalo: '0',
house: '5000',
palace: '10000',
flat: '1000'
};
var adFormElement = document.querySelector('.ad-form');
var fieldsetElements = adFormElement.querySelectorAll('fieldset');
var selectTypeElement = adFormElement.querySelector('#... | true |
f75601003753199a602862c6a1cdb458158a0d84 | JavaScript | skywalker-1993/complete-javascript-course | /01-Fundamentals-Part-1/starter/assignments.js | UTF-8 | 208 | 3 | 3 | [] | no_license | let country = 'Portugal';
let continent = 'Europe';
let population = 10.28;
console.log('Country: ' + country);
console.log('Continent: ' + continent);
console.log('Population (in Millions): ' + population); | true |
45847fd319d48efe3c64757a1d491e4b53e56357 | JavaScript | Talentjun/React-Family | /src/components/Hoc.js | UTF-8 | 1,770 | 3.25 | 3 | [] | no_license | /* import React, { Component } from 'react';
function Kaikeba(props){
return(
<div>{props.stage} - {props.name}</div>
)
}
//高阶组件 实际是一个函数
const withName = Comp =>{//Comp是接收进来的组件
//重写组件的生命周期
class NewComponent extends Component{
componentDidMount(){
console.log('do somethi... | true |
85abad62724bdab1eadf6e87ed54c56f0f28e53e | JavaScript | Ahror0248/React- | /array10.js | UTF-8 | 408 | 3.203125 | 3 | [] | no_license | let n=[ 92, 57, 48, 49, 67, 45, 19, 99, 77, 85, 41, 94, 42, 66, 66, 59, 18, 97, 10, 20 ]
let p=[]
let r=[]
for(let i=0; i<n.length; i++){
if(n[i]%2==0){
p.push(n[i])
}
p.sort((a,b)=>a-b);
}
for(let i=0; i<n.length; i++) {
if(n[i]%2!==0) {
r.push(n[i])
}
r.sort((a,b)=>... | true |
7ce8612d4df1a89059859f37643491254fd1e839 | JavaScript | CitrineInformatics/public_search | /dist/materialPage/materialStatistics/extract/composition.js | UTF-8 | 1,048 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function processCompositionStatistic(stat) {
if (stat.count > 0) {
return stat.average;
}
return undefined;
}
function extractComposition(queryResponse) {
var composition = queryResponse.results.analysis.element;
if (composit... | true |
ecc796fe9efc814870784113e1b20b88377e69ff | JavaScript | pejade14/sample-website | /js2.js | UTF-8 | 1,015 | 3.140625 | 3 | [] | no_license | function login(){
var email = document.forms["loginform"]["email"];
var pw = document.forms["loginform"]["pw"];
var email = document.getElementById("email");
var pw = document.getElementById("pw");
email.addEventListener("blur", emailVerify, true);
pw.addEventListener("blur", pwVerify, true);
if(... | true |
d00e1e38168d8b2b1a3a0746ae98453eae46f120 | JavaScript | AkhilVasudevan/LearningDocument | /JavaScript/Exercise Files/01_07 Classroom Attendance/begin.js | UTF-8 | 548 | 3.328125 | 3 | [] | no_license | /*
WRITE YOUR SOLUTION HERE
*/
function getStudents(classRoom)
{
let {hasTeachingAssistant, classList}=classRoom;
let teacher, teachingAssitant, students;
if(hasTeachingAssistant)
{
[teacher,teachingAssitant,...students]=classList;
}
else
{
[teacher,...students]=classList;
}
return students;... | true |
9d05c7b3ab434410923c3f7802313c1550d8e73f | JavaScript | vinil91/eko-delivery | /src/models/Graph.js | UTF-8 | 3,741 | 3.25 | 3 | [] | no_license | import find from 'lodash/find';
import pull from 'lodash/pull';
import min from 'lodash/min';
class Graph {
constructor(edges) {
const initialVertexes = (edges) => {
const result = [];
edges.forEach((edge) => {
if (result.indexOf(edge.start) === -1) result.push(edge.start);
if (result... | true |
0d163ccce0887de2a4ed59665f7dadcbb50656c0 | JavaScript | Griffollion/BankCreditsListing | /FrontendAsset/footer-links-list.js | UTF-8 | 2,537 | 3.109375 | 3 | [
"MIT"
] | permissive | $(window).load(function () {
/*Функция записи общей высоты элемента в дата атрибут*/
function saveTotalHeight(el) {
var totalHeight = el.outerHeight(true);
el.attr('data-height', totalHeight);
}
/*Функция записи высоты определенного количеста пунктов дата атрибут*/
function saveFixe... | true |
395505305eef0e3f1280ebbd0b03f24723555c20 | JavaScript | SilasYa/2021_SU_Algorithms | /第5课 课件+四种语言模板+代码/lc684 冗余连接(DFS找环法).js | UTF-8 | 950 | 3.234375 | 3 | [] | no_license | /**
* @param {number[][]} edges
* @return {number[]}
*/
var findRedundantConnection = function(edges) {
var n = 0
for (let e of edges) {
n = Math.max(n, e[0])
n = Math.max(n, e[1])
}
// 模板:出边数组初始化
var edge = [];
for (let i = 0; i <= n; i++) edge[i] = [];
var visit = [];
... | true |
5d1b88c92be67bef8c6b656d968e9fcb2a732f69 | JavaScript | kilfoofan/Laitinen | /Laitinen/admin.js | UTF-8 | 22,668 | 2.828125 | 3 | [] | no_license | //Tämä tiedosto sisältää kaikki javaScript-koodit käyttäjien hallintaa varten
//This file contains all javaScript for handling users
$(document).ready(function() {
var data, call, url, whereTo;
var userExists = 1;
$(
"#registerDialog, #uInfoDialog, #aInfoDialog, #userDevicesDialog, #adminGetDevicesDia... | true |
ecf34187c746d6409b759cb02bd211f927f7fd2e | JavaScript | meteor/superdeduper | /lib/constraint-solver/datatypes/package-and-version.js | UTF-8 | 780 | 3.328125 | 3 | [
"MIT"
] | permissive | // An ordered pair of (package, version).
const PackageAndVersion = function (pkg, version) {
// check(pkg, String);
// check(version, String);
this.package = pkg;
this.version = version;
};
// The string form of a PackageAndVersion is "package version",
// for example "foo 1.0.1". The reason we don't use an... | true |
d502f5bdbc1cc783f196cf66f32b171e84e3ca7f | JavaScript | AnaMoros/portfolio | /script.js | UTF-8 | 1,547 | 2.875 | 3 | [] | no_license | "use strict";
// open and close the side navigation when resizing the device
const navMinWidth = window.matchMedia("(min-width: 768px)");
const openMenuBtn = document.getElementById("open-menu");
const closeMenuBtn = document.getElementById("close-menu");
const mainNav = document.getElementById("main-nav");
const overl... | true |
3ed0a6c526b767945243b212760c193dc07cb334 | JavaScript | instructors-sei-curiosity/fewd-nyc | /materials/class15/compare-that/js/app.js | UTF-8 | 301 | 3.15625 | 3 | [] | no_license | $('#submit').click(compare)
function compare() {
var valueA = $('#a').val()
var valueB = $('#b').val()
if (valueA === valueB) {
$('#comparison').html('===')
} else if (valueA > valueB) {
$('#comparison').html('>')
} else if (valueA < valueB) {
$('#comparison').html('<')
}
}
| true |
b6f2a564697bfc3e94450e6910a3a7ab8bcb5812 | JavaScript | spookyvert/thetrumpeffect | /js/pop.js | UTF-8 | 4,260 | 3.390625 | 3 | [
"MIT"
] | permissive | /*
powered by Bronx Academy for Engineering Students
Huberto Martinez
Shemar Dacosta
Eram Manasia
Franklin Benjamin
*/
// Population Info
//
// Observed Years
var a = 2010;
var b = 2011;
var c = 2012;
// NYC population
var ny2010 = 8190000;
var ny2011 = 8273000;
var ny2012 = 8344000;
//Miami Population
var mi... | true |
56909fc0728e3e8b33875382b8f5a1a20502dc31 | JavaScript | ryb73/dealers-choice-meta | /packages/game-states/lib/player-turn-begin-state.js | UTF-8 | 2,356 | 2.765625 | 3 | [
"MIT"
] | permissive | "use strict";
module.exports = PlayerTurnBeginState;
const _ = require("lodash"),
TurnChoice = require("dc-constants").TurnChoice,
AllowSecondDcCard = require("./allow-second-dc-card"),
AllowOpenLot = require("./allow-open-lot"),
buyFromAutoExchange = requir... | true |
90dde373dd22d5c4907f607b61e4b1d6da272ffb | JavaScript | davydhong/mini-apps | /refactoring/employee-type/Employee.js | UTF-8 | 1,081 | 3.5625 | 4 | [] | no_license | class EmployeeType {
constructor(aString) {
this._value = aString;
}
toString() {
return this._value;
}
}
class Employee {
constructor(name, type) {
this.validateType(type);
this._name = name;
this._type = type;
}
validateType(arg) {
if (!['engineer', 'manager', 'salesman'].incl... | true |
17ca0149bfd216d7b7f99111375a6f351998853a | JavaScript | GeoJanik/locV-lo | /assets/js/map.js | UTF-8 | 5,105 | 2.75 | 3 | [] | no_license | class Carte {
constructor() {
this.map = "";
this.apiKeys = "4dc3f8e09a4de492801a441ad990edfc97f58400";
this.lattitudeMap = 43.6;
this.longitudeMap = 1.43;
this.city = "toulouse";
this.availableBikes = document.getElementById("availableBikes");
this.detailStat... | true |
8fdd05041f439a2b451d219b509305ac1a49b3a4 | JavaScript | kjurczyk/human-computer-distraction | /BaseChromeExtension/facilitateNudge.js | UTF-8 | 1,216 | 2.625 | 3 | [] | no_license | var startButton = document.getElementById("start-button");
var snoozeButton = document.getElementById("snooze-button");
var notificationContent = document.getElementById("notificationContent");
var timeIsUp = document.getElementById("timeIsUp");
switch (localStorage.getItem("currentPart")) {
case "0":
// f... | true |
68ebd2ce48f669b102e893934ed9a7832d1d3aa6 | JavaScript | BrianCarela/TKH | /todolist/todolist/src/Form.js | UTF-8 | 622 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
class Form extends Component {
constructor() {
super();
this.state = {
userText: ''
}
}
updateText(event) {
this.setState ({
userText: event.target.value
})
}
pushTask() {
this.props.new(this.state.userText)
this.setState ({
... | true |
4c7146a0790d486de46bdc387796b28645f22354 | JavaScript | anstokes/babel-plugin-tcomb | /test/fixtures/function-return-type/expected.js | UTF-8 | 592 | 3.15625 | 3 | [
"MIT"
] | permissive | function foo(x, y) {
_assert(x, _t.Number, "x");
_assert(y, _t.String, "y");
const ret = function (x, y) {
return x + y;
}.call(this, x, y);
_assert(ret, _t.String, "return value");
return ret;
}
function bar(x, y) {
_assert(y, _t.String, "y");
const ret = function (x, y) {
return x + y;
... | true |
862a5044ba0fa30d483c27dc40bf9bfaf5c58cb7 | JavaScript | gokoku/illustrator_checker | /_checker/lockedItemCheck.jsx | UTF-8 | 794 | 3 | 3 | [] | no_license | // PathItem からロックオブジェクトを津ェックする
// モジュールパターンを使ったクロージャなので結果を蓄積出来る
// usage:
// for(var i=0; i<pathItems.length; i++) { lockedItemCheck.process( pathItems[i] ) }
// lockedItemCheck.result()
var lockedItemCheck = (function() {
var message = []
var result = false
return {
process: function(item... | true |
8321c858f7ac8e8bb7383e2322d4e85033e6f87f | JavaScript | mahendiranp/my-app | /src/component/ImagePlaceholder.js | UTF-8 | 614 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import PlaceHolder from './../assets/150.png';
class ImagePlaceholder extends React.Component {
constructor(props) {
super(props);
this.state = {
src: this.props.url,
errored: false,
};
this.onError = this.onError.bind(this)
}
onError() {
... | true |
95d95bc0f9264f2aa77e288bfdd384e0c070bac3 | JavaScript | teamjann/greenfield | /react-client/src/components/Upvote.jsx | UTF-8 | 2,173 | 2.609375 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
class Upvote extends React.Component {
constructor(props) {
super(props);
this.state = {
canClick: true,
categoryId: this.props.categoryId,
courseId: this.props.courseId,
};
}
componentDidMount() {}
handleUpvoteClick() {
/... | true |
de14b793a4e3ac42a89411c92ce02e3f3dc93bf6 | JavaScript | Leandroluna12/CursoIngresoJS | /9-Parciales/2018_1Cuatri_Parcial_fuentes/uno.js | UTF-8 | 377 | 3.453125 | 3 | [] | no_license |
function mostrar()
{
var ancho;
var largo;
var perimetro;
ancho = prompt("Ingrese ancho del rectangulo aqui ");
largo = prompt("Ingrese largo del rectangulo aqui");
ancho = parseFloat(ancho);
largo = parseFloat(largo);
ancho = ancho * 2 ;
largo = largo * 2 ;
perimetro = ancho + largo ;
alert("El perime... | true |
37f1922f0f46b7ddfdbb93dd548ab1b5a172dc27 | JavaScript | Vilzz/pds-data-fetch | /domparser/parser.js | UTF-8 | 596 | 2.8125 | 3 | [] | no_license | import xmldom from 'xmldom'
const DOMParser = xmldom.DOMParser
const parser = new DOMParser()
const getParsedDOMText = (domstr) => {
let dom = parser.parseFromString(domstr, 'text/html')
let text = ''
walkDOM(dom, function (node) {
if (node.tagName === 'BR') {
text += node.outerHTML
} else if (nod... | true |
7e358c09f0da455a05d857e82a954c1a0b252766 | JavaScript | Liliaborrazas/timecare-api | /controllers/users.controller.js | UTF-8 | 2,346 | 2.5625 | 3 | [] | no_license | const mongoose = require('mongoose');
const User = require('../models/user.model');
const ApiError = require('../models/api-error.model');
module.exports.create = (req, res, next) => {
console.log('llego');
req.body.role = req.body.role.toLowerCase();
User.findOne({
email: req.body.email
})
.then(u... | true |
8464c943a9fe1e5be6439391b7f51d718489fc5a | JavaScript | lequocdatfit/UpDownValue-react | /src/App.js | UTF-8 | 680 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import UpDownBtn from './components/UpDownBtn';
class App extends Component{
constructor() {
super();
this.state = {
globalValue : 0,
}
}
handleBtnUpClicked() {
this.setState({
globalValue: ++this.state.globalValue,
})
}
handleBtnDow... | true |
f43ff33a94c55e945ac6a3799fceb7eb6311f107 | JavaScript | alextolstov/chicago-apt | /chicago-web/src/api/PersonNameLocalizeApi.js | UTF-8 | 859 | 2.640625 | 3 | [
"MIT"
] | permissive | import {language} from '../index';
export default class PersonNameLocalizeApi {
constructor() {
this.fio = ['ru', 'uk', 'be'];
}
toPersonName = (first, middle, last) => {
return ((this.fio.indexOf(language) === 0) ? last + ' ' + first + ' ' + middle :
first + ' ' + middle + (middle.length > 0 ? ' ... | true |
eabd5833151ceed62a68bbd437e0f877573d3149 | JavaScript | anish-experiment/code-review-tool | /bonus.js | UTF-8 | 549 | 2.8125 | 3 | [] | no_license | function padDecimal(number) {
if (parseInt(+number) === +number) return `${number}.0`;
return number;
}
export function renderBonusAmount(amount, unit) {
const formatter = {
DOLLAR: (amount) => `${'$' || ''}${amount || ''}`,
HOURS: (amount) => `${amount || ''} ${'hr' || ''}`,
DOLLARS_PER_HOUR: (amou... | true |
10f680d6be9084485aca4d211687128937800dc1 | JavaScript | iwillwen/pubjs | /lib/middlewares/query.js | UTF-8 | 1,095 | 2.96875 | 3 | [] | no_license | define(function(require, exports, module) {
module.exports = function() {
return function(app, next) {
var search = window.location.search;
app.query = queryParser(search.substring(1));
next();
}
};
function queryParser(quertstring) {
var _tmp1 = quertstring.split('&');
var qu... | true |
5bcabf64fd6e489d63f4b7d2abf6639e568d385d | JavaScript | davidhopper/pavilionStats | /TJP/populate_games.js | UTF-8 | 1,459 | 2.875 | 3 | [] | no_license | // set requirements & import analyze
const fs = require('fs');
const getJSON = require('get-json');
// declare variables
let page = 1;
let pageLength = 0;
let dataArray = [];
let urlBase = 'https://thejoustingpavilion.com/api/v3/games?page='
// check if data.json is populated
fs.readFile('./data.json', 'ut... | true |
09ac3a3c608ba34ce56f802b12460360b179fe66 | JavaScript | wellflat/imageprocessing-labs | /cv/corner_detection/cornerdetect.js | UTF-8 | 7,095 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* Corner Detector module
*/
(function() {
var CornerDetector; // top-level namespace
var _root = this; // reference to 'window' or 'global'
if(typeof exports !== 'undefined') {
CornerDetector = exports; // for CommonJS
} else {
CornerDetector = _root.CornerDetector = {};
}
var version ... | true |
267f05ff1f5674c3ea5d7cc193bedddb81126f01 | JavaScript | afsana1210/Javascript_Training | /objects/objectForInLoop.js | UTF-8 | 158 | 3.296875 | 3 | [] | no_license | var student={
firstName:"John",
lastName:"Smith",
age:20,
};
var txt=" ";
for(var x in student){
txt +=student[x]+" ";
}
console.log(txt);
| true |
cc6d53098e0fa0683bbcd6809de4a042d624ae55 | JavaScript | C-likethis123/regex-engine | /RegexpNode/RepetitionNode.js | UTF-8 | 556 | 2.671875 | 3 | [] | no_license | const {RegexpNode, NeverMatches} = require('./RegexpNode.js');
const AlternationNode = require('./AlternationNode.js');
/**
* Represents the repetition node in Regex
*/
class RepetitionNode extends RegexpNode {
constructor(next) {
super();
this.head = NeverMatches;
this.next = next;
}
derive(char)... | true |
d28d8e3719f8ffdffbd78474f75386904a0e7bd9 | JavaScript | sandip2451984/trivago-case-study | /web/js/src/ReviewsAnalyzer.js | UTF-8 | 2,955 | 2.578125 | 3 | [] | no_license | "use strict";
module.exports = class {
showTestAnalyzerModal() {
$('#testAnalyzerModal').modal();
};
testAnalyzeAndRenderResults() {
const jsonRenderer = $('#json-renderer');
jsonRenderer.empty();
$('<span>Analyzing...</span>').appendTo(jsonRenderer);
$.ajax({
... | true |
9b62b1dfe5866f38f332c205818695dc7642ee57 | JavaScript | TwaMarta/goit-js-hw-06 | /js/task-07.js | UTF-8 | 208 | 3.109375 | 3 | [] | no_license |
const input = document.getElementById('font-size-control');
input.addEventListener('input', function() {
const size = input.value;
document.getElementById(`text`).style.fontSize = size + "px";
}); | true |
102a270a8e9f80efecd555df276090bab9095da5 | JavaScript | DanMike1/Lab7 | /asset/js/slide.js | UTF-8 | 1,057 | 2.78125 | 3 | [] | no_license | const slide1 = document.getElementById("meSlide1")
const slide2 = document.getElementById("meSlide2")
const slide3 = document.getElementById("meSlide3")
$('.carousel').carousel({
interval: 20000
});
$('.carousel').on('slid.bs.carousel',async function (e) {
if (slide1){
let geturl = await fetch('... | true |
eeac8ef4091f0a4776961569cdded6c8a083af98 | JavaScript | PashaKarlin/YarandinTestTask | /src/components/Films.js | UTF-8 | 1,711 | 2.8125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import axios from 'axios'
import Film from './Film'
import Navbar from './Navbar'
const Films = () => {
const [data, setData] = useState([])
const [searchTerm, setSearchTerm] = useState('')
const [sorted, setSorted] = useState(false)
const sortedData =... | true |
cc47ffeae8140e93ab2f880a8c23b96eba770d69 | JavaScript | MinskyNg/leetcode | /092_ReverseLinkedListII.js | UTF-8 | 724 | 3.4375 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @param {number} m
* @param {number} n
* @return {ListNode}
*/
var reverseBetween = function(head, m, n) {
var result = new ListNode(0),
mHead = r... | true |
6ae6c0f4c501498285abac1cc99f755fb8e9ea0a | JavaScript | hemisu/code-interview | /16 包含min函数的栈.js | UTF-8 | 551 | 4 | 4 | [] | no_license | /**
定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数
(时间复杂度应为O(1))。
*/
let stack = [];
let minStack = [];
function push(node)
{
// write code here
stack.push(node);
if(node <= minStack[minStack.length - 1]) minStack.push(node);
else minStack.push(minStack[minStack.length - 1] || node);
}
function pop()
{
minStack.pop... | true |
da35efbb9c4e19dc98b32fe34bd19977dea34aab | JavaScript | JeahaOh/jsStudies | /Velopert'sJS/Part01/25_Array.filter.js | UTF-8 | 323 | 2.71875 | 3 | [
"MIT"
] | permissive | const todos = [
{
id: 1,
text: 'js',
done: true
},
{
id: 2,
text: 'function',
done: true
},
{
id: 3,
text: 'object',
done: true
},
{
id: 4,
text: 'array',
done: false
},
];
const tasksNotDone = todos.filter( todo => todo.done );
console.log( tasksNotDone... | true |
53abd23182bb157f798b596442b64e7d64ee3500 | JavaScript | glalev/projectEuler | /js/problems/Problem53.js | UTF-8 | 946 | 3.984375 | 4 | [] | no_license | /*
There are exactly ten ways of selecting three from five, 12345:
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
In combinatorics, we use the notation, 5C3 = 10.
In general,
nCr =
n!
r!(n−r)!
,where r ≤ n, n! = n×(n−1)×...×3×2×1, and 0! = 1.
It is not until n = 23, that a value exceeds one-million: 23C10 = 1... | true |
e542e525aeac5094005b48fb6c681bbb9db54e8c | JavaScript | calvinfreese/Jasmine-RPG | /routes/apiRoutes.js | UTF-8 | 3,087 | 3.03125 | 3 | [
"MIT"
] | permissive | var db = require("../models");
module.exports = function(app) {
// Get all characters
app.get("/api/characters", function(req, res) {
db.characters.findAll({}).then(function(dbChars) {
res.json(dbChars);
});
});
// get One Character
app.get("/api/characters/:id", function(req, res) {
... | true |
fa3455d0220ddc894c9b546942ff8dd114d6b7f1 | JavaScript | Amigo1995/JavaScriptCourse | /homeworks/Dmytro.Isaiev/hw4/task1.js | UTF-8 | 389 | 3.46875 | 3 | [
"MIT"
] | permissive | /**
* Calculates Сommon Divisor
* @param {number} num1
* @param {number} num2
* @returns {number} Returns Сommon Divisor.
*/
const commonDevisor = (num1, num2) => {
let a = Math.abs(num1);
let b = Math.abs(num2);
while (a && b){ a > b ? a %= b : b %= a; }
a += b;
return a;
};
conso... | true |
23e462dc55a29b577f3b9f8d04d3e3e5b83e0455 | JavaScript | Kardinam/Final-Proejct | /Space101/Scripts/app/services/terrainService.js | UTF-8 | 296 | 2.515625 | 3 | [] | no_license | let TerrainService = () => {
let deleteTerrain = function (id, done, fail) {
$.ajax({
url: `/api/terrains/${id}`,
method: "DELETE"
})
.done(done)
.fail(fail);
};
return {
deleteTerrain: deleteTerrain
};
} | true |
ffe4b2b6097d697a4b849dbfa0d11597826d941f | JavaScript | Shoehart/kolejnosc_w_menu_LD | /kolejność_w_menu_LD.js | UTF-8 | 1,452 | 2.9375 | 3 | [] | no_license | // ==UserScript==
// @name Kolejność w menu - ver 2.
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Przestawia kolejność w menu w LD
// @author RShT
// @match https://servicedesk.net.pp/SD_Operator.WebAccess/wd/*
// @match https://servicedesk.net.pp/SD_Klient... | true |
0a48e54a54da6b1b47db8af76dbc3e4635213035 | JavaScript | craigcabrey/mission-control | /src/js/filters/count-filter.js | UTF-8 | 511 | 2.796875 | 3 | [
"MIT"
] | permissive | /**
* Created by kocsenc on 7/29/15.
* FILTER designed to return an empty array.
* Useful for using ng-repeat for n number of times, rather than iterating
* through an array. (creates empty array
*
* SEE: http://stackoverflow.com/questions/20506360/angular-repeat-span-n-times
*/
angular.module('mission-control'... | true |
36c19ecbc5bb5dc435a486b5c1ae20c900a2436c | JavaScript | keller-mark/vitessce | /src/components/shared-spatial-scatterplot/dynamic-opacity.js | UTF-8 | 2,194 | 2.828125 | 3 | [
"MIT"
] | permissive | import { OrthographicView } from 'deck.gl';
import clamp from 'lodash/clamp';
// Reference: https://observablehq.com/@rreusser/selecting-the-right-opacity-for-2d-point-clouds
// Reference: https://observablehq.com/@bmschmidt/dot-density-election-maps-with-webgl
export function getPointSizeDevicePixels(devicePixelRatio... | true |
37bfe13d5ccc5d4ed42b41ef6a5a240d037e0ce9 | JavaScript | ezan2000/Cssi_2018 | /java/javascript.js | UTF-8 | 1,441 | 3.265625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | console.log("Hello World" );
const name = 'Charlie';
console.log('Hello World ' + name);
const age = 16;
console.log(`You are ${age + 1 } years old`);
if(age)
{
console.log("true");
}
else
{
console.log("false");
}
function greet(name1, name2)
{
if(name1[0] !== 'A');
{ return;
}
}
greet('Alice', 'Bob');
con... | true |
8bf0aeddd8437f72d97d22219636999299d66884 | JavaScript | ivanFlor3s/node-rest-01 | /controllers/productos.controller.js | UTF-8 | 2,034 | 2.78125 | 3 | [] | no_license | const { request, response, json } = require("express");
const { Producto, Categoria } = require("../model");
const crearProducto = async (req = request, resp = response) => {
const { nombre, precio, descripcion, disponible } = req.body;
const { usuario, categoria } = req;
const productoDB = await Producto.findO... | true |
f89e03f810b017fc168e95114860023c73e97fb7 | JavaScript | IrisCaffin/18-PropertyManager | /PropertyManager.Api/PropertyManager.Web/js/infrastructure/authentication.service.js | UTF-8 | 5,111 | 3.140625 | 3 | [] | no_license | angular.module('app').factory('AuthenticationService', function ($http, $q, LocalStorageModule, apiUrl) {
var state = {
authorized: false
};
function initialize() {
// this will be called as soon as the application loads (when the user first opens the page)
var token = LocalStorag... | true |
afb1d3fdd1a3473cfedc58fe5fa8bada03aed77e | JavaScript | MichaelZalla/Fizz | /src/js/spec/spec.Math.js | UTF-8 | 3,701 | 3.328125 | 3 | [
"MIT"
] | permissive | describe("The Math module", function() {
var withGreatProbability = function(conditionalTestFn, expectedProbability) {
expectedProbability = (typeof expectedProbability === "number") ? expectedProbability : 0.9;
var pLowerBound = expectedProbability - 0.1,
pUpperBound = expectedProbability + 0.1,
tota... | true |
3ec8e64c7b491f9de220e959fc9b9b7c42ca9454 | JavaScript | Vizzuality/openaidregister | /lib/assets/javascripts/users/ProjectsCollection.js | UTF-8 | 650 | 2.640625 | 3 | [] | no_license |
/**
* Projects collection
*/
var ProjectsCollection = Backbone.Collection.extend({
search : function(letters, status){
if (letters == "" && status == "") return this;
var pattern = new RegExp(letters,"gi");
return _(this.filter(function(data) {
if (status == '' && patte... | true |
a4a2cdae3014c1b00ef68f870635cf621e9c743a | JavaScript | C2rli3/hackerRank | /insertionSortPartOne.js | UTF-8 | 498 | 3.734375 | 4 | [] | no_license | //Carlie Guevara x insertionSort1 HackerRank
//Given:
//function insert1(n,arr){}
//arr = all in order minues arr[n-1]
//n=5 length of arr
//starting index=arr[n-1]; direction <-negative
insert1 = (n, arr) => {
this.store = arr[n-1];
this.values = arr.reverse().values();
n-=1;
queueMicrotask( () => {
for(const curr... | true |
d48a8fc4ff3671390557a5ba4f98cc0f190cdf61 | JavaScript | sambhav6496/exercise | /fabionaci.js | UTF-8 | 337 | 3.234375 | 3 | [] | no_license | function fabionaci(value){
var a = [1];
// var b = [];
if(value == 0){
return [];
}
for (i=1; i<value; i++){
if(i == 1){
a[i] = a[0];
}
else{
a[i] = a[i-1] + a[i-2];
}
// b.push(a[i]);
}
return a;
}
console.lo... | true |