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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
527ea9037ea797af5d5003b204e212ff754728ba | JavaScript | tuiSSE/laufschrift-online | /rails/app/assets/javascripts/util.js | UTF-8 | 1,022 | 2.765625 | 3 | [] | no_license | "use strict";
var FlashMessage = {
success: function(text) {
$.achtung({message: StringUtil.htmlencode(text), timeout:5, className:'achtungSuccess'});
},
error: function(text) {
$.achtung({message: StringUtil.htmlencode(text), className:'achtungFail'});
},
status: function(text) {
$.achtung... | true |
1a0ac71cbfa46325173a90f846bebf09317a483f | JavaScript | Immatechy/Dufuna-CodeCamp20 | /submissions/victorAienobe/dom/contact.js | UTF-8 | 1,309 | 3.171875 | 3 | [] | no_license | let submitForm = document.getElementById('submit');
let fullName = document.getElementById('fullName');
let email = document.getElementById('email');
let subject = document.getElementById('subject');
let textArea = document.getElementById('textArea');
let fullNameMsg = 'Please enter your Name';
let emailMsg = "Please e... | true |
57ecb344548e9a3b6747edda5a6f467aeaa206ac | JavaScript | kierangoodacre/till_tech_test-1 | /spec/BillSpec.js | UTF-8 | 508 | 2.625 | 3 | [
"MIT"
] | permissive | describe('Bill', function(){
beforeEach(function(){
bill = new Bill();
});
describe('Tally', function(){
it('Has no items by default', function(){
expect(bill.tally).toEqual([]);
});
it('Item price can be added', function(){
bill.addItemPrice('Cafe Latte');
expect(bill.tally).toEqual([4.75]);
... | true |
a63d3db159eb59687215f6886eaf2be704caa27f | JavaScript | astraqube/X1_Resource | /app/dao/AuthDAO.js | UTF-8 | 1,171 | 2.53125 | 3 | [] | no_license | var User = require('../models/User');
const hashPassword = require('../utils/AuthUtils').hashPassword;
function AuthDAO() { }
AuthDAO.prototype.handleRegister = function (payload, callback) {
console.log("handleRegister payload" + JSON.stringify(payload));
let user = new User();
user.id = payload.id;
user.ema... | true |
8c5c7e5aacad33bee208926bca531beaa30676ce | JavaScript | node-migrator-bot/node-gsl | /test/random.js | UTF-8 | 3,244 | 2.734375 | 3 | [] | no_license |
var assert = require('assert'),
gsl = require('..');
module.exports = {
'Test min - function': function(){
assert.eql('number', typeof gsl.random.min());
assert.ok(!isNaN(gsl.random.min()));
},
'Test max - function': function(){
assert.eql('number', typeof gsl.random.max());
assert.ok(!isNaN(gsl.random.ma... | true |
4d033bcfc24f6dac18a8df62d71c13840095b70e | JavaScript | DUU-Dev-Ops/theseus | /data_generators/attendanceFixer.js | UTF-8 | 1,913 | 2.53125 | 3 | [] | no_license | var request = require('request');
var keys = require('../env_vars.js');
data = [];
newData = [];
function lookup(index) {
if (index === data.length) {
console.log(JSON.stringify(newData));
return;
}
point = data[index];
cardNum = point["netid"];
if (cardNum.charAt(cardNum.length -... | true |
afb3c862871f545142d684a0ac727b05369b4372 | JavaScript | milk-abc/The-front-end-of-the-2022-Autumn-Recruitment | /leetcode/排序/归并排序.js | UTF-8 | 615 | 3.703125 | 4 | [] | no_license | function mergeSort(arr) {
let len = arr.length;
if (len < 2) {
return arr;
}
let middle = Math.floor(arr.length / 2),
left = arr.slice(0, middle),
right = arr.slice(middle);
return merge(mergeSort(left), mergeSort(right));
}
function merge(left, right) {
let res = [];
while (left.length && rig... | true |
73798307756a8867eebf5d58fa54485c6901fd19 | JavaScript | treetrees/Khuwy | /Khuwy-AI-master/Khuwy/obstacle.js | UTF-8 | 1,785 | 2.921875 | 3 | [] | no_license | class Obstacle {
constructor(yPos, windDir) {
this.height = 16;
this.width = 44;
this.x=32;
if (windDir < 0){
this.x=570;
}
this.y=yPos - this.height;
this.xVel = windDir * (.85 + random(2.5));
this.wasPassed = false;
... | true |
5ceb64c1e2ff582ae57e6f103d3debe0b99d5ff6 | JavaScript | gbbyuluo/auto_fe | /jQueryUi/views/常用js功能/时间相互之间转化.js | UTF-8 | 393 | 3.6875 | 4 | [] | no_license | //now,格式例如newDate();newDate(1512720796810)
function formatDate(now) {
var year=now.getFullYear();
var month=now.getMonth()+1;
var date=now.getDate();
var hour=now.getHours();
var minute=now.getMinutes();
return year+"-"+month+"-"+date+" "+hour+":"+minute;
}
//实例
var ... | true |
c3133b909b68827797432359150a77770bda2db0 | JavaScript | Damianruizz/Torteria_JS | /javascript.js | UTF-8 | 2,274 | 3.140625 | 3 | [] | no_license | $( ".create-oven" ).on("submit", function( event ) {
event.preventDefault();
$( ".create-oven" ).remove();
$(".oven").css("visibility", "visible");
$(".oven").append('<form id="cook"><input type="text" id="type" name="type" placeholder="Type"><input type="text" id="time" name="time" placeholder="Time"><input... | true |
40063e1335d294eb58b77c404d1522084a842073 | JavaScript | Yippeee/MyTest | /tamplate2.js | UTF-8 | 1,186 | 3.1875 | 3 | [] | no_license | var TemplateEngine = function (tpl, data) {
const reg = /<%(.+?)%>/g, regOperator = /(if|else|switch|break|case|}|{)/g
let group
let code = 'let r = [];', pointer = 0
const handleTpl = (line, isJs) => {
if (isJs) {
if (regOperator.test(line)) {
code +... | true |
aab30cd0c48744057905963a47a0abf5749db0af | JavaScript | gregorytm/express-bizTime | /routes/invoices.js | UTF-8 | 3,214 | 2.5625 | 3 | [] | no_license | //routes for invoices
const express = require("express");
const ExpressError = require('../expressError');
const router = express.Router();
const db = require("../db")
router.get('/', async (req, res, next) => {
try{
const results = await db.query(
`SELECT * FROM invoices`);
return... | true |
ac6f8d5c80fa45513c05da765ec370dc0c39bde5 | JavaScript | norando/gas_monitoring | /sendline.gs | UTF-8 | 1,223 | 2.609375 | 3 | [] | no_license | const setSearchCondition = () => {
const label = prop.getProperty('label');
const now = Math.floor(new Date().getTime() / 1000) ;
const interval = 60;
const term = now - (60 * interval);
return '(label:' + label + ' is:unread after:'+ term + ')';
}
const getMessages = (searchResult) => {
const mails = Gma... | true |
5465d51d6af051fdef4dfda463f8ead65fcdafe7 | JavaScript | vasanthsreeram/That_Aquarium_Webapp | /Webapp/ThatAquariumWebapp/store/static/scripts/main.js | UTF-8 | 3,110 | 2.53125 | 3 | [] | no_license | // cookies stuff
function getToken(name) {
let cookieValue = null;
if (document.cookie && document.cookie !== '') {
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i].trim();
// Does this cookie string begin... | true |
327483ca742e5a9b300b700712b07db687fb88aa | JavaScript | dingjiamughal/jsCleanUp | /leetcode/src/string/1.js | UTF-8 | 251 | 3.03125 | 3 | [] | no_license | const s = 'Let\'s study hard and progress together';
export default function reverse1(str) {
return str.split(' ').map(item => (item.split('').reverse().join(''))).join(' ');
}
console.log(reverse1(s)); // s'teL yduts drah dna ssergorp rehtegot
| true |
ef4d03f891462d86c5496a9b36bd115e85445767 | JavaScript | proactive-dev/coinfi | /app/javascript/App/containers/app/uiReducer.js | UTF-8 | 1,161 | 2.84375 | 3 | [] | no_license | import { fromJS } from 'immutable'
const initialState = fromJS({})
export default (state = initialState, action) => {
const { type, keyPath } = action
let value
switch (type) {
case 'DISABLE_UI':
if (typeof keyPath === 'string') return state.set(keyPath, false)
return state.deleteIn(keyPath)
... | true |
fc1c80bfd5ac23bb133150f0878f82343eb03f4b | JavaScript | zxcq544/simple-menu-animation-test | /public/Menu.js | UTF-8 | 2,132 | 2.640625 | 3 | [] | no_license | console.log('Hello');
let menu = [
{
name: "top level 1",
children: [
{
name: "second level 1",
children: [
{ name: "third level 1", children: [] },
{ name: "third level 2", children: [] },
{ name... | true |
09bb62fb84cafe9683f811a6e96c84c95fde978d | JavaScript | tanapop/Maze-Spinner | /lib/spin_motion.js | UTF-8 | 740 | 2.96875 | 3 | [] | no_license | export let stopSpin;
export let rotator;
export let rotatie;
function rotate(angle, counter, degrees, el){
degrees += angle;
rotator = setTimeout(() => {
counter++ ;
el.style.transform = `rotate(${degrees}deg)`;
if(counter < 90) {
rotatie = setTimeout(() => {
rotate(angle, counter, de... | true |
485f8b9c64e25347fc7018a193ec79c89e0ba606 | JavaScript | lvreynoso/Calcumon.Web | /public/js/animate.js | UTF-8 | 4,562 | 3.5625 | 4 | [] | no_license | // function that gets - calcumon sprite with hand motion
// - a paint ball image
// - the direction for throwing (1 for right, -1 for left)
// Use these to create a phaser animation of calcumons throwing a paintball
// Initialize game
let config = {
type: Phaser.AUTO,
wid... | true |
d3169dc3cfa929eeb3e1ca4d4b79bae52c60efa4 | JavaScript | squareben1/stock-alert | /spec/StockChecker.spec.js | UTF-8 | 1,294 | 2.71875 | 3 | [] | no_license | const StockChecker = require("../src/StockChecker");
const mockPriceObject = require("../mockStockObject.json");
const mockPriceDataOver5 = {
currencySymbol: "$",
currency: "USD",
regularMarketPrice: { raw: 192.4, fmt: "182.78" },
symbol: "VTWIX",
regularMarketChangePercent: { raw: -0.050042556, fmt: "-5.00%... | true |
a257067873ac81ce6b6ac7c43c62f037ff3cfec8 | JavaScript | SISALGO/JS-ThinkStack | /inseong-so/dynamicProgramming/15724/15724.js | UTF-8 | 1,687 | 3.109375 | 3 | [
"MIT"
] | permissive | const solution = (N, M, matrix, territoryRange) => {
const cacheInit = (N, M, matrix) => {
const dp = Array.from({ length: N + 1 }, () => Array(M + 1).fill(0));
for (let i = 1; i <= N; i++) {
for (let j = 1; j <= M; j++) {
dp[i][j] += dp[i - 1][j] + matrix[i - 1][j - 1];
}
}
for (l... | true |
c2c8ed4516972736b08428bebd04607cb1778ecd | JavaScript | Alex-Just/json2jsdoc | /src/lib/index.js | UTF-8 | 1,905 | 3.1875 | 3 | [
"MIT"
] | permissive | export function convertJsonToJsdoc (jsonData) {
let obj
try {
obj = JSON.parse(jsonData)
} catch (e) {
return e
}
return processObject({obj, objName: ''}).trim()
}
function processObject ({obj, name}) {
let objects = []
let t = '/**\n'
if (name) {
t += ` * ${red('@typedef')} {${capitaliz... | true |
421498df04753c01f494efff6de8ffdbe2e912d9 | JavaScript | HarshKapadia2/vocab | /src/static/js/back_to_top_btn.js | UTF-8 | 501 | 3.125 | 3 | [
"MIT"
] | permissive | const header = document.querySelector("#header");
const back_to_top_btn = document.querySelector(".back-to-top-btn");
back_to_top_btn.addEventListener("click", () => header.scrollIntoView(true));
const observer = new IntersectionObserver(scrollToTop);
observer.observe(header);
function scrollToTop(entries, observe... | true |
8c2cbe733d036cee80208cd5c62173bd8475f5d9 | JavaScript | JasonMonroe-EdgeTech/SD-101-Angular-Http | /JS-Day-5-Storage/scripts/myScript.js | UTF-8 | 499 | 2.78125 | 3 | [] | no_license |
console.log(sessionStorage.HackerName+"..."+sessionStorage.Message);
console.log(localStorage.UserName+" High Score: "+localStorage.HighScore);
sessionStorage.HackerName = "Neo";
sessionStorage.Message = "The Matrix Has you...";
localStorage.UserName = "YatzeeKing";
localStorage.HighScore = "622";
console.log("---... | true |
ca56e6bb420fd29bb60d5a7b95ac005da7df3899 | JavaScript | soyaliciaflores/HarryPotter | /harrypotterapp/src/App.js | UTF-8 | 2,158 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import Cards from "./components/Cards";
import Students from "./components/Students";
import Staff from "./components/Staff";
import "./components/styles/styles.scss";
import logo from "./assets/logo.png";
import FilterAlive from "./components/FilterAlive";
import Fil... | true |
ffabc2dc2c9f81856a41941cc7994946120e202a | JavaScript | jefflee1990710/yahoofinance-worker | /src/yahoo.js | UTF-8 | 1,705 | 2.515625 | 3 | [] | no_license | const axios = require('axios')
const {Parser} = require('json2csv')
const moment = require('moment-timezone');
async function getData(code, start, end, interval){
try{
let url = `https://query1.finance.yahoo.com/v8/finance/chart/${code}?symbol=${code}&period1=${start}&period2=${end}&interval=${interval}&in... | true |
978844ecc374ce9b2c8047d7183457518781357f | JavaScript | rechandler/contractGenerator | /api/db/seed.js | UTF-8 | 2,615 | 2.53125 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-console */
const { PrismaClient, dmmf } = require('@prisma/client')
const dotenv = require('dotenv')
dotenv.config()
const db = new PrismaClient()
const clearAllData = async () => {
console.log('Deleting Previous Records ....')
const modelNames = dmmf.datamodel.models.map(model => model.name.... | true |
7d61a4f889ea071ffe0ab9bbe4ce1f77513c2bbb | JavaScript | vmvini/bdncproject | /public/maps/marker.js | UTF-8 | 3,329 | 2.921875 | 3 | [] | no_license | //ICONES PARA CADA TIPO DE DENUNCIA
var MARKER_ICON = (function() {
var icon = "http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|";
var private = {
'Assédio': icon+"FFD50A",
'Violência': icon+"950770",
'Estupro': icon+"B91B0F"
};
return {
get:... | true |
a9c70c665c68db23a8f64b268ac248a02d7c85d3 | JavaScript | realbwoi/rest-countries-api | /src/components/country/Country.js | UTF-8 | 1,753 | 2.671875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { useParams } from 'react-router';
import { Link } from 'react-router-dom'
import axios from 'axios';
export default function Country() {
const { country } = useParams();
const [ countryData, setCountryData ] = useState();
const [ borderCountryData, setB... | true |
267fbba4d7751a3ffcad0a6a844fd3cd70d1dd9b | JavaScript | tlee319/Webscraping-MLB-Players | /scrape.js | UTF-8 | 4,225 | 2.96875 | 3 | [] | no_license | const request = require('request');
const cheerio = require('cheerio');
var ffURL = 'https://www.pro-football-reference.com/years/2018/fantasy.htm';
runFFURL({ uri: ffURL, headers: { 'User-Agent': 'request' } });
function runFFURL(options) {
request(options, (error, response, html) => {
if (!error && resp... | true |
45f3743e0941ecf3403f565143f0ecf6e0aecfd3 | JavaScript | RedHatInsights/tower-analytics-frontend | /cypress/e2e/Notifications.spec.js | UTF-8 | 1,651 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /* global cy, Cypress */
import { notificationsUrl } from '../support/constants';
const appid = Cypress.env('appid');
const getUniqueRandomNumbers = (upperBound, total, excluded) => {
let randomIDS = [];
while (randomIDS.length < total) {
let thisID = Math.floor(Math.random() * upperBound);
if (!randomIDS... | true |
c8d32cad8b1d31b5a62384d0de084667ad3e4b62 | JavaScript | AndyAmorim/pet-shop | /index.js | UTF-8 | 2,764 | 3.5625 | 4 | [] | no_license | const nomepetshop = "PETSHOP"
let pets = [
{
vacinado: false,
sintomas: ['febre', 'dor'],
pelo: 'curto',
agressividade: 'calmo',
servicos:[],
idade:2,
peso: 4,
categoria: "cachorro",
nome: "Jose"
},
{
vacinado: false,
... | true |
135559c79e85ba0529733b682e1d97de37062cfc | JavaScript | lina-22/sep_21_-js-_exersise- | /start_stop/script.js | UTF-8 | 359 | 2.8125 | 3 | [] | no_license | (()=>{
let workOn = document.querySelector('.tifa');
workOn.addEventListener('click', ()=>{
if(workOn.classlist.contains('start')){
workOn.classList.remove('start'),
workOn.classList.add('stop')
}else{
workOn.classList.remove('stop');
workOn.classL... | true |
caa95886a8f875df8153a784ba51fafb4435d56c | JavaScript | asriii/Wilddog | /public/js/customer.js | UTF-8 | 2,996 | 2.84375 | 3 | [
"MIT"
] | permissive |
$(document).ready(function() {
$('#submitAdd').on("click",function(){
if($("#action").val() == "ADD"){
saveCustomer();
} else {
updateCustomer($("#custom_id").val());
}
});
$('#btnAdd').on("click", function(){
$('#customerModal').modal("show")
... | true |
b4de9bf30d3a8619d11bd01c651c2f9f624f7b66 | JavaScript | JacobLayton/code-problems | /hackerrank/Algorithms/algorithms/betweenTwoSets.js | UTF-8 | 973 | 3.90625 | 4 | [] | no_license | function getTotalX(a, b) {
// calculate aLast integer
const aLast = a[a.length - 1];
// calculate bFirst integer
const bFirst = b[0];
// check which number(s) between aLast and bFist are divided evenly into and put into a new array
const arrTemp = [];
for (let i = aLast; i <= bFirst; i++) {
let flagA... | true |
b81800dc86c8bb5e578570f185e50fa98e443d31 | JavaScript | moinul7002/react-star-matching-game | /src/customHook/index.js | UTF-8 | 1,091 | 3.0625 | 3 | [] | no_license | import { useState, useEffect } from "react";
import utils from "../utils";
//Custom Hooks
const useGameState = () => {
const [stars, setStars] = useState(utils.random(1, 9));
const [available, setAvailable] = useState(utils.range(1, 9));
const [candidate, setCandidate] = useState([]);
const [seconds, setSecond... | true |
0296b96a469f3d5a07e251c8014819ac24cb5c62 | JavaScript | Jahoda/animovany-prechod | /script.js | UTF-8 | 680 | 2.828125 | 3 | [] | no_license | var doba = 0.25;
document.body.style.animation = document.body.style.webkitAnimation = "zmizet " + doba + "s ease-in reverse";
function plynuleSkryt(el, delka) {
document.body.style.animation = document.body.style.webkitAnimation = "";
setTimeout(function() {
document.body.style.animation = document.bo... | true |
bc19ae560e19175852daf537cf34a1470dd3a284 | JavaScript | vsashyn/qnm | /src/actions/fuzzy-search.js | UTF-8 | 3,986 | 2.5625 | 3 | [
"MIT"
] | permissive | const chalk = require('chalk');
const figures = require('figures');
const logUpdate = require('log-update');
const isEmpty = require('lodash/isEmpty');
const Input = require('../fuzzy-search/input');
const sortBySimilarity = require('../fuzzy-search/sort-by-similarity');
const getAction = require('./get');
const HALF... | true |
25925a0788c37914e3abaa4c00b6d7133f7ee4ca | JavaScript | edmw/scripts | /files/galleries/scripts/2015page.js | UTF-8 | 3,186 | 2.546875 | 3 | [] | no_license | /*
* Requires
* - jquery-3.1.1.slim.min.js
* - jquery.popupoverlay-1.7.13.min.js
*/
/*
* Load next image page, if any.
*/
function nextImage() {
// get link to next image page from html link element.
var href = $('link[rel=next]').attr('href')
if (href) {
window.location.href = href;
}
}
... | true |
30f5024ba8a5a4579f673a442210e1c0da805b6f | JavaScript | scriptfoundry/karma-requirejs-mock | /test/specs/FooSpec.js | UTF-8 | 941 | 2.5625 | 3 | [] | no_license | define(['chai', 'mocker'], function (chai, mocker) {
var expect = chai.expect;
describe("Foo", function () {
describe("Base functionality", function () {
it("should have correct Foo with a mocked Bar", function (done) {
var mocks = {
'Bar': function () {
this.id = "Bar12345";
}
};
... | true |
0c1620c163dd17f2a6102a91125eeba09f5df851 | JavaScript | Jack1993116/trello | /frontend/src/redux/reducers/auth/auth.reducer.jsx | UTF-8 | 882 | 2.59375 | 3 | [] | no_license | import UserActionTypes from './auth.action.type';
const INIT_STATE = {
isLogin: false,
isSignup: false,
user: null,
status: null,
error: null,
loading: false
}
const userReducer = (state=INIT_STATE, action) => {
let error;
switch (action.type) {
case UserActionTypes.SIGN_UP_SUCCESS:
return {...state, isS... | true |
2c2d033ba5982bcbeafab0e6023a74b96f471dab | JavaScript | ntesh2021/portfolio | /js/scripts.js | UTF-8 | 3,377 | 2.515625 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded", (event) => {
// Activate Bootstrap scrollspy on the main nav element
const mainNav = document.body.querySelector("#mainNav");
if (mainNav) {
new bootstrap.ScrollSpy(document.body, {
target: "#mainNav",
offset: 74,
});
}
// Collapse responsive na... | true |
2eb49d0d2ed07af141bc70f0441468ed80c13c0e | JavaScript | fullstacksk/react-lab | /src/quokka/sample.js | UTF-8 | 420 | 3.453125 | 3 | [] | no_license | import axios from 'axios';
const a = 20;
console.log(a);
const array = [ 12, 13, 14, 15 ];
const sum = array.reduce((acc, curr) => {
return acc + curr;
});
console.log(array, sum);
function add(a, b) {
return a + b;
}
console.log(add(11, 22));
const getUser = async (id) => {
const res = await axios({
method: ... | true |
197dadb2521783188795b5e9dac65f9dc4b49a5a | JavaScript | GioRichard/SpeedCode | /assets/js/app.js | UTF-8 | 1,591 | 2.796875 | 3 | [] | no_license |
// thay đổi ảnh banner đơn giản
const images = document.querySelectorAll(".list img");
images.forEach(el => addEventListener("click",HandleChangeImage));
function HandleChangeImage(e){
const source = e.target.getAttribute("src");
const featureImage = document.querySelector(".feature-image");
featureImage.s... | true |
ca9cb30e1cf872f192e370d1d47ddd0ec2185239 | JavaScript | becky168/react-todo | /webpack.config.js | UTF-8 | 9,342 | 2.625 | 3 | [] | no_license | var webpack = require("webpack");
/**
* The path module provides utilities for working with file and directory paths.
* It is built in node.js, there's no need to install it.
*/
var path = require("path");
/*
Parse and load environment files (containing ENV variable exports)
into Node.js environment, i.e. process.en... | true |
c0e1660becf1b8edd0f54d40ca3f76ec82f23c66 | JavaScript | amygbui/HappyMe | /frontend/components/restaurant/show/photo_highlights.jsx | UTF-8 | 1,507 | 2.546875 | 3 | [] | no_license | import React from 'react';
class PhotoHighlights extends React.Component {
constructor(props) {
super(props);
this.state = { img1: "img-default",
img2: "img-selected",
img3: "img-default"
};
this.switchHover = this.switchHover.bind(this);
this.re... | true |
96ad70e60efbb428f2ede66fdf3fa0f7253a47d5 | JavaScript | matheusmr13/app-script-api | /meta/MetaFunction.js | UTF-8 | 1,063 | 2.84375 | 3 | [] | no_license | const JUMP_LINE = '\n';
const FORMAT_CHAR = '\t';
class MetaFunction {
constructor({
name = '',
type = '',
parameters = [],
privacy = ''
}) {
this.name = name;
const typeParts = type.split('.');
this.type = typeParts[typeParts.length - 1];
this.parameters = parameters;
const parametersDep = this.p... | true |
daf50487d593fdc7e8b297880eeb92f04c5ac254 | JavaScript | Roman-Hana/express | /index.js | UTF-8 | 272 | 2.765625 | 3 | [] | no_license | import express from "express";
const app = express();
const port = 3000;
app.get("/hello", function (req, res) {
const name = req.query.name;
res.send({ message: `Hello ${name}` });
});
app.listen(port, () => {
console.log(`Example app listening at ${port}`);
});
| true |
4e540d4a499294c2264ca2b067ac3eab3f493d1a | JavaScript | rplsykes/Borboun | /client/views/login/login.js | UTF-8 | 738 | 2.65625 | 3 | [] | no_license | define(["jquery", "app", "auth"], function($, App, Auth) {
// Handle login button click.
$('#login_form').submit(function(e) {
e.preventDefault();
var credentials = {
Username: $("#username_fld").val(),
Password: $("#password_fld").val()
};
if ( !credentials.Username |... | true |
8e32f1371bfee625451f45c86d2a0189e8b3c8e7 | JavaScript | persevereC/nodejs-crawler-douban | /recursion.js | UTF-8 | 1,867 | 2.765625 | 3 | [] | no_license | const https = require('https');
const fs = require('fs');
const cheerio = require('cheerio');
var data = [], images = [], pages = [];
for(let i = 0; i < 250; i = i + 25){
pages.push(i);
};
var p = 0;
getData();
var a = new Date();
function getData(url){
/*var option = {
hostname: 'movie.douban.com... | true |
75ffe37e733a93e9779dd580799738ec9d723d43 | JavaScript | Kennedy777/tracksuggestor | /js/scripts.js | UTF-8 | 1,331 | 3.3125 | 3 | [
"MIT"
] | permissive | // var total = function(company + work + food + people + city) {
// if ((company + work + food + people + city) <= 7) {
//
// return "You might enjoy taking CSS/Design";
//
// } else if ((company + work + food + people + city) > 8 && (company + work + food + people + city) <= 12) {
//
// return "You might enjoy R... | true |
32144a6f8b57393dc4467a64ff4cb3ad1b3d3f01 | JavaScript | Spartak-Belov-Floresku/pokedex | /src/Pokemons.js | UTF-8 | 1,319 | 2.828125 | 3 | [] | no_license | import ReactDOM from 'react-dom'
import './Pokemons.css';
import pokedex_arr from './pokedex';
const ChangePokemons = id => {
const pokemons = document.querySelectorAll('.Pokemons');
if(pokemons.length > 1){
pokemons.forEach(elm => {
if(elm.getAttribute('data-id') != id){
... | true |
390cd4160b7b7a4a2628972eaeed41c02ab15188 | JavaScript | LeaCamara/GuineaPig | /events.js | UTF-8 | 2,998 | 3.921875 | 4 | [] | no_license | // DONE: When any section is clicked the output target text should be "You clicked on the {text of the section} section"
// DONE: When the mouse is over the h1 tag, the output element should contain the text "You moved your mouse over the header".
// DONE: When the mouse leaves the h1 tag, the output element should con... | true |
1f90c857fdfae6c46e9e23962588257f7bfaa00d | JavaScript | prismm/remarket | /server/api/actions.js | UTF-8 | 16,409 | 2.828125 | 3 | [] | no_license | /* ROUTES FOR PATH '/api/actions' BELOW */
const express = require('express');
const router = express.Router();
const model = require('../db');
const Endorsement = model.Endorsement;
const User = model.User;
const Listing = model.Listing;
const Comment = model.Comment;
const Offer = model.Offer;
var Analytics = requir... | true |
3ec615646136877e43bbbd77efbc18133ea23743 | JavaScript | sacros/vue_tutorial | /test/yo.js | UTF-8 | 3,048 | 3.078125 | 3 | [] | no_license | // const app = new Vue({
// el:"#mahapp",
// data:{
// sacros: {
// first: "Shubham",
// last: "Suyal",
// age: 22
// },
// anct: {
// first: "Sacros",
// last: "anct",
// age: 23
// },
// friends: [
... | true |
71d98a6bbef0581e326502ad8fb3cc97dd19cfaa | JavaScript | vadimJS/web-server-with-service | /controllers/users.js | UTF-8 | 2,859 | 2.515625 | 3 | [] | no_license | const userHandler = require('../handlers/users');
module.exports = {
addUser: async (req, res) => {
if (!req.body.name || !req.body.age) {
res.json(`Request data not full! Body: ${req.body}`);
return res.end();
}
let user = new userHandler(req.body);
try {
... | true |
c08a5c5f5890d80864da78717fa981db111f0f4c | JavaScript | prajadimas/bankboss | /modules/saveToken.js | UTF-8 | 1,527 | 2.546875 | 3 | [] | no_license | const db = require('../config/db')
module.exports = function (token, client, user) {
return new Promise((resolve, reject) => {
// console.log('token: ', token)
// console.log('client: ', client)
// console.log('user: ', user)
console.log('using [QUERY]: INSERT INTO token(access_token,access_token_expir... | true |
c5206a229daad69a15c68a9778c3f8d3950d4c5a | JavaScript | Adreah/adminTest | /07.js | UTF-8 | 2,165 | 3.078125 | 3 | [] | no_license | var url=require("url");
// console.log(url)
// {
// Url: [Function: Url],
// parse: [Function: urlParse],
// resolve: [Function: urlResolve],
// resolveObject: [Function: urlResolveObject],
// format: [Function: urlFormat],
// URL: [Function: URL],
// URLSearchParams: [Function: URLSearchPar... | true |
a2f4bff7597d36dfaaa1a3407e8e80afb033925c | JavaScript | stefanus1292/h8-p0-w2 | /exercises-12.js | UTF-8 | 438 | 3.234375 | 3 | [] | no_license | function konversiMenit(menit) {
let minute = math.floor(menit/60)
let second = menit %60
if (String(second).length ===1){
second = "0+second"
}
let hasil = minute + ":" + second
return String(hasil)
}
// TEST CASES
console.log(konversiMenit(63)); // 1:03
console.log(konversiMenit(124)); // 2:04
consol... | true |
b02fd149e1bcc540bb4779d6399b05378ca78523 | JavaScript | AidenBow/pokeAPI | /src/actions/actions.js | UTF-8 | 1,362 | 2.640625 | 3 | [] | no_license | import axios from "axios"
import {connect} from "react-redux"
export const FETCH_POKEMON_START = "FETCH_POKEMONS_START";
export const FETCH_POKEMON_SUCCESS = "FETCH_POKEMONS_SUCCESS";
export const FETCH_POKEMON_FAILURE = "FETCH_POKEMON_FAILURE";
export const FETCH_NEXT_SUCCESS = "FETCH_NEXT_SUCCESS";
export const FE... | true |
4a04ac82987dba1e57c3ea4a7ce5d5ffa29ef28a | JavaScript | cheonseungmin/algorithm | /프로그래머스/lv3/멀리 뛰기.js | UTF-8 | 134 | 3.40625 | 3 | [] | no_license | let n = 5;
let arr = [0, 1, 1];
for (let i = 3; i <= n; i++) arr[i] = (2 * arr[i - 2] + arr[i - 1]) % 1234567;
console.log(arr[n])
| true |
8516346daa14748d735cf5d3eda77e93d9b74b49 | JavaScript | unboundedimages/jervayNews | /src/Test.js | UTF-8 | 521 | 2.609375 | 3 | [] | no_license | import React from "react";
class Tester extends React.Component {
setState= {
myapi:{}
}
componentDidMount() {
fetch("https://jervay.agency/tester")
.then(res => res.json())
.then(res => console.log(res))
}
render() {
// let arr = [];
// Ob... | true |
521f13a9308098b7759566a66ee1ec86c7e3ed8b | JavaScript | samuel-casey/rails-prods-reviews-client | /src/Components/Product/Product.js | UTF-8 | 2,331 | 2.71875 | 3 | [] | no_license | import React, { useState } from 'react';
import axios from 'axios';
import './Product.css';
export default function Product({
product,
selectReview,
selectProduct,
history,
handleDelete,
}) {
const [reviews, setReviews] = useState([]);
const handleClick = async (e) => {
const reviewData = await axios.get(
... | true |
ef17540a6d25ca50e9600f1b9e858f626a8e4a07 | JavaScript | AAI-USZ/FixJS | /input/100+/after/9136233d28a10c98c1f8b4c81cf10c0ceddf8e47_6_1.js | UTF-8 | 471 | 2.53125 | 3 | [
"MIT"
] | permissive | function() {
var foodStrings, graph, pairs;
graph = new Game.Graph(this.grid.toGraph());
Game.log(graph);
foodStrings = this.grid.foodItems._queue.map(function(item) {
return item.toString();
});
pairs = graph.dijkstras.apply(graph, [this.head.toString()].concat(__slice.call(... | true |
f02ad4890622643751dd353f065a1c733cbb546c | JavaScript | AnanthaKannan/date-fn | /function/util.js | UTF-8 | 833 | 2.859375 | 3 | [] | no_license | module.exports = {
getDate_, getMonth_, getMonthShort, getMonthLong
}
function getDate_(date){
const getDate = date.getDate();
if(getDate < 10) return `0${getDate}`;
else return getDate;
}
function getMonth_(date){
const getMonth = date.getMonth() + 1;
if(getMonth < 10) return `0$... | true |
2625768a76a3bbb2cc6cbe2673d0cabe8f1aa912 | JavaScript | 3nj0y/New-Project | /js/script.js | UTF-8 | 2,938 | 3.234375 | 3 | [] | no_license | /* Задания на урок:
1) Удалить все рекламные блоки со страницы (правая часть сайта)
2) Изменить жанр фильма, поменять "комедия" на "драма"
3) Изменить задний фон постера с фильмом на изображение "bg.jpg". Оно лежит в папке img.
Реализовать только при помощи JS
4) Список фильмов на странице сформировать на основании... | true |
3c09c4dd785a6382155037c497221ac8783c3ffa | JavaScript | OBGame/FreeGame | /WebContent/js/map/SceneCollection.js | UTF-8 | 2,117 | 3.109375 | 3 | [] | no_license | /**
*
*/
Game.SceneCollection=function(){
this.scenes={};
}
Game.SceneCollection.prototype.init=function(){
var firstScene=new Game.AtomScene().init();
this.scenes[this.generateId(0,0)]=firstScene;
}
/**
*expand scenes[i][j]'s area
* direct:
* 1
* ---
* 4 |i,j| 2
* ---
* 3
*/
... | true |
5c3c099da37994041a7c85e9dcabfb350b61e21a | JavaScript | tkmagesh/Cisco-Node-Dec-2015 | /Day-02/09-appServer/calculatorHandler.js | UTF-8 | 1,191 | 2.765625 | 3 | [] | no_license | var calculator = require('./calculator'),
qs = require('querystring');
module.exports = function(req, res, next){
if (req.url.pathname === '/calculator'){
console.log('beginning calculator')
if(req.method === 'GET'){
var n1 = parseInt(req.url.query.n1, 10),
n2 = pars... | true |
bc3fb34b2394ecc12c1e38e431f6220ad3a69e74 | JavaScript | 666ghy/oppophone | /shopping.js | UTF-8 | 5,519 | 2.65625 | 3 | [] | no_license | define(["jquery","jquery-cookie"],function($){
//node8-->oAa;Foo-->node9;node1--->oShapping,node2--->oSlide
function shopping(node8,node9,node1,node2){
$(node1).hover(function(){
$(node2).stop(true).animate({
right:0,
}, 1000)
... | true |
e10368511d403b7c9d7a84ba9af8c439c939bb70 | JavaScript | matzayonc/intro-to-javascript | /L7 - Formularze/zadanieB.js | UTF-8 | 1,494 | 2.671875 | 3 | [] | no_license | var express = require("express")
var app = express()
const PORT = 3000;
var path = require("path")
var bodyParser = require("body-parser")
app.use(bodyParser.urlencoded({ extended: true }));
var users = [
{ nick: "uno", mail: "uno@w.pl" },
{ nick: "duo", mail: "duo@w.pl" }
]
function isMail(str) {
retu... | true |
4c258e5aac02e6a887f9c4a849420846b2fcce27 | JavaScript | pwlmaciejewski/getter | /examples/customGettersAndSetter.js | UTF-8 | 317 | 2.96875 | 3 | [
"MIT"
] | permissive | var getter = require('../lib/getter');
var obj = {};
getter.mixin(obj, {
foo: {
value: 'bar',
getter: function () {
return this.foo + this.foo
},
setter: function (val) {
this.foo = val + val;
}
}
});
console.log(obj.getFoo()); // "barbar"
obj.setFoo('x');
console.log(obj.getFoo()); // "xxxx" | true |
ee22d75915577922b47ffdffc4ac31ae82fb2dd4 | JavaScript | quanxuctu/try-if-else-1 | /ex5/js.js | UTF-8 | 226 | 2.984375 | 3 | [] | no_license | function check() {
let x = document.getElementById('a').value;
if (x<40){
alert('D')
}else if(x<60){
alert('C')
}else if(x<80){
alert('B')
}else if(x>=80){
alert('A')
}
} | true |
a0ab429b225092c370ba327581b3076b9d0783e5 | JavaScript | satishweb/senecajs-microservices-starter | /sharedlib/formatter.js | UTF-8 | 3,113 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | 'use strict';
var Localize = require('localize');
var lodash = require('lodash');
var microtime = require('microtime');
/**
* Function : This class will render messages/string according to the code and the arguments given as input.
* This requires the messages to be defined in translations.js
* @class ... | true |
4a00330665a0580736a263376548d868735237d6 | JavaScript | Kreator22/Test-CRUD | /ClientApp/src/components/GetPostExample.js | UTF-8 | 4,540 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
export class GetPostExample extends Component {
static displayName = GetPostExample.name;
componentDidMount() {
this.ReadData();
}
constructor(props) {
super(props);
this.state = {
ReceivedValue: 0,
ReceivedNes... | true |
3a1b39e589f78f71909cab6ca51780442e0cf33a | JavaScript | cristhianbenitez/eloquent-js-exercises | /2. Program Structure/2.1-Looping_a_triangle.js | UTF-8 | 509 | 4.5625 | 5 | [] | no_license | //EXERCISE:
//Write a loop that makes seven calls to console.log to output the following code
// #
// ##
// ###
// ####
// #####
// ######
// #######
//SOLUTION:
let str = '';
// FOR LOOP:
for (let i = 0; i < 7; i++) {
str += '#';
console.log(str);
}
// SHORTER FOR LOOP
for (let str = '#'; str.length <= 7; str ... | true |
13184b645f3e91c05272dbe3217d0b8ad15602e1 | JavaScript | IsmoPismo/Practice | /05_backend-web-dev/03_Express/02_assignment/app.js | UTF-8 | 931 | 3 | 3 | [] | no_license | var express = require("express")
var app = express();
app.get("/", function(req, res){
res.send("Hi there")
});
app.get("/sound/:animal", function(req, res) {
var animalSounds = {
dog : "Wau-Wau = Ruf-Ruf",
cat : "Mjau-Mjau = Meow-Meow",
rooster : "Kukuriku = Cock-a-Doodle-Doo",
... | true |
5757c4a068fab24731c1582204e2c8f2bf621c29 | JavaScript | DataWallet/crowdsale | /test/TestDataWalletToken.js | UTF-8 | 3,589 | 2.609375 | 3 | [] | no_license | const DataWalletToken = artifacts.require('./helpers/DataWalletToken.sol')
const assertFail = require('./helpers/assertFail.js')
const { increaseTimeTo } = require('./helpers/increaseTime')
const { latestTime, duration } = require('./helpers/latestTime')
contract('DataWalletToken', (accounts) => {
beforeEach(async... | true |
5d72ba327f49e32bf8ddc909d56371ee4610ca91 | JavaScript | cody0203/crwn-clothings | /src/redux/loading/loading.reducer.js | UTF-8 | 625 | 2.609375 | 3 | [] | no_license | import { shopTypes } from '../shop/shop.types';
const initialState = {
isLoading: false
};
const loadingTypes = [shopTypes.FETCH_COLLECTION_START];
const loadedTypes = [
shopTypes.FETCH_COLLECTION_FAILURE,
shopTypes.FETCH_COLLECTION_SUCCESS
];
const loadingReducer = (state = initialState, action) => {
if (lo... | true |
359d8f894ba31be7f6110e7ffbccd7d09c281b78 | JavaScript | codeglock/friday-challenge-04 | /src/context/SwitchContext.js | UTF-8 | 748 | 2.59375 | 3 | [] | no_license | import React, { createContext, useReducer } from "react";
export const SwitchContext = createContext();
const SwitchContextProvider = props => {
const [isLightOn, dispatch] = useReducer(SwitchReducer, false);
return (
<SwitchContext.Provider value={{isLightOn, dispatch}}>
{props.children... | true |
07fe487c6c7c4bff1ab1f0c086df05c7487a08a6 | JavaScript | wise-team/engrave | /engrave-blogs-renderer/src/themes/clean-blog/public/js/main.js | UTF-8 | 1,924 | 2.890625 | 3 | [] | no_license | $(document).ready(function () {
let skip = 12;
if($("#posts").children().length < 12) {
$('.center-button').hide();
}
$("#load-more").click(function (e) {
e.preventDefault();
var category = $('#category_indicator').val();
var username = $('#author_indicator').... | true |
00e8d60681925f3d05f39098acdaeb0254a4c9ff | JavaScript | 4wuyan/stemformatics-pyramid | /S4M_pyramid/public/js/workbench/graph_new.js | UTF-8 | 4,993 | 2.546875 | 3 | [] | no_license | var reA = /[^a-zA-Z]/g;
var reN = /[^0-9]/g;
function sortAlphaNum_array(a,b) {
// var a = a.toLowerCase();
// var b = b.toLowerCase();
var AInt = parseInt(a, 10);
var BInt = parseInt(b, 10);
if(isNaN(AInt) && isNaN(BInt)){
var aA = a.replace(reA, "");
var bA = b.replace(reA, "");
... | true |
9004daa0972fec8d0d90c140144a5f06f3e10dd8 | JavaScript | Miftakhunnurudin/sugoku | /src/store/reducers/boardReducer.js | UTF-8 | 950 | 2.921875 | 3 | [] | no_license | const initialStateBoard = {
loading: false,
board: [],
answer: [],
status: 'unsolved'
}
const boardReducer = (state = initialStateBoard, action) => {
switch (action.type) {
case 'FETCH_BOARD_START':
return {...state, loading:true}
case 'FETCH_BOARD_DONE':
const board_data = action.payload... | true |
2c170798f23e4264524239677a87beb77eb38c37 | JavaScript | masquel/intermoney-front | /src/utils/roundTo.js | UTF-8 | 160 | 2.796875 | 3 | [] | no_license | export default function roundTo(digit, decimals){
if(!digit) return undefined;
return Math.round(digit * Math.pow(10, decimals)) / Math.pow(10, decimals);
} | true |
fc1f6f6a1b3449077790168dc6f715292c434d0a | JavaScript | tungsteno22/sorting | /bubblesort.js | UTF-8 | 446 | 3.65625 | 4 | [] | no_license | function swapper(val, comparator) {
if (val > comparator) return true;
return false;
}
function bubbleSort(array) {
let totalLoops = array.length - 1;
while (totalLoops > 0) {
for (let i = 0; i < totalLoops; ++i) {
let currIdx = array[i];
let nextIdx = array[i + 1];
if (swapper(currIdx, ... | true |
defa34a8651aeabeaa2cbcfd5a06cfb7583bcf0a | JavaScript | KengpachiHa/alarm | /src/components/DateCheck.js | UTF-8 | 795 | 2.578125 | 3 | [] | no_license | import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
// import Button from '@material-ui/core/Button';
const styles = makeStyles({
root: {
display: "flex",
justifyContent: "space-around",
fontSize: "13px",
fontWeight: 400
}
})
export default function({ onDateChange }) ... | true |
6330b7321dccf8ebabb0144727255a55fdd07032 | JavaScript | trdancer/Books-of-History | /src/redux/book/bookActions.js | UTF-8 | 2,677 | 2.921875 | 3 | [] | no_license | import axios from 'axios'
export const FETCH_BOOKS_START = 'FETCH_BOOKS_START'
export const FETCH_BOOKS_SUCCESS = 'FETCH_BOOKS_SUCCESS'
export const FETCH_BOOKS_FAILURE = 'FETCH_BOOKS_FAILURE'
const MAX_BOOKS_PER_QUERY = 12;
export const fetchBooksStartCreator = (index) => {
return {
type : FETCH_BOOKS_STAR... | true |
528eb76b69a73ba33d6f785dd160cb93da9f612e | JavaScript | hrachyahakobyan/comp354-project | /scripts/glossary-test-table-generator.js | UTF-8 | 670 | 3.09375 | 3 | [] | no_license | const path = process.argv[2];
const json = JSON.parse(require('fs').readFileSync(path, 'utf8'));
const firstColSize = '4cm';
const dataColSize = '13cm';
let table = generateTableTop() + ' \n';
Object.keys(json).forEach((key) => {
table += generateRow(key, json[key]) + ' \n';
});
table += '\\end{longtable}\n';
con... | true |
5840daffcfa30c105c773a3eef6fd5a7f9cd9d94 | JavaScript | Sweetimg/yunchang | /js/index4.js | UTF-8 | 4,307 | 2.875 | 3 | [] | no_license | window.onload=function(){
//头部导航
var aTu1=document.querySelectorAll('.txyx-nav .zuo .li3 img');
var aBiao1=document.querySelectorAll('.txyx-nav .zuo .li3 .kk');
var aZi1=document.querySelectorAll('.txyx-nav .zuo .li3 span');
var aD1=document.querySelectorAll('.txyx-nav .zuo .li3 .zz');
var aL1... | true |
3b9bf84fb07efdc1da904d863db0119ff0637c45 | JavaScript | Keso93/citrus | /public/assets/js/main.js | UTF-8 | 1,744 | 2.671875 | 3 | [] | no_license | var template = $("#template").html();
var templateComment = $("#template-comment").html();
var title = new RegExp('{{title}}', 'g');
var mainRow = $("#mainRow");
var commentRow = $("#comment-row");
var adapterSettings = {
baseUrl: 'http://localhost:8000',
}
var adapter = {
post: function (route, data, success... | true |
c1ae2cb388f363e07562dffb9427b1fadf008435 | JavaScript | mscharlock/salmonCookies | /app.js | UTF-8 | 2,083 | 4.03125 | 4 | [
"LicenseRef-scancode-public-domain"
] | permissive | //Constructor function for our store
function Store (name, max, min, avgCookies) {
this.max = max;
this.min = min;
this.avgCookies = avgCookies;
}
//method for getting random customers - I'm not sure why this isn't working
//It may have to do with the fact that we are calling the function on the prototype
Store.... | true |
8310dc5d3d26644327480fa2c15c8058c2a094eb | JavaScript | Rosalita/js-play | /my-app/_test/clock.test.js | UTF-8 | 2,392 | 3.609375 | 4 | [] | no_license | const Clock = require("../src/clock.js").Clock
test ('There is a clock that has a time', () => {
const myClock = new Clock("07:00:00")
expect(myClock._time).toEqual("07:00:00")
});
test ('The clock can get the time', () => {
const myClock = new Clock ("12:34:56")
// 1. decide the inputs and outputs
// inpu... | true |
fc7613de79d188e855f209516749b1f7d4e206ce | JavaScript | krowka/JavaScript | /lab2/lab/script.js | UTF-8 | 4,638 | 3.40625 | 3 | [] | no_license | var all_words = 0;
var all_lines = 0;
var length;
var words_of_given_length = 0;
var lines_with_given_word = 0;
var arr = [0,0,0,0,0,0,0,0,0,0];
var colors = ["red", "blue", "purple", "grey", "green", "yellow", "black", "orange", "pink", "navy"];
var button = document.getElementById("btn");
function drawCircleCut(ctx,... | true |
e4bd01a2bd6b58ae70fba7d26fbb2132ead915fc | JavaScript | byte-pushers/myfamily | /src/main/webapp/libs/byte-pushers/com.bytepushers.utils.converters.date.DateConverter.js | UTF-8 | 9,503 | 2.59375 | 3 | [
"MIT"
] | permissive | /*global*/
var BytePushers = BytePushers || {};
BytePushers.converters = BytePushers.namespace("com.bytepushers.utils.converters");
BytePushers.converters.DateConverter = BytePushers.namespace("com.bytepushers.utils.converters.DateConverter");
BytePushers.converters.DateConverter.MMDDYYYY_DATE_FORMAT = 0;
BytePushers.c... | true |
ef522f74d967100f0f6357580c55bfb4aa4a7dbe | JavaScript | Sprokopyak/sprokopyak.github.io | /L_11_Data-types_ [Stepan_Prokopiak]/Data type homework/js/6.getTopNRichestNames.js | UTF-8 | 789 | 3.515625 | 4 | [] | no_license | function getTopNRichestNames(n, arrayOfObj) {
var objNumbers = {
B: 1e9,
M: 1e6,
K: 1e3
};
var people = arrayOfObj.map(function(person) {
var newPerson = {
name: person.name,
income: parseFloat(person.income) * objNumbers[person.income[perso... | true |
0669c5d2296020bb5941a438529acc136d0eed84 | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/JAMSTACK-TEMPLATES/_EVENMOAR/USERS/GREGBER/babel/packages/babel-preset-env/src/targets-parser.js | UTF-8 | 6,784 | 2.6875 | 3 | [
"MIT"
] | permissive | // @flow
import browserslist from "browserslist";
import invariant from "invariant";
import semver from "semver";
import {
semverify,
isUnreleasedVersion,
getLowestUnreleased,
getValues,
findSuggestion,
} from "./utils";
import { objectToBrowserslist } from "./normalize-options";
import browserModulesData fr... | true |
03a3b7507c4fb4507254bd5d0d858fb9aa7ad8f1 | JavaScript | nabilotchi/Todo | /app.js | UTF-8 | 4,772 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | //selector
const inputText = document.querySelector(".input-text");
const plusBtn = document.querySelector(".btn");
const list = document.querySelector(".list");
const deleteBtn = document.querySelector(".checkbox-1");
const select = document.querySelector('.select');
const footer = document.querySelector(".footer");
c... | true |
a75a40e2c9c33401f1c5a98a3036a818385c2c33 | JavaScript | ilmoralito/pharmacy-app | /web-app/js/providerFilter.js | UTF-8 | 1,529 | 2.828125 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
const filter = document.querySelector('#filter');
filter.addEventListener('keyup', handleFilter);
function handleFilter(event) {
const criteria = event.target.value.toLowerCase();
fetchProviders().then(providers => {
const ... | true |
13a1f39ad0d0face41ee1240eaa372ced81e3856 | JavaScript | ChenWeiYuan123/js-study | /scope.js | UTF-8 | 1,857 | 3.6875 | 4 | [] | no_license | /*
基本类型 String Boolean Number Undefined Null
基本类型保存在栈内存 占据固定大小内存
引用类型保存堆内存
*/
function Person(name) {
this.name = name;
}
let person = new Person('andy');
person instanceof Person;
Person.prototype.consrtructor = null;
person instanceof Person;
person.__proto__ === Person.prototype;
Person.prototype = {};
person i... | true |
f84f128fae8a363f5a8aa75ceb53a3f7f89e0f5c | JavaScript | Will-Rich-724/MERN-Deployment | /client/src/Components/PirateCreate.js | UTF-8 | 5,471 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import axios from 'axios';
import { navigate, Link } from '@reach/router';
const PirateCreate = (props) => {
const [crewMember, setCrewMember] = useState("");
const [role, setRole] = useState("Captain");
const [eyePatch, setEyePatch] = useState(true);
... | true |
77388969d2ca34b76ed3a16fa32ec767126958e5 | JavaScript | gkorde/BudgetApp | /app.js | UTF-8 | 757 | 2.84375 | 3 | [] | no_license | //Budget Controller
var budgetController = (function() {
//some code
})();
//UI Controller
var UIController = (function() {
//some code
})();
//Global App Controller
var controller = (function(budgetCtrl, UICtrl) {
//some code
var ctrlAddItem = function() {
// TODO: Get input field data
// TOD... | true |