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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
69153ff727586a450640eb37368bc83539309bfc | JavaScript | soberstadt/Chromoji | /options.js | UTF-8 | 677 | 3.125 | 3 | [] | no_license | function loadOptions() {
var ioscompat = document.getElementById("fieldioscompat");
var value = localStorage["ioscompat"];
ioscompat.checked = (value == "true");
}
function saveOptions() {
var ioscompat = document.getElementById("fieldioscompat");
var value = ioscompat.checked;
localStorage["ioscompat"] = value;... | true |
0074e93b98a48d6bc9de1f2bbf8e7366d852a27a | JavaScript | abarnhard/real-world-react-slides | /src/code/stateful-stateless-pure.js | UTF-8 | 496 | 3.140625 | 3 | [] | no_license | export default `import React from 'react'
// stateful - the component has its own state
class StatefulComponent extends React.Component {
state = { ... }
// ...
}
// stateless - no state, rerendered *every time*
const StatelessComponent = (props) => (
<div>I don't have state, but I have props {props.someProp}</... | true |
4cfe13b06d085e61ecd28ae02b9975f9e9023882 | JavaScript | zeuxisoo/node-chinese-chess | /Position.js | UTF-8 | 377 | 3.34375 | 3 | [] | no_license | function Position(x, y) {
this.x = x;
this.y = y;
}
Position.prototype.getX = function() {
return this.x;
}
Position.prototype.getY = function() {
return this.y;
}
Position.prototype.equals = function(obj) {
return this.x == obj.x && this.y == obj.y;
}
Position.prototype.toString = function() {
return "(" + t... | true |
86ecdeb98c5df3546cb1d4d1a827d499e54b5847 | JavaScript | taoteg/dexjs | /src/dex.maps.js | UTF-8 | 3,661 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | // Allow user to override, but define this by default:
/**
*
* The main dexjs module.
*
* @module dex
* @name dex
*
* @requires d3
* @requires jquery
* @requires jqueryui
* @requires underscore
*
*/
var dex = { charts : { d3 : { map : {}}}};
/**
*
* The version of dexjs.
*
* @name version
* @type {st... | true |
8f35d4457ef3810d168f1fa3202cd1922bc635e3 | JavaScript | phatnguyenuit/js-interview-preparation | /callback/callback-challenge.js | UTF-8 | 179 | 3.71875 | 4 | [
"MIT"
] | permissive | // Your goal is to use the following function to log 8 to the console
function foo(a, b) {
b(function () {
return a + a;
});
}
foo(4, (cb) => {
console.log(cb());
});
| true |
aa556ed0f60fa06771faee711314fa661a18296f | JavaScript | nnmerkel/Processing-Sketches | /Grad School Sketches/haufTest/converted_haufBG/sketch.js | UTF-8 | 2,997 | 2.921875 | 3 | [] | no_license | var n;
var lineDistance;
var numNodes;
var numPoints;
var nodeSize;
var param;
var positive;
var negative;
var accent;
var accent2;
function setup() {
var c = createCanvas(800, 450);
//canvas.parent('myClass');
noStroke();
lineDistance = 120;
numPoints = 150;
nodeSize = 200;
param = 1.5;
positive = col... | true |
bb84e214e5f897009389c8e5e9f36a9f2ced0c24 | JavaScript | courtm187/taxes | /main.js | UTF-8 | 365 | 2.734375 | 3 | [] | no_license |
module.exports = {
calcTax: function(income){
if (income < 10){
return income * 0.10;
}
else if (income >= 10 && income < 20){
return 1 + ((income - 10)*0.07);
}
else if (income >= 20 && income < 30){
return 1.7 + ((income - 20)*0.05);
}
else if (income >=30){
ret... | true |
704f1790047432b6860639478fc08671855d05cf | JavaScript | JoyRapture/morahaji | /WebContent/js/list.js | UTF-8 | 2,907 | 2.625 | 3 | [] | no_license | //수정 (11/30) 그냥 덮어쓰세요
function go(page,myall) {
var data="";
if (myall){
var data = "state=mine&page=" + page;
ajax(data);
}else {
var data = "state=all&page=" + page;
ajax(data);
}
}
function setPaging(href, digit) {
output += "<li class=page-item>";
gray = "";
if (href == "") {
gray = "gray";
}
a... | true |
2715ee3498e8e87b5daa78b6d09e761b34a81dd7 | JavaScript | vefforritun/vef2-2021 | /fyrirlestrar/07/daemi/06.events/src/App.js | UTF-8 | 1,487 | 2.96875 | 3 | [] | no_license | import React, { Component } from 'react';
function ActionLink() {
function handleClick(e) {
e.preventDefault();
console.log('The link was clicked.');
}
return (
<a href="#click" onClick={handleClick}>
Click me
</a>
);
}
class Bindings extends Component {
constructor(props) {
super... | true |
084bb4f0bc47a4ca274fe954c93a157be9072117 | JavaScript | benitos/scheme-js | /src/parser.js | UTF-8 | 2,778 | 3.390625 | 3 | [] | no_license |
/**
* SchemeParser für Strings
*/
module.exports = (function () {
/**
* SchemeParser für Strings
* @param {String} string Der zu parsende String
*/
function SchemeParser (string) {
var type = typeof string;
if (type !== 'string') {
throw 'SchemeParser expected a ... | true |
f6a663dfdc7c7938552a95277c00c7e209d60772 | JavaScript | Harty136/Webapp_for_SmartSpy | /public/javascripts/prop.js | UTF-8 | 927 | 2.53125 | 3 | [] | no_license | function getProperty(obj) {
txt=obj.innerHTML
info=txt.split(' : ')
type=info[0];
IP=info[1].split('-')[0]
$.getJSON( '/riv_property/'+type+'/'+IP, function( data ) {
txt='Revealer PROPERTY: <br>'
for (key in data) {
var va... | true |
04eaee5e081ca67a148f076b71ae21a91747826e | JavaScript | lynchd2/assignment_fideligard_spa | /controllers/tradeController.js | UTF-8 | 2,358 | 2.890625 | 3 | [] | no_license | app.controller("tradeCtrl", ["$scope", 'dateService', "stockService", "portfolioService", "tradeService", "$stateParams", function($scope, dateService, stockService, portfolioService, tradeService, $stateParams) {
//Acquire params
$scope.opening = $stateParams["opening"];
$scope.symbol = $stateParams["symbol"];
... | true |
a338ef29d4f0a09236c9ae22ed0b386a4ee4e5dd | JavaScript | justmoo/Graduation-Project | /models/student.js | UTF-8 | 458 | 2.734375 | 3 | [] | no_license | class Student {
// this is what's inside the blocks
constructor(ID, name, hash, year, university, major) {
// Student ID
this.ID = ID;
// name, Duh.
this.name = name;
// Hash of the certificate
this.hashOfCertificate = hash;
// year of graduation
this.year = year;
// from which u... | true |
5dbba3dafd0f18c9f12d3b6bee5f53224e8110c9 | JavaScript | ehsanmajd/simple-chat-app | /src/reducers/conversationReducer.js | UTF-8 | 1,223 | 2.515625 | 3 | [] | no_license | import { createdTime } from '../data/fetchData'
const initialState = {
conversations: [],
selectedConversation: {}
};
export default function reducer(state = initialState, { type, payload }) {
if (type === 'CONVERSATIONS_REQUESTED') {
return {
...state,
conversations: payloa... | true |
5b35168402f7222e6e98fd1b6709a1e3a4e3d20e | JavaScript | Richarmi/CAPSTONE | /gifs-json-api/controllers/gifController.js | UTF-8 | 2,050 | 2.859375 | 3 | [] | no_license | const express = require('express');
// Next we set up the Router
const router = express.Router();
// require Our Model - Remember Model is
// a representation of our data
// The model should capitalized
const Gif = require('../models/gif');
// Creating the index route
// index route should show all the fruits
router.g... | true |
9e5f728724f6d35afda51e8752ddb89c8529919b | JavaScript | donkup/11--syntax | /js/components/algebra/praktika.js | UTF-8 | 463 | 2.890625 | 3 | [] | no_license | /*
parasyti funkcija:
- duoto zodzio pirma raide
- duoto zodzio vidurine raide
- duoto zodzio paskutine raide
- ar duoto zodzio N-oji raide yra didzioji? true/false
- ar duoto zodzio N-oji raide yra mazoji? true/false
*/
const pirmaRaide = text => text [0];
export { pirmaRaide }
const paskutineRaide = text => text[... | true |
ec0a280e95c97b847d7c02a0df797089b85040e2 | JavaScript | TheOldMan66/TelerikAcademy | /JS Basics/09.Exam preparation/Variant 2/2.LabirynthEscape/Escape.js | UTF-8 | 1,515 | 3.296875 | 3 | [] | no_license | //testVar = ["3 4", "1 3", "lrrd", "dlll", "rddd"];
testVar = ["5 8", "0 0", "rrrrrrrd", "rludulrd", "durlddud", "urrrldud", "ulllllll"]
function Solve(input) {
var rows = Number(input[0].split(' ')[0]);
var cols = Number(input[0].split(' ')[1]);
var startPos = [Number(input[1].split(' ')[0]), Number... | true |
3bbff394bc091efaeb4e1262fd792b06b9d506be | JavaScript | AsaadsHub/crisislogger | /public/js/pages/capture-audio.js | UTF-8 | 4,779 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | //webkitURL is deprecated but nevertheless
URL = window.URL || window.webkitURL;
let gumStream;
//stream from getUserMedia()
let rec;
//Recorder.js object
let input;
//MediaStreamAudioSourceNode we'll be recording
// shim for AudioContext when it's not avb.
let AudioContext = window.AudioContext || window.webkitAudioCo... | true |
9b748145ba1afda30180e8074b5b4ad2bcfca59b | JavaScript | Accumulate007/Data-structures-Algorithms-Design-Pattern | /算法/JavaScript数据结构与算法高级进阶课程/src/进阶算法/dynamic.js | UTF-8 | 2,200 | 3.46875 | 3 | [] | no_license | /**
* 动态规划
* 1.不同路径问题
* 2.最短路径问题
*
* 动态规划三个重要概念:
* 状态转移方程
* 最优子结构
* 边界
*
*/
/**
* 不同路径Ⅱ(Leet Code 63)
*一个机器人位于一个m x n网格的左上角(起始点标记为start)
* 机器人每次只能向下或者向右移动一步,机器人视图抵达网格的最右下角(标记为Finish)
* 现在考虑网格中有障碍物,那么从左上角移动到右下角有多少条不同的路径
* m,n的值都不超过100
*
*/
const uniquePathsWithObstacles = (arr/*二维数组*/, m, n) => {... | true |
87ec66d19c3661e6d0f4cfcd4effea0958e9a39b | JavaScript | redbearin/algorithm-challenges | /number-of-even-or-odd-digits/answer.js | UTF-8 | 866 | 3.921875 | 4 | [
"MIT"
] | permissive | const countDigits = (nums, type) => {
// build array of string nums
const strNums = [];
for (let i = 0; i < nums.length; i++) {
strNums.push(nums[i].toString());
}
const final = [];
// go through string number by string number
for (let i = 0; i < strNums.length; i++) {
// initialize count for stri... | true |
067e64a5402e9efe9dbedce93e06512e43023b57 | JavaScript | dvovna/encryption_lab1 | /decriptor.js | UTF-8 | 1,233 | 3.34375 | 3 | [] | no_license | var criptCreator = require('./cript-creator.js');
exports.decript = decrypt;
// decrypt("я", 2, 'юяа бвг');
function decrypt (word, number, text) {
var decryptedText = "",
alphabet = [],
wordCodes = [],
cript;
alphabet = getAlphabetCodes('а', 'я');
cript = criptCreator.getCript(alphabet, word, number);
d... | true |
8fb3dd50e8fa6dae65e58d5977126db283948536 | JavaScript | hackeru2/apster-goku-pwa | /src/Character/Goku/algos/calculationWithFunctions.js | UTF-8 | 1,891 | 4.28125 | 4 | [] | no_license | // This time we want to write calculations using functions and get the results. Let's have a look at some examples:
// seven(times(five())); // must return 35
// four(plus(nine())); // must return 13
// eight(minus(three())); // must return 5
// six(dividedBy(two())); // must return 3
// Requirements:
// There must b... | true |
a6f47eecc7e1275b03a193320cb288f25f53543c | JavaScript | deepMOORE/Quiz | /src/scripts/answer-generator.js | UTF-8 | 2,244 | 2.875 | 3 | [] | no_license | import {QuestionTypes} from './Enums/question-types';
export class AnswerGenerator {
generate(question) {
switch (question.type) {
case QuestionTypes.RADIO :
return this._generateRadio(question);
case QuestionTypes.CHECK :
return this._generateCheck(... | true |
06478d58eb0f392d9a111310d349e38db7b7742d | JavaScript | LynetteNB/codeup-web-exercises | /js/break_and_continue.js | UTF-8 | 2,185 | 4.5 | 4 | [] | no_license | function skipNumber() {
var number;
while (number = prompt("Please enter an odd number from 1-50")) {
//If user presses cancel
if (number == null) {
break;
} //When user inputs valid odd number, nested loop displays odd number list and skips user inputted number
else ... | true |
912d89066663b408c4aa210bcd201dc1f3e99579 | JavaScript | olslash/spacegame | /player.js | UTF-8 | 905 | 3.234375 | 3 | [] | no_license | var Player = function() {
this.res = 300; // player starts with 300 res
this.resCount = game.add.text(200, 50, 'RESOURCES:');
// Center align
this.resCount.anchor.set(0.5, 0.5);
// this.resCount.align = 'left';
// Font style
this.resCount.font = 'Arial';
this.resCount.fontSize = 24;
this.resCount... | true |
a5122c5a9a0d8c247010cf1b0cf153b38b559a67 | JavaScript | l4zy0n3/ts-misc | /uno.js | UTF-8 | 734 | 3.09375 | 3 | [] | no_license | let test = {
dog: "🐕 ",
cat: "🐈 ",
cow: "🐄 ",
};
console.log(test);
console.log(Object.keys(test));
console.log(Object.values(test));
console.log(Object.entries(test));
Object.assign(test, {
dog: "🐕 ",
cat: "🐈 ",
cow: "🐄 ",
turtle: "🐢 ",
});
console.log(test);
console.log(Object.keys(test));
cons... | true |
a28721ee9cbc54f71d83ead75836798ee1697576 | JavaScript | thatsme111/acoustic-blog-search | /blogs-crawler/crawler.js | UTF-8 | 2,510 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | const axios = require("axios");
const puppeteer = require('puppeteer');
const xml2js = require("xml2js");
const fs = require("fs");
const getAllBlogsUrls = async () => {
const sitemap = "https://acoustic.com/sitemap.xml";
const response = await axios.get(sitemap);
const parsedSiteMap = await xml2js.parseSt... | true |
7379f1465d19517165f9a4ccaee555d1c19a5998 | JavaScript | coderJeff8170/MyFirstApp | /main.js | UTF-8 | 1,220 | 3.4375 | 3 | [] | no_license | //this is going to load the jquery ready function so that we wait for the page to load before the js
$(document).ready(function () {
console.log('you are reading this from the console');
//document.getElementByName(h1).style.color = "red";
$("h1").css("color", "red");
//changes h1 elements to red (jquer... | true |
e90df737550722042d1dcabd6f030fa977e03b02 | JavaScript | phileasFoggy22/LifeloggingActivityLogger | /bin/html/scripts/LifelogMain.js | UTF-8 | 2,063 | 2.671875 | 3 | [] | no_license | const URLstring = "http://localhost:8080/LifeloggingActivityLogV3/api/";
function setUpPage() {
var images = ['T0010081.jpg', 'T0010086.JPG', 'T0020021.JPG', 'T0020046.jpg', 'T0020101.jpg', 'T0020114.jpg', 'T0040145.jpg', 'T0040160.jpg', 'T0040166.jpg', 'T0040174.jpg', 'T0040189.jpg', 'T0040215.jpg', 'T0040226.jp... | true |
5fe6d9a24825e4d4c75802656c0079fb5363a3d3 | JavaScript | lukewill18/gradebook | /tests/tests.js | UTF-8 | 11,677 | 2.78125 | 3 | [] | no_license | import { Selector } from 'testcafe';
fixture `Testing page`
.page `file:///C:/Users/Luke/bootcamp/grade-table/index.html`;
let validInput = [
{
"grade": "8.21",
"name": {
"first": "Stanton",
"last": "Carpenter"
}
},
{
"grade": "43.41",
"name": {
"f... | true |
3d4a3c5e0902a61a8c6265d3e1ce81ef306b2f11 | JavaScript | DanielPickens/piglatin | /piglatin.js | UTF-8 | 1,967 | 3.78125 | 4 | [] | no_license | let finishedWord = "";
let string = "";
let a = "";
let e = "";
let i = "";
let o = "";
let u = "";
let vowelPositionArray = [];
function minimumPosition(vowelPositionArray){
return vowelPositionArray >= 0;
}
function vowelPosition(){
a = string.indexOf("a");
vowelPositionArray.push(a);
e = string.indexOf("e... | true |
26b953fd908c69836a70d5564455fb431bf9907a | JavaScript | cxqdmm/react-start | /sourceMapTool/gitCommand.js | UTF-8 | 1,566 | 2.515625 | 3 | [] | no_license | const { exec } = require('child_process');
const chalk = require('chalk');
const Spinner = require('cli-spinner').Spinner;
function createSpinner(title = "") {
const spinner = new Spinner(title)
spinner.setSpinnerString(0);
return spinner;
}
class GitCommand {
constructor(args = {}) {
this._opti... | true |
f82428b420241aa63608969c0fd9b09509e91b3e | JavaScript | sharondavis2906/kahoot | /Kahoot/static/script.js | UTF-8 | 3,471 | 2.90625 | 3 | [] | no_license | $(document).ready(function() {
// Index page
var socket = io.connect('http://127.0.0.1:5000');
// Message to Flask when button is pressed
// Game 1 button pressed
$('#game1').on('click', function() {
/*
var message = $('#message').val();
*/
socket.emit('game sel... | true |
f8c7f280210437ba380eb4dcf3539317751a1ecb | JavaScript | iqzq123/webgame | /js/DisplayObject.js | UTF-8 | 2,126 | 2.859375 | 3 | [] | no_license | var Display = function() {
var Class = {
initialize: function(props) {
this.id= '';
this.name = '';
this.x = 0;
this.y = 0;
this.width = 0;
this.height = 0;
this.scaleX = 1;
this.scaleY = 1;
this.rotation = 0;
this.alpha = 1;
this.regX = 0;
this.regY = 0;
this.context = null;
... | true |
bcb0f8e472fd9e642caea36a993b6bc76bd9e365 | JavaScript | sumer9999/DataStructuresAndAlogsUsingJS | /coderByte/minOf.js | UTF-8 | 101 | 3.140625 | 3 | [] | no_license | const minOf = (...arr) => arr.reduce((min, val) => Math.min(min, val));
console.log(minOf(1, 2, 3)); | true |
960a330ecec58f1f418b89eca7ba71ec26f718bf | JavaScript | yaherin/Octo4 | /js/mancalajsite.js | UTF-8 | 14,898 | 3.203125 | 3 | [] | no_license | // JavaScript source code
var numofseeds;
var pitsnum; var seednum; //משתנים שלתוכם מקליד המשתמש את מספר הגומות והגולות הרצויות
var temppits; // משתנה עזר שנועד להכיל את מספר הגומות הרצויות, וככה לא משתבש אף פעם המספר המקורי
var turn = true; // לדעת איזה תור במשחק
var names = true; var start = true; // נועדו כדי ... | true |
dfd656263dc1bef77b0fc5f7b6b807cb13ee9cd2 | JavaScript | codepope/supportble | /hackacommand.js | UTF-8 | 2,947 | 2.5625 | 3 | [] | no_license | var noble = require('noble');
var stringify = require('json-stringify')
var repl = require('repl')
var bands={}
noble.on('stateChange', (state) => {
if (state === 'poweredOn') {
console.log("Starting scan")
noble.startScanning(["FFF0"]);
} else {
console.log("Stopping Scan")
noble.stopScanning();
... | true |
0f1b26804dc417f05116784a0ece4dded935e96c | JavaScript | LouAlicegary/BugChess | /js/_MVC/MODEL.js | UTF-8 | 42,355 | 2.953125 | 3 | [] | no_license | /**
* Determines all empty hex locations on outside edge of hive. Used to compute possible spider paths.
* @param {Array} in_hive
* 2-Dimensional array (array[x][0] = x_val; array[x][1] = y_val) containing pieces making up hive.
* @return {Array}
* Contains all of the hex locations that are al... | true |
61b4ac0dab57094aed70c089e226140664fe29d0 | JavaScript | CraigClarkAlgonquin/week-04 | /dom-introduction/js/dom-intro.js | UTF-8 | 2,419 | 4.03125 | 4 | [] | no_license | //getElementById
//use this to target items in the DOM (document object model)
//var k;
//for(k in document) {
// console.log (k + " :: " + document[k] + "\n\n"); //loops through all the objects in the dom
//}
/*
console.log("\n\n getElementById \n");
//Get ElementbyId
var tag_line = document.getElementById("tag-... | true |
c32c4129185508c0281195eb6f29fc8b025893fb | JavaScript | GavrilovicAleksa/sajt1php2 | /assets/js/singleProduct.js | UTF-8 | 733 | 2.578125 | 3 | [] | no_license | window.onload = function(){
var korpa = document.getElementById("Korpa");
korpa.addEventListener("click",function(){
console.log("Aleksa");
var idProizvod = this.dataset.id;
var idKorisnik = this.dataset.korisnik;
$.ajax({
data:{
idProizvod : idProizvo... | true |
34a283b6a8042ff221e17122c27b40ee39550754 | JavaScript | kellydhunter1/team-profile-generator | /index.js | UTF-8 | 3,727 | 3.1875 | 3 | [] | no_license | const inquirer = require('inquirer');
const Employee = require('./lib/Employee');
// create an array of questions to collect employee information
questionnaire = () => {
let teamInfo = [];
return inquirer.prompt([
{
type: 'input',
name: 'manager',
message: 'Enter full name of th... | true |
35dea8ff261fab97c4e2f2acfb36655348cdaf6d | JavaScript | hongtong/leetcode | /02/index.js | UTF-8 | 573 | 3.03125 | 3 | [] | no_license | var addTwoNumbers = function(l1, l2) {
var add = 0;
var headnode = null;
var ans = null;
while (l1 || l2) {
v1 = l1?l1.val:0;
v2 = l2?l2.val:0;
var sub = v1+v2+add;
add = (v1+v2+add)>9 ? 1:0;
curnode = new ListNode(sub % 10);
!ans && (ans =... | true |
594ce965ea7c3627c8503a213e6a94382246b3f0 | JavaScript | aashu16/yoga-pm | /src/Components/Projects/LexoRank.js | UTF-8 | 1,120 | 3.75 | 4 | [] | no_license | const MIN_CHAR = "A".charCodeAt(0);
const MAX_CHAR = "z".charCodeAt(0);
export const insert = (prev, next) => {
if (prev === "") {
prev = string(MIN_CHAR);
}
if (next === "") {
next = string(MAX_CHAR);
}
let rank = "";
let i = 0;
while (true) {
let prevChar = getChar(prev, i, MIN_CHAR);
... | true |
863dcff91ffe061be7847126e495d4d62a5e49f6 | JavaScript | aqrln/sandboxing-example | /sandboxedModule/en/thirdApp.js | UTF-8 | 623 | 3.125 | 3 | [] | no_license | var fs = require('fs');
// Print module listing
console.log('Module source:');
fs.readFile(__filename, function(err, data) {
if (err) {
console.error(err);
return;
}
console.log(data.toString());
});
// Console constructor wrapper demonstration (part 2):
// create a Console instance backed by an externa... | true |
dabc68a9b5b406e3c32ec31fae74c35327a69aea | JavaScript | iacobcatalin/module4 | /main.js | UTF-8 | 1,781 | 2.828125 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", start);
var menuItem;
var difX;
var difY;
var body;
var timeout;
var requestAnimationFrame = window.requestAnimationFrame;
var mouseX;
var mouseY;
var animationFrame;
function start() {
menuItem = document.getElementsByClassName("menuItem")[0];
... | true |
b8441b2c5dd77a4697bac2d332c0239a3fde9e0a | JavaScript | Rod97/ers | /ERSApp/src/main/webapp/employee-home.js | UTF-8 | 3,742 | 2.953125 | 3 | [] | no_license | $(function () {
document.getElementById("pendingTab").addEventListener("click", showPending);
document.getElementById("acceptedTab").addEventListener("click", showAccepted);
document.getElementById("rejectedTab").addEventListener("click", showRejected);
function showPending() {
document.getElem... | true |
eb0cfa612d2d87bd8c99176571eace137056b6ba | JavaScript | Gudolle/Project3D | /Game.js | UTF-8 | 1,026 | 2.5625 | 3 | [] | no_license |
//var scene;
var renderer;
function Game() {
renderer = new THREE.WebGLRenderer();
document.body.appendChild(renderer.domElement);
renderer.setSize(window.innerWidth, window.innerHeight);
document.getElementById("Barre").style.display = "none";
MyGame.ChangeScene(IdentifiantScene.SOLAIRE);
... | true |
d60653883d45e6a55e83d697704f886835189472 | JavaScript | jeremy-jung/Tufts-Schedule-React | /frontend/src/components/views/ButtonFBLogin.js | UTF-8 | 2,823 | 2.78125 | 3 | [] | no_license | /* Written by Jeremy (9/1/2021)
Facebook Login button
*/
import React from 'react';
import style from './styles/ButtonFBLogin.module.css';
class ButtonFBLogin extends React.Component {
constructor (props) {
/* use callbacks from parent to get states from this child */
super(props);
th... | true |
8b013f1ea9ae34b59a5b4df5b5543644a7955050 | JavaScript | miloalfonzo/PracticeStyledComponents | /src/index.js | UTF-8 | 1,470 | 2.703125 | 3 | [] | no_license | import React, { useState } from "react";
import ReactDOM from "react-dom";
import axios from "axios";
import styled from "styled-components";
import Ritmosustanciometro from "./Ritmosustanciometro";
import "./styles.css";
const Contenedor = styled.div`
width: 100%;
max-width: 640px;
`;
function App() {
const ... | true |
d64ddcc2fbf1c16bf8281ab60b527e0bbc549cd1 | JavaScript | JHNC99/javascriptProject | /booklist/app.js | UTF-8 | 3,401 | 3.46875 | 3 | [] | no_license | //Book connstructor
function Book(tittle,author,isbn){
this.tittle=tittle;
this.author=author;
this.isb=isbn;
}
//UI constructor
function UI(){
UI.prototype.addBookToList=function(book){
const List=document.querySelector('#book-list');
//create tr
const row=documen... | true |
edd3c617cd0311dff0bf52b809184836f3b53866 | JavaScript | windspeech/mgr-web-demo | /src/utils/tool.js | UTF-8 | 9,001 | 3.34375 | 3 | [] | no_license | 'use strict'
var toString = Object.prototype.toString
/**
* 判断是否是数组
*
* @param {Object}
* @returns {boolean} 返回bool值
*/
export const isArray = (val) => {
return toString.call(val) === '[object Array]'
}
/**
* 判断值是否为FormData
*
* @param {Object}
* @returns {boolean}
*/
export const isFormData = (val) => {
... | true |
d0f8127e31b7cfb35c6a538b0e3adf5bdd183ae0 | JavaScript | DriftMind/js-tracker | /test/lib/EsprimaParser-unit/structures/Closure-test.js | UTF-8 | 1,778 | 3.125 | 3 | [
"MIT"
] | permissive | describe('Closure tests', () => {
let Closure
before(() => {
Closure = require(`${libDir}/structures/Closure`)
})
describe('constructor tests', () => {
it('should set data to given data', () => {
const data = {data: 'data'}
const closure = new Closure(data)
expect(closure.data).to.b... | true |
f556fa51f273eae0a512acb833446ad73208eaf5 | JavaScript | Iryna-Y-S/Timer | /TimerFullMode.js | UTF-8 | 486 | 2.8125 | 3 | [] | no_license | var TimerFullMode = (function () {
function Constructor () {
this.getTime = function () {
var today = new Date(),
hours = this.normalize(today.getHours()),
minutes = this.normalize(today.getMinutes()),
seconds = this.normalize(today.getSeconds());
... | true |
bcaaba73f61bcc922c759a1c705471b336f0d72b | JavaScript | CCBaxter84/portfolio2 | /src/components/ToggleButtons.js | UTF-8 | 911 | 2.59375 | 3 | [] | no_license | import React from 'react';
import { useState } from 'react';
import { Link } from 'react-router-dom';
import './ToggleButtons.css';
function ToggleButtons() {
const [shortSelected, setShort] = useState(true);
const [longSelected, setLong] = useState(false);
const handleClick = event => {
const { value } = ev... | true |
9c64d126ddee3f5b46ba4b7eebe4515209e8f936 | JavaScript | azltdanh/stock-exchange | /js/main.js | UTF-8 | 10,864 | 2.671875 | 3 | [] | no_license | function debug() {
console.debug('Stock-Exchange', arguments);
}
var app = angular.module('myApp', ['nvd3']);
app.constant('DATE_RANGES', {
"ALL": "all",
"FIVE_YEARS": "5-years",
"ONE_YEAR": "1-year",
"SIX_MONTHS": "6-months",
"THREE_MONTHS": "3-months",
"ONE_MONTH": "1-month",
"ONE_WE... | true |
c8950c0c6d794ce61a9842e2cc6ba7f585c3ef85 | JavaScript | sinha-arpita/javascript | /sorting/findNum.js | UTF-8 | 1,300 | 3.765625 | 4 | [] | no_license | /* Write a function that takes array of input and a query integer as input parameters, and returns
the index of query integer if it is found in the array, else returns -1.
*/
function checkInt(userArray,num){
for(var i=0;i<userArray.length;i++){
if(userArray[i] === num){
return i;
}
... | true |
8ce5df401940edb62556359d8dcd570f6627b846 | JavaScript | noreiller/react-calendar-pane | /demo/Example.js | UTF-8 | 1,830 | 2.765625 | 3 | [
"MIT"
] | permissive | import createClass from 'create-react-class';
import React from 'react';
import ReactDOM from 'react-dom';
import Calendar from '../lib/Calendar.js';
import moment from 'moment';
import momentFr from 'moment/locale/fr';
function customDayRenderer (props) {
return (
<a className="Day-inner" href={'#' + props.da... | true |
ab84e4e43ef15e3c1e1869ad7b09fc91c7cade06 | JavaScript | GGotha/exercicios-javascript | /ex02/js/start.js | UTF-8 | 1,335 | 3.0625 | 3 | [] | no_license | let inputN = document.querySelector("#inputNome");
let inputV = document.querySelector("#inputValorDoPedido");
let btn = document.querySelector("#botao");
let spanNome = document.querySelector("#spanNome");
let spanEstado = document.querySelector("#spanEstado");
let spanValor = document.querySelector("#spanValor");
let... | true |
d1bb4841ded7b1b3a30be3062ebd97f9d65b39c6 | JavaScript | erratir/pixel-hunter_ES6 | /js/screens/header-view.js | UTF-8 | 2,061 | 2.9375 | 3 | [] | no_license | /** View хеадера. На экранах игр c таймером и жизнями. На статических экранах только кнопка goWelcomeScreen*/
import AbstractView from "../abstract-view";
export default class HeaderView extends AbstractView {
constructor(state) {
super();
if (state) {
this._isGameHeader = true;
this._time = stat... | true |
4647aae4cdd5d590b5c9a21cd5733e7380d5cad4 | JavaScript | ashiyaman/React-Projects | /3.github-battle/app/components/Nav.js | UTF-8 | 1,060 | 2.671875 | 3 | [] | no_license | var React = require('react');
// Link and Navlink are both required to render an actual anchor tag
// var Link = require('react-router-dom').Link;
// Navlink is coz sometimes we may need to change the style based on if the link is active
// eg. highlighting the current tag
// also navlink comprises of link with some ex... | true |
ed8115d684c1d0a00c770cf0d1990c029570553c | JavaScript | DiluniMalsha/In-Memory-POS-System | /js/orderForm.js | UTF-8 | 5,246 | 2.953125 | 3 | [] | no_license |
function item(code, name, qty, price) {
this.code=code;
this.name=name;
this.qty=qty;
this.price=price;
}
function customer(id, fname, lname) {
this.id=id;
this.fname=fname;
this.lname=lname;
}
var items=[
new item("I001","Anchor",350.00,12),
new item("I002","Lux",50.00,60),
new... | true |
e17f6cae4fcd06aba6f6938c2e7dc5e95793415c | JavaScript | skywlrl/BlogSyncer | /controllers/blogConvert.js | UTF-8 | 7,796 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /**
*
* Created by aleckim on 2015. 5. 8..
* @description convert format between blogSync and providers
*/
"use strict";
var botFormat = require('../models/botFormat');
/**
*
* @type {{wrapMediaTag: Function, convertPostLinkToText: Function, convertPostMediaToText: Function, makeTitle: Function}}
*/
var blogCo... | true |
c99bd3211654ab70726b04c4f56c4ae3a8308682 | JavaScript | kakadodo/theF2EChallange | /source/js/index.js | UTF-8 | 1,107 | 2.75 | 3 | [] | no_license | $(function(){
$.get('./json/item-list.json', function(data){
$('.js_loading').hide();
let temp = '';
data.forEach(d => {
temp += `
<div class="card">
<div class="card-img">
<img src="${d.imgSrc}" alt="${d.title}" class="card-img-top">
</div>
<div cla... | true |
364dbdba227616fc8a17e21306112babeb5ef06b | JavaScript | Kouroshb26/ChatNodeJS | /index.js | UTF-8 | 2,740 | 2.953125 | 3 | [] | no_license | var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
let clients = []
let nameCounter = 0;
let names = ["John","Joe","Hellen","Smith","Dylan","Sukh","Mandy","Michael","Travis","Jeremy","Kris","Mathew"];
let messages = []
function Client(name,color,id){
this.na... | true |
02821460df1db19f92a433deec0cb3b8c4ea9640 | JavaScript | rasmuserik/yolan | /dep/diff.js | UTF-8 | 2,914 | 3.109375 | 3 | [] | no_license | var diff = exports;
diff["edit"] = function(arr0, arr1) {
var start = 0;
var result = [];
while (arr0[start] === arr1[start] && start < arr0["length"]) {
result.push("skip");
start = start + 1;
}
var i = arr0["length"] - 1;
var j = arr1["length"] - 1;
var end = 0;
while ... | true |
36f7a7495edf9209b069b5c8fa802a8773b7c759 | JavaScript | apkko/arial | /engine/engine.js | UTF-8 | 4,636 | 2.640625 | 3 | [] | no_license | class GameEngine{
constructor(PORT){
///Подключение файла мэнэджеров
var manager = require('./manager.js');
///Математическая библиотека
this.MATH = require('./math.js');
//Глобальная переменная движка
global.G_ENGINE = this;
//Настройки
this.SETTING... | true |
f94e79bac0a14df6712f640ad0e901ca96b5f90a | JavaScript | pawanrana1992/puzzle-test | /src/App/components/Board/Board.js | UTF-8 | 4,538 | 2.765625 | 3 | [] | no_license | import React from "react";
import Tile from "../Tile/Tile";
import PropTypes from 'prop-types';
import './_board.scss'
class Board extends React.Component {
constructor(props) {
super(props);
this.state = {
zero: 0,
possibleTopIdx: 0,
possiblRightIdx: 0,
... | true |
a314b2d38e103fb6723b5282d7f18f3858a4b3f4 | JavaScript | koksaver/HK_HeQiaoJSC | /河桥智慧乡镇管理平台/HaikanSmartTownCockpit.BigData/lib/jquery/jquery.extend.js | UTF-8 | 12,993 | 2.671875 | 3 | [
"MIT"
] | permissive | /*!
* jQuery插件扩展
*
*/
(function (window, jQuery, undefined) {
"use strict";
var $ = jQuery;
$.extend({
/**
* 无参数方法异常处理
* @param {any} callBank 执行函数
* @param {any} exCallBack 异常处理
*/
exception: function (callBank, exCallBack) {
if (!callB... | true |
81a5250d3c976949c95d2a5955cc5ba569c8f9a5 | JavaScript | JRJurman/blind_discs | /elements/winner/winner.js | UTF-8 | 1,705 | 3.078125 | 3 | [
"MIT"
] | permissive | const Tram = require('tram-one')
const html = Tram.html({})
const { PLAYER_1, PLAYER_2 } = require("../../constants/gameConstants");
const noMorePieces = (player, grid) => !grid.some((row) => row.some((square) => square === player));
const checkRowForPiece = (grid, row, player) => grid[row].some((square) => square ===... | true |
f04b2aa39e891e329be88f565d1c0b7e83870d45 | JavaScript | Cookie923/lightning | /routes/login.js | UTF-8 | 2,894 | 2.515625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
//引入model
var mongoose = require('mongoose');
mongoose.Promise = global.Promise;
var User = require('../models/User.js');
//引入md5加密
var md5 = require('../config/MD5.js');
//统一返回格式
var responseData;
router.use(function (req, res, next) {
responseData... | true |
60ee99a133888c503085c1312c5b37bd5b2e67f9 | JavaScript | yeong0809/react-native-autoreheight-webview | /Example2.js | UTF-8 | 5,559 | 2.9375 | 3 | [] | no_license | /**
* Created by PeterKong on 2018/1/3.
*/
'use strict';
import React, {Component} from 'react';
import AutoResizeHeightWebView from './AutoResizeHeightWebView';
import {
ScrollView,
StyleSheet, Text, TouchableOpacity,
View,
} from 'react-native';
let Dimensions = require('Dimensions');
let {width, hei... | true |
540d3a287422dc0b1f6c01800dc0f44c97822c2c | JavaScript | JosephKTsai/tmobile-hackathon | /server/db/controllers/rest.js | UTF-8 | 6,819 | 2.5625 | 3 | [] | no_license | import { Router } from 'express'
import { Log } from '../../integrations'
import _ from 'lodash'
import config from 'config'
const env = config.get('env')
/*
CORE RESTful CONTROLLER:
Every model adheres to this interface as a baseline.
After extending, each controller may have certain overrides
(saving subdo... | true |
199ed79d0b397485e561a55cb4b22def75d2fd75 | JavaScript | wps132230/aws-sdk-examples-helper | /server/searchKeyWord.js | UTF-8 | 13,886 | 2.875 | 3 | [
"MIT"
] | permissive | if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
});
};
}
... | true |
b106e79005d010b585f17f2e22abe7129f5fb9d8 | JavaScript | pcapr-local/pcapr-local | /lib/pcapr_local/www/static/script/closet/closet.quantity.js | UTF-8 | 2,317 | 3 | 3 | [
"MIT"
] | permissive | var closet = closet || {};
closet.quantity = (function() {
return {
bytes: function(size) {
if (size > 1024*1024) {
var mb = Math.round(size/1024/1024);
return mb + ' MB';
} else if (size > 1024) {
var kb = Math.round(size/1024);
return kb + ' KB';
... | true |
eabc51f7ecdbed1724edfae71c780649a3136524 | JavaScript | pepdbm7/skylab-bootcamp-201809 | /stuff/es6/async-await.js | UTF-8 | 1,928 | 3.796875 | 4 | [] | no_license | // demo 1
// function addOneAsync(num) {
// return Promise.resolve()
// .then(() => ++num)
// }
// function calc() {
// addOneAsync(0)
// .then(res => addOneAsync(res))
// .then(res => addOneAsync(res))
// .then(res => addOneAsync(res))
// .then(res => addOneAsync(res))... | true |
3c177e94e67dad4dc019d9a7ca55fa3f31fe4b31 | JavaScript | Eqbal78/ProgrammingConstructs_JavaScript | /Sequence Practice/RandomNumber.js | UTF-8 | 148 | 3.828125 | 4 | [] | no_license | // 1. To get single digit using random function
let number = Math.floor(Math.random() * 10);
console.log("Single digit random number : " + number); | true |
a8cd653fabbffb9e149609f01e3db5b563d6216b | JavaScript | agentleman/webProject | /JS_API/promise/promise.js | UTF-8 | 4,606 | 3.625 | 4 | [] | no_license | "use script";
// var P = new Promise(function(resolve,reject){
// //在这里执行一些异步操作
// setTimeout(function(){
// console.log('执行完成');
// //调用resolve方法
// resolve('随便说都可以')
// },2000);
// })
//封装Promise
function runAsync() {
var P = new Promise(function(resolve, reject) {
//在这里执行一些异步操作
setTimeout(functi... | true |
5ded4dc025bfe0aac275b8d2d5542eab757d3b53 | JavaScript | Soulk1ss/RosaAnalysis | /src/logic/app.js | UTF-8 | 11,843 | 2.875 | 3 | [] | no_license | function category_a(horizontal, vertical) {
console.log(`horizontal ${horizontal} vertical ${vertical}`)
switch (horizontal) {
case 2:
if ([2, 3].includes(vertical)) return 2
else if (vertical == 4) return 3
else if (vertical == 5) return 4
else if (vertic... | true |
b2bc22e20d67e7c5bd29a864ef8a75ce2f0e0809 | JavaScript | Petryxan/skill-counter | /src/Componens/testHooks.js | UTF-8 | 1,637 | 2.609375 | 3 | [] | no_license | import React from "react";
import { useState } from "react";
import { useSelector, useDispatch } from "react-redux";
import { addItem, addName } from "../redux/actions/testHooksAction";
const TestHooks = () => {
const [datas, setData] = useState(false);
// const [visible, setVisible] = useState(false);
const [va... | true |
4e41dd2fc42f7a552ab1f00fd397de3e43710b9c | JavaScript | PolentacomFarofa/dbo-2019-ava00 | /ava00/squareroot.js | UTF-8 | 947 | 3.703125 | 4 | [] | no_license | console.log('square')
// squareroot.js // 0.4 pts
// 0.1 pts // easy
let n1 = 9;
let sqrt;
function sqrt1 (n){
let t = Math.sqrt(n);
console
return t;
}
sqrt = sqrt1(n1);
// your algorithm here
console.log(sqrt); // 3
console.assert(sqrt === 3);
// 0.1 pts // medium
let n2 = 12;
function... | true |
19df8cd8fcfec17d1595a4bbbcf7715402f3cdd8 | JavaScript | Smulligan85/LearnYouNode | /firstIO.js | UTF-8 | 175 | 2.6875 | 3 | [] | no_license | var fs = require('fs');
var fileName = process.argv[2];
var buffStr = fs.readFileSync(fileName).toString();
var lines = buffStr.split('\n').length - 1;
console.log(lines);
| true |
4ac39d08909e6cbfb3e434963c066b471a04cc2b | JavaScript | Zinggi/NoKey | /web/js/copyToClipboard.js | UTF-8 | 946 | 2.90625 | 3 | [
"MIT"
] | permissive | const copyToClipboard = (text) => {
if (window.clipboardData && window.clipboardData.setData) {
// IE specific code path to prevent textarea being shown while dialog is visible.
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupport... | true |
22d960536d5bce500694ea918a93f5c81c42b988 | JavaScript | Auliz/Flatiron-Ranch-FE | /src/auz.js | UTF-8 | 3,266 | 3.5 | 4 | [] | no_license | let questionsAnswered = 0
let questionsCorrect = 0
let questionsIncorrect = 0
let animalsIncorrect = []
const answerBtns = document.querySelector('#answer-btns')
const animalPic = document.querySelector('#animal-pic')
const optionOneBtn = document.querySelector('#option1')
const optionTwoBtn = document.querySelector(... | true |
50c28dfbbd3fd0c862c85abe544788c6a2374739 | JavaScript | shreyaskamath7/expense-tracker-mern | /client/src/components/Balance.js | UTF-8 | 851 | 2.609375 | 3 | [] | no_license | import React,{useContext} from 'react'
import {GlobalContext} from '../context/GlobalState'
import {numberWithCommas} from '../utils/utils'
const Balance = () => {
const {transactions}=useContext(GlobalContext);
const amounts=transactions.map(transaction=>{
if(transaction.type==="expense") return -trans... | true |
4941fd1f61a6ff6801e05cb7db27481640cf09ec | JavaScript | the-maniac/EX.UA-FLV | /background.js | UTF-8 | 345 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* Clicked button or not
* @type {boolean}
*/
var executed = false;
//adding button click event
chrome.browserAction.onClicked.addListener(function(tab) {
if (!executed) {
chrome.tabs.executeScript(null, {file: "jquery-1.11.1.js"}, function () {
chrome.tabs.executeScript(null, {file: "content.js"});
});
... | true |
ccb995df219e46bd177093b098dbdeeb2893083e | JavaScript | prasad1261997/swabhav-techlabs | /js-assignment/MyScript2.js | UTF-8 | 159 | 2.828125 | 3 | [] | no_license | var userName = "Steave";
(function (name) {
function display(name)
{
alert("MyScript2.js: " + name);
}
display(name);
})(userName);
| true |
57c187e3f4e53fe9f275968bf112134032095090 | JavaScript | eskeemos/JavaScript30 | /09 - DevTools/script.js | UTF-8 | 1,760 | 3.515625 | 4 | [] | no_license | const header = document.querySelector("h1");
const dogs = [{ name: 'Snickers', age: 2 }, { name: 'hugo', age: 8 }];
// 1. Clearing
console.clear();
console.log("::::::Ex.1 'above^'");
// 2. Interpolated
console.log("::::::Ex.2");
console.log("Hello %s World!","🌎");
// 3. Styled
console.log("::::::Ex.3");
console.log... | true |
3ff6aac9685847f55512addfef770f1c88300804 | JavaScript | YSavir/grips | /lib/grips.js | UTF-8 | 5,280 | 2.78125 | 3 | [] | no_license | (function(){
///////////////
// CONSTANTS //
///////////////
var ATTRS = {};
ATTRS['global'] = ['accesskey', 'class', 'contenteditable', 'contextmenu',
'dir', 'hidden', 'id', 'lang', 'style', 'tabindex',
'title', 'translate'];
ATTRS['input'] = ATTRS['global'].con... | true |
4a5b074048bec10caf0407c675a60324fbcb236f | JavaScript | hapikelvin/dev | /SortedList.jsx | UTF-8 | 1,768 | 2.671875 | 3 | [] | no_license | import React, {Component} from 'react';
import Card from './Card';
import { DropdownButton, Dropdown } from "react-bootstrap";
class SortedList extends Component {
constructor(props) {
super(props);
this.state = {
sortMode: "descend"
};
};
renderList() {
const sorted = this... | true |
53b3eba020f7370176ca8614b95717c9c96c974f | JavaScript | waffle-iron/javascriptix | /test/js/t$.js | UTF-8 | 4,145 | 2.9375 | 3 | [] | no_license | (function (t$) {
function simpleEquals(o1, o2) {
return o1 === o2;
}
function assertEquals(obj1, obj2, equals = simpleEquals) {
if (!equals(obj1, obj2)) {
throw new Error(`Assertion failed. [${obj1}] not equal to [${obj2}]`);
}
}
function arrayEquals(arr1, ... | true |
bf6b73b682cfd4aeddbed996d0790e1e6d7e418d | JavaScript | lhs9101/client-side-route | /router.js | UTF-8 | 1,978 | 2.640625 | 3 | [] | no_license | ESLS.ROUTER = function() {
var routes = [];
var self = this;
window.onpopstate = function() {
self.changeRoute(location.pathname);
};
function getRouteInfo(url) {
var params = {};
var functions;
var urlArr = url.split('/').filter(el => el !== '');
routes.some... | true |
e39c043f8e600464da3916d21351be5760f20b0f | JavaScript | MiryamOren/web-dev.-pre-course-exercises | /ex16/ex16.js | UTF-8 | 236 | 3.359375 | 3 | [] | no_license | function reverseArr(arr)
{
var len = arr.length;
var i;
for (i = 0; i < Math.floor(len / 2); i++)
{
var temp = arr[i];
arr[i] = arr[len - 1 - i];
arr[len - 1 - i] = temp;
}
return arr;
}
| true |
8f3aa452578b013b98b5fef816ead33bbb3b3521 | JavaScript | Mparaiso/mpm.form | /js/fields.js | UTF-8 | 18,743 | 2.59375 | 3 | [] | no_license | /*jslint stupid:true,eqeq:true,node:true,es5:true,white:true,plusplus:true,nomen:true,unparam:true,devel:true,regexp:true */
"use strict";
var _ = require('underscore');
var util = require('util');
var utils = require('./utils');
var validation = require('mpm.validation');
/**
* @namespace
* @type {Object}
*/
var f... | true |
b7c5360b2062ab43eff1c398f4997ba0c8e1723c | JavaScript | Vitz/TreeStructure | /WebApplication1/wwwroot/js/iconActions.js | UTF-8 | 3,521 | 2.609375 | 3 | [] | no_license |
function setActionRollIcons() {
$(document).ready(function () {
$("div[title='roll_icon']").click(function (e) {
var branch = $(this).parent().parent().parent().children()[1];
branch.toggleAttribute("hidden");
$(this).children().first().toggleClass("fa-plus")
... | true |
ef4e52c7ab41d1a6309fdf769bdd7d61985dd7ea | JavaScript | tsahay2/react-spring-boot | /ui/src/containers/home-page/HomePage.js | UTF-8 | 2,370 | 2.65625 | 3 | [] | no_license | import React, {Component} from 'react';
import './home-page.scss'
import {Form, FormButton, Grid, Input} from 'semantic-ui-react'
export class HomePage extends Component {
constructor(props) {
super(props);
this.dynamicSearch = this.dynamicSearch.bind(this)
this.editSearchTerm = this.editS... | true |
1cf2bd02fb415d46a42ac4bd9a2f7183f894a051 | JavaScript | divyanshsikarwar/Agriculture-Portal | /js/TradeCrops.js | UTF-8 | 3,429 | 2.609375 | 3 | [
"MIT"
] | permissive | function tradecrops() {
var temp = document.getElementById("trade_farmer_cost").value;
var cost = Number(temp);
var crop=document.getElementById("crops").value;
var goAhead = true;
if(!crop.localeCompare("arhar")) {
if((cost>(39+Math.ceil(39*0.05)))||(cost<(39-Math.ceil(39*0.05))... | true |
6ada60ecdb58b7385f7f550c9a47f09556457af2 | JavaScript | SamuelU100/MyFirstNodejs | /server.js | UTF-8 | 1,025 | 2.734375 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const axios = require ('axios');
const app = express();
app.use(bodyParser.urlencoded({extended: true}));
app.get('/', (request, response)=>{
response.sendFile(__dirname + '/index.html');
//response.send("<h1> Hello world </h1>");
}... | true |
6e1f84965714ce09f333163d0e53fc120fa9633c | JavaScript | emadamczyk/EA-Portfolio | /assets/javascript/app.js | UTF-8 | 956 | 2.640625 | 3 | [] | no_license | // Initialize Firebase
// Initialize Firebase
var config = {
apiKey: "AIzaSyBFpiT3jEPjr5JxKKih-nR5-rKO5FGFh3Q",
authDomain: "ea-portfolio.firebaseapp.com",
databaseURL: "https://ea-portfolio.firebaseio.com",
projectId: "ea-portfolio",
storageBucket: "ea-portfolio.appspot.com",
messagingSenderId:... | true |
db82160429eee0e86ffc0332f6729466ad785bc2 | JavaScript | SiamKing/codewars | /power/power.js | UTF-8 | 111 | 3.328125 | 3 | [] | no_license | function numberToPower(number, power){
return Array(power).fill(number).reduce((tot, num) => tot * num, 1)
}
| true |
93255d4e518d8ecd28b132a7602193369884cf35 | JavaScript | melvinthemok/codility-solutions | /frog-river-one.js | UTF-8 | 1,105 | 3.3125 | 3 | [] | no_license | function solution (A, X) {
// let arr = Array(X).fill(0).map((e, i) => i + 1)
// for (let i = 0; i < A.length; i++) {
// if (arr.includes(A[i])) arr.splice(arr.indexOf(A[i]), 1)
// if (arr.length === 0) return i
// else return -1
// }
// // let leaves = {}
// // for (let i = 0; i < A.length; i++) ... | true |