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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6c1574882055648ae955b29756b34f69c2aa6548 | JavaScript | Naviam/Shop-Any-Ware | /TdService.UI.Web.MVC/Scripts/ViewModels/AddressViewModel.js | UTF-8 | 7,097 | 2.546875 | 3 | [] | no_license | ko.extenders.displayBrokenRule = function (target, brokenRule) {
//add some sub-observables to our observable
target.hasError = ko.observable();
target.validationMessage = ko.observable();
//define a function to do validation
function validate(newValue) {
target.hasError(newValue ? false :... | true |
b5a87923820be448871258f9236e6f1ec32be271 | JavaScript | aramgev/cordova-plugin-document-reader-api | /www/results/rfid/File.js | UTF-8 | 2,285 | 2.703125 | 3 | [] | no_license | //import java.util.ArrayList;
//import org.json.JSONArray;
//import org.json.JSONObject;
import {FileData} from './FileData';
import {SecurityObjectCertificates} from './SecurityObjectCertificates';
export class File {
constructor(){
this.fileData = null;//FileData
this.fileID = null;//String
... | true |
0acf9becb4e43d699ac06a43cc77c75bc6d3c5a4 | JavaScript | melmsie/chi | /commands/eval.js | UTF-8 | 793 | 2.6875 | 3 | [
"MIT"
] | permissive | const util = require('util')
exports.run = function (client, msg, args, config) {
if (!config.devs.includes(msg.author.id)) return
let res
let evalTime
try {
const rep = new RegExp(client.token, 'gi')
const before = Date.now()
res = eval(args.join(' '))
evalTime = Date.now() - before
if (typeof res === ... | true |
6baa7793f875ea40f495f43f1b743e26772f72e1 | JavaScript | wernersbacher/rumblerace-php | /gui.js | UTF-8 | 13,817 | 2.515625 | 3 | [] | no_license | /* global moment, store */
function formatTime(dur) {
return date("H:i:s", dur - 3600) + "s";
}
function precise_round(num, decimals) {
return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
function setTuneData(part, preis, dur, acc, speed, hand, dura) {
$("#" + part).fin... | true |
844a98f382f81740a9ae675ab0dae1c24f179e1e | JavaScript | darpanpathak/golden-crown | /models/kingdom.js | UTF-8 | 208 | 2.53125 | 3 | [] | no_license | module.exports = class Kingdom{
constructor(name, emblem, king = "", allies = []) {
this.name = name;
this.emblem = emblem;
this.king = king;
this.allies = allies;
}
} | true |
b476209b4aba503c9cbf9891eeb22fea4ddaf10f | JavaScript | bepyan/pyan-board | /client/src/components/login/SignupModal.js | UTF-8 | 1,725 | 2.546875 | 3 | [] | no_license | import { $, $$, isInVailInput, popSuccess, renderError } from "../../libs/util.js";
import makeModal from "../../libs/makeModal.js";
import api from "../../libs/api.js";
import load from "../../router.js";
const Signup = () => {
// TO DO
// add reset button
/* usecase event */
const onSignup= () => {
... | true |
6c097f168ac29a15fd0ca37ce8ead4a50355066c | JavaScript | rafacastalla/ETSINF-3 | /TSR/pract2/zmqadvanced/batec/brokerbatec.js | UTF-8 | 3,637 | 2.65625 | 3 | [] | no_license | // ROUTER-ROUTER request-reply broker in NodeJS
var aux = require('./auxfunctions1718.js');
var zmq = require('zmq');
var args = process.argv.slice(2);
var frontend = zmq.socket('router');
var backend = zmq.socket('router');
var fePortNbr = args[0] || 8059;
var bePortNbr = args[1] || 8060;
var verbose = false;
if(... | true |
73fa329524c1d1cd2e24798de3c9d395710bfd4d | JavaScript | sinaGh-cyber/Form-wave-animation | /script.js | UTF-8 | 280 | 2.84375 | 3 | [] | no_license | const lables = document.querySelectorAll('.form-control label');
lables.forEach((lable) => {
lable.innerHTML = lable.innerText
.split('')
.map((letter, idx) => {
return `<span style="transition-delay: ${idx * 30}ms;" >${letter}</span>`;
})
.join('');
});
| true |
44d6411f2f652077011ce501e4535a3b0d23d22f | JavaScript | mradkov/aepp-calldata-js | /tests/utils/RLPInt.js | UTF-8 | 606 | 2.578125 | 3 | [
"ISC"
] | permissive | const test = require('../../src/test.js')
const RLPInt = require('../../src/utils/RLPInt.js')
const b = (value) => new Uint8Array(value)
test('RLP Encode Integer', t => {
t.plan(8)
t.deepEqual(RLPInt(0), b([0]))
t.deepEqual(RLPInt(1), b([1]))
t.deepEqual(RLPInt(127), b([127]))
t.deepEqual(RLPInt(1... | true |
ed9c17a7abb376f55fdd1375b18a581beb3ad63c | JavaScript | google/CodeCity | /core/core_13_$.Selector.js | UTF-8 | 24,659 | 2.625 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | true |
6b48385972f3754552311e49f20e8e3cfe70ccfd | JavaScript | giocodes/FrameworkWars | /js/chart.js | UTF-8 | 1,331 | 2.53125 | 3 | [] | no_license | let ctx = document.getElementById("myChart");
let chartData = {
labels: ["Angular","React", "Vue", "Ember"],
datasets: [{
label: "Watchers",
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rg... | true |
59401e64746c1ef5375abc9cba8ffbb836fa54da | JavaScript | JazHolz/CS1430-2018 | /GuessingGame/js/guess.js | UTF-8 | 928 | 3.640625 | 4 | [] | no_license | //javascript
var randomNum = Math.floor(Math.random()*100);
function gameStart()
{
document.getElementById("userMessage").innerText = "Hello there, thanks for coming to play a guessing game with us!";
}
function compareGuesses()
{
var theguess = eval(document.guessForm.userGuess.value);
if( theguess < randomNum ... | true |
602ee22790a0de02f702dfd3b6dfcb81ad0602bd | JavaScript | rfearing/custom-blocks | /src/components/options/image/index.js | UTF-8 | 1,948 | 2.65625 | 3 | [] | no_license | const {
MediaUpload,
} = wp.editor;
const {
Button,
Dashicon,
} = wp.components;
/**
* Conditional Return Add Image or Remove Image.
* @param {object} attributes - attributes of the block.
* @param setAttributes() - function provided by wp.
* @param isSelected - boolean provided by wp.
* @param im... | true |
9445526b28d5512e23b2178cb8d054dd5464a078 | JavaScript | marksinkovics/marksinkovics.github.io | /assets/source-maps/_assets/js/theme.js | UTF-8 | 1,343 | 3.0625 | 3 | [] | no_license | const STORAGE_KEY_THEME_MODE = "mode"
const THEME_MODE_DARK = "dark"
const THEME_MODE_LIGHT = "light"
function switchTheme() {
const themeSwitcher = document.getElementById('themeSwitcher');
sessionStorage.setItem(STORAGE_KEY_THEME_MODE, themeSwitcher.checked ? THEME_MODE_DARK : THEME_MODE_LIGHT);
setTheme... | true |
cacc46e934d00948eb762ed531f06df71c651400 | JavaScript | Luoyuda/js-demo | /codewar/CountingDuplicates.js | UTF-8 | 1,074 | 3.828125 | 4 | [] | no_license | /*
* @Author: xiaohuolong
* @Date: 2021-07-18 19:39:29
* @LastEditors: xiaohuolong
* @LastEditTime: 2021-07-18 19:40:05
* @FilePath: /js-demo/codewar/CountingDuplicates.js
*/
/*
Count the number of Duplicates
Write a function that will return the count of distinct case-insensitive alphabetic characters and numeri... | true |
5be2f398b6718bc6c72135cf48e1fc518778a2b1 | JavaScript | dacy413/TestDemo | /test_object.js | UTF-8 | 315 | 3.34375 | 3 | [
"MIT"
] | permissive | function Dog(name){
this.name = name;
}
Dog.prototype.food = "meat";
var miaomiao = new Dog("miaomiao");
console.log("dog name is ",miaomiao.name);
console.log("dog eat ",miaomiao.food);
var wangwang = new Dog("wangwang");
console.log("dog name is ",wangwang.name);
console.log("dog eat ",wangwang.food);
| true |
9ea4aff4d44d1bedc2e0ff8873644588ab60019e | JavaScript | YWHo/hello-doctor | /src/shared/dateHelper/dateHelper.js | UTF-8 | 5,279 | 2.890625 | 3 | [] | no_license | import dayjs from 'dayjs';
import { DAY_MORNING, DAY_AFTERNOON, DAY_EVENING } from '../constants';
import customParseFormat from 'dayjs/plugin/customParseFormat';
dayjs.extend(customParseFormat);
const memCache = {
datesInThreeMonths: {},
monthArray2d: {}
};
export function getDatesOfPreviousTwoDaysFrom(givenDate... | true |
0371baf4ebafdc66b3de7176d9d857f0dd6be2e5 | JavaScript | 15900679749/weixinSurvey | /pages/index/index.js | UTF-8 | 4,460 | 2.671875 | 3 | [] | no_license | //index.js
//获取应用实例
const app = getApp()
Page({
data: {
olddistance:"",//上一次两个手指的距离
newdistance: "",//本次两手指之间的距离,两个一减咱们就知道了滑动了多少,以及放大还是缩小(正负嘛)
diffdistance: '', //这个是新的比例,新的比例一定是建立在旧的比例上面的,给人一种连续的假象
Scale: 1,//图片放大的比例,
baseHeight: '', //原始高
baseWidth: '' //原始宽
},
uplo... | true |
1b8a31ff4a511ed67ac65e0aadb987a2ff09869d | JavaScript | dainiusjocas/labs | /V_semester/chaos theory/ifs-js/ifs.js | UTF-8 | 1,979 | 3.578125 | 4 | [
"Beerware"
] | permissive | window.onload = function (){
document.getElementById("start").addEventListener('click', init, false);
};
var canvas = null;
var context2D = null;
// Calculation data
var rotateAngle = Math.PI / 4;
var sin = Math.sin(rotateAngle);
var cos = Math.cos(rotateAngle);
var iterationCount = 10;
function init()
{
canva... | true |
052280f402210445faf35df3e4c690f165065360 | JavaScript | tynrare/dust-assignment-0 | /public/javascripts/game-0/utils/events_manager.js | UTF-8 | 3,629 | 3.109375 | 3 | [] | no_license | /**
* @file events_manager.js
* @author tynrare
* @version 1
* @module Core/Utils/EventsManager
*/
import CoreEvents from 'events';
//импортим напрямую просто чтоб избежать рекурсивных включений
import logger from './logger-public'
const MAX_LISTENERS = 100;
/**
* singletone class for managing events
*
* @st... | true |
3b7b613093f9f00e0a5295008a6231223be71c71 | JavaScript | dmrichwa/iRobot | /Commands/avatar.js | UTF-8 | 708 | 2.546875 | 3 | [] | no_license | const { get_member } = require("../utils/");
exports.run = async (client, msg, args) => {
get_member(args.splice(1).join(" "), msg.guild, msg.member).then(member => { // try to find the user they want
msg.channel.send("`" + member.user.username + "`'s avatar: " + member.user.displayAvatarURL({ dynamic:... | true |
8321270b48e3bf4a95ed9c4a36d074cd932f9c94 | JavaScript | vitorhpaes/mecanica | /front/assets/js/func.js | UTF-8 | 1,416 | 2.609375 | 3 | [] | no_license | ;(function($) {
var getServlet = function(data, callback){
$.ajax({
url: 'http://localhost:8080/Backend_/webApp',
type: 'GET',
data: data,
dataType: 'JSON',
complete: function(response){
ret = response.responseJSON;
callback(ret);
}
});
}
var getFuncionario = function(callback) {
... | true |
4cad20afa4d832e8a95e305ec22c123c1a65f7c5 | JavaScript | tiy-clt/curriculum | /be-13-bigdata/dataset.js | UTF-8 | 3,882 | 2.890625 | 3 | [] | no_license | const fs = require('mz/fs');
const Sequelize = require('sequelize');
const loadSchemas = require('./schemas/schemas');
const VOTERS_PER_CITY = 100;
const issues = [
`All parents receive Friday's off.`,
`Minimum wage should be $60.`,
`We should build a new park downtown.`,
`We should clean up the local... | true |
8d01b88e693f8195046a036b94f3ed412b38aa01 | JavaScript | pvinthemix/wheeloffortune | /js/Player.js | UTF-8 | 498 | 2.796875 | 3 | [] | no_license | class Player {
constructor(name) {
this.name = name;
this.grandTotal = 0;
this.score = 0;
}
increaseCurrentPlayerScore() {
if (game.round === 4) {
this.score += game.bonusWheel.currentSpinValue;
}
if (wheel.currentSpinValue === 'BANKRUPT') {
this.score = 0;
} else {
... | true |
88efc16d1c24e03eb8709a7251361baae49adf1e | JavaScript | GreDiSe/theBestTask | /task15.js | UTF-8 | 621 | 3.875 | 4 | [] | no_license | var a = { x: 1, y: 2, z: [1, 2, 3] };
var b = shallowCopy(a); // b — это отдельный объект
b.x = 10;
console.log(a.x); // 1
console.log(b.x); // 10
b.z.push(4);
console.log(a.z); // [1, 2, 3, 4]
console.log(b.z); // [1, 2, 3, 4]
var c = new Date(2014, 1, 1);
var d = shallowCopy(c);
d.setFullYear(2015);
console.log(c.get... | true |
c032a4e2132e6dbfee1c92ff1bdf8922bdaeaf01 | JavaScript | thanhnh89/ReactJsExample2 | /src/helpers/StorageUtils.js | UTF-8 | 576 | 2.71875 | 3 | [] | no_license |
export const STORAGE_KEYS = {
token: 'token',
userName: 'userName',
userID: 'userID'
};
export default class StorageUtils {
// local storage
static setItem(key, value) {
window.localStorage.setItem(key, value);
}
static getItem(key, defaultValue) {
const result = window.localStorage.getItem(key... | true |
7c9a095389c5cbbe1d1ee96c2654e0018b901975 | JavaScript | diversivo/adidasMemo | /src/pages/info.js | UTF-8 | 4,418 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from 'react';
import Layout from '../components/layout';
import SEO from '../components/seo';
import { navigate } from 'gatsby';
import { validarRUT } from 'validar-rut';
import { clrIlTxt } from '../components/utils';
import Banner from '../assets/images/img-completa.jpg';
cons... | true |
63e9f31c7646001eebedebd339e499ed40b2f24c | JavaScript | jinwookkim1/RNEx09ListView | /Main.js | UTF-8 | 16,354 | 3.15625 | 3 | [] | no_license | import React, {Component} from 'react';
import {View, Text, StyleSheet, FlatList, TouchableOpacity, Image} from 'react-native';
export default class MainComponent extends Component{
// React Native에서 ListView의 역할을 하는 Component는 2가지 종류가 있음.
// 1. FlatList : 모든 아이템이 같은 모양일 때 많이 사용 - 일반적인 리스트뷰
// 2. SectionL... | true |
64e838a2c97191aa6be89ce501fad9e4389caaca | JavaScript | GuiAndrew/the-controlled-component | /src/App.js | UTF-8 | 661 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import FormComponent from './components/formcomponent';
class App extends Component {
constructor() {
super();
this.state = {value: ''};
}
handleChange(event) {
this.setState({value: event.target.value})
}
render(){
return (
... | true |
77d38de16c392eafb3dce0713493655b1fad1406 | JavaScript | kagithapk/task-manager | /src/components/pages/dashboard/index.jsx | UTF-8 | 2,526 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import TASK_API from '../../../api/taskApi';
import END_POINTS from '../../../endPoints/routes';
import Loader from '../../atoms/loader';
import DashboardTemplate from '../../templates/dashboard';
const DashboardPage = () => {
const [tasks, setTasks] = useState([])... | true |
ca33fde5e133ccf284cc90f701735fec7d448aed | JavaScript | K4orta/IGN-Code-Foo | /LicensePlate/js/script.js | UTF-8 | 4,667 | 3.53125 | 4 | [] | no_license | /* Author:
Erik Sy Wong
*/
// License plate pattern class and methods
function LicensePattern(){
//Initalize member variables
this.DIGITS = "0123456789";
this.LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
this.popSize = 0;
this.totalPlates = 0;
this.base = 0;
this.numSecondBaseChars = 0;
this.excess ... | true |
5b1aff43883fdb27f893fd2d1f28852ded163edf | JavaScript | Boop-Py/project4 | /network/static/network/library.js | UTF-8 | 7,118 | 2.578125 | 3 | [] | no_license | var last_form = null;
document.addEventListener('DOMContentLoaded', function () {
// when heart is clicked, call the like_and_dislike function
document.querySelectorAll('.heart').forEach(div => {
console.log("heart clicked")
div.onclick = function() {
like_and_dislike(this);
... | true |
ec691c4e2d753a3ff2e42f5c80ef8392f8a2cf84 | JavaScript | ivansanchezg/tic-tac-toe-react | /src/components/Board.js | UTF-8 | 3,026 | 3.265625 | 3 | [] | no_license | import * as React from 'react';
import Square from './Square';
const lines = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6],
];
const size = 9;
const squaresPerRow = 3;
export const X = 'X';
export const O = 'O';
export class Board extends React.Component {
... | true |
16e3d2d6806db7d94c0db6c1bfb780ee88069e8e | JavaScript | msarubbe/Principles-Of-Software- | /app.js | UTF-8 | 776 | 2.78125 | 3 | [] | no_license |
var express = require("express");
var bodyParser = require('body-parser');
var Chart = require('chart.js');
//START CHART.JS CODE
//END CHART.JS CODE
let hello_string = "t";
const app = express();
app.set( "view engine", "ejs" ); //needed for ejs file
// var urlencodedParser = bodyParser.urlencoded({ extended: ... | true |
c1b17c01908f2bbbfdaac60ad5c916a30c7b3732 | JavaScript | andqok/learning-materials | /simple-games/Game of Life/gameOfLife.js | UTF-8 | 3,253 | 3.609375 | 4 | [] | no_license | var cellCountH, cellCountW, cellToIndex, indexToCell
class StateOfLife {
constructor(state) {
this.state = state || []
}
getStr() { return JSON.stringify(this.state) }
clickCell(index) {
if (this.state.includes(index)) {
this.state = this.state.filter(el => el !== index)
this.updateView({ b... | true |
a8c7dcd5cfcdce7fd0d7c01226aa25b5c506789b | JavaScript | minademian9/Vue-JS-Playground | /js/vue_computeprops.js | UTF-8 | 1,117 | 3.046875 | 3 | [] | no_license | var vm = new Vue({
el: '#computed_props',
data: {
firstname :"M",
lastname :"D",
birthyear : ""
},
computed :{
getfullname : function(){
return this.firstname +" "+ this.lastname;
}
}
})
var vm2 = new Vue({
el: '#computed_props_2',
data: {
... | true |
77505e3abab3307ea3fd9b33d3c34ca79a72a0f8 | JavaScript | wengqi/webapp | /app/index.js | UTF-8 | 1,707 | 2.890625 | 3 | [
"MIT"
] | permissive | /**
* app 入口文件
*/
require('./core/route.js');
/*-------------------------------全局初始化执行方法-------------------------------*/
$(function(){
$("html").niceScroll();
});
/*-------------------------------全局初始执行函数-------------------------------*/
//处理键盘事件 禁止后退键(Backspace)密码或单行、多行文本框除外
function banBackSpace(e){
... | true |
aabf4998ac13b17e78d460c28056480b29d3c0f4 | JavaScript | bjkeller/no-blobby-you-know | /src/layout/EdgeLayout.js | UTF-8 | 2,001 | 2.5625 | 3 | [
"MIT"
] | permissive | /* @flow */
"use strict";
/*
* Copyright (c) 2015 Benjamin Keller
* All rights reserved
*
* This source code is licensed under the MIT License found in the LICENSE
* file in the root directory of the source tree.
*
*/
import Point from '../geometry/Point';
import PointSet from '../geometry/PointSet';
import Edg... | true |
27f17c1f9f1528c84da335d335b62c041e4d5515 | JavaScript | ChamaraM/Assignemet-Sever-App | /server.js | UTF-8 | 1,921 | 2.609375 | 3 | [] | no_license | var express=require('express');
var app=express();
var fs = require('fs');
var count = 0;
var dateTime = require('node-datetime');
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
next();
});
app.get('/getData',functi... | true |
330cfb875409f1743bfb13737f807213d25e03e9 | JavaScript | vuksamardzic/learnyounode | /5/printFiles.js | UTF-8 | 477 | 2.703125 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const path = require('path');
function filterFiles(list, filter) {
return list.filter(function (file) {
return path.extname(file) == '.' + filter;
});
};
module.exports = function (directory, filter, callback) {
fs.readdir(directory, function (error, list) {
if (... | true |
94dc0c064173c6561f236ed44c607db09245c333 | JavaScript | FanHHHHH/express-mongodb-restful | /app.js | UTF-8 | 778 | 2.53125 | 3 | [] | no_license | const express = require('express')
const app = express()
const port = 3000
//导入子路由
const routes = require('./routes')
routes(app)
app.use(express.json())
app.get('/', (req, res) => {
res.send('Welcome')
})
app.post('/', function (req, res) {
console.log('收到请求,请求体为:', req.body)
res.status(201).send({ id: 2, ..... | true |
c693c1c5fe5a0f5c437c454a1c80071d84ffd0bd | JavaScript | endojs/endo | /packages/test262-runner/test262/test/built-ins/String/prototype/normalize/return-normalized-string-from-coerced-form.js | UTF-8 | 1,249 | 3.34375 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-ecma-no-patent"
] | permissive | // Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.1.3.12
description: >
Returns normalized string from coerced form.
info: |
21.1.3.12 String.prototype.normalize ( [ form ] )
...
4. If form is not provided o... | true |
11a94f370a4a99ed95a0e4fcfc4a50c418a1f2d8 | JavaScript | mickuankit/Dhothraki-trans | /app.js | UTF-8 | 755 | 3.15625 | 3 | [] | no_license | var inputTxt = document.querySelector("#inputText");
var button = document.querySelector("#btn");
var output = document.querySelector("#out");
button.addEventListener("click",clickHandler);
var serverUrl = "https://api.funtranslations.com/translate/dothraki.json"
function outUrl(text){
return serverUrl+"?"+"text="+... | true |
7b1b0631ac8875e91dfedad2d54bc9da89144ca8 | JavaScript | Redleaf23477/dataTables | /js/datatable.js | UTF-8 | 1,632 | 2.9375 | 3 | [] | no_license | //javascript for making a table from input
//dt refers to data_transfer, a json object
/*
{
"subject":["name", "name", "name", ... ],
"students":[
{
"intro":{"name":"..."},
"score":{"raw":[number, number, number, ...], "average":number}
},
...
]
... | true |
86142852d3bad8da8dcfdd224d81b5d08af2d12e | JavaScript | jonathanhuffaker/sandwich_maker | /cheese.js | UTF-8 | 287 | 2.578125 | 3 | [] | no_license | var Sandwich = (function(Sandwich) {
var cheeseOpt = {
"cheddar": "1.00",
"swiss": "1.00",
"american": "1.00",
"provolone": "1.00",
"pepperJack": "1.00"
}
Sandwich.getCheeseOpt = function(userIput) {
return cheeseOpt[userInput];
}
return Sandwich;
})(Sandwich); | true |
91cccb1cc651446622d2845eeac331ed40f3d514 | JavaScript | uojiaku-ojiaku/Technical-Interview-Scratchpad | /Javascript/Demo/index.js | UTF-8 | 762 | 4.5625 | 5 | [] | no_license | console.log('Hello World');
function greet() {
console.log('Hello World');
}
greet();
function greet(name) {
console.log('Hello' + name)
}
// name is a parameter, only meaningful inside this function
// name is also an input to this function
greet('John')
// Hello John
// John is an argument to the greet... | true |
d3d7c47052237d9e5ddf97ebe247f76a3fae208e | JavaScript | nagpai/my-monkeys | /copy-reset-tool-url.js | UTF-8 | 959 | 2.609375 | 3 | [] | no_license | // ==UserScript==
// @name Update URL in Reset tool
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Copy site URL to text field in reset (revert) tool
// @author Nagesh
// @match https://mc.a8c.com/automated-transfer/revert.php?blog_id=*
// @icon data:image/g... | true |
bead95eef0cedf2e0dc3f20ad12220532122ee31 | JavaScript | damenor/prueba_tecnica_api | /models/policie.js | UTF-8 | 2,600 | 2.515625 | 3 | [] | no_license | 'use strict'
var Client = require('./client');
var client = new Client();
class Policie {
constructor() {
this.http = require('http');
this.url = 'http://www.mocky.io/v2/580891a4100000e8242b75c5';
}
/*
* Get one policie by id
*@Params policieId: number, callback: function
*/
getOne(policieId, callback) {... | true |
119b86b3f2917ec91322e53b209e611aaf947192 | JavaScript | meteorbelt/meteorbelt | /packages/belt-product/product_tests.js | UTF-8 | 1,591 | 2.59375 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | permissive | // Should create the correct slug
Tinytest.add("belt - product - new", function (test) {
var p = new Product();
test.equal(p.validate(), 'name required');
p.name = 'Eggs';
p.description = 'Farm fresh';
p.totalPrice = 10.33;
p.isUnique = true;
test.equal(p.validate(), true);
});
Tinytest.add("belt - produ... | true |
32f0eb46e0508d66fc3c4f36e869f13775d25810 | JavaScript | CharlesCreativeContent/CodeWars | /7th Kyu/minMax.js | UTF-8 | 185 | 3.328125 | 3 | [] | no_license | /*
Implement a function that returns the minimal and the maximal value of a list (in this order).
/*
//Answer//
function getMinMax(arr){
return [Math.min(...arr),Math.max(...arr)]
};
| true |
23a5975aa2af7d38386556c7498e8d07f0d3db4f | JavaScript | KNU-MobileApp-Team8/Server | /Server/Database/databaseLoader.js | UTF-8 | 1,990 | 2.546875 | 3 | [] | no_license | var mongoose = require('mongoose');
var databaseLoader = {};
databaseLoader.init = function(app, config, callback){
console.log('# Initialize the database.');
connect_database(app, config, callback);
}
function connect_database(app, config, callback){
console.log('# Called connect().');
mo... | true |
25e6368b9e26b738aaacdf51b9478008af5a62ab | JavaScript | Aqzhyi/blogger-posts-crawler | /src/index.js | UTF-8 | 1,545 | 2.515625 | 3 | [] | no_license | import _ from 'lodash'
import isUrl from 'is-url'
import request from 'request-promise'
import bloggers from './bloggerAPI'
/**
@name Article
@interface
@prop {string[]} address
@prop {string} body - Content of article
@prop {string} cover - Generally first element of Article.images
@prop {string[]} images - Contain U... | true |
0fc619d742b0663974c21fee464d7ec5cc708e27 | JavaScript | Shujito/interactive-megumin | /index.js | UTF-8 | 3,310 | 3.25 | 3 | [] | no_license | // game logic starts here
function main() {
// query for the canvas
let canvas = document.querySelector('canvas');
// 2d context is used for drawing stuff
let ctx = canvas.getContext('2d');
// these are the bounds of the canvas (position relative to the <body> and it's size)
let bounds = canvas.getBoundingClientR... | true |
96c59cfbfb109e9708ed0bb3433dd16f040a8011 | JavaScript | manhtuan1112/React_Training | /dev/js/reducers/cartReducer.js | UTF-8 | 1,534 | 2.65625 | 3 | [] | no_license | import * as types from '../actions/actionTypes';
import initialState from './initialState';
import {browserHistory} from 'react-router';
export default function cartReducer(state = initialState.carts, action) {
switch(action.type) {
case types.LOAD_CARTS_SUCCESS:
return action.carts
case types.ADD_C... | true |
36a1d375c671af1b0accbab84bb3e78e276bc5fd | JavaScript | whichlight/interactive-trading-card | /js/web3.js | UTF-8 | 1,167 | 2.515625 | 3 | [] | no_license | class ConfettiVortex {
constructor({ onAccountChange }) {
if (typeof window.ethereum !== 'undefined') {
console.log('We are in the browser and Metamask is running');
window.web3 = new Web3(window.ethereum);
window.ethereum.on('accountsChanged', onAccountChange)
}
}
init() {
if (type... | true |
852e1c89b90e339b46feafb2d4dd84f9048198ff | JavaScript | thechamp84/hospital | /src/pages/department/index1.jsx | UTF-8 | 1,152 | 2.8125 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
class Index extends React.Component{
constructor(props)
{
super(props);
this.state = {addtask: '', tasks:[{name:'therichpost'}]};
this.addValue = this.addValue.bind(this);
this.updateInput = this.updateInput.bind(this);
}... | true |
e151260a38554819842f07c57954fc0d61e162c5 | JavaScript | castorini/honkling | /honkling-assistant/app/micAudioProcessor.js | UTF-8 | 2,895 | 2.671875 | 3 | [
"MIT"
] | permissive | let micProc;
function MicAudioProcessor() {
micProc = this;
this.audioContext = new AudioContext();
this.browserSampleRate = this.audioContext.sampleRate;// 44100
this.srcBufferSize = 1024;
// with buffer size of 1024, we can capture 44032 features for original sample rate of 44100
// once audio of 44100 ... | true |
baee9c1982a476c45fa109bdb01936339b27a1ed | JavaScript | SandhyaLakshmi21/Practice | /billing3/billing3.js | UTF-8 | 1,944 | 3.046875 | 3 | [] | no_license | var Mosambi_price=120, Watermelon_price=150, Grapes_price=160, Avacoda_price=180;
var Mosambi_q=0; Watermelon_q=0; Grapes_q=0; Avacoda_q=0;
document.getElementById("name").addEventListener("keyup",function(){
document.getElementById("name2").innerHTML=this.value;
});
document.getElementById("email").addEventLi... | true |
20aff4b3b33c2bf82980eec345f90ee8df0d2768 | JavaScript | AqeelGani/ACA031-Iron-Man-1 | /ACA-31-Iron-Man-Level1-master/sketch.js | UTF-8 | 834 | 2.734375 | 3 | [] | no_license | var ironMan;
var bg, backgroundImg;
function preload() {
backgroundImg = loadImage("images/bg.jpg");
ironMan_Image = loadImage("images/iron.png");
}
function setup() {
createCanvas(1340, 615);
bg = createSprite(580,300);
bg.addImage(backgroundImg);
bg.scale = 1.2;
ironMan = createSprite(30,500,20,20);
... | true |
3454645749599c5fac6769dc9114fe3e2369ffa6 | JavaScript | fbwCia/returnstatement-Madhu-DCI | /num.js | UTF-8 | 238 | 3.453125 | 3 | [] | no_license | function minAndMaxInArray(array) {
array.sort();
let minOfArray = array[0];
let maxOfArray = array[array.length - 1];
return { minOfArray, maxOfArray };
}
let minAndMax = minAndMaxInArray([3, 6, 8, 9]);
console.log(minAndMax);
| true |
42ad0f2149e3514e6b0e1808940295ce9f7ebe36 | JavaScript | royer-z/CS490ReleaseCandidateRepo | /myscript.js | UTF-8 | 1,919 | 3.34375 | 3 | [] | no_license | /*jshint esversion: 6 */
var onlyForm = document.getElementById('onlyForm');
var result = document.getElementById('result');
onlyForm.addEventListener('submit', function(event) {
"use strict"; // Avoids error message
event.preventDefault(); // Prevents page refresh and hides form input from URL
var fData = new F... | true |
05015b7660456477ffb1fde820247d7dd6d4e420 | JavaScript | brijesh-pant/calendar-book | /src/util/index.js | UTF-8 | 1,105 | 2.96875 | 3 | [
"MIT"
] | permissive | export const monthList = [
{ value: '1', label: 'January' },
{ value: '2', label: 'February' },
{ value: '3', label: 'March' },
{ value: '4', label: 'April' },
{ value: '5', label: 'May' },
{ value: '6', label: 'June' },
{ value: '7', label: 'July' },
{ value: '8', label: 'August' },
{ value: '9', label: 'Sept... | true |
82d88b57ee9b92725b9ded94d951d01aaf9a7c46 | JavaScript | ManuelSdev/practica4 | /firstapi/routes/index.js | UTF-8 | 752 | 2.625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const Anuncio = require('../models/Anuncio')
/* GET home page. */
router.get('/', async(req, res, next) => {
const nombre=req.query.nombre
const anuncios = await Anuncio.find({}).exec()
//res.locals.anuncios=anuncios[0].tags
res.locals.anuncio... | true |
52bb58ec08ec38dff489ebd008505bad513a7d2f | JavaScript | tarasovdenis/examples_code | /PHP/taxiservice/scripts/grid.js | UTF-8 | 673 | 2.75 | 3 | [] | no_license | function Field(id, fio, email, departure, destination, car, status){
this.id = id;
this.fio = fio;
this.email = email;
this.departure = departure;
this.destination = destination;
this.car = car;
this.status = status;
this.tr = document.createElement('tr');
this.s = document.crea... | true |
fa7bf4fa1660ea3dd8612dcc9cbef67eef8f2c25 | JavaScript | LuckyKoala/LiveScreep | /src/service/terminal.js | UTF-8 | 4,219 | 2.6875 | 3 | [
"MIT"
] | permissive | let mod = {};
module.exports = mod;
//Simple:
// sell energy/low mineral in terminal
const COST_LIMIT = 600;
const BASE_COUNT = 1000;
function ordersOf(targetRoom, resourceType, orderType, costLimit=COST_LIMIT) {
return Game.market.getAllOrders(order => order.resourceType === resourceType &&
... | true |
a0333af0dc8078cdc2871d1900d59be4634c9623 | JavaScript | bridgjr/Little_Brick_Out | /brick.js | UTF-8 | 667 | 3.359375 | 3 | [] | no_license | function Brick(x, y, w, h) {
this.w = w;
this.h = h;
this.x = x;
this.y = y;
this.show = function () {
push();
strokeWeight(2);
stroke(0);
fill(255, 0, 0);
rect(this.x, this.y, this.w, this.h);
pop();
}
this.hit = function (obj) {
if ... | true |
4089b7de8a54a9ba0389c1ca69beecbc54656bad | JavaScript | kevinliposl/098765 | /public/js/Backup-NoMin/Views/insertProfessorView.js | UTF-8 | 3,824 | 2.734375 | 3 | [
"MIT"
] | permissive | function checkTypeId(type) {
if (type === 'C') {
$("#form-id").attr('minlength', '9');
$("#form-id").attr('maxlength', '9');
$("#form-id").val('');
} else {
$("#form-id").attr('minlength', '9');
$("#form-id").attr('maxlength', '20');
$("#form-id").val('');
}
}... | true |
8fcf55d8a9643c1ca3cccfcbc9c8bac4c12b7621 | JavaScript | ambikarajesh/meetups-page | /server/services/speakersService.js | UTF-8 | 1,588 | 2.859375 | 3 | [] | no_license | const fs = require('fs');
const util = require('util');
const readFile = util.promisify(fs.readFile);
class SpeakerServices{
constructor(dataFile){
this.dataFile = dataFile
}
async getData(){
const data = await readFile(this.dataFile, 'utf-8');
if(!data){
return [];
... | true |
6b98fcd7fdd7610a398579460afb944f312dd809 | JavaScript | MapcreatorIO/interactive | /app/js/helpers.js | UTF-8 | 4,841 | 2.859375 | 3 | [] | no_license | /**
* Helpers methods
* @type {object}
*/
var helpers = {
/**
* Start the drawing of the map 60FPS
*/
startDrawing: function() {
requestAnimationFrame(function() {
main.object.levels.getCurrent().draw();
if(main.globals.isDown) {
helpers.startDrawing();
}
});
},
/**
* Moves the canvas to... | true |
c2cb0ba52e57731948ac23b48c44c96dd076fa6f | JavaScript | proff69/pa-technical-challenge | /library/es-webpack/src/index.js | UTF-8 | 3,173 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | import { BingoGraph } from './graph';
import { mxgraph } from './initializer';
const titleHeight = 70;
const columnWidth = 130;
const rowHeight = 100;
const columnNumber = 5;
const rowNumber = 5;
// eslint-disable-next-line no-undef
if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line no-consol... | true |
088097fc0455e82b26ad235529e516702717666a | JavaScript | Amrithaknair/student_information_system | /src/component/Getdata.js | UTF-8 | 1,053 | 2.515625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import axios from 'axios'
import '../App.css';
class Getdata extends React.Component
{
state={
persons:[]
};
componentDidMount()
{
axios.get('http://localhost:8095/rest/users/all/').then(res =>{
console.log(res);
this.setState({persons:res.data});
... | true |
4dfc21ed7a83534a9b13760d20d0890d1ec80be2 | JavaScript | veroca88/algorithms-practice | /CashRegister/cashRegister.js | UTF-8 | 3,207 | 3.75 | 4 | [] | no_license | // Cash Register
// Design a cash register drawer function checkCashRegister() that accepts purchase price as the first argument (price), payment as the second argument (cash), and cash-in-drawer (cid) as the third argument.
// cid is a 2D array listing available currency.
// The checkCashRegister() function should alw... | true |
910aa11bbec412a5a49831b54bd60ebc6cd8b1d8 | JavaScript | Raghavi94/webdev-related-stuff | /EJS Exercises/Chapter 2/Chapter 4/Q1.sum of range.js | UTF-8 | 741 | 4.03125 | 4 | [] | no_license | function range(start, end, step = start < end ? 1 : -1) {
let array = [];
if (step > 0) {
for (let i = start; i <= end; i += step) array.push(i);
}
else {
for (let i = start; i >= end; i += step) array.push(i);
}
return array;
}
function sum(array){
let su... | true |
c28e0689fe005c8c27f3e56e1bf8a943cc69316d | JavaScript | rankitbishnoi/happytohelp | /client/angular/services/createQueryService.js | UTF-8 | 681 | 2.53125 | 3 | [] | no_license | myapp.service('createQ', ['$rootScope','$http', function($rootScope, $http){
var self= this;
self.postQuery = (token, subject, description, name, email)=> { // function to send postQuery request to the server with the data
var data = { subject: subject, description: description, name: name, email:... | true |
38a5dc53eeeac39905fc513f8e43c29cf887d297 | JavaScript | doczi/ScreepsAgent | /SpiralTest.js | UTF-8 | 1,379 | 2.65625 | 3 | [
"MIT"
] | permissive | var Spiral = require('Spiral')
var Assert = require('Assert')
module.exports = {
testConstructor: function() {
var pos = new RoomPosition(32, 32, 'room')
var spiral = new Spiral(pos, 1)
Assert.assertTrue(spiral.next().isEqualTo(pos))
},
testDistanceOne: function() {
var s... | true |
1cb175a94ba581fbb705605de612667c1fe0672d | JavaScript | DrBlack1/DrBlack1.github.io | /messingMongoDB/playground/mongodb-delete.js | UTF-8 | 1,279 | 3.484375 | 3 | [] | no_license |
//can use object destructuring
/*
eg
var myObject = {name: 'dan', age: 25}
var {name} = myObject;
because libraries are just objects, we can use destructuring on libraries.
*/
//const MongoClient = require('mongodb').MongoClient;
const {MongoClient, ObjectID} = require('mongodb') // exactly the same as the code abo... | true |
4e3f9282afbfadcb3d1a5245531dba51541507b0 | JavaScript | Richard-Lynch/Snake | /Snake.js | UTF-8 | 2,414 | 3.15625 | 3 | [] | no_license | function Snake(){
this.x;
this.y;
this.xspeed;
this.yspeed;
this.total = 0;
this.tail = [];
this.alive = 0;
this.been_updated = 0;
this.update = function(){
//if(loops > speed/(s.total+1)){
if(loops > speed){
this.been_update = 0;
if(this.total === this.tail.length){
... | true |
f62ec2556b838d0b8d2d252b1efef90c04aa1f00 | JavaScript | jeromeetienne/dataflow-ui | /src/dataflowInput.js | UTF-8 | 1,275 | 2.578125 | 3 | [] | no_license | var Dataflow = Dataflow || {}
//////////////////////////////////////////////////////////////////////////////////
// Comment //
//////////////////////////////////////////////////////////////////////////////////
Dataflow.Input = function(node){
this.uuid = Dataflow.Utils.generateUUID()
this.node = node
this.l... | true |
ab7384b5bae27df8c25481500edef667e52d3ba6 | JavaScript | ZaenalMaestro/jurnalapp | /public/js/pengujian.js | UTF-8 | 6,640 | 2.953125 | 3 | [
"MIT"
] | permissive | // baseurl
let baseurl = 'http://localhost:8080';
/*
/*
* fungsi load semua data video dari database ketika halaman diload
*/
// window.onload = loadData();
/*
* ketika tombol pengujian diklik
*/
document.querySelector('.pengujian').addEventListener('click', function () {
const video = document.getElementById(... | true |
021fbd7e22ba365b3c79865b5defad507668f6ab | JavaScript | khairul-abdi/h8-p0-w3 | /review15.js | UTF-8 | 1,232 | 3.640625 | 4 | [] | no_license | function groupAnimals(animals) {
var animals = animals.sort()
// console.log(animals)
// for(var i = 0; i < animals.length; i++){
// for(var j = i+1; j < animals.length; j++){
// if(animals[i] > animals[j]){
// var temp = animals[i]
// animals[i] = anima... | true |
0e2a3dc2ef7c262719c40841a3b2fe280f8656f2 | JavaScript | SiarheiDrozd/Search-Youtube | /development/script/html/createPagingElement.js | UTF-8 | 383 | 2.53125 | 3 | [] | no_license | import {ComponentConstants} from "../constants";
export default function (index) {
const PAGE_BUTTON = document.createElement("button");
PAGE_BUTTON.classList.add(...ComponentConstants.PAGING_LIST_ELEMENT_CLASSES);
PAGE_BUTTON.setAttribute("id", ComponentConstants.PAGING_LIST_ELEMENT_BASE_ID + index);
... | true |
195984037b6119d3aa6637f6695ae117ef7613cd | JavaScript | learn-academy-2021-delta/week-3-assessment-ciannadogan | /code-challenges.test.js | UTF-8 | 4,121 | 4.46875 | 4 | [] | no_license | // ASSESSMENT 3: Coding practical questions with Jest
// Please read all questions thoroughly
// Pseudo coding is REQUIRED
// If you get stuck, please leave comments to help us understand your thought process
// Use test driven development to complete the following questions
// Add appropriate dependencies: $ yarn ad... | true |
4517154b92226944f754eaa6c360a04cad2dfa1d | JavaScript | nayeonk/ITP-404 | /9 - JSONP, Facebook Graph API, Client-side Templating/in-class-examples/jsonp-facebook.js | UTF-8 | 444 | 3.046875 | 3 | [] | no_license | var script = document.createElement('script');
script.src = "https://graph.facebook.com/cocacola?callback=myFunction";
document.getElementsByTagName('head')[0].appendChild(script);
function myFunction(data) {
console.log(data);
var templateString = document.getElementById('fb-page-template').innerHTML;
var template... | true |
42bb057ef4504b8729a5c4842d94a89f6c4b946f | JavaScript | azizssh/typeahead-twitter | /src/utils/tests/extractUserData.test.js | UTF-8 | 849 | 2.640625 | 3 | [] | no_license | import { extractUserData } from "../extractUserData";
import { LOGGED_IN_USER } from "../../constants/constants";
test("return null object if one of properties is missing", () => {
const twitterUser = {
name: null,
screen_name: null,
profile_image_url: null,
};
const expectedUser = {
name: null,
... | true |
6822564f6c17b372223826e14291c0305612a60b | JavaScript | Bhagyshree-More/trackify | /app/app.js | UTF-8 | 4,262 | 2.578125 | 3 | [] | no_license | var BASE_URL1 = "https://api-sandbox.pitneybowes.com/oauth/token";
var BASE_URL2 = "https://api-sandbox.pitneybowes.com/shippingservices/v1/tracking/70180360000213168419?packageIdentifierType=TrackingNumber&carrier=USPS";
var BASE_URL = "https://httpbin.org/";
function displayStatus(type, message) {
client.interfa... | true |
f8090e88452d41c460f27efd34ebf9758ed3108f | JavaScript | christopherpaulcunningham/git-a-job | /client/src/components/SearchBar/SearchBar.js | UTF-8 | 2,566 | 2.515625 | 3 | [] | no_license | import React, { useState } from 'react';
import imgLoupe from '../../assets/images/loupe.png';
import imgLoupeWhite from '../../assets/images/loupe-white.png';
import imgPin from '../../assets/images/location-pin.png';
import './SearchBar.css';
const SearchBar = (props) => {
const [formData, setFormData] = useState(... | true |
6e18aaf0421d40a695339243e6e9990c195e2ea1 | JavaScript | nikolaiotsu/techDegreeproject-2 | /js/script.js | UTF-8 | 1,778 | 3.609375 | 4 | [] | no_license | /******************************************
Treehouse Techdegree:
FSJS project 2 - List Filter and Pagination
******************************************/
// Variables that store DOM elements
let $students = $('.student-item');
let pageCount = 1;
let div = document.createElement('div');
let ul = document.createElement(... | true |
c7e6d482a61063cd6e5e2921f3dddcee022e1c5d | JavaScript | Bladtman242/Cryptoflow | /lib/src/innardsParsing/stringToAbstract.js | UTF-8 | 1,249 | 2.671875 | 3 | [
"ISC",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | module.exports = parseInnardsToAbstractSyntax;
const matchers = [
{
regex: /^([a-z0-9_]+)\s+\<\-\s+([a-z0-9_]+)\((?:([a-z0-9_]+),\s*)*([a-z0-9_]+)?\s*\)$/,
build: (match) => { return {
type: "assignment",
variableName: match[1],
blockId: match[2],
arg... | true |
57bbedfbb38a7f36a061035bf5802e5aa0bad753 | JavaScript | vijexakiraind/smarthome | /src/frontend/src/Components/UIs/Hsl.js | UTF-8 | 5,749 | 2.75 | 3 | [
"MIT"
] | permissive | import React from 'react'
import './Hsl.css'
import HslToRgba from '../../Utils/HslToRgb'
export default class Hsl extends React.Component {
constructor(props) {
super(props)
this.state = {
hue: 0,
saturation: 1,
lightness: 1,
hueStart:... | true |
48c5cfae1181a5e4a703919d641edaed5779a0af | JavaScript | Gabrieldev-web-coder/sunnyside-agency | /js/js.js | UTF-8 | 229 | 2.640625 | 3 | [] | no_license | const $headerMenu = document.querySelector('.icon-menu')
const $ul = document.querySelector('#header ul')
const activateMenu = () => {
$ul.classList.toggle('animation')
}
$headerMenu.addEventListener('click',activateMenu)
| true |
d7cfa5928e56848c1e7b288b3fe7671450085bb5 | JavaScript | lukeocodes/pentest-tool-lite | /src/html/js/minify/minify.js | UTF-8 | 614 | 2.578125 | 3 | [
"MIT"
] | permissive | import UglifyJS from 'uglify-js';
export default function(result) {
const error = [];
const r = UglifyJS.minify(result.body, { mangle: false, output: { comments: true } });
const r2 = UglifyJS.minify(result.body);
if (r.code.length !== result.body.length) {
error.push('minified');
}
if (r2.code.lengt... | true |
469b02b7ef2ac2e625d7687bbf4c5fab5c2d1b12 | JavaScript | Mlipphardt/Memory-Game | /src/App.js | UTF-8 | 3,811 | 3.265625 | 3 | [] | no_license | import React, { Component } from "react";
import "./App.css";
import CharacterCard from "./components/CharacterCard";
import Wrapper from "./components/Wrapper";
import Navbar from "./components/Navbar";
import Modal from "./components/Modal";
import Header from "./components/Header";
import characters from "./characte... | true |
558c0f907c1d50098264f78fbe0ff2947fd7eb54 | JavaScript | aldengolab/blockchain-for-data-consent | /lib/logic.js | UTF-8 | 7,502 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed u... | true |
471649b67e085f2f58686c3b15f90254fb5fec97 | JavaScript | chrisipacs/mozarellaFrontend | /src/reducers/studentsListReducer.test.js | UTF-8 | 2,763 | 2.578125 | 3 | [] | no_license | /**
* Created by krisztian on 2017. 03. 05..
*/
import expect from 'expect';
import studentsListReducer from './studentsListReducer';
import * as actions from '../actions/studentActions';
import * as listActions from '../actions/listActions';
import * as learnItemActions from '../actions/learnItemActions';
describe... | true |
6a238cea76c80ce67a4e4f3c0c647a3a6f8fc617 | JavaScript | victoria-huang/yourx-v1 | /src/components/prescriptions/TakeTimesForm.js | UTF-8 | 2,183 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react'
import { createTakeTime } from '../../fetches'
const DEFAULT_STATE = {
day: '',
rx_time: '',
errors: []
}
class TakeTimesForm extends Component {
state = {
...DEFAULT_STATE
}
handleSubmitClick = (event) => {
event.preventDefault();
event.stopPropagatio... | true |
64ab5eb9d0d172495d98b05419bd245deffc920f | JavaScript | azbeaver/sheetmaker | /src/SheetItems/Elements/TopInfo/top-info-elements.js | UTF-8 | 1,229 | 2.875 | 3 | [
"MIT"
] | permissive | import Label from "./Label";
import Text from "./Text";
const MAIN_INFO_OPTIONS = [
{
type: 'label',
text: 'Add Label'
},
{
type: 'text',
text: 'Add Text'
}
];
/**
* Renders a single Top Info element. No validation of whether an element *should* be rendered is
* done here.
*
* Props Requi... | true |
b1c1a7a11efc88468e4ba7f9ca451e702fb56b0e | JavaScript | SensorCentre/sensors | /js/sensors.js | UTF-8 | 6,654 | 3.53125 | 4 | [
"MIT"
] | permissive | /*
Sensors.
*/
var sensorBar;
var trialGraph;
// Create a new sensor node for use in the simulation
function createNode(radius, xStartPos, id) {
var newNode = Object.create(nodeObject);
newNode.radius = radius;
newNode.x = xStartPos;
newNode.y = 0;
newNode.id = id;
return newNode;
}
/**
* S... | true |
590a8236dc8b356d9dc8fa84a5c8649cb66422ef | JavaScript | RoxanaSfabu/Wantsome-JavaScript-Homeworks | /functions.js | UTF-8 | 2,888 | 3.71875 | 4 | [] | no_license | // 1. Scrieti o functie de tip named function care accepta ca argument un CNP si verifica sexul unei persoane. In urma apelului acestei functii, se va returna un text de forma "Persoana verificata este de sexul M/F".
function verificaSex(CNP) {
if(CNP.charAt(0) == 1) {
return "Persoana verificata este de sexul M";... | true |
b5da2467eafbad4819de8a9f5d631d6c6600c9e5 | JavaScript | davidfoliveira/node-secretagent | /test/test_cs.js | UTF-8 | 3,314 | 2.6875 | 3 | [] | no_license | #!/usr/bin/env node
var
net = require('net'),
stdin = process.openStdin(),
SecretAgent = require('../lib/secretagent'),
name = process.argv[2],
listenPort = parseInt(process.argv[3]),
connectTo = [],
secretagent;
if ( !name )
throw Error("No name");
if ( !listenPort )
throw Error("No listen port");
// Conne... | true |
b9137d20b0be5182bc6618cb653b01277ea91fc3 | JavaScript | Emmynash/nodeTodo | /playground/hash.js | UTF-8 | 1,156 | 2.8125 | 3 | [] | no_license | const { SHA256 } = require('crypto-js');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcryptjs');
var password = "password";
// bcrypt.genSalt(10, (err, salt) => {
// bcrypt.hash(password, salt, (err, hash) => {
// console.log(hash);
// })
// })
var hashPassword = "$2a$10$ik/ZSOGHiEr2k... | true |