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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
046d657be8c37899d4cf33695e057d748a56c6cd | JavaScript | YousefMokaddem/health-logger-openshift | /client/src/components/data/script.js | UTF-8 | 2,900 | 2.78125 | 3 | [] | no_license | import $ from 'jquery';
const script = () => {
$(document).ready( () => {
if($('page-buttons').length !== 0){
let $cards = $('.food-grid').children();
let list = $cards;
let buttonDiv;
if($('.page-buttons').length === 0){
buttonDiv = document... | true |
de6f7d619afd4ac16867278b803dfb365930fb0f | JavaScript | Adamant-im/adamant-tradebot | /helpers/notify.js | UTF-8 | 3,712 | 2.53125 | 3 | [] | no_license | const axios = require('axios');
const config = require('../modules/configReader');
const log = require('./log');
const api = require('../modules/api');
const {
adamant_notify = [],
adamant_notify_priority = [],
slack = [],
slack_priority = [],
discord_notify = [],
discord_notify_priority = [],
} = config;
... | true |
1d90a32a9d70d76acc57027581aef56e2941d6a3 | JavaScript | aflores94/Simple-Calculator | /calculator.js | UTF-8 | 1,311 | 3.390625 | 3 | [] | no_license | //jshint esversion:6
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded({extended: true}));
app.get("/", function(req, res){
res.sendFile(__dirname + "/index.html");
});
app.post("/", function(req, res){
let num1 = req.body.n... | true |
a941b25692ca5a423eb81c40924163ef4abb7674 | JavaScript | spryor/dash4twitter | /app/views/scripts/js.js | UTF-8 | 13,676 | 2.53125 | 3 | [] | no_license | function removeFadeBox() {
$(".fadeMessageBox .container").animate({left: -1500}, "normal", function(){
$(".fadeMessageBox").fadeOut("normal", function(){
$(this).remove();
$(".fadeBox").fadeOut("normal", function(){
$(this).remove();
});
});
});
}
function showFadeBox(stat, detai... | true |
d3f49cbaef3b89c7bf53272ca0ed66de27c356e7 | JavaScript | rtsuzaki/n-queens | /src/solvers.js | UTF-8 | 4,068 | 3.4375 | 3 | [] | no_license | /* _
___ ___ | |_ _____ _ __ ___
/ __|/ _ \| \ \ / / _ \ '__/ __|
\__ \ (_) | |\ V / __/ | \__ \
|___/\___/|_| \_/ \___|_| |___/
*/
// hint: you'll need to do a full-search of all possible arrangements of pieces!
// (There are also optimizations that will allow you to skip a lot of the dead s... | true |
8930248c29db03da76132d16c8d17419407b2d3f | JavaScript | replayio/types-viewer | /src/protocol/utils.js | UTF-8 | 2,296 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
BSD 3-Clause License
Copyright (c) 2020, Web Replay LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of cond... | true |
7ae91a49da83f6aaaaa4da85165580af0b2a6a5e | JavaScript | SabrinaSusmi/Intro-Sign-Up-Project | /intro-component-with-signup-form/Js/valid.js | UTF-8 | 1,302 | 2.875 | 3 | [] | no_license | function validation(){
var f = document.getElementById('firstName');
var l = document.getElementById('lastName');
var e = document.getElementById('Email');
var p = document.getElementById('Password');
var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if (f.value==="") {
f.classN... | true |
aadef967fe1d03021484e4cfbf4887fad25f5dcc | JavaScript | Across-777/umiCalculator | /src/models/calu.js | UTF-8 | 4,070 | 2.609375 | 3 | [] | no_license | export default {
namespace: 'calc',
state: {
value: 0,
numbers: '0123456789',
operators: '+-*/',
numberArr: [
['1', '2', '3', '+'],
['4', '5', '6', '-'],
['7', '8', '9', '*'],
['0', 'C', '=', '/'],
],
states: {
Init: 0,
LeftInput: 1,
OpInput: 2,
... | true |
95c2117289af8c6caf610cbb8928f48a8132bf33 | JavaScript | thiscouldbebetter/GameFramework | /Source/Geometry/Network/Network.js | UTF-8 | 4,593 | 3.03125 | 3 | [] | no_license |
class Network
{
nodes;
links;
constructor(nodes, links)
{
this.nodes = nodes;
this.links = links;
}
static random(nodeCount, randomizer)
{
var nodes = [];
for (var i = 0; i < nodeCount; i++)
{
var nodeId = i;
var nodePos = Coords.create().randomize(randomizer);
var node = new NetworkNode(... | true |
d62905a74967fb7b4fd05ad8ecfae820a09c6792 | JavaScript | ryli/goku | /queue/queue.js | UTF-8 | 806 | 4.125 | 4 | [] | no_license | /**
* 队列
*/
class Queue {
constructor() {
this.items = []
}
// 向队尾添加数据
enqueue(element) {
this.items.push(element)
}
// 移除第一个数据
dequeue() {
if (this.isEmpty()) return
return this.items.shift()
}
// 返回第一个数据
peek() {
if (this.isEmpty()) return
return this.items[0]
}
... | true |
d8ecc8eba83bb86ef88cb1b195e6c6fd0e09cc3c | JavaScript | sashee/dealing-with-async-in-react | /src/PropsErrorCheck.jsx | UTF-8 | 2,287 | 2.71875 | 3 | [] | no_license | "use strict";
import React from "react";
import ReactDOM from "react-dom";
import q from "q";
const DatabaseConnection = React.createClass({
getInitialState() {
return {
result: "not connected"
};
},
connect(selected) {
this.setState({result: `connecting to ${selected}`});
q.delay(2000).then(() => {
... | true |
3b1428990fe16c165c7adbbf7442de412402adcf | JavaScript | ShimiSun/grommet-nextjs | /examples/NumberInput/decimals.js | UTF-8 | 412 | 2.59375 | 3 | [] | no_license | export const decimals = `class Demo extends React.Component {
constructor() {
super();
this.state = { number: 3.5996 }
}
render() {
const { number } = this.state;
return (
<NumberInput
value={number}
decimals={4}
step={0.5}
onChange={({ target: { value } }) ... | true |
1d617ac040a0dbb6421c35cae44f7b33f6a2195c | JavaScript | HexRweb/ghost-deploy | /actions/get-token.js | UTF-8 | 1,099 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
const axios = require('../utils/axios');
const handleAxiosError = require('../utils/handle-axios-error');
/*
* @name getToken
* @description authenticates with Ghost and retrieves access and refresh tokens
* @param {object} instance - instance details (API root, Client ID, Client Secret, username, and... | true |
3e1740dc3e48f3aa46edf5bf35e0936b38549474 | JavaScript | wangxuanooi/curriculum-design | /JavaScript/js/login.js | UTF-8 | 2,561 | 3.09375 | 3 | [] | no_license | /**
* 登录页
* @author ankoye
*/
// 切换登录注册表单
const loginTitle = document.getElementById('loginTitle')
const registerTitle = document.getElementById('registerTitle')
const form = document.querySelectorAll('.login-form-content')
loginTitle.onclick = loginF
function loginF() {
loginTitle.classList.add('active')
regi... | true |
74938cd5a9de2525b822ea09618087ec2421e775 | JavaScript | fjlanasa/cambridge-age_visualization | /src/Histogram.js | UTF-8 | 4,120 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import * as d3 from 'd3';
export default class Histogram extends Component {
componentDidUpdate() {
let keys = ['City of Cambridge', this.props.chosenNeighborhood];
d3.select('g.legend').selectAll('text')
.data(keys.slice())
.text((d) => {return d; });
... | true |
6afc585a52141b723686251571f67440bb952ac2 | JavaScript | Saowar/Rainbow-Poem | /JS/convertTemp.js | UTF-8 | 1,401 | 3.59375 | 4 | [] | no_license | //Detail
document.getElementById("rangeCel").innerHTML = "0" + "\xB0" + "C - 100" + "\xB0" + "C";
document.getElementById("unitCel").innerHTML = "\xB0C";
document.getElementById("rangeFah").innerHTML = "32" + "\xB0" + "F - 212" + "\xB0" + "F";
document.getElementById("unitFah").innerHTML = "\xB0F";
document.getElemen... | true |
a177e05a7e25279de2e25ddc597cb23b70f7c4a7 | JavaScript | haydaralkac/java-first | /Ders-5/app.js | UTF-8 | 3,657 | 3.578125 | 4 | [] | no_license | // Conditionals
/* let score = 85;
// let grade = score >= 50
if (score >= 80) {
console.log(`Tebrikler notunuz ${score}, çok iyi bir öğrencisiniz`);
}else if (score >= 50) {
console.log(`Tebrikler notunuz ${score}, sınavdan geçtiniz`);
}else{
console.log(`Üzgünüm notunuz ${score}, sınavdan kaldınız`... | true |
2d35677fa3d13215469ed3323c6dfe377aaef7fb | JavaScript | whosAle/bot-builder | /src/containers/BotsPage.js | UTF-8 | 1,767 | 2.6875 | 3 | [] | no_license | import React from "react";
import BotCollection from "./BotCollection";
import YourBotArmy from "./YourBotArmy";
import BotSpecs from "../components/BotSpecs";
import BotFilter from "../components/BotFilter";
//bots api endpoint
const BOTS_ENDPOINT = "https://bot-battler-api.herokuapp.com/api/v1/bots";
class BotsPa... | true |
7fdd73f75bced77b384a1fb94eda0484b9d708af | JavaScript | lcdlovel/weixin | /微信课件/20171108/xz/js/login.js | UTF-8 | 736 | 2.828125 | 3 | [
"MIT"
] | permissive |
//模块一:完成用户登录
//1:为登录按钮绑定点击事件
console.log(1);
$("#btn1").click(function(e){
console.log(2);
//2:阻止事件默认行为,原因:a默认行为
e.preventDefault();
//3:获取用户输入用户名和密码
var n = $("#uname").val();
var p = $("#upwd").val();
console.log(3);
//alert(n+p);
//4:发送ajax请求
$.ajax({
type:"GET",
... | true |
f5520843230ac20d91e8376407d88c1437c26be4 | JavaScript | lanceden/dh | /src/filters/inovices.js | UTF-8 | 350 | 2.703125 | 3 | [] | no_license | // 發票狀態
export const inoviceStatus = (val) => {
return parseInt(val) === 1 ? '未開發票' : '已開發票'
}
// 發票類型
export const inoviceType = (val) => {
switch (parseInt(val)) {
case 1: return '電子發票'
case 2: return '紙本發票'
case 3: return '捐贈發票'
case 4: return '公司三連發票'
}
}
| true |
24c32b5339ba131a049367208d209ec0ace831c4 | JavaScript | patelviralb/cs5610-final-project | /src/redux/reducers/searchQuestionsReducer.js | UTF-8 | 715 | 2.5625 | 3 | [] | no_license | import {RESET_SEARCH_QUESTION_RESULTS, SET_SEARCH_QUESTION_RESULTS} from "../actions/searchQuestionsActions";
let initialState = {
questions: [],
query: "",
};
const searchQuestionsReducer = (state = initialState, action) => {
switch (action.type) {
case SET_SEARCH_QUESTION_RESULTS: {
... | true |
75e7dd5ca4334d37f83aee588c5d365c44467591 | JavaScript | tconn89/AssetPredictions | /prediction-ui/src/util/index.js | UTF-8 | 1,134 | 2.59375 | 3 | [] | no_license |
export async function execFetch(url, body, method = 'GET') {
const baseURL = url.startsWith('/finn') ? '/dev' + url : '/dev/api/v1' + url;
try {
let params = {
method,
redirect: 'follow',
referrerPolicy: 'no-referrer',
headers: {
'Content-Type': 'application/json'
... | true |
b82dd62d5b92ff8706e8934dec69a2bea64c6045 | JavaScript | jdgg1993/LaunchSpaceChallenge2 | /Competed Project/myScript.js | UTF-8 | 1,257 | 3 | 3 | [] | no_license | var URL = "http://launchspacetestdemo.azurewebsites.net/api/launchspaceusers";
function show() {
document.getElementById("demoButton").innerHTML=Date();
}
function processName() {
var name = document.getElementById("name").value;
for (var i = 0; i < name.length; i++) {
console.log(name[i]);
... | true |
bc91e192b6c46e5b85c4ed974ff289ef0acfc64a | JavaScript | Isabella18081996/js-es6-cats | /assets/js/script.js | UTF-8 | 3,493 | 3.640625 | 4 | [] | no_license | /*
1) Definire un array di oggetti; ogni oggetto rappresenta un gatto, che è caratterizzato da: nome, età, colore e sesso.
2) Tramite la funzione .forEach(), stampare in pagina tutti i gattini, ciascuno con il proprio colore e il proprio nome.
Milestone 2
3) Dividere i gatti in due contenitori distinti in base al ses... | true |
135fa028bed76202c7d131a5e0934c9843089129 | JavaScript | paul-han-intern/paul-han-intern.github.io | /v1/account-score-bar/account-score-bar.js | UTF-8 | 2,147 | 2.890625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", () => {
var groups = [0, 0, 0, 0, 0];
for (var i=0; i<1000; i++) {
let score = Math.random() * 100;
if (score <= 20) groups[0] = groups[0] + 1;
if (score <= 40 && score >= 20) groups[1] = groups[1] + 1;
if (score <= 60 && score >= 40) groups[2] = groups[... | true |
fc940232c4873bdb9f7a744ac379ed15c9da93c5 | JavaScript | Fordalex/frontend_work | /register/javascript.js | UTF-8 | 668 | 3.375 | 3 | [] | no_license | // Submitting the registration form
var registerForm = document.getElementById('registerForm');
function registerUser(e) {
e.preventDefault();
var passwordOne = document.getElementById('passwordOne').value;
var passwordTwo = document.getElementById('passwordTwo').value;
var errorContainer = document.g... | true |
a5aae6c920279d62bdfa21eba5c4b6f205622666 | JavaScript | StandyMerizier/codeWarsSolutions | /flippingAnImage.js | UTF-8 | 1,123 | 4.28125 | 4 | [] | no_license | // Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image.
// To flip an image horizontally means that each row of the image is reversed.
// For example, flipping [1,1,0] horizontally results in [0,1,1].
// To invert an image means that each 0 is replaced by 1,... | true |
b6d55328fc28ea450f96671832d8d29ccba66dfc | JavaScript | thiscatiskool/Train-Wreck | /trainwreck.js | UTF-8 | 2,408 | 3.09375 | 3 | [] | no_license | // Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyCC5ZS8f79byC6bS7bRienwYsMdyqCfADg",
authDomain: "trainwreck-a200f.firebaseapp.com",
databaseURL: "https://trainwreck-a200f.firebaseio.com",
projectId: "trainwreck-a200f",
storageBucket: "trainwreck-a200f.appspot.com",
... | true |
d5f929e7e1dce2a9a2253ebb73afacde97bb5509 | JavaScript | Prashanth-Chandra/amfoss-tasks | /TASK-8/page-2/js/index.js | UTF-8 | 561 | 3.28125 | 3 | [] | no_license | function myButton1(){
localStorage.setItem("name", "Prashanth Chandra Reddy");
}
function myButton2(){
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
window.alert("Current time is "+time)
}
function myButton3(){
document.body.style... | true |
74160cac5490fe18597f3aa67e2c68c21a3ce278 | JavaScript | rutadaki/Rutadaki | /RutadakiApi/WebContent/components/timetable.js | UTF-8 | 3,202 | 2.875 | 3 | [] | no_license | var timetableModule = angular.module('ui.timetable', []);
timetableModule.directive('rnTimetable', function() {
return {
restrict: 'AE',
templateUrl: 'components/timetable.html',
scope: {
timeTable: '=ngModel'
},
link: function(scope, iElement, iAttrs) {
... | true |
c1985cc2c0dcb418ff71cf8ae7a7ce142d889d00 | JavaScript | Fajle-Rayhan/CodePen | /Object Follow the Mouse Pointer/js/index.js | UTF-8 | 3,369 | 2.59375 | 3 | [] | no_license | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, des... | true |
7648189cf8161d725025984e62aa8b6b8026b2cf | JavaScript | Aleksbgbg/SoftUni-JavaScript-Modules | /JavaScript Core/JavaScript Apps/2. AJAX and jQuery AJAX/Exercises Solution/1. Bus Stop/main.js | UTF-8 | 686 | 2.828125 | 3 | [] | no_license | function getInfo() {
const stopId = $("#stopId").val();
const stopNameDiv = $("#stopName");
const busList = $("#buses");
$
.ajax(`https://judgetests.firebaseio.com/businfo/${stopId}.json`, {
beforeSend: function() {
busList.empty();
},
error... | true |
78d345b68a9fe79dba25a8a4911a8968febc5868 | JavaScript | Khevinn/javascript | /desestruturacao.js | UTF-8 | 419 | 3.78125 | 4 | [] | no_license | const array = [ 'um', 'dois', 'tres', 'quadro' ]
const [ item1, item2, ...restanteArray ] = array
const objeto = {
nome: 'Tony',
gatos: 6,
gatoFavorito: 'Thomas'
}
console.log(restanteArray)
// const { nome, gatos, ...restanteObjeto } = objeto
// const [ a, b, ...restanteString ] = 'abcdefg'
// const foo = ... | true |
56db177ed642028b28119fabcd1af48d839acbd9 | JavaScript | jabu/EmployeeDirectory | /Employees/js/Views/EmployeeView.js | UTF-8 | 1,904 | 2.625 | 3 | [] | no_license | define([
'lib/jquery-min',
'lib/underscore-min',
'lib/backbone-min',
'Models/Employee',
'Views/UpdateEmployeeView'], function($, _, Backbone, Employee, UpdateEmployeeView){
var EmployeeView = Backbone.View.extend({
tagName: "li",
initialize: function(options){
this.bus = options.bus;
this... | true |
53369a57c2be19a0342096f7582aeb2f09b67291 | JavaScript | Tobinaut/Timetable | /js/components/timeEditor.js | UTF-8 | 3,649 | 2.84375 | 3 | [] | no_license | var LOWER_TIME_BOUND = moment({y: 2000, M: 0, d: 1, h: 0, m: 0, s: 0, ms: 0});
LOWER_TIME_BOUND = LOWER_TIME_BOUND.toDate();
var UPPER_TIME_BOUND = moment({y: 2000, M: 0, d: 1, h: 23, m: 59, s: 59, ms: 999});
UPPER_TIME_BOUND = UPPER_TIME_BOUND.toDate();
App.TimeEditorComponent = Ember.Component.extend({
actions... | true |
93e18fb2bb6f0f734669683080b0589c65f63f9e | JavaScript | xuchunyang/qr-code | /server.js | UTF-8 | 4,831 | 2.984375 | 3 | [] | no_license | // API
async function encode(text) {
const qr = require("qrcode");
const url = await qr.toDataURL(text);
if (!url.startsWith("data:image/png;base64,")) {
throw new Error("qrcode.toDataURL should return data url with image/png encoding");
}
const data = url.slice(url.indexOf(",") + 1);
const buffer = Buf... | true |
255d84c20f8a708be818585d716aa09bbfc3be1b | JavaScript | SeijiMatsumoto/Fashion-E-Commerce-Site | /client/src/Review/ReviewTile/ReviewTileBody.jsx | UTF-8 | 1,581 | 2.6875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { Container, ImageFlexContainer, Image } from '../Styles/ReviewStyles.js';
import ReviewModal from '../../Helper-Components/ReviewModal.jsx';
const ReviewTileBody = (props) => {
const review = props.review;
const body = review.body;
//returns the body ... | true |
862481c69202332b5d0a5eaa3ae02cfd2759652b | JavaScript | asimzsaeed/episerver_dojo_playground | /EpiserverSite2/modules/_protected/Shell/Shell/10.0.2.0/ClientResources/epi/shell/request/Extender.js.uncompressed.js | UTF-8 | 3,316 | 2.515625 | 3 | [] | no_license | define("epi/shell/request/Extender", [
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/Deferred"
], function (declare, lang, Deferred) {
return declare([], {
// summary:
// Xhr request wrapper calling a chain of optional request mutators before sending the request to a
// ... | true |
ef2c2b1880ee0ec6120645227d0acb33ae305db3 | JavaScript | MrJustreborn/TestDrivenDev | /test/server/serverPlayerTest.js | UTF-8 | 12,154 | 2.984375 | 3 | [] | no_license | /*
* Testcases for Player on the server side
*/
TestCase("PlayerServerTest",
{
setUp: function() {
this.player1 = new tddjs.server.player();
},
"test Player Object should be created": function()
{
assertObject(this.player1);
... | true |
0436a179550593cbc02dec2acb211c78aa2276ba | JavaScript | DzmVasileusky/klika_music | /server/models/genres.js | UTF-8 | 587 | 2.75 | 3 | [] | no_license | var _ = require('lodash');
var Track = require('./tracks')
var genres = (function() {
var collection = [],
keys = {},
tracks,
id = 1;
tracks = Track.all();
for (var i = 0; i < tracks.length; i++) {
if (keys[tracks[i]['genre']]) continue;
keys[tracks[i]['genre']] = true;
collectio... | true |
be7ff91d635063fd3b71424b017f8c696d8d83bb | JavaScript | eugene-ryabczinski/893705-big-trip-12 | /src/view/trip-day-item.js | UTF-8 | 677 | 2.671875 | 3 | [] | no_license | import moment from 'moment';
import AbstractView from './abstract-view';
const createTripDayItemTemplate = (day, index) => {
const formatedDate = moment(day).format(`MMM DD`);
return (
`<li class="trip-days__item day">
<div class="day__info">
${day && index ? `<span class="day__counter">${index}<... | true |
3bb1244d4c7fbb95cb69bc4b8d09dde45701c110 | JavaScript | JulieBusch/auther-workshop | /start/browser/redux/signup.js | UTF-8 | 550 | 2.84375 | 3 | [] | no_license | import axios from 'axios';
const signUpUser = 'SIGNUP_NEW_USER';
const signUp = user => ({ type: signUpUser, currentUser : user})
export default function reducer (currentUser = {}, action) {
switch(action.type) {
case signUpUser:
return action.currentUser
default:
return currentUser;
}
}
export co... | true |
075a577fce11d8e64a2b211fe651335d0e1e888c | JavaScript | vscherbo/upm | /examples/javascript/rotaryencoder.js | UTF-8 | 729 | 2.6875 | 3 | [
"MIT"
] | permissive | /*
* Author: Zion Orent <zorent@ics.com>
* Copyright (c) 2015 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
var rotaryEncoder = require("jsup... | true |
255f58fec7760a5a3db29ea00d106cb745c5f749 | JavaScript | carolorru/Bastro-FULL | /js/maps.js | UTF-8 | 1,135 | 2.609375 | 3 | [] | no_license | $(document).ready(function () {
// MAPS
var map;
var directionsDisplay; // Instanciaremos ele mais tarde, que será o nosso google.maps.DirectionsRenderer
var directionsService = new google.maps.DirectionsService();
var markerA = new google.maps.MarkerImage('img/pin.png');
var markerB = new google.map... | true |
9d050d13d18def8ae55c39775de75597a7decfd1 | JavaScript | feldstja/crypto-world-analytics | /frontend/FAQ.js | UTF-8 | 3,569 | 2.59375 | 3 | [] | no_license | import React from 'react';
export default class Faq extends React.Component {
render() {
return (
<div className="page">
<div className="allButtons">
<button className="homebutton" onClick={() => this.props.redirect(0)}>Home</button>
<button className="aboutbutton" onClick={() => th... | true |
fe5cb8a7c0a384ea8ec70f57478ae1c32a8ba333 | JavaScript | IchenDEV/Leetcode | /456.132-模式.js | UTF-8 | 662 | 3.09375 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=456 lang=javascript
*
* [456] 132模式
*/
// @lc code=start
/**
* @param {number[]} nums
* @return {boolean}
*/
var find132pattern = function (nums) {
nums = nums.reverse();
let minn = nums[0];
let maxn = -Number.MAX_SAFE_INTEGER;
for (let i = 1; i < nums.length; i++) {
if (... | true |
e33d98ac312f0f33266f16a6ee28126669d79820 | JavaScript | AlanCintora/CursoIngresoUTN | /2-InstruccionIf/jsInstruccionIF (10).js | UTF-8 | 472 | 3.21875 | 3 | [] | no_license | function mostrar()
{var num1;
num1 = Math.floor(Math.random()*(11-1))+1;
console.log(num1);
if(num1 >= 9)
{
alert("EXCELENTE");
}
else if(num1 >= 4 && num1 < 9)
{
alert("APROBÓ");
}
else
{
alert("Vamos, la proxima se puede");
}
/*Para saber si esta correcto el resultado del RANDOM
po... | true |
e2bf0520e4893e501929da89a04f390b4c6deb67 | JavaScript | Offirmo/web-tech-experiments | /nodejs/node_domains_001/server.js | UTF-8 | 1,519 | 2.8125 | 3 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | #!/usr/bin/env node
'use strict';
console.log('Hello world !');
process.on('uncaughtException', function(err){
console.error('uncaught exception !', err);
});
// https://nodejs.org/api/domain.html#domain_domain
// interesting reads :
// https://stackoverflow.com/questions/19461234/domains-not-properly-catching-erro... | true |
b30d01fc984bebcc2b3ff3f638a1ef7694bdec4b | JavaScript | Allysonubius/java | /js/lampada.js | UTF-8 | 603 | 3.1875 | 3 | [] | no_license | /* *
* JS - Vinculando um documento JS
* @author Allyson de OLiveira Brandao
* */
/*Tabuada*/
function on() {
document.getElementById("lamp").src = "img/lampada-on.jpg";
}
function off() {
document.getElementById("lamp").src = "img/lampada-off.png";
}
function blinck() {
var intervalo = 0;
var con... | true |
e0b4b5dede9d80c4287267fc20fbde85e7abc703 | JavaScript | Wolgrand/create-next-pwa | /utils/end.js | UTF-8 | 1,887 | 2.5625 | 3 | [
"MIT"
] | permissive | const cliTable = require('cli-table');
const colors = require('colors');
const chalk = require('chalk');
const logSymbols = require('log-symbols');
const checkForUpdate = require('update-check');
const pkgJSON = require('../package.json');
/**
*
* checks whether an update is available for the CLI
*/
const notifyUpd... | true |
7905dcbfeca13727c21e1c28d540fc41ce0faada | JavaScript | pazjacket/zenoplex-_-back-tube | /src/utils.js | UTF-8 | 459 | 2.625 | 3 | [
"MIT"
] | permissive | export const getSize = (elem) => {
const win = window;
const doc = document;
const delem = doc.documentElement;
const body = document.body;
let width;
let height;
if (elem === win) {
width = Math.max(win.innerWidth, delem.clientWidth, body.clientWidth);
height = Math.max(win.innerHeight, delem.cl... | true |
c835ea17fe759792fa87a7e4269bde9d1574e943 | JavaScript | ThisIsMissEm/react-player-challenge | /app/components/AudioStream.js | UTF-8 | 2,254 | 2.90625 | 3 | [] | no_license | import React from 'react';
export default class AudioStream extends React.Component {
constructor() {
super();
}
componentDidMount() {
this.audio = document.createElement('audio');
}
// This could probably be changed to have some sort of "prop diff"
// rather than all these if statements checking... | true |
30dd6826cf08b528465407f61c7c08ada26c595a | JavaScript | csspence/codewars_whats_up_next | /codewars_whats_up_next.js | UTF-8 | 634 | 4.75 | 5 | [] | no_license | /*
Given a sequence of items and a specific item in that sequence, return the item immediately following the item specified. If the item occurs more than once in a sequence, return the item after the first occurence. This should work for a sequence of any type.
When the item isn't present or nothing follows it, the fu... | true |
4ac7bf48cef75c58c880a91142b08db68257d232 | JavaScript | Prabhakaran77/groceryApp | /grocery.js | UTF-8 | 4,572 | 3.296875 | 3 | [] | no_license | var product;
var units;
var unit_price;
var price;
var rowNo=0;
const ITEM_NAME='item_name';
const UNIT='unit';
const UNITS='units';
const UNIT_PRICE='unit_price';
const PRICE='price';
const DISPLAY='display';
const PRODUCT='product';
function add()
{
//creating new row with new data cells and buttons
var newTd... | true |
8f9bf994855d91260ee1d31d9fff2c966b812101 | JavaScript | mamorvan/The-Local-SE | /routes/routes.js | UTF-8 | 3,436 | 2.671875 | 3 | [] | no_license | var express = require("express");
var request = require("request");
var cheerio = require("cheerio");
var Article = require("../models/articles.js");
var Notes = require("../models/notes.js");
var router = express.Router();
//render index page
router.route("/")
.get(function(req, res){
res.render("index");
});
//... | true |
9316066f7423aeae5ea8302359171ccb697ca631 | JavaScript | CootCraig/sinatra_sse_02 | /public/js/actor.js | UTF-8 | 468 | 2.546875 | 3 | [] | no_license |
$(document).ready(function() {
var my_id = "Me"
var url = "/actor/" + my_id
var source = new EventSource(url)
source.onmessage = function() {
var event_count = 0;
return function(event){
event_count += 1;
var detail_id = "event_" + event_count;
var new_detail = $("<li />", {... | true |
b3246bd1624bceabdb5994acdbc54b1782dae020 | JavaScript | imbartek/travel | /app.js | UTF-8 | 461 | 2.6875 | 3 | [] | no_license | const items = document.querySelectorAll('.gallery__item');
const shadows = document.querySelectorAll('.shadowContainer')
const prevColor = 'rgba(0, 0, 0, 0.596)';
const newColor = '#ba402db7';
items.forEach( item => {
item.addEventListener('mouseover', () =>{
item.children[0].style.backgroundColor... | true |
d8cbd7973ea1477b810f4f358ef0e0fcfac2757c | JavaScript | kesun/jQuery-Fiddles | /a-star-path-algo/a-star-path-algo-2d-array.js | UTF-8 | 10,213 | 2.984375 | 3 | [] | no_license | // TESTING VARIABLES
var counter = 3;
// =================
// Colour codes
var unexploredColour = "transparent";
var openColour = "#D56AFF";
var closedColour = "#562E6E";
var pathColour = "#FFFF7A";
var wallColour = "#868686";
var startColour = "#FF0095";
var destColour = "#00ABFF";
var greyButton = "#53707C";
var liv... | true |
d0aac07aa2de063d87b16835351fbbb1cf54e521 | JavaScript | helin24/language-agnosticism-workshop | /javascript/solutions/part2/LongestWordFinder.js | UTF-8 | 563 | 4.09375 | 4 | [] | no_license | function findLongestWord(sentenceString) {
var longestWord = '';
//note that this is imperfect for punctuation
words = sentenceString.split(" ");
for (var i = 0; i < words.length; i++) {
if (words[i].length > longestWord.length) {
longestWord = words[i];
}
}
return longestWord;
}
var senten... | true |
93b1f3967b44f989dadfc61f632ec162c676d050 | JavaScript | allen4dev/2_node-blog-api | /server/api/users/controller.js | UTF-8 | 2,194 | 2.5625 | 3 | [] | no_license | const mongoose = require('mongoose');
const User = mongoose.model('User');
const Post = mongoose.model('Post');
const Comment = mongoose.model('Comment');
exports.param = (req, res, next, id) => {
User.findById(id)
.then(user => {
if (!user) return Promise.reject(new Error(`User ${id} not found`));
... | true |
ee21463135a9d9f030022915086efacb2cc8fe55 | JavaScript | lupengge/table2excel | /src/index.js | UTF-8 | 11,691 | 2.703125 | 3 | [
"MIT"
] | permissive | import 'xlsx-style/dist/xlsx.core.min';
import { saveAs } from 'filesaver.js';
import tableToData from './helpers/table-to-data';
import dataToWorksheet from './helpers/data-to-worksheet';
import {decodeCell, decodeRange } from './helpers/decode-cell.js';
import {encodeCell, encodeRange } from './helpers/encode-cell... | true |
10734e1be43be6d1b0af82d46283d3c105fa9ad8 | JavaScript | cbonamusa/recipe_web | /src/components/RecipesList.js | UTF-8 | 3,214 | 2.8125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import axios from "axios";
import { setRecipe } from "../store/recipeActions";
import { useDispatch } from "react-redux";
import Recipe from "./Recipe";
const RecipeList = () => {
const dispatch = useDispatch();
const [text, setText] = useState("");
const [he... | true |
ffb8e257a1fee9c414e4f5b4dcd26edd5fea8661 | JavaScript | dominikalipka/lab-thinking-in-react | /src/components/FilterableProductTable.js | UTF-8 | 904 | 2.546875 | 3 | [] | no_license | import React from "react";
import SearchBar from './SearchBar'
import ProductTable from './ProductTable'
import products from './../data.json';
class FilterableProductTable extends React.Component {
state = {
productsToDisplay: products.data,
searchInputState: ''
};
setSearchField = (searchInput) => {
... | true |
ec0540e2e94703f9e6bcd742e53a8dadaac2cff1 | JavaScript | Ranjith786/ran-2305 | /js/dashboard.js | UTF-8 | 7,408 | 3 | 3 | [] | no_license |
function countChars(textbox_id, counter_id, max) {
var count = max - document.getElementById(textbox_id).value.length;
if (count < 0) {
document.getElementById(counter_id).innerHTML = "<span style=\"color: red;\">" + count + "</span>";
document.getElementById(textbox_id).style.backgroundColor = "red";
... | true |
37f1193d70ba5bfa203e7595740dc3d96d44d723 | JavaScript | Nice-Ming/build-your-own-react | /src/Counter.js | UTF-8 | 244 | 2.578125 | 3 | [] | no_license | /** @jsx Didact.createElement */
import Didact from './Didact'
function Counter () {
const [state, setState] = Didact.useState(1)
return (
<h1 onClick={() => setState(c => c + 1)}>
{state}
</h1>
)
}
export default Counter
| true |
65e913c415bf57249d4fdf8a14b8de1e46aafe49 | JavaScript | telerik/serverless-s3-upload | /lib/services/s3-service.js | UTF-8 | 5,351 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict";
const fs = require("fs");
const path = require("path");
class S3Service {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.logger = this.serverless.cli;
this.provider = this.provider = this.serverless.providers.aws;
this.config = this._loadPluginCo... | true |
5beaee6fdd81be316b2eb7767dfa8b7b1deb1146 | JavaScript | fgassert-pub/flood_notebooks | /floodmath.js | UTF-8 | 3,365 | 3.078125 | 3 | [] | no_license | //
FloodMath = new function(){
"use strict";
var _ = this,
FloodFrequencies = [.000001,.001,.002,.004,.01,.02,.04,.1,.2,.5,1/1.5];
_.process_loss_data = function(D) {
// the damage data comes in as an array of values corresponding to how much loss
// a flood of return periods [2,5,10,25,50,100,250,... | true |
77737c0cf0c6da6750bddb602cca4fef1fbc98bf | JavaScript | liurong2017/work | /src/main/resources/templates/js/brand.js | UTF-8 | 3,271 | 2.53125 | 3 | [] | no_license | $(function(){
$.ajax({
url:"/brand/getList",
type:"GET",
async:false,
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
},
success : function(info) {
var h="";
var list=info.result.records;
if(list!=null&&list.length>0){
for (var x=0;x<list.length;x++... | true |
e44edd00e5d0768ec82ff497e730434ffe54de7d | JavaScript | SpenserDavis/algoVisualizer | /src/algoProblemDescriptions/topological.js | UTF-8 | 818 | 2.921875 | 3 | [] | no_license | import React from "react";
const description = (
<div className="description">
<p>
You're given a list of arbitrary jobs that need to be completed; these
jobs are represented by distinct integers. You're also given a list of
dependencies. A dependency is represented as a pair of jobs where the
... | true |
a4c6adcc3fdd9f15cb7b0e87398cd4029e5952ba | JavaScript | fusion-io/framework | /src/Migration/MigrationSet.js | UTF-8 | 3,224 | 2.703125 | 3 | [] | no_license | import {EventEmitter} from "events";
const MIGRATING = 'MIGRATING';
const MIGRATED = 'MIGRATED';
export default class MigrationSet {
constructor(defineds = []) {
this.defineds = defineds;
this.executeds = [];
this.event = new EventEmitter();
}
setState(executeds) {
... | true |
751a4d0e683de5baa70feb25e565918e484c7a1c | JavaScript | rakeshssn/rakeshssn.github.io | /yap/yap/static/js/graph.js | UTF-8 | 11,017 | 2.53125 | 3 | [] | no_license | /* global crossfilter, dc, d3, queue, $ */
//--------------------------------------------------- SECTION 01 - LOAD THE DATA
queue()
.defer(d3.json, "https://api.npoint.io/89ea5155e97033aae77a")
.await(makeGraphs);
//--------------------------------------------------- SECTION 02 - CROSSFILTER THE DATA AND PAR... | true |
cd658f381eb933876ab0123d1e2dc26ceb4fdcb5 | JavaScript | wpiao/event-driven-applications | /driver.js | UTF-8 | 398 | 2.703125 | 3 | [] | no_license | 'use strict';
const events = require('./events.js');
events.on('pickup', payload => setTimeout(driverPickedUp, 1000, payload));
events.on('delivered', payload => setTimeout(driverDelivered, 3000, payload));
function driverPickedUp(payload) {
console.log(`DRIVER: picked up ${payload.orderID}`);
}
function driverDe... | true |
b076554f44c5f2474899e9085b142c0b34c1a90b | JavaScript | HyperX-Dev/esercizi-di-programmazione-javascript | /esercizi-condizioni/che-giorno-oggi.js | UTF-8 | 1,514 | 3.75 | 4 | [] | no_license | /*
Che giorno è oggi?
Scrivi un programma che dato un numero intero compreso tra 1 a 7
visualizzi il corrispondente giorno della settimana. Sapendo che:
1 = lunedì
2 = martedì
3 = mercoledì
...
7 = domenica
Utilizza il costrutto Switch-case e prevedi anche il caso in cui il valore immesso no... | true |
e8248118b2975457b3ee098768ed498dcb2cf269 | JavaScript | smartrplace/ogema | /src/apps/graph-generator/src/main/resources/org/ogema/app/graphgenerator/gui/communication.js | UTF-8 | 2,802 | 2.53125 | 3 | [
"Apache-2.0",
"EPL-1.0",
"MIT"
] | permissive | var servletPath = "/apps/ogema/graphgenerator?user=" + otusr + "&pw=" + otpwd;
var visJsNetwork = undefined;
// callback should have two arguments, data and status
function sendGET(callback) {
$.get(servletPath, callback);
}
function processGET(data, status) {
alert("Data: " + data + "\nStatus: " + status);
}... | true |
262e83edbdbd41857a07c78edf271faa2e41cf2f | JavaScript | ange1lop/OCL1_P2 | /backend/controller/Operacion/Operacion.js | UTF-8 | 3,047 | 2.765625 | 3 | [] | no_license | const TIPO_OPERACION = require("../Enums/TipoOperacion");
const TIPO_VALOR = require("../Enums/TipoValor");
const TIPO_INSTRUCCION = require("../Enums/TipoInstruccion");
const Aritmetica = require("./Aritmetica");
const Logica = require("./Logica");
const Relacional = require("./Relacional");
const OperacionTernaria = ... | true |
9718df3fcdc8bd7ab46f75dcc4c6595a7dc02fdc | JavaScript | yaswanth97531/react-jest-enzyme-examples | /src/Containers/ItemsList/List.test.js | UTF-8 | 1,047 | 2.609375 | 3 | [] | no_license | import List from './List';
let wrapper;
const items = ['one', 'two', 'three'];
beforeEach(() => {
wrapper = mount( <List items={items} /> );
});
describe('<List /> rendering', () => {
it('renders list-items', () => {
// Expects the wrapper object to be defined
expect(wrapper.find('#list-items')).toBeDefi... | true |
6cb1bce3dd7fbc0a8320b24ea551d87b74226801 | JavaScript | AliA1997/graphql-mini | /server/graphql/schema.js | UTF-8 | 3,773 | 3.109375 | 3 | [] | no_license | const axios = require('axios');
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLList,
GraphQLNonNull
} = require('graphql');
let characters = require('./model');
//Circular references reference things not created yet.
const PersonType = new GraphQLObjectType({
... | true |
fd138286a04dd6b69d466270a76dd31f023646a0 | JavaScript | waseemawan/wfnassistant | /app.js | UTF-8 | 10,565 | 2.53125 | 3 | [] | no_license |
//====================
// import
//
var restify = require('restify');
var builder = require('botbuilder');
var fs = require('fs');
//======================
//Entities
//
var employeesData = {
"Adams AA": {
name:"Adams AA" ,
employeeId: "ID00001",
regularHours : 50 ,
ptoHours : 10 ... | true |
0fbf553499f81ff336abdbf33fe14f1477b2d9c9 | JavaScript | DmytroLypovetskiy/tetris | /js/field.js | UTF-8 | 2,764 | 3.3125 | 3 | [] | no_license | 'use strict';
(function(global) {
/**
*
* @param width of the game field
* @param height of the game field
* @constructor
*/
var Field = function(width, height) {
this.width = width || 10;
this.height = height || 18;
this.init();
};
Field.prototype = {
constructor: Field,
wid... | true |
e378c263ad71ae6afbb9c59b63a57f4f370e6b35 | JavaScript | faryabimm/web_hw2 | /src/Components/NumberedList/NumberedList.js | UTF-8 | 4,054 | 2.734375 | 3 | [] | no_license | import React from 'react';
class Rest {
makeAjaxCall(url, methodType) {
var promisObj = new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open(methodType, url, true);
xhr.send();
xhr.onreadystatechange = function () {
... | true |
131c956febabfcf5b23891f7329b81e5a688a552 | JavaScript | Uynet/CPCTFvisualizer2019 | /public/src/gl/camera.js | UTF-8 | 2,589 | 2.578125 | 3 | [] | no_license | //this may be static
class Camera{
constructor(){
this.pos = vec3(0);
this.quakeOffset = vec3(0);
//view
this.forward = vec3(0,0,-1);
this.up = vec3(0,1,0);
this.asp = canvas.width/canvas.height;
this.FOV = Math.PI*1/2.5;
this.near = 0.1;
this.far = 60.0;
this.viewMat = this.... | true |
40cc99f1f481a7d8ae71ed71157a141887f979c2 | JavaScript | thanhdatwg/Frontend_Basic | /JAVASCRIP/testB4.js | UTF-8 | 162 | 2.671875 | 3 | [] | no_license | var tieude = document.getElementsByTagName('h4');
console.log(tieude);
for(var i=0; i<tieude.length; i++){
tieude[i].innerHTML = "<button>THANHDAT</button>"
} | true |
b4af276fb09a09deaab3a81cd370ac081caee974 | JavaScript | philpoore/shellkit | /src/promisify.js | UTF-8 | 335 | 2.59375 | 3 | [
"MIT"
] | permissive | export default function promisify (fn, displayName) {
let newFn = (...args) => new Promise((resolve, reject) => {
fn(...args, (err, ...results) => {
if (err) {
reject(err)
} else {
resolve(...results)
}
})
})
newFn.displayName = displayName || fn.displayName || fn.name
... | true |
74f4f04e92590b2fc68b0c087a654311515647a6 | JavaScript | athira07/Project7 | /java.js/demo.js | UTF-8 | 407 | 3.640625 | 4 | [] | no_license | let add = function (x, y) {
return x + y
}
console.log(add)
let result = add(1, 2)
console.log(result)
let i = 500
function outer() {
i = 100
let s="hello"
console.log("inside function outer")
console.log(i)
function inner() {
console.log(s)
let k = 50
console.log("inside... | true |
71827ff1f315a4294f6ffd68f4215e0ef61adfe3 | JavaScript | Saurabhkumar12-byte/webscraping | /espnPart2.js | UTF-8 | 4,074 | 2.640625 | 3 | [] | no_license | // const request = require("request");
// const cheerio = require("cheerio");
// const fs = require("fs");
// request(
// "https://www.espncricinfo.com/series/ipl-2020-21-1210595/chennai-super-kings-vs-kings-xi-punjab-53rd-match-1216506/full-scorecard",
// function (err, response, body) {
// let data = cheerio... | true |
dee8a37c536d7766b31ef6b42b42cc5947306830 | JavaScript | mylo-james/pokehooks | /react-hooks-pokedex-starter/src/AppWithContext.js | UTF-8 | 1,597 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react';
import { baseUrl } from './config';
import App from './App';
import pokemonContext from './contexts/pokemonContext';
const AppWithContext = () => {
const storageToken = window.localStorage.getItem('state-pokedex-token');
const [loaded, setLoaded] = useState(false);
cons... | true |
88b0f295e6aa5d8f3b2da1c1899a3c92210427ed | JavaScript | Liaozhenting/telepro-autofix | /autowrite/rename.js | UTF-8 | 1,225 | 2.671875 | 3 | [] | no_license | let fs = require('fs');
let walk = require('walk');
let path = require('path');
let sourcePath = '../src';
//需要处理的文件目录
// let root = path.join(__dirname, sourcePath);
let workpath = path.join(__dirname,sourcePath);
let DealAll = function (workpath) {
return new Promise(function (resolve, reject) {
try {
w... | true |
c8d8d698ad1f7025aac06694e4cf6b365ed65f88 | JavaScript | singhamritpal49/algos | /Other/capitalization.js | UTF-8 | 389 | 4.21875 | 4 | [] | no_license | // Examples
// capitalize(‘good weather’) → “Good Weather”
// capitalize(‘lazy days during quarantine’) →” Lazy Days During Quarantine”
function capitalize(string) {
let words = string.split(' ');
string = []
for(let i = 0; i < words.length;i++) {
string.push(words[i][0].toUpperCase() + words... | true |
c277df4332c1b3e83babf89a3a7527134042ac9a | JavaScript | tonkec/text_hover_demo | /src/components/Header.js | UTF-8 | 1,172 | 2.59375 | 3 | [] | no_license | import React from 'react';
class Header extends React.Component {
constructor(props) {
super(props)
this.toggleClass = this.toggleClass.bind(this);
}
toggleClass(e) {
const headingFirstClass = e.classList[0];
if (headingFirstClass.includes("click")) {
if (e.classList[2]){
e.classLi... | true |
a4e68553c00f37f9d6a7f8d47ef62728f8a7171c | JavaScript | dim2019/JS-homeworks | /day-22/homework-2.js | UTF-8 | 1,176 | 3.234375 | 3 | [] | no_license | class Countries {
constructor(url) {
if (typeof url !== 'string') throw new TypeError("`url` isn't string")
this.url = url
}
send(city) {
if (typeof city !== 'string') throw new TypeError("parameter isn't a string")
let regex = /&appid/i
const insertindex = this.url.m... | true |
b4744c6325c709ccf6a5fb7ab6232136ecf43254 | JavaScript | ericgutierre01/GeneradorContratos | /js.js | UTF-8 | 11,572 | 2.578125 | 3 | [] | no_license | function importe(url){
var script = document.createElement('script');
var parentScript = document.getElementById('myscript');
parentScript = parentScript.src;
parentScript = parentScript.split('/');
parentScript.pop();
parentScript = parentScript.join();
parentScript = parentScript.replace(/,/gi, '... | true |
b897975908e5eb4344854045c604369f4d280f7f | JavaScript | SheLovesCode/ELEN-4010-BillSplitterGroupLab | /app/routes/bills.js | UTF-8 | 1,653 | 3.359375 | 3 | [] | no_license | 'use strict'
// Creating a bill object with amount and share for members bill is split with
const bill = {
amount: 0,
number_of_members: 0,
split_share: 0,
type: '',
payer: 'user1',
members: []
}
// Calculating the share of each member for equally split bill
const calculateShare = (amount, numOfMembers) =... | true |
8d50d5b36d372c695b0ebb3b883f187b3daf63f6 | JavaScript | Labil/r-p--g | /js/classes/Map.js | UTF-8 | 1,160 | 3.328125 | 3 | [] | no_license | function Map(name)
{
var xhr = getXMLHttpRequest();
xhr.open("GET", './maps/' + name + '.json', false);
xhr.send(null);
if(xhr.readyState != 4 || (xhr.status != 200 && xhr.status != 0)) //Code 0 for local
throw new Error("Not able to load the map called \"" + name + "\" (HTTP code: " + xhr.status + ")."... | true |
46b35d9ee28c10e18667586250b98c8afedfed2c | JavaScript | aleksanderbrymora/sei-36 | /frank_da/week1/day3/homework4-Geometry Function Lab/main.js | UTF-8 | 2,165 | 4.65625 | 5 | [] | no_license | // Part 1, Rectangle
const rectangleA = {
length: 4,
width: 4
};
const isSquare = function (rectangle) {
if (rectangle.width === rectangle.length) {
return 'rectangle is square';
} else {
return 'rectangle is not square';
}
}
const area1 = function (rectangle) {
... | true |
322f08bfe32e27abb1fa0ec6c0e9d2bb9ce196b5 | JavaScript | claytonbarnette/restrap | /src/lib/Breadcrumb.js | UTF-8 | 2,364 | 3.15625 | 3 | [] | no_license | import React from 'react'
/**
* This element represents a Bootstrap Breadcrumb. A particial deviation
* has been made to make logical sense of the Breadcrum metaphor.
*
* A Breadcrumb is well represented in Hansel and Gretel (https://en.wikipedia.org/wiki/Hansel_and_Gretel)
*
* But to me, a Breadcrumb compone... | true |
40ecbf8cab15d52dd356a82c0483bb98c20ca754 | JavaScript | dpa99c/react-native-launch-navigator | /ios.js | UTF-8 | 8,012 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict';
import {NativeModules} from 'react-native';
let ln = require('./constants');
/*********************
* Internal properties
*********************/
let RNLaunchNavigator = NativeModules.RNLaunchNavigator;
/******************
* Public Constants
******************/
// Launch modes for Apple Maps
ln.LAU... | true |
d87f5c00e4610b584830dadbd6ada4edc02e7c5c | JavaScript | maxwhalezhou/team-project | /src/Search.js | UTF-8 | 4,305 | 2.953125 | 3 | [] | no_license | import React from "react";
import firebase from "firebase";
import { PostItem } from "./Featured";
import { hashHistory } from "react-router";
//create search box
class SearchResults extends React.Component {
constructor(props) {
super(props);
this.state = {
value: '',
Post... | true |
bf03d686231a76997d4653862f233f0917bc0d7a | JavaScript | DannyShien/DIR-React | /stopwatch-timer/src/components/Stopwatch.js | UTF-8 | 1,463 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import Button from './Button';
class Stopwatch extends Component {
constructor(props) {
super(props);
this.state = {
timer: 0,
isCounting: false
}
}
render() {
return (
<>
<h1>{... | true |
57b8398de9e911e1a77340675bf984f46756b864 | JavaScript | bangumi/scripts | /binota/bangumi-green-block-improve.user.js | UTF-8 | 2,937 | 2.734375 | 3 | [
"MIT"
] | permissive | // ==UserScript==
// @name Bangumi-Green-Block-Improve
// @namespace org.binota.scripts.bangumi.bgbi
// @description Draw green block with 30Jikansei
// @include /^https?:\/\/(bgm\.tv|bangumi\.tv|chii\.in)\/?$/
// @include /^https?:\/\/(bgm\.tv|bangumi\.tv|chii\.in)\/subject\/\d+$/
// @version 0.0.... | true |
8501f12a05a18b5a27eed559bb35b39b05c4a99c | JavaScript | csod-netsuite/collections | /FileCabinet/SuiteScripts/SO_Libs/SO_UE_Functions.js | UTF-8 | 16,606 | 2.515625 | 3 | [] | no_license | define(['N/record', 'N/search'], function (record, search) {
/**
* Module Description...
*
* @exports Various User Event Functions
*
* @copyright 2018 Cornerstone OnDemand
* @author Chan Yi <cyi@csod.com>
*
* @NApiVersion 2.x
* @NModuleScope Public
*/
var expor... | true |