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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9a8e293821e0047fe38d59d1c960a9ea848b76f7 | JavaScript | bonhokage06/geopins | /controllers/UserController.js | UTF-8 | 1,022 | 2.828125 | 3 | [] | no_license | require("dotenv").config();
var axios = require("axios");
const User = require("../models/User");
exports.findOrCreateUser = async token => {
//verify auth token
const AuthUser = await verifyAuthToken(token);
if (AuthUser) {
//check if the user exist
const user = await checkIfUserExits(AuthUser.em... | true |
6c25e92c8b9c4b05063c844171cc4077843fbf35 | JavaScript | andreas-HG/Leospa | /src/components/pages/home/booking/Booking.jsx | UTF-8 | 4,327 | 2.640625 | 3 | [] | no_license | import React, { useState } from "react";
import { useEffect } from "react";
import { create, getAll } from "../../../../assets/scripts/apiCalls";
import style from "./Booking.module.scss";
import Appointment from '../../../../assets/gfx/appointment-img.jpg'
const Booking = () => {
const [treatments, setTreatments] =... | true |
34fb0d7a7e0ed84434fcfc067277338e63110ba5 | JavaScript | secondred-fleckner/pogobuf | /pogobuf/lehmer.js | UTF-8 | 513 | 3.046875 | 3 | [
"MIT"
] | permissive |
function Random(seed) {
this.multiplier = 16807;
this.modulus = 0x7fffffff;
this.seed = seed;
this.mq = Math.floor(this.modulus / this.multiplier);
this.mr = this.modulus % this.multiplier;
}
Random.prototype.nextInt = function() {
var temp = this.multiplier * (this.seed % this.mq) - (this.mr ... | true |
bcff783f81e3ae35f801f0956d9b82bb32dc3c1c | JavaScript | jae-shin/practice-problems | /guessMyHat.js | UTF-8 | 1,041 | 4.1875 | 4 | [] | no_license | // input: array
var countMistakes = function (arr1, arr2) {
return arr1.reduce(function(mistakes, value, i) {
if (value !== arr2[i]) {
mistakes++;
}
return mistakes;
}, 0);
};
var guessingLogic = function (hats) {
var guesses = [];
for (var i = 1; i <= hats.length; i++) {
guesses.push(pa... | true |
599e69728ce00f886d12e7a49f260b7b481a6fef | JavaScript | atsepkov/drone | /util.js | UTF-8 | 6,442 | 2.9375 | 3 | [] | no_license | // utilities submodule
// equivalent to array.filter() but works with async filtering functions
exports.filterAsync = async (arr, callback) => {
const fail = Symbol();
return (
await Promise.all(
arr.map(async item => ((await callback(item)) ? item : fail)),
)
).filter(i => i !== fail);
};
// retu... | true |
3e442a1b7b0dae4606f293c9efdb0192992887fb | JavaScript | trunghieult1807/ToDoList | /VirtualEnv/static/js/hello.js | UTF-8 | 113 | 2.609375 | 3 | [] | no_license | function myFunction() {
var element = document.getElementById("myTask");
element.classList.toggle("done");
}
| true |
0c912d0420a719daf709e68dbaf6087c6cd8f989 | JavaScript | completejavascript/fcc-markdown-previewer-codemirror | /main.js | UTF-8 | 15,403 | 2.671875 | 3 | [
"MIT"
] | permissive | // ALLOWS LINE BREAKS WITH RETURN BUTTON
marked.setOptions({
breaks: true,
});
// INSERTS target="_blank" INTO HREF TAGS (required for codepen links)
const renderer = new marked.Renderer();
renderer.link = function (href, title, text) {
return `<a target="_blank" href="${href}">${text}` + '</a>';
}
const markdownT... | true |
282629f3e16bd93fde8c91a9780e4d6f41b42287 | JavaScript | churuitao/check-js | /js/move.js | UTF-8 | 5,928 | 2.625 | 3 | [] | no_license | //运动JS
//包含 :获取样式 弹性运动 缓冲运动
function onload_nav() {
var oNav = document.getElementsByTagName('nav')[0];
var aLi = oNav.getElementsByTagName('li');
var oDiv = oNav.getElementsByTagName('div')[0];
//初始化导航栏移动改变oDiv的位置
for(var i=0;i<aLi.length;i++){
(function(index){ //立即执行函数
... | true |
fef1d8803f9e8bba8d84d0f83b13ab90555b80ef | JavaScript | John-Pierce42/codeup-web-exercises | /js/practice.js | UTF-8 | 7,220 | 4.21875 | 4 | [] | no_license | (function (){
"use strict";
// --------------- assessment functions -------------------------->
/*
Write a function named calculateTax that takes in two inputs representing the totalPaid and the taxPercent. If both inputs are numeric or numeric strings, calculateTax should return the total with tax added in a string... | true |
a474eb0e1eef3d8eae2dba4bb850cab11795ace6 | JavaScript | leennabraham/alignminer | /TOWEB_aligminer/js/canvas/TXGrid.js | UTF-8 | 2,267 | 2.625 | 3 | [] | no_license | //=======================================
//Clase para pintar el eje X
//
// v0.1 - 20080426 - Diego Darío Guerrero
//=======================================
var TXGrid = Class.create(TGraphObject, {
//Constructor
initialize: function($super,graphBoardObject,color,separation) {
this.separation = separati... | true |
4eda3542670896b6473b9daeb1229f5541b7e0f2 | JavaScript | edensongjbs/React-Practice-Code-Challenge-nyc01-seng-ft-060120 | /sushi-saga-client/src/App.js | UTF-8 | 1,669 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import SushiContainer from './containers/SushiContainer';
import Table from './containers/Table';
// Endpoint!
const API = "http://localhost:3000/sushis"
class App extends Component {
state = { allSushi: [], sushiIndex:0, sushiBudget: 100}
componentDidMount() {
fe... | true |
0908c8e2be287c8faa540f4720591e1e6e8db8bf | JavaScript | joeyklee/p5-redux-examples | /ex02-sorting/sketch.js | UTF-8 | 2,465 | 3.03125 | 3 | [] | no_license | let store = Redux.createStore(dots);
let addBtn;
let removeBtn;
let sortBrightnessBtn;
let sortHueBtn;
let sortSaturationBtn;
function setup() {
colorMode(HSB, 360, 100, 100);
createCanvas(400, 400);
store.subscribe(refreshBackground)
store.subscribe(renderNumber)
store.subscribe(renderSquare)
addBtn =... | true |
a4d591ac10cf83e14c2b88a8543bdf71858532bf | JavaScript | vooit/React-Playground | /src/scripts/MyChallangeComponent.js | UTF-8 | 1,868 | 2.875 | 3 | [] | no_license | /**
* Created by Wojtek on 2017-06-16.
*/
import React from 'react';
class MyChallangeComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0
};
};
incrementCount(value) {
this.setState({
coun... | true |
a6904c1144c524c3ada33462203e5756c93d05fd | JavaScript | JaniecMichal/CurrencyConverter-react | /src/App/Form/Clock/useClock.js | UTF-8 | 733 | 2.796875 | 3 | [] | no_license | import {useState, useEffect} from "react";
export const useClock = () => {
const [newDate, setNewDate] = useState(new Date());
useEffect(() => {
const intervalId =
setInterval(
() => {
setNewDate(new Date());
}, 1000);
return () =... | true |
410ba2d3e7d183e4ece99ca2454255feed2b6b01 | JavaScript | RodrigoCBArj/cursoWeb-JS | /exercicios/fundamentos/usandoVarEmLoop1.js | UTF-8 | 220 | 3.484375 | 3 | [] | no_license | for (var i = 0; i <10; i++) {
console.log(i)
}
console.log('i =', i) /* aparece o valor de i que o fez sair do loop, ou seja, 10.
pq qnd chega 10 pro for, ele retorna false e sai do loop */ | true |
8007f3aac8283e9bed2a0041990690b0ced02411 | JavaScript | jiajiafan/JS | /resource/js-B/jd/js/my.js | UTF-8 | 4,347 | 3.078125 | 3 | [] | no_license |
function byclass(classn){//全局获取
var tags=document.all ? document.all : document.getElementsByTagName('*');
var arr=[];
for (var i = 0; i < tags.length; i++) {
if (tags[i].className.indexOf(classn)!=-1) {
arr.push(tags[i]);
}
}
return arr;
}
function getclass(parentID,classn){//局部获取
var parent=... | true |
016baf60648b97251c9365c7cd99ebfec58fb195 | JavaScript | norma-bazzi/CatalogProject | /js/js/myjs.js | UTF-8 | 992 | 2.921875 | 3 | [] | no_license | /* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
function myFunctions() {
document.getElementById("myDropdownn").classList.toggle("show");
}
// Close the dropdown menu if the us... | true |
a57e1362113ac558a59f63ee124bf9706c53164a | JavaScript | juancarlosvim/ejercicios_jQuery | /ejercicio52/js/main.js | UTF-8 | 574 | 3.171875 | 3 | [] | no_license | $(document).ready(function () {
let lista = [];
let itemLista = [];
let itemLista2 = [];
let arrayCiudades = ["Andújar", "Linares", "Bailén", "Jaén", "La Carolina"];
for(let i=0;i<2;i++){
lista[i] = $("<ul id='"+i+"'></ul>");
}
$("body").append(lista);
for(let j=0; j<arrayCiudades.length;j++)... | true |
4f2fa82372dbd8fa7ecae5131f94e84ddd5245c6 | JavaScript | jjxmonster/recruitment_tasks | /task1/src/data/reducers/inputReducer.js | UTF-8 | 362 | 2.53125 | 3 | [] | no_license | import { USER_TYPING } from '../actions/types';
const inputState = {
userType: '',
};
export const inputReducer = (state = inputState, action) => {
const { type, payload } = action;
switch (type) {
case USER_TYPING:
return {
...state,
userType: payload,
};
... | true |
02207a8575e19d33fb6be79e406f18165a8d45a7 | JavaScript | PineDuan/WSC2019 | /XX_JS-PHP_B/src/store.js | UTF-8 | 764 | 2.75 | 3 | [] | no_license | const LOCAL_TOKEN = '200907_token';
const LOCAL_USERNAME = '200907_username';
const store = {
auth: {
token: localStorage.getItem(LOCAL_TOKEN) || null,
username: localStorage.getItem(LOCAL_USERNAME) || null,
},
setAuth({token, username}) {
this.auth.token = token;
this.auth.... | true |
6678e14d2678cd05be3337b039ff712cf1b0ee98 | JavaScript | j-dags/Algos | /educative/SlidingWindow/SmallestSubarrWithSum-Backup.js | UTF-8 | 844 | 4.15625 | 4 | [
"MIT"
] | permissive | function smallestSubArr(s, arr) {
let windowStart = 0
let windowEnd = 0
let windowSum = arr[0]
let minLength = Infinity
while (windowEnd < arr.length) {
// Slide window end right while sum is less than target
if (windowSum < s) {
windowEnd++
windowSum += arr[windowEnd]
}
// Slide window start right ... | true |
1f7e4478fab705f39174cbec2e54fef07ed10205 | JavaScript | Khululeka/PIXI_Engine | /Joystick.js | UTF-8 | 3,031 | 2.890625 | 3 | [] | no_license | function Joystick() {
PIXI.Container.call(this);
// this.pivot.set(0.5);
this.inner = new PIXI.Sprite(PIXI.TextureCache["joyInner"]);
this.outer = new PIXI.Sprite(PIXI.TextureCache["joyOuter"]);
this.inner.anchor.set(0.5);
this.outer.anchor.set(0.5);
this.addChild(this.inner);
t... | true |
46857cdb9b5b43dc85625be137ee727435f6758d | JavaScript | cshoon95/Algorithm | /programmers/level1/같은 숫자는 싫어.Js | UTF-8 | 136 | 2.734375 | 3 | [] | no_license | function solution(arr)
{
var answer = [];
return arr.filter((item,index) => {
return item !== arr[index+1]
})
} | true |
dd53c78d2a9d3d922e25f637deaf1b63a78d3597 | JavaScript | techmsi/autostyles | /src/CreateGuide.js | UTF-8 | 1,333 | 2.625 | 3 | [
"MIT"
] | permissive | /* Autostyles - Main Module */
const { readFileSync } = require('fs');
const css = require('mensch');
const walk = require('directory-tree');
const CreatePage = require('./CreatePage');
const { logConfig, logMsg, separator } = require('./helpers.js');
const getFilePaths = ({ children }) =>
children.map(({ name, path... | true |
6afcffa379b73065a842cbeeff1afc35b54e0741 | JavaScript | VidolVidolov/JS-Advanced-SoftUni | /JS Advanced/Exercise DOM Manipulations/10. Sudomu/solution.js | UTF-8 | 1,882 | 3.0625 | 3 | [
"MIT"
] | permissive | function solve() {
let [checkSudomu, clearSudomu] = document.getElementsByTagName('button');
let pseudoMatrix = [[], [], []];
let table = document.querySelector('#exercise > table');
let msg = document.querySelector('#check > p');
checkSudomu.addEventListener('click', () => {
let rows = doc... | true |
e53ec1509ea4d41e683f9db9c8760415aa8815b9 | JavaScript | angela0202/custom_table | /src/helpers/helpetFunctions.js | UTF-8 | 489 | 3.375 | 3 | [] | no_license | export const isEqual = (obj1, obj2) => {
if (obj1 && obj2 && typeof obj1 === 'object' && typeof obj2 === 'object' &&
obj1.constructor === Object && obj2.constructor === Object) {
return JSON.stringify(obj1) === JSON.stringify(obj2);
} else if (Array.isArray(obj1) && Array.isArray(obj2)) {
... | true |
0b5130580556d36972ea1731ce558016bcf73b8a | JavaScript | marianieca9/gestionClientes | /application/resources/js/dataClient.js | UTF-8 | 2,638 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function saveDataClient() {
var dniOld=$('#dniClient').val();
var name=$('#inputName').val();
var surname=$('#inputSurname').val();
var dni=$('#inputDni').val();
var address=$('#inputAddress').val();
var phone=$('#inputPhone').val();
var email=$('#inputEmail').val();
if(name=='' || ... | true |
b278b3358aa79f15b549a1030efff4b1be75201b | JavaScript | LeonMilosevic/tvmreza-frontend | /src/components/admin/pages/article/crudpages/ReadallArticles.js | UTF-8 | 3,279 | 2.609375 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
// import helpers
import { Link } from "react-router-dom";
// import comopnents
import AdminNavbar from "../../../dashboard/AdminNavbar";
import AdminManagementNavbar from "../../../dashboard/AdminManagementNavbar";
import CrudTab from "../../../dashboard/CrudTab";
//... | true |
403db64d6def58847f34cfffe6b2c4a34db2a038 | JavaScript | camipe/100zombies | /src/components/Game/Game.js | UTF-8 | 2,952 | 3.375 | 3 | [] | no_license | import React, { Component } from 'react';
import House from '../House/House';
import './Game.css';
class Game extends Component {
state = {
// keeps track of the score for each game
games: [],
// keeps track of the houses' infection status
houses: Array(100).fill(false),
nrOfZombies: 1,
days... | true |
b1516f5c743f3b0a81f406e70a1fbc001a626150 | JavaScript | sjjefferis16/MillersvilleCodingProjects | /Javascript/Modulo.js | UTF-8 | 1,185 | 4.5 | 4 | [] | no_license | var nums = [];
for (i = 0; i < 10; i++) {
var number = readline();
number %= 42;
var includesNum = nums.includes(number, 0);
if(!includesNum){
nums.push(number);
}
}
console.log(nums.length);
/*
Given two integers 𝐴 and 𝐵, 𝐴 modulo 𝐵 is the remainder when dividing 𝐴 by 𝐵. For example, the numbers 7... | true |
a2fcdcadf4c5b66be33d1895604c6d7cdddcb4fc | JavaScript | Tribaltech1979/pronosticone2 | /public/javascript/insris.js | UTF-8 | 2,381 | 2.53125 | 3 | [] | no_license | /**
* Created by Daniele on 29/08/2015.
*/
$(document).ready(function () {
$("[value='null']").val('');
$("input").css('width',$("img").width()/13+"px")
$(".alert").hide();
$(".G3").each(function(){if($(this).val() && $(this).val()== 0){$(this).val('X');}})
});
function checkSubmit() {
$(".aler... | true |
e64be829c7627d8ac446468d7a0adb2ea6cb1503 | JavaScript | sven36/MayReactV16 | /src/leetSrc/15.三数之和.js | UTF-8 | 2,726 | 3.8125 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=15 lang=javascript
*
* [15] 三数之和
*
* https://leetcode-cn.com/problems/3sum/description/
*
* algorithms
* Medium (24.43%)
* Likes: 1523
* Dislikes: 0
* Total Accepted: 118.3K
* Total Submissions: 484.3K
* Testcase Example: '[-1,0,1,2,-1,-4]'
*
* 给定一个包含 n 个整数的数组 nums,判断 n... | true |
c22e3b09ebdb895f4031d17d3ea18ba67f1311e7 | JavaScript | TheDux/Node.JS | /test/nodetest.js | UTF-8 | 4,059 | 2.953125 | 3 | [] | no_license | "use strict";
var request = require("supertest"),
expect = require("chai").expect;
var postAnimal =
{
// "id":0,
"category": {
"id":0,
"name": "peixes"
},
"name": "",
"photoUrls": [
"string"
],
"tags": [
... | true |
269e994c586fbdb241951e047839e84c7a4b7095 | JavaScript | VikiSevcikova/movie-website | /src/components/movie-seat-components/Seat.js | UTF-8 | 1,592 | 2.890625 | 3 | [] | no_license | import React from 'react';
const Seat = ({seat, seats, setSeats, selectedSeats, setSelectedSeats}) => {
const seatClickHandler = () => {
//only if the status is different from occupied then proceed in executing
if(seat.status !== 'occupied'){
setSeats(seats.map((row)=>{
... | true |
456d134ced256397f536f005eac5e06d6dd2e1a1 | JavaScript | ekazakov/node-tasks | /koa-chat/test/chat.js | UTF-8 | 3,718 | 2.59375 | 3 | [] | no_license | /* global describe, before, beforeEach, after, it, context, JSON */
require('co-mocha');
const expect = require('expect');
const chat = require('../chat');
const rp = require('request-promise').defaults({
resolveWithFullResponse: true,
simple: false
});
const host = 'http://localhost:3006';
describe('Koa cha... | true |
75d14dcff6cc9db4ddb094bbf2ade635c97782ff | JavaScript | Nemrtvej/htmlendris | /src/js/htmlendris/States/RotatableStepAfterFreeFall.js | UTF-8 | 3,824 | 2.78125 | 3 | [] | no_license | import {AbstractState} from "./AbstractState.js";
import {CheckFilledRowState} from "./CheckFilledRowState.js";
import {CollisionException} from "/js/htmlendris/Exceptions/CollisionException.js";
import {KeyPressResult} from "./StateResult/KeyPressResult.js";
import {FallingPieceState} from "./FallingPieceState.js"... | true |
c39e3e143d9652dc7c45a79876452449434a86ed | JavaScript | frankad/CSE442-17F-A3-Zillow-House-Exploration | /CSE442-17F-A3-Zillow-House-Exploration/old-index.js | UTF-8 | 3,368 | 2.78125 | 3 | [] | no_license | (function() {
var width = 500;
var height = 500;
var dataset = [];
// var selected = [];
var isFilterSelected = [];
var x = d3.scaleLinear().domain([0, 100]).range([0, 500]);
for (var i = 0; i < 20; i++) {
dataset.push([Math.round((Math.random()) * 100), Math.round((Math.random()) * 100)]);
isFilterSele... | true |
3328bc79fab08b9945eefe75d724999716b7415e | JavaScript | faculdadeTaina/algoritmo | /Lista-javascript-3/js/script8.js | UTF-8 | 1,288 | 3.515625 | 4 | [] | no_license | //falta terminar
//melhor taxa de juros
var melhorT, taxaI, taxaII, taxaIII, taxaIV;
//quantas taxas serão verificadas
//var quantidade= +prompt("Quantas empresas para testar a melhor taxa?");
var valorInvestido=+prompt("Qual o valor a investir?")
// for (i=0; i<quantidade; i++){
//somente 4 taxas para compar... | true |
16a1b0400a6cef1706bfab91f8cfa445c320c53c | JavaScript | ashikprodhan/assignment3 | /Sum.js | UTF-8 | 81 | 2.921875 | 3 | [] | no_license | function add(a,b){
return a +b;
}
var result =add(3,4);
console.log(result); | true |
5a5338f9526473cda6cf795cd7204630333d10a9 | JavaScript | ulyavrubel/frontendMasters-practicalAlgo | /greedyAlgorithms.js | UTF-8 | 669 | 3.671875 | 4 | [] | no_license | //write function counting number of coins for the given amount and coin values
function makeChange(amount, coins) {
let numberOfCoins = 0;
coins.sort((a,b) => b - a);
function divideAndCount(num) {
if (num == 0) return;
for (let i = 0; i < coins.length; i++) {
if (num / coins[i... | true |
4d3b429ac187f8a464a95926c87c89c780ff148f | JavaScript | darekg11/CHIP-8 | /src/emulator/opcodes.js | UTF-8 | 6,683 | 2.984375 | 3 | [
"MIT"
] | permissive | const OP_CODES = {
// LD I, addr
// Set I = nnn.
// The value of register I is set to nnn.
LD_I: 0xA,
// CLS / RET
// Both start with 0 as first 4 bits
CLS_RET: 0x0,
// Clear the display.
CLS: 0x00E0,
// Return from a subroutine.
// The interpreter sets the program counter to the address at the... | true |
20433677d0e8400a4f2b05b3566da3a7a7942749 | JavaScript | cunderw/appium-poc | /test/screenobjects/app.screen.js | UTF-8 | 1,274 | 2.671875 | 3 | [] | no_license | import { DEFAULT_TIMEOUT } from '../constants';
import Utilities from '../Utilities/Utilities';
const SELECTORS = {
BACK_BUTTON:
'android=new UiSelector().resourceId("com.oreillyauto.mobilestoretoolbox.emulator:id/button_back")',
SCREEN_TITLE:
'android=new UiSelector().resourceId("com.oreillyau... | true |
f9e3365bf6305cbbcf786800bca6e2dffc991de2 | JavaScript | webdott/Clock-App | /Js/script.js | UTF-8 | 5,987 | 3.0625 | 3 | [] | no_license | const expandDetails = document.querySelector('.expand__details');
const timezoneDetails = document.querySelector('.timezone-details');
const showStatus = document.querySelector('.expand__details .show-status');
const arrowUp = document.querySelector('.up');
const arrowDown = document.querySelector('.down');
const refr... | true |
44c1d0e682ecac0584f3697772c294391ea8f127 | JavaScript | junosw/mandelbrot | /src/mandlebrot.js | UTF-8 | 1,903 | 3.5 | 4 | [] | no_license | import { forEach } from 'lodash'
const MAX = 100
/**
* Generate an array of RGBA image data based on the mandelbrot set
*/
export function genImageData(width, height) {
let imageData = []
for (let x = 0; x < width; x++) {
for (let y = 0; y < height; y++) {
const real = (x - width / 2.0) * 4.0 / width
... | true |
ba8d018254c92b232fd4db42027ba38445ae0b6a | JavaScript | gdamjan/firefox-switch-tabs-addon | /lib/main.js | UTF-8 | 1,296 | 2.515625 | 3 | [] | no_license | /*
XF86Back and XF86Forward keys on a Thinkpad are just above the cursor keys,
so I want to use them to switch active tab.
I personally use back/forward with the shift modifier to switch tabs, since
without a modifier I switch the active window in awesome wm.
*/
var windows = require("windows").brow... | true |
1519fa82d07bdd7593b79200424f28415e9eb228 | JavaScript | LaviniaMatei/shopping-cart | /src/orderPlaced.js | UTF-8 | 406 | 2.765625 | 3 | [] | no_license | window.onload = function(){
const confirmedData = JSON.parse(localStorage.getItem('confirmedOrderData'));
const finalRes = document.getElementById('finalRes');
finalRes.innerHTML = `<p class ='finalMsg'>You have completed the order, total sum is ${confirmedData.totalPrice}<br>
... | true |
545ce2106ad4bdef2e42da7bf466686a115736a4 | JavaScript | tchen00/softdev | /12_svg-dot/svg.js | UTF-8 | 1,197 | 2.59375 | 3 | [] | no_license | // Team "." - Tammy Chen & Joseph Lee
// SoftDev pd9
// K12: Connect the Dots
// 2020-03-30
var svg = document.getElementById("vimage");
var clear = document.getElementById("clear");
var path = null;
svg.addEventListener('click', function(e) {
//createElementNS: Creates an element with the specified namespace URI a... | true |
230d8109126b475c37cc1f316c625857ecf1cbfc | JavaScript | abruestle/PathfinderScraper | /version 1 (temp)/server.js | UTF-8 | 12,292 | 2.546875 | 3 | [] | no_license | //Dependencies
var express = require("express");
var bodyParser = require("body-parser");
var path = require("path");
var logger = require("morgan");
var mongoose = require("mongoose");
var axios = require("axios");
var cheerio = require("cheerio");
//Models
var db = require("./models");
//Initializing
... | true |
e2922259e4b23d05e70f9158b5c2981c5463009c | JavaScript | brandonDeen/Hacker_Rank | /Code_Wars/Javascript/duplicate_encoder.js | UTF-8 | 771 | 4.03125 | 4 | [] | no_license | // Description: http://www.codewars.com/kata/54b42f9314d9229fd6000d9c
//
// The goal of this exercise is to convert a string to a new string where each character in the new string is '(' if that character appears only once in the original string, or ')' if that character appears more than once in the original string. I... | true |
73b256c563b9347db1db68c95940ff846ea8290b | JavaScript | yaroslavskriaga/java-chatroom | /vue-front/store/main.js | UTF-8 | 3,597 | 2.53125 | 3 | [] | no_license | import Vue from "vue";
export const state = () => ({
sidebar: true,
username: "",
roomList: [],
usersInChatRoom: {},
roomMessages: {}
});
export const getters = {
sidebar: state => state.sidebar,
username: state => state.username,
roomList: state => state.roomList,
roomName: state => roomId => {
... | true |
e6e33773164ab79ee7a717006d245b43f55d1260 | JavaScript | bmalbright/homework-10 | /Tests/employee.test.js | UTF-8 | 415 | 2.765625 | 3 | [
"MIT"
] | permissive | const Employee = require ("../lib/employee.js")
describe("Employee", () => {
describe("initialization", () => {
it("creates the Engineer subclass", () => {
const employeeTest = new Employee("Zeke", 26, "zeke@zeke.com")
expect(employeeTest.name).toEqual("Zeke");
expect(employe... | true |
bc01221791cc2ee807d32917773c15c1afc72112 | JavaScript | kevinydhan/infini | /server/utils/parsers/playlists.js | UTF-8 | 323 | 2.609375 | 3 | [] | no_license | /**
* Parses Spotify Web API's playlist data object.
*
* @param {Object} playlist - Playlist data, retrieved from Spotify Web API
*/
const parsePlaylist = playlist => {
return {
id: playlist.id,
name: playlist.name,
image_url: playlist.images[0].url
}
}
module.exports = parsePlayli... | true |
5c85dd7941294739ea280215f187d3df39374566 | JavaScript | ternasvet/imt-learning | /1_lesson/10/app.js | UTF-8 | 1,251 | 3.9375 | 4 | [] | no_license | /*
Создать одномерный массив чисел любым способом (вручную или прогнать через цикл). Сортировать
его от большего к меньшему методом sort(). Дальше удалить из него два элемента в любом месте и вставить
на их место числа 100 и 200 (используем метод splice()). Весь результат обработать методом join()
и вывести массив одн... | true |
67d6f4c44aff24cff1737435fcc237e96edb4cdb | JavaScript | isabella232/cordova-medic | /medic/medic-downloadlogs.js | UTF-8 | 3,606 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | var path = require('path'),
fs = require('fs'),
https = require('https'),
optimist = require('optimist'),
q = require('Q'),
mkdirp = require('mkdirp'),
util = require('util');
var SERVER = "https://ci.apache.org";
var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone... | true |
8ba6e718d81358f107d3af190e507f1931118a6f | JavaScript | guptamadhur/React-Auth0 | /server.js | UTF-8 | 2,080 | 2.5625 | 3 | [
"MIT"
] | permissive | const express = require("express");
require("dotenv").config();
const jwt = require("express-jwt"); // Validate JWT and set req.user
const jwksRsa = require("jwks-rsa"); // Retrieve RSA keys from a JSON Web Key set (JWKS) endpoint
const checkScope = require("express-jwt-authz"); // Validate JWT scopes
const checkJwt =... | true |
2e274ca5e2f23297d479425efcf741d4515402ee | JavaScript | dulcehc/places-to-go | /src/components/Search.js | UTF-8 | 1,102 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
class Search extends Component {
constructor(props) {
super(props);
this.state = {
venue: '',
location: '',
};
}
handleSubmit = e => {
e.preventDefault();
this.props.onSubmit(this.state.venue, this.state.location);
}
handleVenue = e... | true |
dc6da076d24ef85f967b0607c876e39eaee455b0 | JavaScript | p481026117/controlador_de_auto | /src/controladorAuto.js | UTF-8 | 2,920 | 3.15625 | 3 | [] | no_license | function ControladorAuto(cadena) {
let dividir = cadena.split("/");
let grilla = dividir[0];
let posicionInicial = dividir[1];
let instrucciones = dividir[2];
return ConvertirAString(ProcesarComandos(grilla,posicionInicial,instrucciones));
}
function ConvertirAString(posicion) {
return [posicion.i, posicion... | true |
2e4feebb1c260cff536ad684a04b276b299540fa | JavaScript | garySiladi/exerciseCollectionSovy | /src/exercices/normalizing-exercises/exercise6.js | UTF-8 | 2,041 | 2.921875 | 3 | [] | no_license | const input = [
{
country: "China",
data: {
continent: "Asia",
population: 1409517397
},
GDP: "%5",
activities: [
{ name: "economics", income: "2540000" },
{
name: "entertainment",
income: "4270000"
}
]
},
{
country: "India",
data: {
... | true |
103a0d4cf7f65fb4a00acdc9b41accc569660cf2 | JavaScript | alexandremasy/sample-angular-weather | /statics/libs/app/providers/CityProvider.js | UTF-8 | 966 | 3.0625 | 3 | [
"MIT"
] | permissive | angular
.module(APPNAME)
.service('City', function()
{
/**
* Default city name
**/
this.text = '';
// this.text = 'Llanfairpwllgwyngyll';
/**
* Max characters allowed
**/
this.max = 20;
/**
* Add character to the city name
*
* @param character String
* @return String
**/
t... | true |
5ac725ea57969cd0cff083528c1205cf0c26d01b | JavaScript | Human437/javascript-exercises | /fibonacci/fibonacci.js | UTF-8 | 495 | 3.65625 | 4 | [] | no_license | const fibonacci = function(number) {
let previousValue = 1;
let previousValue2 = 1;
let currentValue;
if (number > 2){
for(i =2; i < number; i ++){
currentValue = previousValue + previousValue2;
previousValue2 = previousValue;
previousValue = currentValue;
... | true |
ab2bf435f2565b0622d817c688777aa76142b406 | JavaScript | manuelxaguilar/bot-inspector | /__test__/set-crawler-regex.test.js | UTF-8 | 755 | 2.703125 | 3 | [
"MIT"
] | permissive | const setCrawlerRegex = require('../lib/helpers/set-crawler-regex');
test('Should throw if no value is passed as a parameter', () => {
expect(() => {
setCrawlerRegex();
}).toThrow();
});
test('Should throw if an object is passed as a parameter', () => {
expect(() => {
setCrawlerRegex({});
}).toThrow()... | true |
1c4489ddba3585b767a83fc3a46a6f0c4e9730a1 | JavaScript | kotlasrinivasreddy/social-connect | /reactfrontend/src/post/NewPost.js | UTF-8 | 4,783 | 2.703125 | 3 | [] | no_license | import React, {Component} from 'react';
import {isAuthenticated} from "../auth";
import {create} from "./apiPost";
import {Redirect} from "react-router-dom";
class NewPost extends Component {
constructor() {
super();
this.state= {
title: "",
body: "",
photo: "",... | true |
0d70198b3ee4540806ef2e9bc0e010505d2ee23a | JavaScript | waterfoul/Lantern-Hoard | /common/gameState/monsterController.js | UTF-8 | 450 | 2.53125 | 3 | [
"ISC"
] | permissive | // actions
const CHANGE_MONSTER_CONTROLLER = 'CHANGE_MONSTER_CONTROLLER';
// reducer
const monsterController = (state = null, action) => {
switch (action.type) {
case CHANGE_MONSTER_CONTROLLER:
return action.controller;
default:
return state;
}
};
// action creators
const changeMonsterController = (contro... | true |
ee71901988ff54679c471d6685753989be487529 | JavaScript | micnem/developers_institute | /Week2/Day4/xp/ex4s.js | UTF-8 | 323 | 3.6875 | 4 | [] | no_license | function cap_name(sentence) {
let array = sentence.split("")
let newarray = []
for (let item of array) {
if (item == item.toUpperCase()) {
newarray.push(item.toLowerCase())
} else {
newarray.push(item.toUpperCase())
}
}
console.log(newarray.join(""))
}
cap_name("The Quick Brown Fo... | true |
554b509cab337a2b2edda787a54fc45c3be1597d | JavaScript | ingride/ember.js | /packages/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.js | UTF-8 | 1,180 | 2.65625 | 3 | [
"MIT"
] | permissive | export default function TransformQuotedBindingsIntoJustBindings() {
// set later within HTMLBars to the syntax package
this.syntax = null;
}
/**
@private
@method transform
@param {AST} ast The AST to be transformed.
*/
TransformQuotedBindingsIntoJustBindings.prototype.transform = function TransformQuotedBind... | true |
5a3e0d6fffe8caaf05b13694f6553b86ac4a398e | JavaScript | tinacg/tinacg.github.io | /porteng/app.js | UTF-8 | 1,378 | 3.625 | 4 | [
"MIT"
] | permissive | function buildTable(orderByLeft) {
var sortFunction;
if (orderByLeft) {
sortFunction = function(a, b) {
return a.left.localeCompare(b.left, 'pt');
};
} else {
sortFunction = function(a, b) {
return a.right.localeCompare(b.right, 'pt');
};
}
//var table = document.createElement(... | true |
1598cf5eac45e194665a486d5dcbfaae1162e811 | JavaScript | pl5es/ES | /code/web/src/utils/validations/editProfileSchema.js | UTF-8 | 1,412 | 2.578125 | 3 | [] | no_license | import * as yup from 'yup';
const editProfileSchema = yup.object().shape({
username: yup.string().required('Username is required!'),
email: yup
.string()
.email('E-mail is not valid!')
.max(50, 'E-mail address too long!')
.required('E-mail is required!'),
name: yup
.string()
.max(50, 'Nam... | true |
bbf3df541a89953b3aa73b696f643752f42c27f0 | JavaScript | scajasc/mern-stack-frontend | /src/components/Notes.js | UTF-8 | 2,517 | 2.546875 | 3 | [] | no_license | import React, { Component, useEffect, useState } from 'react'
import axios from 'axios'
import { format } from 'timeago.js'
import { Link } from 'react-router-dom'
function Notes() {
const [notas, setNotas] = useState([]);
/* Variables de entorno */
const [urlNotas, setUrlNotas] = useState(process.env.R... | true |
b8cf5ae5a048d2cb648c5d1b0f955612631bea40 | JavaScript | gabrielleiteds/API_Github | /src/utils/concatenateUser.js | UTF-8 | 147 | 2.546875 | 3 | [] | no_license | function concatenateUser(user, project) {
const concatenate = user + ' - ' + project
return concatenate;
}
module.exports = concatenateUser; | true |
4bfc8328fd50adb35c6a2643653fb25b838fc898 | JavaScript | Sonar-Programming-Language/1st-implementation | /src/errorHandler/ErrorHandler.js | UTF-8 | 3,545 | 2.59375 | 3 | [] | no_license | const { globalLog } = require('../log/Log');
const ERRORS = require('./ERRORS');
class ErrorHandler {
constructor() {
this.log = globalLog;
};
throw(msg, line, col) {
let err;
if (line && col) {
err = `\n\n: ${msg} at line ${line}, col ${col}\n`;
} else {
err = `\n\n: ${msg}\n`;
... | true |
2ac270a71ea0ac081dc0e1080d107f761ddfe41f | JavaScript | MicroFish91/Personal-Notes | /javascript/node/about_npm.js | UTF-8 | 2,313 | 2.625 | 3 | [] | no_license | // NPM Packages: npmjs.com
// For Mac perfix command using 'sudo' anytime you make a -g (global) change via command-line
// ** Semantic versioning (SemVer) **
// 4.13.6 => Major.Minor.Patch
// ^4.13.6 => '^' update any version that follows 4.x
// ~4.13.6 => '~' update any version that follows 4.13.x
// 4.13.6 => only... | true |
aaf316a08aa8fadac20c57f4ee65bcefe539ef6f | JavaScript | AliNisarAhmed/NodeCourse-AndrewMead | /node-tests/utils/utils.test.js | UTF-8 | 604 | 3.15625 | 3 | [] | no_license | const utils = require('./utils');
it('adds two values', function() {
var res = utils.add(11, 33);
expect(res).toBe(44);
});
it('squares a number', () => {
var res = utils.square(4);
expect(res).toBe(16);
});
test('checks the object for specific properties', () => {
let res = utils.obj;
expect(res).toHave... | true |
7f5fdc5b4ed7b163211bdce87e71c2be54790226 | JavaScript | crazyvalse/js-examples | /leet-code/moocsrc/code/chain/lesson2.js | UTF-8 | 748 | 3.3125 | 3 | [
"MIT"
] | permissive | // 声明链表的节点
class Node {
constructor (value) {
this.val = value
this.next = undefined
}
}
// 声明链表的数据结构
class NodeList {
constructor (arr) {
// 声明链表的头部节点
let head = new Node(arr.shift())
let next = head
arr.forEach(item => {
next.next = new Node(item)
next = next.next
})
... | true |
041f2b391e1e56752d5d7d5a79b722b3b7505542 | JavaScript | ealine/ife | /ife-20/ife20.js | UTF-8 | 2,133 | 3.625 | 4 | [] | no_license |
$ = function (el) { return document.querySelector(el); }; //多用选择符API,和jquery的选择方法一样
function init(){
var btnnode = document.getElementsByName("btn");
// alert($("btn").length);
for(var i=0,len=btnnode.length;i<len;i++){
btnnode[i].addEventListener("click",function(event){
click_f(event)... | true |
39d5f1e39be40fc5f4f628f36ee1641f6e011290 | JavaScript | unzreham/Project04_Auth_CRUD_ASP.NET | /client/src/components/Storage.js | UTF-8 | 323 | 2.6875 | 3 | [] | no_license | const Storage = (function() {
let myStorage = window.localStorage;
function get(name) {
return myStorage.getItem(name);
}
function set(name, value) {
myStorage.setItem(name, value);
}
function remove(name) {
myStorage.removeItem(name);
}
return {
get,
set,
remove
};
})();
export default Storag... | true |
0fd1f69a77219d9f3525c09ed6c4dd2903ad3ef7 | JavaScript | gptankit159/Devsnest_Frontend_THA | /9/script.js | UTF-8 | 821 | 3.1875 | 3 | [] | no_license | let inp = '<div class="seat"></div>';
let row = '<div class="par">' + inp.repeat(10) + '</div>' + '<br>' ;
let col = row.repeat(10) ;
let Bseats = 0;
let Rseats = 100;
function insert(){
document.querySelector(".main").innerHTML=('<br>' + col);
}
setTimeout(() => {
const sea = document.querySelectorAll(... | true |
19ab7b65d26579c4ddcd6b53a51c3fe28bf738d2 | JavaScript | nnattawat/learn-redux | /app/reducers/index.jsx | UTF-8 | 577 | 2.640625 | 3 | [] | no_license | let todoId = 1;
export let searchTextReducer = (state = '', action) => {
switch (action.type) {
case 'CHANGE_SEARCH_TEXT':
return action.searchText
break;
default:
return state;
}
};
export let todosReducer = (state = [], action) => {
switch (action.type) {
case 'ADD_TODO':
r... | true |
ec08176c62e668e14318e46ccde69a6bd05e9c13 | JavaScript | krischanthas/react_getdevjob | /src/reducers/theme_reducer.js | UTF-8 | 324 | 2.546875 | 3 | [] | no_license | import types from '../actions/types';
const DEFAULT_STATE = {
themeName: 'light',
theme: {}
};
export default(state = DEFAULT_STATE, action ) => {
switch(action.type){
case types.SET_THEME:
return {themeName: action.themeName, theme:action.theme};
default:
return state;
... | true |
f59b2cc3931a149fcfb5b04305613287c2a826a1 | JavaScript | tinaaggarwal/CMPE273 | /Lab2-013735592/Grubhub/frontend/src/js/reducers/ownerReducer.js | UTF-8 | 622 | 2.53125 | 3 | [] | no_license | import actionTypes from '../constants/index';
const initialState = {
owner_email: '',
password: '',
authFlag: false,
signupOwner: false
};
const ownerReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.LOGIN_OWNER:
return Object.assign({}, sta... | true |
3dd9cb96f2358f31f97c1cf7e7a08579d49373d6 | JavaScript | sakiii999/ASE-Assignment | /Lab Assignment 2/Source/JS/app.js | UTF-8 | 4,102 | 2.546875 | 3 | [] | no_license | /**
* Created by Saki on 01/02/17.
*/
var app =angular.module("GoogleDirection", [])
.controller("googlemapoutput", function ($scope) {
var map;
var directionsDisplay = new google.maps.DirectionsRenderer({
draggable: true
});
var directionsService = new google.maps.Di... | true |
596296260b6fd56ac7a7ae2660935920fb68b59e | JavaScript | istvan-plt/react-ws | /src/demos/Demo8.js | UTF-8 | 1,055 | 2.9375 | 3 | [] | no_license | import React, { useState, useCallback, memo } from 'react'
import initialTodos from '../utils/todos'
// !Performance solutions
// ?Note: If the component just gonna have a few leafs (and the leafs are light), it's won't be an issue as re-rendering a component is really cheap in react.
// !Good solution
function Todo(... | true |
223fa1776d607dadfb85e1e014196e472d7183cd | JavaScript | coderSabbirr/js-string-array | /upercase-lowercase.js | UTF-8 | 167 | 3 | 3 | [] | no_license | const userMail ='saBbirnahid5817@gmail.com';
const lowerlitter =userMail.toLowerCase();
if(userMail == 'sabbirnaJid5817@gmail.com'){
console.log(lowerlitter);
}
else{
console.log('error 404');
} | true |
7685058fec51fb5b414cb877614a2d82d809ba7c | JavaScript | tpgmartin/simonSaysJS | /src/game.js | UTF-8 | 1,440 | 2.984375 | 3 | [] | no_license | var $ = require('jquery');
function flashGamePiece (correctSequence) {
var gamePieces = $('.game-piece');
var index = Math.floor(Math.random()*4);
var selected = gamePieces[index];
correctSequence.push(selected);
correctSequence.map(function (el, index) {
setTimeout(function () {
... | true |
6963130ea1114465e67180bea598a12ca73bbdb8 | JavaScript | thibaudcolas/specificity-ascii | /tests/index.spec.js | UTF-8 | 918 | 2.625 | 3 | [] | no_license | import { describe, it } from 'mocha';
import { expect } from 'chai';
import fs from 'fs';
import specificityASCII from '../index';
const showOutput = (output) => {
process.stdout.write(output);
process.stdout.write('\n');
};
const rawCSS = fs.readFileSync('./examples/test.min.css', 'utf-8');
describe('specificit... | true |
19ef0a83b25344fbad79358055788eb7ce0516de | JavaScript | Gracechung-sw/toy-codeReview | /4차_정렬/hj_sort.js | UTF-8 | 1,564 | 4.53125 | 5 | [] | no_license | /*
* Write a function that takes as its input a string and returns an array of
* arrays as shown below sorted in descending order by frequency and then by
* ascending order by character.
*
* :: Example ::
*
* characterFrequency('mississippi') ===
* [
* ['i', 4],
* ['s', 4],
* ['p', 2],
*... | true |
b5be3cb1ef7936eedaf2da3ee47ffccda358d1f1 | JavaScript | ruyadorno/request-hash | /lib/__tests__/requestHash.test.js | UTF-8 | 15,461 | 2.5625 | 3 | [
"MIT"
] | permissive | const getRequestHash = require('..');
describe('defaultSerializer', () => {
const { defaultSerializer } = getRequestHash();
it('should defaultSerializer a simple object', () => {
expect(defaultSerializer({ foo: 'bar' })).toBe('foo,bar');
});
it('should defaultSerializer a multi-level object', () => {
... | true |
d57d5bbed8b68d67c053b76dd0d4961a8cffb195 | JavaScript | legionaryu/angry-nerds | /js/Agent.js | UTF-8 | 631 | 2.734375 | 3 | [] | no_license | Agent.prototype = Object.create(Resource.prototype);
Agent.prototype.constructor = Agent;
Agent.prototype.draw = function (context){
if(typeof this.customDraw === "function")
this.customDraw(context);
else
Resource.prototype.draw.call(this, context);
};
Agent.prototype.update = function (delta... | true |
536c5da92fea399a97e3d34ca2228cee94db1dce | JavaScript | tblanchard01/ping_pong_tim | /frontend/src/Components/Rules.js | UTF-8 | 1,565 | 2.765625 | 3 | [] | no_license | import React, { Component } from "react";
class Rules extends Component {
render() {
return (
<div className = "rules-container">
<h2> Scoring</h2>
<p>A match is played best 3 of 5 games (or 4/7 or 5/9). For each game, the first player to reach 11 points wins that game, however a game must ... | true |
e4946dde970d2de3f69bcbe3345907d1009b2c11 | JavaScript | joohnsro/hiringcoders-desafio1 | /scripts/scripts.js | UTF-8 | 686 | 2.59375 | 3 | [] | no_license | (() => {
const button = document.getElementById('send-email');
const nameInput = document.getElementById('name-input');
const emailInput = document.getElementById('email-input');
button.addEventListener('click', (event) => {
event.preventDefault();
localStorage.setItem('newsletter-name... | true |
de7105f664a16e564edb07cbe9f15f76b21ea07d | JavaScript | palzuncoff/OrsaStudio | /src/DataList.js | UTF-8 | 1,317 | 2.765625 | 3 | [] | no_license | import dataView from './DataView'
class DataList {
table = ''
error = null
setTable = table => {
this.table = table
}
getDataValueAtIndex = (index) =>{
dataView.setViewRange(0, Infinity)
return dataView.getDataValuesInViewRange(this.table)
.then(data => data[index])
.catch(error =... | true |
02bdeadb0853ceabf4ca9831f72494a7ef69585b | JavaScript | jcmandersson/Operation | /public/js/checkEffect.js | UTF-8 | 1,058 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | // Changes the color of tablerows when they are checked.
var changeTableGraphics = function(tablerow, isChecked, preparation) {
if (isChecked) {
tablerow.css('background-color', 'rgba(76, 169, 34, 0.2)');
} else {
if (preparation) {
tablerow.css('background-color', '');
} else {
tablerow.css... | true |
027707a63dfc5ed0366c27331373feeb3df9fe3c | JavaScript | pofallon/node-callbackmaybe | /test/test.js | UTF-8 | 5,709 | 3 | 3 | [] | no_license | /*!
* node-callbackmaybe
* Copyright(c) 2012 Paul O'Fallon <paul@ofallonfamily.com>
* MIT Licensed
*/
var CallbackMaybe = require('../index.js');
var should = require('should');
describe('CallbackMaybe', function() {
beforeEach(function() {
});
afterEach(function() {
});
describe('with a callback', f... | true |
4ed25eef5f89fb058d071283cb4cc121768e0d23 | JavaScript | josemmduarte/webalpha | /webnew/src/main/webapp/js/prueba2.js | UTF-8 | 472 | 2.765625 | 3 | [] | no_license | /**
*
*/
function prueba() {
var fileInput = document.getElementById('portada');
var filePath = fileInput.value;
var allowedExtensions = /(.jpg|.jpeg|.png)$/i;
if(!allowedExtensions.exec(filePath)){
document.getElementById("spportada").innerHTML = "Suba: .jpeg/.jpg/.png";
fi... | true |
128fc6dffde6e0d96480dafd3e6053c53c86eabb | JavaScript | skipjack/better-frontend-test | /client/components/hypertext.jsx | UTF-8 | 1,093 | 2.65625 | 3 | [] | no_license | import React from 'react'
import PropTypes from 'prop-types'
import { colors } from '../utils.js'
/**
* Detects and hyperlinks any URLs within the given content
*
* @param {string} props.children - A string that possibly contains links
* @return {object} - React markup
*/
const Hypertext = ({
... | true |
fc3971a8a4f28f21fe59f67e4456367930741d60 | JavaScript | katkaldunska/weather-app | /weather/weather.js | UTF-8 | 837 | 2.984375 | 3 | [
"MIT"
] | permissive | const request = require('request');
const darkSkyApiKey = process.env.DARKSKY_API_KEY;
var convertFahrenheitToCelsius = f => Math.round((f - 32) * (5/9) * 10) / 10;
var getWeather = (lat, lng, callback) => {
if (!darkSkyApiKey) {
return callback('ERROR - No Dark Sky API key');
}
request({
ur... | true |
6947ebbbd9aa394f0809cb894b9294cf1f6ebbcc | JavaScript | Franjk/data-warehouse | /Frontend/src/styles.js | UTF-8 | 3,503 | 3.15625 | 3 | [] | no_license | let activeDropdown;
function hideElement(el) {
el?.classList.add('display-none');
}
function unHideElement(el) {
el?.classList.remove('display-none');
}
function toggleElement(el) {
el.classList.toggle('display-none');
}
function isHidden(el) {
return el.classList.contains('display-none');
}
function hideA... | true |
a5ab8297a9d3d8fc2492ceb863c3b7859847a114 | JavaScript | bonomali/Ally-Py | /plugins/gui-core/gui-resources/scripts/js/jquery/utils.js | UTF-8 | 1,707 | 2.546875 | 3 | [] | no_license | define('jquery/utils',['jquery'], function ($) {
$.isString = function( obj ) {
return obj && typeof(obj) === 'string';
}
$.isObject = function( obj ) {
return obj && typeof(obj) === 'object';
};
$.isDefined = function( obj ) {
return obj && typeof(obj) !== 'undefined';
};
$.combineObj = function(keys, valu... | true |
eda85d6cb60ceb4114caad0d21ebf65a5e525b75 | JavaScript | nabsty55/Intro-to-javascript | /functions/null_checker.js | UTF-8 | 126 | 3.4375 | 3 | [] | no_license | var x = 0;
if (x > 0){
console.log ("1");
}else if (x < 0){
console.log ("-1");
}else if (x ===0){
console.log ("0");
}
| true |
9998684e9910994d27841baae4049e147e3dfb6b | JavaScript | minustime/short-documentation | /app/index.js | UTF-8 | 6,112 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
const fs = require('fs'); // traverse the file system to load a JSON config;
const yeoman = require('yeoman-generator'); // yeoman toolset;
const yosay = require('yosay'); // ASCII art for yeoman console message;
const os = require('os'); // used for OS specific end-of-line characters;
let config; // t... | true |
55cee122e4d096a0a4690ba20d09d62fe574bba1 | JavaScript | rentes/projectile.js | /projectile.js | UTF-8 | 9,692 | 3.375 | 3 | [
"MIT"
] | permissive | /**
* Projectile project.
*/
/*jslint browser: true, devel: true, vars: true */
/* canvas details */
var width = 800;
var height = 600;
var canvas;
var ctx;
var frameRate = 1 / 40; /* seconds */
var frameDelay = frameRate * 1000; /* milli-seconds */
var loopTimer;
var nrClicks = 0; /* controls the number of clicks d... | true |