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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
af41294fd04389f3462ef7e555309c70aa3922a1 | JavaScript | ivan3123708/codewars | /javaScript/5_kyu/Simple_Pig_Latin.js | UTF-8 | 127 | 2.625 | 3 | [] | no_license | function pigIt(str){
return str = str.split(' ').map((word) => {
return word.slice(1) + word[0] + 'ay';
}).join(' ');
}; | true |
9adf6b26278a801c484b89cb899108d888f7de41 | JavaScript | prendradjaja/vchess | /client/src/data/problemCheck.js | UTF-8 | 338 | 2.78125 | 3 | [
"ISC"
] | permissive | export function checkProblem(p) {
const vid = parseInt(p.vid, 10);
if (isNaN(vid) || vid <= 0) return "Please select a variant";
if (!V.IsGoodFen(p.fen)) return "Errors in FEN";
if (p.instruction.trim().length == 0) return "Missing instructions";
if (p.solution.trim().length == 0) return "Missing solution"... | true |
0e32f183b78bcb3a88ebc2dd1152f7bfb801a1a6 | JavaScript | 10015918/murray-fianace-assessment | /javascript.js | UTF-8 | 2,026 | 3.84375 | 4 | [] | no_license | //variables
var total_cost = 0;
var total_volume = +0;
var volumes = [5000, 5500, 6300, 9000, 6000, 5000];
var prices = [0.55, 0.58, 0.60, 0.63, 0.65, 0.70];
// making table
var table = document.getElementsByTagName("table")[0];
// hard coding first row to add titles for columns
table.innerHTML = '<thead><tr><th>Volu... | true |
4b33a9a32d008885d101ed837b8da66066316eb1 | JavaScript | timschott/dd-db | /server.js | UTF-8 | 2,952 | 2.65625 | 3 | [] | no_license | // server js creates app and sets up routing services.
const express = require('express');
const port = 8000;
const gitsource = "https://github.com/timschott/dd-db/blob/main/corpus/txts(cleaned)/";
// create new express app and save it as "app"
const app = express()
// db conf
const DB_PORT = process.env.PORT || 8... | true |
f2af16cdc8a7ef0341b85e1ecd33e810c804a830 | JavaScript | fbw-28/04-spa-lifecycle-skrvasilis | /src/Search.js | UTF-8 | 1,268 | 2.765625 | 3 | [] | no_license | import React, { Component } from "react";
import './Search.css'
export default class Search extends Component {
constructor(props) {
super(props);
this.state = {
data: [],
};
}
componentDidMount() {
fetch("https://jsonplaceholder.typicode.com/users")
.then((res) => res.json())
... | true |
d6ca51c60ad5deb832d92de37a767a6cebf9fd3b | JavaScript | PopradiArpad/learn-js | /other/apply.js | UTF-8 | 811 | 3.75 | 4 | [] | no_license | 'use strict';
//Funtion.prototype.apply calls a function
//with a defined 'this' and arguments as array
let o1 = {
a: 1
};
let o2 = {
a: 2
};
function incA() {
this.a++;
}
incA.apply(o1);
console.assert(o1.a === 2);
//-------------------------
o1.a = 1;
function addA(value) {
this.a += value;
}
o1.a = ... | true |
1fe657f19aff5db792f0de424048e4adc4e28f20 | JavaScript | jstafford/events-order | /src/App.js | UTF-8 | 18,074 | 2.71875 | 3 | [] | no_license | // @flow
import React, { Component } from 'react';
import './App.css';
type OwnProps = {
children?: React$Node,
value: number,
}
class Wrapper extends Component<OwnProps> {
el: ?HTMLDivElement = null
handleClick = (e:SyntheticMouseEvent<HTMLDivElement>): void => {
const {value} = this.props
console.l... | true |
752005eaef92ab31c2e9718eff5875664b5713a7 | JavaScript | stephenbaiuoft/react-udemy | /client/src/reducers/authReducer.js | UTF-8 | 732 | 2.875 | 3 | [] | no_license | import {FETCH_USER} from '../actions/types';
// named with authReducer to indicate this file is of functions
// this is a pure reducer function --> dispatch sends to all reducer methods
export default function(state= null, action) {
console.log(action);
switch(action.type) {
case FETCH_USER:
... | true |
8269ed00f91f27fd87cb569193313c76ed3fe434 | JavaScript | vKeulen/Icenium-sample | /Conversio/scripts/conversio.js | UTF-8 | 3,894 | 3 | 3 | [] | no_license | // JavaScript Document
// Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);
// Variable to handle if user is already logged in
// Login should be handled in webservice/api
LoggedIn = false;
// Datasource for the messages listview
var ds;
// PhoneGap is ready
function onDevice... | true |
e4393a996299ff564f40504df9a76c7cfb59be53 | JavaScript | dwolters/samsung-smarttv-cli-remote | /app.js | UTF-8 | 665 | 2.6875 | 3 | [] | no_license | const Remote = require('new-samsung-remote'); program = require('commander');
program
.version('0.0.1')
.usage('OPTIONS ON/OFF')
.option('--on [on]', 'on key')
.option('--off [off]', 'off key')
.option('-h, --host [host]', 'Host')
.parse(process.argv); const config = {
ip_address: program.host, // ... | true |
f8cc5e254bbfb8ba073ba8f1b352f44ab587943f | JavaScript | loicbaron/myslice2 | /myslice/web/static/js/src/components/base/ElementDetails.js | UTF-8 | 878 | 2.65625 | 3 | [
"MIT"
] | permissive | import React from 'react';
const ElementDetails = ({data}) => {
var pairs = [];
for(var k in data){
var val = null;
if(k.indexOf('key') == -1 && k.indexOf('credential') == -1 && k.indexOf('type')==-1){
if(Array.isArray(data[k])){
if(typeof(data[k][0])==='string'){
... | true |
59adcc59fe1b869189df392146bf6a2b76605b1b | JavaScript | rikonor/ReportYourExpensesMeteor | /client/graphs/bar.js | UTF-8 | 1,286 | 2.890625 | 3 | [] | no_license | var Bar = Graph.Bar = function(selector) {
Graph.call(this, selector);
return this;
};
Bar.prototype = Object.create(Graph.prototype);
Bar.prototype.constructor = Bar;
Bar.prototype.drawData = function() {
main = this;
this.barWidth = this.width / this.dateValueArray.length;
// Remove previous d... | true |
343e345655a44a6071b6b85b4585b494caf705b3 | JavaScript | esjay/just-deserts | /js/lib/crafty/src/storage.js | UTF-8 | 2,518 | 3.53125 | 4 | [] | no_license | var Crafty = require('./core.js'),
document = window.document;
/**@
* #Storage
* @category Utilities
* Very simple way to get and set values, which will persist when the browser is closed also.
*/
/**@
* #.storage
* @comp Storage
* @sign .storage(String key)
* @param key - a key you would like to get from ... | true |
17378a130d16ff7f0a2694bf1e468f54448eb6ef | JavaScript | nhahn/SSUI-Web-2015 | /assets/assignments/p2/container-test.js | UTF-8 | 4,628 | 2.5625 | 3 | [
"MIT"
] | permissive | window.onload = function () {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var root = new Doodle(context);
var rotContainer1 = new Container({
width: 150,
height: 150,
left: 700,
top: 300,
fill: "cyan",
borderWidth: 3,
});
var r... | true |
0febc32cea666e3f30f4f1d59573e031e48e6b76 | JavaScript | fahimc/TextToHTML | /src/main.js | UTF-8 | 2,023 | 2.828125 | 3 | [] | no_license | (function(window) {
var data;
var clipboard;
function Main() {
if (window.addEventListener) {
window.addEventListener("load", onLoad);
} else {
window.attachEvent("onload", onLoad);
}
}
function onLoad() {
Utensil.URLLoader.load("resource/data/numeric_html_entities.json", onDataLoadComplete);
}
... | true |
25344202d3e0925d2ec9ba91e15a1a41bb2a98a4 | JavaScript | DanyeleSales/Reprograma | /Semana 7/revisao/planilha/script/script.js | UTF-8 | 1,653 | 3.359375 | 3 | [] | no_license | //cria o botão
const button = document.querySelector(".feedback__button")
//cria o evento do botão
button.addEventListener("click", function(evento){
evento.preventDefault();//previne o evento padrão
//Seleciona tabela
const respostas = document.querySelector (".respostas__table")
//pega o input... | true |
a8b0665f6e1d254217f2bfa09c8dd99852166314 | JavaScript | LordKenzo/ramda-js-roma | /test/Livello1.test.js | UTF-8 | 1,749 | 3.40625 | 3 | [] | no_license | import {expect} from 'chai';
import * as kata from '../src/Livello1';
describe('Kata Livello 1', () => {
it('should return a flat array', () => {
expect(kata.flatten([1],[2, [[3]]])).to.deep.equal([1,2,3]);
});
it('should return a list within [1,2,3] with use two-args function', () => {
expect(kata.eser... | true |
b93683eefa56bbed7d549a845877a084087b3994 | JavaScript | kengo-taka/leet-code | /Problem1952.js | UTF-8 | 246 | 3.796875 | 4 | [] | no_license | var isThree = function (n) {
let array = []
for (i = 1; i <= n; i++) {
if (n % i === 0) {
array.push(i)
}
}
if (array.length === 3) {
return true
} else {
return false
}
};
let n = 17
console.log(isThree(n)) | true |
52422e1b161f2c6439a10efc50b69eb56292c1c7 | JavaScript | Sophealin-Hul/unv-101 | /RPG.js | UTF-8 | 3,195 | 3.125 | 3 | [] | no_license | const readlineSync = require('readline-sync');
const name = readlineSync.question('Enter your name ');
readlineSync.question('Welcome! ' + name + ', this is The Unknown. Today your fate will determinded your conquest for treasure.' + ' But watch out for the monsters lurking in the shadow. \nPress Enter to begin your j... | true |
8fa88a956de44a2fd109eb00a83570e6237b99a9 | JavaScript | StephanieFaula/react-pokemon-app | /frontend/src/helpers/FormatDate.js | UTF-8 | 172 | 2.828125 | 3 | [] | no_license | const FormatDate = (date) => {
const createdDate = date.getDate()+'/'+(date.getMonth()+1)+'/'+date.getFullYear();
return(createdDate);
}
export default FormatDate; | true |
2364192c58854f7879c978c02c3efff0699a5fd8 | JavaScript | g00377038/MA_lab2 | /part3.js | UTF-8 | 938 | 2.96875 | 3 | [] | no_license | "use strict";
exports.__esModule = true;
var ToDos = /** @class */ (function () {
function ToDos() {
this.list = [];
}
ToDos.prototype.addTask = function (taskToAdd) {
this.list.push(taskToAdd);
console.log(taskToAdd + " has been added to the list.");
return this.list.length;... | true |
830a716724acc14b4c73a6ff57eed52990a4fa5e | JavaScript | aditbro/tok2 | /src/views/screen/screens/playerRegistration.js | UTF-8 | 2,658 | 2.765625 | 3 | [] | no_license | 'use strict';
import React from 'react';
import './playerRegistration.css';
export default class PlayerRegistration extends React.Component {
constructor(props) {
super(props);
this.state = {
players: []
};
this.comm = this.props.comm;
this.comm.ongamemessage = (msg) => {
this.handl... | true |
0e8c72771ac4d721064ec06a8987f3691863e84f | JavaScript | Rombelirk/JS-Assessment | /app/functions.js | UTF-8 | 947 | 3.015625 | 3 | [] | no_license | if (typeof define !== 'function') { var define = require('amdefine')(module); }
define(function() {
return {
argsAsArray : function(fn, arr) {
return fn(...arr)
},
speak : function(fn, obj) {
return fn.apply(obj)
},
functionFunction : function(str) {
return (str2) => `${str}, ... | true |
5ef63bd52581bcf829ed37845f44a54c4da44d3d | JavaScript | Tannerwill756/User-Onboarding | /onboardingapp/src/components/Form.js | UTF-8 | 4,049 | 2.765625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import * as yup from 'yup';
import axios from 'axios';
import styled from 'styled-components';
import './Form.css'
const FormStyle = styled.div`
display:flex;
flex-direction:column;
`;
const formSchema = yup.object().shape({
name: yup.string().required("... | true |
5625666f710653297b9967958d9edfffd6547f4b | JavaScript | tzetzo/MongoDBwithNode | /test/controllers/drivers_controller_test.js | UTF-8 | 2,176 | 2.71875 | 3 | [] | no_license | const assert = require("assert");
const request = require("supertest");
const mongoose = require("mongoose");
const app = require("../../app");
const Driver = mongoose.model("driver");
describe("Drivers controller", () => {
it("handles a POST request to /api/drivers and creates new driver", done => {
Driver.coun... | true |
bb1187aae9e42435def9897e0e2968817e6a0645 | JavaScript | Sapfir0/Meteo-Server | /public/js/graphic.js | UTF-8 | 1,937 | 3.078125 | 3 | [] | no_license | import { chartNewLineGraphic, setDatasForLineGraphic, setOptionForLineGraphic } from "./typeOfGraphics/lineGraphics.js"
import { findMaxMinArraysValues, dateToStr } from "./helpers.js"
import { criticalHighHum, criticalHighTemp, criticalLowHum, criticalLowTemp } from "./typeOfGraphics/colorSettings.js"
let datasForCha... | true |
3560e178645c9251ce933eec4f81633cc53cdf0e | JavaScript | IEH-intekglobal/intekTraining | /exercisesJS/exercises1/backup.js | UTF-8 | 1,453 | 3.015625 | 3 | [] | no_license | let tree = {'A':{'a':{'aa': null},'b':{'ba':null, 'bb':null},'c':{'ca':null, 'cb':{'cab':null}}}};
let canvas = document.querySelector("canvas");
let ctx = canvas.getContext("2d");
ctx.font = "30px Arial";
let branchesObj = {0:tree};
let positions = {};
let sep;
let ypos = 50;
let xpos = 0;
let level = 0;
let checker... | true |
5375c7e5cf2e25509858e7effcc9065c20329f7a | JavaScript | radrex/SoftuniCourses | /JS Web Developer/JS Advanced/JS Applications/04.Remote Databases/Lab/app.js | UTF-8 | 895 | 2.703125 | 3 | [
"MIT"
] | permissive | let baseUrl = 'https://remotedb-55dd4.firebaseio.com/';
const html = {
tbody: () => document.getElementById('table-body'),
};
fetch(`${baseUrl}Books.json`)
.then(handleError)
.then(deserializeData)
.then(constructTable)
.catch(handleError);
function constructTable(x) {
let fragment = new DocumentFragment... | true |
95c0cb7294abb78a702b034bd8849ffd78607c9e | JavaScript | jonasermert/hackerrank | /10-days-of-js/day5-arrow-functions.js | UTF-8 | 1,047 | 4.71875 | 5 | [] | no_license | /*
Objective
In this challenge, we practice using arrow functions. Check the attached tutorial for more details.
Task
Complete the function in the editor. It has one parameter: an array, nums. It must iterate through the array performing one of the following actions on each element:
- If the element is even, mul... | true |
e4d702d72790946e70d34e5f50d514cc410b2e82 | JavaScript | NamuIsTree/Musicweb_upload | /client/src/AddAlbum.js | UTF-8 | 2,462 | 2.546875 | 3 | [] | no_license | import React from 'react'
class AddAlbum extends React.Component {
constructor(props) {
super(props);
this.state = {
name : "",
artist : "",
genre : 0,
nation : "",
year : 0,
volume : 0,
rating : 0.0
... | true |
c2ffeceb34eed3ba57d393a037d27237a741a9e7 | JavaScript | owenkellogg/ambassadors.anypay.global | /lib/dash_price.js | UTF-8 | 510 | 2.65625 | 3 | [] | no_license | const http = require('superagent')
var dashDollarPrice;
const dashPriceUrl = 'https://api.coinmarketcap.com/v1/ticker/dash/';
async function loadDashDollarPrice() {
let response = await http.get(dashPriceUrl);
dashDollarPrice = parseFloat(response.body[0].price_usd)
return;
}
module.exports.getDashDollarPr... | true |
a57a497353b59bfc88a186313b988edbda53473f | JavaScript | annaconway/azc5184-430-project-1 | /src/server.js | UTF-8 | 3,320 | 2.578125 | 3 | [] | no_license | //------------------------
// SERVER JS THAT HANDLES
// SERVER REQUESTS
//------------------------
// Pull in modules
const http = require('http');
const url = require('url');
const query = require('querystring');
// Import external .js files
const htmlHandler = require('./htmlResponse.js');
const jsonHandler = requi... | true |
a16097681f569b5635086cf51d392aaac0daed4e | JavaScript | yangxin1994/farvekonfigurator | /color-modular/colorab2.js | UTF-8 | 119 | 2.53125 | 3 | [] | no_license | (function() {
// Make the color #ab2
HTMLElement.prototype.colorab2 = function() { this.style.color = '#ab2' }
})() | true |
ddb0ac0d87b683479eda6c9a637d41f436a2ca79 | JavaScript | tiffboors29/w1-MBTA-homework | /MBTA_Homework.js | UTF-8 | 2,244 | 3.171875 | 3 | [] | no_license | 'use strict;'
var red = [
'south station',
'park st',
'kendall',
'central',
'harvard',
'porter',
'davis',
'alewife'
];
var green = [
'haymarket',
'government center',
'park st',
'boylston',
'arlington',
'copley'
];
var orange = [
'north station',
'haymarket',
'park st',
'state... | true |
614e9673ec5e3d9c3dd30471d863af1b0d9efadb | JavaScript | simonchauvin/FM.js-Engine | /src/Game.js | UTF-8 | 18,265 | 2.96875 | 3 | [
"MIT"
] | permissive | /*global FM*/
/**
* The Game object is a singleton that represents the game application and
* contains all the necessary information and methods to handle its execution.
* @class FM.Game
* @static
* @author Simon Chauvin
*/
FM.Game = {
/**
* Name of the game.
* @field
* @type string
* @private... | true |
b8f913096b55a4d7299ff2b1f3c83096fbf62857 | JavaScript | open-company/medium-editor-extentions | /src/AutoCode/index.js | UTF-8 | 3,344 | 2.609375 | 3 | [
"MIT"
] | permissive | import MediumEditor from "medium-editor";
// Inspired by https://github.com/varun-raj/medium-editor-autolist
var AutoCode = MediumEditor.Extension.extend({
name: 'AutoCode',
preCollection: null,
throttledCheck: null,
init: function(){
var editor = this.getEditorElements()[0]
this.preCollection = edit... | true |
3b2519d97301131421db1fe93c3ec03be5a48b1c | JavaScript | Athrun1027/accounts-list | /src/Components/Amount.js | UTF-8 | 2,818 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
import axios from 'axios'
class Amount extends Component {
constructor(props) {
super(props);
this.state = {
load: true,
date: '',
description: '',
amount: ''
}
}
ChangeRecord(event) {
e... | true |
541428021ad021114b3a1f77c95fc6a7ea488383 | JavaScript | hwjeon297/funnyec1 | /public/script/index.js | UTF-8 | 887 | 2.59375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // 메인 페이지 화면 강조 이벤트
var flag = 1;
function testjs(id) {
var shoesType = document.getElementById(id);
switch (shoesType.id) {
case "canvars":
// shoesType.addEventListener('mouseover', function(){
// var layout = document.getElementById("half1_layout");
// ... | true |
37b1788a1b997a261a8036b673b6ebbba030a274 | JavaScript | Andrewkind/Ghostbox | /Assets/Frogames_ProtoPack/example Scenes/ExempleScene_Ragdoll/Ragdoll_Script.js | UTF-8 | 2,229 | 2.546875 | 3 | [] | no_license | var LaunchSound : AudioClip;
var ButtonSound : AudioClip;
var POV1 : Transform;
var POV2 : Transform;
private var buzy : int = 1;
private var Force : String = "-";
function Start(){
yield WaitForSeconds (1.0);
buzy = 0;
}
function Launch(){
//Apply a force to the ragdoll
var ForwardForce = Random.Range... | true |
8ca2ad23d17677bfb93b36b45211e14982296384 | JavaScript | tamastro/minutes-vart | /functions/closeDiscussion/helpers/arrToObj.js | UTF-8 | 157 | 2.609375 | 3 | [
"MIT",
"CC0-1.0"
] | permissive | module.exports = arr => {
if (!arr)
return null
let result = {}
arr.forEach((item, index) => {
result[index] = item
})
return result
} | true |
2c04ecd04032245b64a61d63346d6fd51f586fcc | JavaScript | maroua199525/AirBnB_clone_v4 | /web_dynamic/static/scripts/1-hbnb.js | UTF-8 | 368 | 2.65625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | $(document).ready(function () {
const Id = {};
$('input[type="checkbox"]').click(function () {
if ($(this).prop('checked') === true) {
Id[$(this).data('id')] = $(this).data('name');
} else if ($(this).prop('checked') === false) {
delete Id[$(this).attr('data-id')];
}
$('div.amenities H4'... | true |
61afaecbfdc4483bd9f81992161ee31bea5ac332 | JavaScript | laojala/fullstackopen-2019 | /chapter_6/redux-anecdotes/src/reducers/notificationReducer.js | UTF-8 | 637 | 3 | 3 | [
"MIT"
] | permissive |
const initialNotification = null
const notificationReducer = (state = initialNotification, action) => {
console.log("STATE: ", state)
switch (action.type) {
case 'NOTIFICATION':
if (action.data === null)
return null
else
return `${action.data}`
default:
return state
... | true |
1a303bd16cca302140e964a146c3a9ea5d53aef7 | JavaScript | gyng/comicchat | /client/js/client.js | UTF-8 | 2,848 | 2.515625 | 3 | [
"MIT"
] | permissive | (function () {
'use strict';
var params = (new URL(document.location)).searchParams;
var serverAddress = params.get('server') || 'ws://localhost:8084';
var ui = new UI({
content: document.getElementById('content'),
input: document.getElementById('input'),
inputForm: docu... | true |
cc54883c0bcf5aa85641ffb106d84c786d247628 | JavaScript | react-bootstrap/react-bootstrap | /www/docs/examples/Modal/FullScreen.js | UTF-8 | 946 | 2.515625 | 3 | [
"MIT"
] | permissive | import { useState } from 'react';
import Button from 'react-bootstrap/Button';
import Modal from 'react-bootstrap/Modal';
function Example() {
const values = [true, 'sm-down', 'md-down', 'lg-down', 'xl-down', 'xxl-down'];
const [fullscreen, setFullscreen] = useState(true);
const [show, setShow] = useState(false)... | true |
c868f5c44d3bceb509f833d38757f6c57de81295 | JavaScript | ConnieIp/POS-Machine | /__tests__/main-spec.js | UTF-8 | 7,060 | 2.515625 | 3 | [] | no_license | const printReciept = require("../main");
describe('countBuyItems', function() {
it(`Given ['ITEM000001','ITEM000001'] and product list, When call countBuyItems, Then return a buy item list [{barcode: 'ITEM000001', name:'Coca-Cola', unit:'bottles', price:3.00, quantity:2}]`, function() {
let idList = ['... | true |
026d12889260cb3116fc36d0e54ec66e2d3017e7 | JavaScript | jezd-hmrc/ers-checking-frontend | /public/javascripts/ers_csv_scripts.js | UTF-8 | 3,208 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | /***********************/
/* Check CSV file page */
/***********************/
var MAX_CSV_FILESIZE = 100000000// 100 MB
function csvFileSizeOK (fileSize) {
if (ie<10) {
return true
} else {
if (fileSize > MAX_CSV_FILESIZE) {
return false
} else {
return true
}
}
}
function duplicateF... | true |
11eb2ae95f7538760bdd29451d4960df2cb9f420 | JavaScript | VidolVidolov/SoftuniFundamentals | /sorting 3 numbers.js | UTF-8 | 962 | 3.53125 | 4 | [
"MIT"
] | permissive | function solve(num1, num2, num3){
let biggest = 0;
let middle = 0;
let lowest = 0;
if(num1 > num2 && num1 > num3){
biggest = num1;
}else if(num2 > num1 & num2 > num3){
biggest = num2;
}else if(num3 > num1 && num3 > num2){
biggest = num3;
}
if(num1 === bigg... | true |
a5f9aa902b118c6d78cda65823147d485c7e2306 | JavaScript | ishantk/ENCFSD2021B1 | /linkedlist1.js | UTF-8 | 2,245 | 4.09375 | 4 | [] | no_license | class Song{
constructor(track, artitsts, duration){
this.track = track;
this.artists = artitsts;
this.duration = duration;
// 2 attributes to handle who is next and who is previous
this.nextSong = null;
this.previousSong = null;
}
show(){
... | true |
9233adc1be3662f6d6fb57dafae5148ee0536427 | JavaScript | 45ewertton/verificar-notas-js | /scripts.js | UTF-8 | 695 | 3.578125 | 4 | [] | no_license | function verificar(){
let notatxt = document.getElementById("notatxt")
let res = document.getElementById("result")
let nota = Number(notatxt.value)
let notaResult = ''
if (nota >= 0 && nota <= 60){
notaResult = 'F'
}else if(nota > 60 && nota <= 69){
notaResult = 'D'
}el... | true |
ceb48e3ef7a146e547e6eb4c22ceeafd084d0f01 | JavaScript | kevyyar/JS-Complete_Guide | /math_object/mathObject.js | UTF-8 | 654 | 4.4375 | 4 | [] | no_license | // Contains Properties and Methods for Mathematical constants and operations
// rounding a number
Math.round(4.7); // 5
// Absolute Value
Math.abs(-465); // 465
// Raises 2 to the power of the 5th power
console.log(Math.pow(2, 5)); // 32
// Removes the decimal (doesn't round, just chops off the decimal)
console.log... | true |
109b42e86cd3d8b4c96cc054d05709aec9cdb840 | JavaScript | Kenzie-Academy-Brasil-Developers/entrega-katas-javascript-5-sprint-6-Christian-mf25 | /katas5.js | UTF-8 | 5,511 | 3.03125 | 3 | [] | no_license | const testeReverseString1 = () =>{
let result = reverseString("Kenzie Academy")
let expected = "ymedacA eizneK"
console.assert(result === expected, `esperado: ${expected}, obtido: ${result}`)
}
const testeReverseString2 = () =>{
let result = reverseString("Socorram-me, subi no ônibus em Marrocos!")
let expected ... | true |
ffb98e753124453d58ccae3933ad36fbdb9d7e33 | JavaScript | htfei/chrome_exts | /RssPlus/js/popup.js | UTF-8 | 5,844 | 2.5625 | 3 | [
"MIT"
] | permissive |
document.write("<script language=javascript src='js/common.js'></script>");
//document.head.appendChild(document.createElement('script')).src = '/js/common.js';
//loadPopup();
setTimeout("loadPopup()",200);//等待common.js加载完毕
//一次加载的数量
var onceNums = localStorage.onceNums ? localStorage.onceNums : 10;
//当前加载的rssUrl
... | true |
490253c53675902112e3b80e5315df274da018fe | JavaScript | mathiuskormasela12/belajar-oop-typescript | /build/pertemuan1/index.js | UTF-8 | 1,157 | 3.796875 | 4 | [] | no_license | "use strict";
class Mahasiswa {
constructor(nama, usia) {
this.data = 'Ini data';
this.nama = nama;
this.usia = usia;
}
sayHello() {
console.log(`Hello my name is ${this.nama}`);
}
}
class Mathius extends Mahasiswa {
constructor(nama, usia, ...skills) {
super(... | true |
320aeb62536530bc9d4934daefa4d58077534d05 | JavaScript | podefr/computer-science | /string/suffix-tree.js | UTF-8 | 1,714 | 3.34375 | 3 | [
"MIT"
] | permissive | "use strict";
function buildSuffixTree(string) {
const suffixTree = {};
for (let i = 0, stringLength = string.length; i < stringLength; i++) {
let leafIndex = i + 1;
for (let j = 0; j < i + 1; j++) {
extendTree(string.slice(j, leafIndex), leafIndex)
}
}
function ex... | true |
861d66336610f75ec446457b8be65c2d73a32eb3 | JavaScript | acenine/chatterbox-client | /client/scripts/app.js | UTF-8 | 4,880 | 3.125 | 3 | [] | no_license | // YOUR CODE HERE:
// http://parse.sfm6.hackreactor.com/chatterbox/classes/messages
// let user = {
// // name = (prompt('What is your name?')
// }
$(document).ready(() => {
$(".clearMessages").click(function(){
$(".chatUl").html("");
});
// app.call(this);
// console.... | true |
ea58d91ccf1796399f31625cc43caa74db809d44 | JavaScript | gregdanko92/project-one-movies | /controllers/moviesController.js | UTF-8 | 6,658 | 2.625 | 3 | [] | no_license | /* -------------------------------------------------------------------------- */
/* Required Modules */
/* -------------------------------------------------------------------------- */
const express = require('express');
const db = require('../models/index.js')
... | true |
621bfd6a7c907bb27afdd5e9c208c96f8f676c55 | JavaScript | Gatodegithub/calendar-app | /src/helpers/prepareEvents.js | UTF-8 | 259 | 2.6875 | 3 | [] | no_license | import moment from "moment";
export const prepareEvents = (events = []) => {
// La fecha esta en string, debo pasarla a objeto tipo date.
return events.map((e) => ({
...e,
end: moment(e.end).toDate(),
start: moment(e.start).toDate(),
}));
} | true |
756338e5e0e00a351a7d89ce167fbd4699a585ab | JavaScript | Prajapathi/booking-form | /booking-form-main/main1.js | UTF-8 | 7,857 | 2.609375 | 3 | [] | no_license | const tabNavList = document.querySelectorAll('.email-control');
const tabBody = document.querySelectorAll('#row');
console.log("main1");
tabNavList.forEach((item, index, listArray) => {
item.addEventListener('click', () => {
item.style.backgroundColor = "#007bff";
item.style.color = "white";
listArray.fo... | true |
86738001006d9ec1834acbfd8bc5971d66790714 | JavaScript | JsunJ/ls-js101 | /lesson-2-small-programs/rps-bonus-features/rock_paper_scissors.js | UTF-8 | 3,520 | 3.515625 | 4 | [] | no_license | const readline = require('readline-sync');
const VALID_CHOICES = {
r: 'Rock',
p: 'Paper',
sci: 'Scissors',
spo: 'Spock',
l: 'Lizard'
};
const WINNING_COMBOS = {
r: ['sci', 'l'],
p: ['r', 'spo'],
sci: ['p', 'l'],
spo: ['r', 'sci'],
l: ['p', 'spo']
};
const MAXIMUM_SCORE ... | true |
35ae137f43b747c507fdee8d7165d6f35ca3f4a6 | JavaScript | SiamKing/codewars-exesAndOhs | /xAndO.js | UTF-8 | 183 | 2.953125 | 3 | [] | no_license | function XO(str) {
let arr = str.toLowerCase.split('');
let o = arr.filter(v => v === 'o');
let x = arr.filter(v => v === 'x');
return x.length === o.length ? true : false;
}
| true |
5a2639b71448e4f348a4d257affb19c2df6d7b1a | JavaScript | SatGarcia/amazon-invoice-downloader | /background.js | UTF-8 | 1,710 | 2.625 | 3 | [] | no_license | browser.runtime.onMessage.addListener(downloadLink)
function onStartedDownload(id) {
console.log(`Started downloading: ${id}`);
}
function onFailedDownload(error) {
console.log(`Download failed: ${error}`);
}
function downloadLink(message) {
var components = message.url.split('/');
var s = components[component... | true |
c8969170f7809459854285bcbf61e0ec4651fe21 | JavaScript | Ralex86/node-chat-app | /playground/time.js | UTF-8 | 397 | 3.03125 | 3 | [] | no_license | var moment = require('moment');
var date = moment();
// check moments documentation online
// console.log(date.format('MMM Do, YYYY')); // MMM short version of month
//
// console.log(date.format('HH:mm'));
//new Date().getTime()
var someTimestamp = moment().valueOf(); // return a timestamp in linux epic
var create... | true |
5fd489009c3ed67a8cdca1b3fb264492a8757208 | JavaScript | AlexanderDLe/TypeScript_DataStructuresAndAlgorithms | /build/Arrays/FindDisappearedNumbers.js | UTF-8 | 3,013 | 3.46875 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* 448. Find All Numbers Disappeared In An Array
*/
const Utilities_1 = require("../utils/Utilities");
const findDisappearedNumbersA = (nums) => {
let result = [];
for (let i = 0; i < nums.length; i++) {
let numToFlip = Ma... | true |
d8a6e778f656b0ab66eb9d78727ea8823db42bfd | JavaScript | m760622/dalilakNet | /dalilak/wwwroot/js/site.js | UTF-8 | 1,744 | 2.859375 | 3 | [] | no_license | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
function getLocation() {
if (navigator.geolocation) {
navigator.geolocatio... | true |
9f59105b1a3004f0292ffdd626176a81fdf2356f | JavaScript | Frenkieli/myComponents | /commonlyUsedComponents/getElement.js | UTF-8 | 1,132 | 2.671875 | 3 | [] | no_license | "use strict";
exports.__esModule = true;
function AEA(elementBox, elementArray) {
elementArray.forEach(function (v) {
elementBox.appendChild(v);
});
return elementBox;
}
exports.AEA = AEA;
function AE(elementBox, element) {
elementBox.appendChild(element);
return elementBox;
}
exports.AE = A... | true |
d08c764c43e0af3a0a7253f8058f34bb3c91ee55 | JavaScript | awaghadsangita/NodeDevelopment | /birthMonth.js | UTF-8 | 365 | 3.359375 | 3 | [] | no_license | let months=["0","Jan","Feb","March","April","May","June","July","Aug","Sept","Oct","Nov","Dec"]
let personMap=new Map();
let personListMap=[];
for(let i=1;i<=12;i++)
{
personListMap[i]=new Map();
}
for(let i=1;i<=50;i++){
month=Math.floor(Math.random()*10)%12+1;
personMap.set(months[month],personListMap[month].set... | true |
a3c71029cbf04e9ec63645cd6b4c5cfa7bdf41c5 | JavaScript | sriya90/StringAi | /src/CarosalCustom.js | UTF-8 | 1,356 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import {Carousel} from 'react-bootstrap';
export class CarosalCustom extends Component {
constructor() {
super();
this.state = {
imageSource: [],
index: 0,
direction: 'next',
wrap:true
};
}
... | true |
29695c4a804b96cf3c47bec9706dd2293be8a2b3 | JavaScript | Sushmeet/training | /egghead/this-series/4-constructor-new.js | UTF-8 | 482 | 4 | 4 | [] | no_license | function Person(firstName, lastName) {
console.log(this) // our new object has been linked to the Persons functions' prototype
this.firstName = firstName;
console.log(this);
this.lastName = lastName;
console.log(this);
// secret return almost magical which returns the person prototype
// if... | true |
1a7ec1eced76bb202aa283cf8ff14aaadb1fb6cd | JavaScript | zongyz/get-website-favicon | /lib/rank.js | UTF-8 | 1,068 | 2.6875 | 3 | [
"MIT"
] | permissive | 'use strict'
let orders = [{
key: 'origin',
rank: item => {
const rule = [/^\/favicon.ico$/im, /<link/im, /<meta/im, /manifest.json/im].reverse()
let rank = 0
for (let n in rule) {
rank += rule[n].test(item.origin) ? parseInt(n) : 0
}
return rank
}
}, {
key: 'ext',
rank: item => {
const rule = [/\.... | true |
c7d06024ed6105ab1019fc11cea689dfc3b63090 | JavaScript | devyncunningham/majora | /src/generator.js | UTF-8 | 2,967 | 2.71875 | 3 | [] | no_license | /**
* This module is responsible for generating the majora.lock.json file
* that lives in the root directory of your project.
*/
const fs = require('fs-extra');
const chalk = require('chalk');
const { getWhiteLabelFiles } = require('./auditor');
/**
* @description Converts
*
* Array<{
* ...package, ... | true |
8f5194f53a0bc5dc5358b78d82b31411487478d2 | JavaScript | bergieboy/w7d3 | /Pokedex/frontend/components/pokemon/pokemon_detail.jsx | UTF-8 | 1,461 | 2.859375 | 3 | [] | no_license | import React from 'react';
class PokemonDetail extends React.Component {
constructor(props) {
super(props);
this.state = { pokeId: this.props.match.params.pokeId };
this.componentWillReceiveProps = this.componentWillReceiveProps.bind(this);
}
componentWillMount() {
this.props.requestSinglePokem... | true |
18ce6092f0734e46b2e5fda48d42c7c2136e44e3 | JavaScript | webdeveloperbashar/weather-app | /js/core.js | UTF-8 | 71 | 2.59375 | 3 | [] | no_license |
let a = {
angel: 'bashar'
}
a.angel = 'hasan'
console.log(a); | true |
831328622d743d4d9d9da0df2d76fc2c5d68c007 | JavaScript | stvreumi/watch-data-table | /src/Table.js | UTF-8 | 3,581 | 2.578125 | 3 | [] | no_license | // reference: https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/expanding
import { useTable, useExpanded, useGroupBy } from "react-table";
function Table({ columns: userColumns, data }) {
// instance
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prep... | true |
764b074708835b9443f11e35d64c46840bd1fa49 | JavaScript | Franperceb/Project-2 | /public/javascripts/script.js | UTF-8 | 1,502 | 3.21875 | 3 | [] | no_license | let likeButtons = document.querySelectorAll('.like')
let recipes = document.querySelectorAll('.recipe')
//Change button style with likes
likeButtons.forEach(button => {
button.onclick = (e) => {
if(button.getAttribute('class') === 'like'){
button.setAttribute('class', 'like selected')
} else {
button.set... | true |
cd4d41fc813a2aebf071b2139c286bafc508dc91 | JavaScript | cathydongxueyan/algorithm020 | /Week3/全排列.js | GB18030 | 549 | 3.125 | 3 | [] | no_license | //ο˱˵
var permute = function(nums) {
var res = [];
rec([], new Set());
return res;
function rec(path, set){
if(path.length === nums.length){
res.push(path.concat());
return;
}
for (var i = 0; i < nums.length; i++){
if (!set.has(i))... | true |
0e21e9355d49a48778cdb732e43206dd4955732d | JavaScript | joaomarcus13/webmoderno | /node/entradaESaida.js | UTF-8 | 548 | 3.484375 | 3 | [] | no_license | //pegar os argumentos
const anonimo = process.argv.indexOf('a') !== -1
const arg = process.argv
console.log(arg[2])
if ( anonimo ){
//saida padrao
process.stdout.write("fala anonimo\n")
//matar processo
process.exit()
}else{
process.stdout.write("Escreva seu nome")
process.stdin.on('data',data... | true |
06bf58f9279c6fb5585b60f7627d9ba55fc48249 | JavaScript | NabilAFK/chatnabil | /main.js | UTF-8 | 9,359 | 2.515625 | 3 | [] | no_license | $(function() {
//OPTIONS
var FADE_TIME = 175;
var TYPING_TIMER_LENGTH = 2500;
var COLORS = [
'#e21400', '#91580f', '#f8a700', '#f78b00',
'#58dc00', '#287b00', '#663300', '#4ae8c4',
'#3b88eb', '#3824aa', '#a700ff', '#d300e7'
];
var $window = $(window);
var $usernameIn... | true |
7d1b6f876dd35c4e60d894b51550cfc1ccde5149 | JavaScript | jwala5/Lab-javascript-higher-order-functions | /slice.js | UTF-8 | 2,180 | 4.25 | 4 | [] | no_license | // Function #1: Array Slice
var foods = ["pizza", "burger", "fingerchips", "donuts", "springroll"];
let modifiedfoods = foods.slice(1, 4);
console.log(modifiedfoods);
// Function #2: Array Splice
var newFoods = ["pizza", "burger", "fingerchips", "donuts", "springroll"];
newfoods.splice(2, 0, "icecream", "fi... | true |
54ea64f5e3f4d76a7d5a362fc36c314c06a4b5db | JavaScript | Bateelsaber/assignment_4 | /challenge_1/sketch.js | UTF-8 | 856 | 3.21875 | 3 | [] | no_license | function setup() {
// create a place to draw
createCanvas(640, 360);
noStroke();
noLoop();
}
function draw() {
// clear the background
background(100, 200, 255);
// draw rectangle
fill(50, 200, 90);
rect(0, 210, 640, 350);
// draw flowers
for (var i = 0; i < 40; i++) {
drawTarget(random(10, 630), i * 4 + ... | true |
cc4eb6946b66393efdcab44d7635efd3a7e1e89a | JavaScript | wearereasonablepeople/react-collect | /index.mjs | UTF-8 | 6,503 | 2.71875 | 3 | [
"MIT"
] | permissive | //. # React Collect
//.
//. [](https://travis-ci.com/wearereasonablepeople/react-collect)
//. [](https://greenkeeper.io/)
//.
//. Allow... | true |
280726bb7c84fb6dc4ae9be81316df57ec67eee9 | JavaScript | Shrikanthale/React1 | /src/state/form1.js | UTF-8 | 897 | 2.875 | 3 | [] | no_license | import React from 'react'
class FormA extends React.Component{
constructor(props){
super(props)
this.state = {
username : " ",
id : null
}
}
setdeatails = (event) => {
this.setState({[event.target.name] :event.target.value})
}
setForm = (even... | true |
6f80cc945cb6905df047e9ee373c5bb177c7840a | JavaScript | marypanasenko/192347-keksobooking-20 | /js/card.js | UTF-8 | 3,267 | 2.859375 | 3 | [] | no_license | 'use strict';
(function () {
var cardTemplate = document.querySelector('#card')
.content
.querySelector('.map__card');
cardTemplate.querySelector('.popup__features').innerHTML = '';
var renderCard = function (object) {
var cardElement = cardTemplate.cloneNode(true);
cardElement.querySelector('.p... | true |
09c73f726f0917a8f56e34dfc03bcae7640bce88 | JavaScript | tonykieling/Chatty_App | /chatty_server/server.js | UTF-8 | 1,532 | 2.96875 | 3 | [
"MIT"
] | permissive | const express = require('express');
const SocketServer = require('ws').Server;
// Set the port to 3001
const PORT = 3001;
// Create a new express server
const server = express()
.use(express.static('public'))
.listen(PORT, '0.0.0.0', 'localhost', () => console.log(`Listening on ${ PORT }`));
// --auxiliary func... | true |
24dd157a2b3bd53318c0728e1ed4a445be8e791b | JavaScript | Rakib-CS/Advance-javascript | /double-equal-vs-triple.js | UTF-8 | 256 | 3.796875 | 4 | [] | no_license | const first = 3;
const second = "3";
if (first === second) {
console.log("condition is true");
}
else {
console.log("condition is false");
}
//double equal check only value;
//triple equal check the type and comapare whether it is string or value. | true |
9e0dffe0b063b843f9e53800453917080f7cfff2 | JavaScript | WeaselPeasel/WeaselPeasel.github.io | /projects/OldSite/Proj3/js/index.js | UTF-8 | 4,261 | 2.921875 | 3 | [] | no_license | // index.js
$(document).ready(function(){
//initialize
setup_board();
//set mousedown functions
$(".space").mousedown(function(ev){
if (ev.which == 3){
toggle_mark($(this));
}
});
//---------------------------
$(".bomb").click(function(){
clicked_bomb($(this));
});
//---------------------------
$... | true |
10c537754aeffb7fb533c6b5b8db56be61bd02b2 | JavaScript | lwywuyang/uroad | /asset/js/cityservice.js | UTF-8 | 1,111 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive |
var data = [
{
"name":"name1",
"station":["chongqinggaosu","chongqinggaosu","chongqinggaosu","chongqinggaosu"]
},
{
"name":"name",
"station":"chongqinggaosu2",
}
];
function service(){
var data = [
{
"name":"name1",
"station":["chongqinggaosu","chongqinggaosu","chongqinggaosu","chongqinggaosu"... | true |
760ad6dc4f210c3ef48f8a267c5278c030462a29 | JavaScript | alinaka/javascript | /homework07/homework07-3.js | UTF-8 | 905 | 3.125 | 3 | [] | no_license | ;(function(){
window.myUtils = {
min: function (arr) {
let array = arr.concat();
array.sort(fn);
return array[0];
function fn(num1, num2) {
if (num1 > num2) {
return 1;
} else if (num1 < num2) {
return -1;
} else {
return 0;
}
}
},
max: function... | true |
7f42a094e5e061c17937a97e8c942d7ba01edb33 | JavaScript | minibao/ema-web | /bin/server.js | UTF-8 | 3,700 | 2.875 | 3 | [] | no_license | /**
* Created by B-04 on 2017/7/27.
*/
var controlArr = new Array();//记录所有control端的连接
var showArr = new Array();//记录所有show端的连接
var ws = require('nodejs-websocket');
var server = ws.createServer(function (connection) {
connection.data = null;
connection.type = null;
console.log("new connetion");
consol... | true |
b8a499954c6b91a2a424436ab957734e6d1468d8 | JavaScript | hemantsai17/PigGame | /pig game/script.js | UTF-8 | 2,375 | 3.234375 | 3 | [] | no_license | const player0E1 = document.querySelector('.player--0');
const player1E1 = document.querySelector('.player--1');
const score0E1 = document.querySelector('#score--0');
const score1E1 = document.getElementById('score--1');
const diceE1 = document.querySelector('.dice');
const btnRoll = document.querySelector('.... | true |
e1db404bce836ad7e19bd5617d9ff308772d099f | JavaScript | windldream/leetcode | /twoPointers/isPalindrome.js | UTF-8 | 404 | 3.75 | 4 | [] | no_license | /**
* @param {string} s
* @return {boolean}
*/
var isPalindrome = function (s) {
let l = 0
let r = s.length - 1
const reg = /[A-Za-z0-9]/
while (l < r) {
while (!reg.test(s[l])) {
l++
}
while (!reg.test(s[r])) {
r--
}
if (l > r) return true
if (s[l].toLowerCase() !== s[r].... | true |
ba0437b5ded7918af3dc39781f56037d5274161d | JavaScript | tborghetti/proyectoIntegrador3 | /src/api/RandomUsers.js | UTF-8 | 248 | 2.90625 | 3 | [] | no_license | export async function getData(){
try{
let resultado = await fetch('https://randomuser.me/api/?results=5');
let json = await resultado.json();
return json.resulsts;
}catch(e){
console.log("ERR: " + e);
}
} | true |
59ddfaf964620adf5bdd15953451f6f1b2691639 | JavaScript | lx515318141/163music-demo | /src/js/admin/song-form.js | UTF-8 | 4,192 | 2.65625 | 3 | [] | no_license | {
let view = {
el: ".master > main",
init() {
this.$el = $(this.el);
},
template: `
<form class="form">
<div class="row">
<label>
歌名
</label>
<input name="name" type="text" value="__name__">
</div... | true |
ab57d07f370ec12e83f0992a05bbcd247ffafe40 | JavaScript | TestLeafPages/JavaScriptJuly2020 | /week2Day1/arrow.js | UTF-8 | 648 | 3.390625 | 3 | [] | no_license | //Arrow functions
let foodItems = [
{ name: "Idly", type: "veg", price: 20, when: "Dinner" },
{ name: "dosa", type: "veg", price: 50, when: "Dinner" },
{ name: "chiken Soup", type: "nonVeg", price: 100, when: "Lunch" },
{ name: "Adai", type: "veg", price: 20, when: "Evening" },
{ name: "mutton... | true |
b3040b6daead179dfc2592b3c909318b5c4dd9e1 | JavaScript | dojo-react-workshop/daniel_andrade | /getproducts.js | UTF-8 | 575 | 3.46875 | 3 | [] | no_license | function getProduct(arr){
const afterProds = [];
const beforeProds = [];
let rollingProd = 1;
for(let i = 0; i<arr.length; i+=1){
beforeProds[i] = rollingProd;
rollingProd *= arr[i];
}
rollingProd = 1;
for(let i = arr.length-1; i>=0; i-=1){
afterProds[i] = rol... | true |
bc7ac040e969a98ddc2dcec638165ba83f687148 | JavaScript | CLTPayne/chess-game | /lib/king.js | UTF-8 | 4,045 | 3.125 | 3 | [] | no_license | import { getPosition, cloneBoard } from "./chessboard.js";
import {
getPotentialHorizontalOrVerticalMoves,
getOpponentMoves,
getPotentialDiagonalMoves
} from "./moveHelpers.js";
export const kingValidMoves = (currentBoard, currentPosition) => {
const { row, col } = currentPosition;
const playerColor = getPosition... | true |
2aa6a851bc081111ecb1c9cd527f269cf07f86b4 | JavaScript | AdityaGawde97/FundooNotesReactNative | /src/Firebase/AuthServices.js | UTF-8 | 2,688 | 2.53125 | 3 | [] | no_license | import firebase from './Firebase';
import AsyncStorage from '@react-native-community/async-storage';
export function emailExistance(email, ifCallback, elseCallback) {
firebase.auth().fetchSignInMethodsForEmail(email)
.then(function (signInMethods) {
if (signInMethods.indexOf(
fi... | true |
290bd14c04801d37b7b86fb1ccd135989debe774 | JavaScript | steven-daniell-jackson/resume-js | /js/main.js | UTF-8 | 2,788 | 3.5 | 4 | [] | no_license | // Skills Matrix obj
var skillsMatrix = {
heading: "Test",
skill: ['HTML','HTML2','HTML3','HTML4','HTML5','HTML6','','','','','','','','','','','','','',''],
proficiency: ['4','5','6','2','1','2','','','','','','','','','','','','','','']
};
// Steven_jackson_obj
var steven_jackson_obj = function(first... | true |
1994c07691d433f29a3637a8aed5894d2a2bc2ad | JavaScript | msusergithub/JSAV | /test/unit/utils.js | UTF-8 | 1,690 | 2.8125 | 3 | [
"MIT"
] | permissive | (function() {
module("jsav.utils.rand", { });
test("seeding random", function() {
var r = JSAV.utils.rand,
seed = new Date().getTime();
r.seedrandom(seed);
var rand1 = r.random(),
rand2 = r.random();
r.seedrandom(seed);
equal(r.random(), rand1);
equal(r.random(), rand2);
... | true |
2099fa3d65e48fa5ce2bf078771f152e5634c64c | JavaScript | Immodal/simulating-an-epidemic | /src/sim/simulation.js | UTF-8 | 4,856 | 2.671875 | 3 | [
"MIT"
] | permissive | class Simulation {
constructor(controls, chart, fullReset=false) {
this.controls = controls
this.chart = chart
this.id = null
this.reset(fullReset)
}
/**
* Reset the simulation
*/
reset(full=false) {
globalUpdateCount = 0
this.lastRUpdate = 0
this.rMax = 0
this.rVal = 0... | true |
2dc526c33f6a131276c1f72a66e46c5c44f5196b | JavaScript | pkellogg/eXD-Design-System | /fx-radiobutton.js | UTF-8 | 1,858 | 2.9375 | 3 | [] | no_license | (function () {
let template = `
<style>
@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,700);
/* THEME CODE */
.container.green {
background-color: #37bc9b;
}
.container.green .day-long {
color: #278b70;
}
.containe... | true |