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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4ec22efbbf3b9d9942e9e1d148104e7637c02e7b | JavaScript | balazstasi/webdev-ora-2 | /React/dice-roll/src/Die.js | UTF-8 | 577 | 2.671875 | 3 | [] | no_license | import React from "react";
import "./Die.css";
export default function Die(props) {
// const getWordByNum = () => {
// if (props.value === 1) return "one";
// if (props.value === 2) return "two";
// if (props.value === 3) return "three";
// if (props.value === 4) return "four";
// if (props.value... | true |
a1ba9c513a2ec71931142fc0f5745eda90ee60bf | JavaScript | AbdulrahmanS1/Week14_Day03_WarmUp-TypeScript | /HomeWork.js | UTF-8 | 986 | 3.609375 | 4 | [] | no_license | var one = ['A', 'E', 'I', 'O', 'U', 'L', 'N', 'S', 'T'];
var two = ['D', 'G'];
var three = ['B', 'C', 'M', 'P'];
var four = ['F', 'H', 'V', 'W', 'Y'];
var five = ['K'];
var six = ['J', 'X'];
var seven = ['Q', 'Z'];
function calculcateString(Sarawiq) {
var count = 0;
Sarawiq.toUpperCase().split('').forEach(funct... | true |
dc8d58db8e7a6d3e791841468db0fd0fe6378c1d | JavaScript | Supra-MS/You-Dont-Know-JS_Quizzes | /server/data/bookQuizData.js | UTF-8 | 145,359 | 3.234375 | 3 | [] | no_license | let quizData = [
{
"_id": 1,
"book_name": "Up & Going",
"chapters": [
{
"chapter_id": 1,
"chapter_name": "Into Programming",
"quizzes": [
{
"answers": [
"1",
"2",
"3",
"4"
],
... | true |
b4ebc6d11a6e96d4c372f379af85057640ade5bc | JavaScript | jdrew1303/magazine | /t/purge.t.js | UTF-8 | 1,357 | 2.640625 | 3 | [
"MIT"
] | permissive | require('proof')(9, prove)
function prove (assert) {
var Cache = require('..')
var cache = new Cache
var magazine = cache.createMagazine()
var cartridge = magazine.hold(1, {})
cartridge.value.number++
cartridge.adjustHeft(1)
cartridge.release()
var cartridge = magazine.hold(2, {})
... | true |
a171c7a6d88e6edb5a8abcc766c9ba62674923ec | JavaScript | grabowskiArtur/javaScriptSzybkiStart | /L2_PodstKoncepcjeJS/L6-PraktycznyProjektI_ES6/js/app.js | UTF-8 | 362 | 2.8125 | 3 | [] | no_license | import $ from "jquery"; //zostalo wczesniej zainstalowane na stale za pomoca konsoli npm install jquery --save-dev
import Person from "./Person.js"; //importujemy to co jest w pliku person dane do export
var jan = new Person("Jan", "Kowalski");
//document.querySelector("h1").innerHTML = jan.sayHello();
$("h1").html(j... | true |
8a365b384f8642c6af7b3b698fdac733d1d0ba0a | JavaScript | AdamPawlinski/Christmas-app | /script.js | UTF-8 | 5,856 | 2.734375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
let drawResultsState = [];
let userTabStart = ['Adam', 'Krzysztof', 'Anna', 'Grzegorz', 'Karolina'];
let userEmail = ['adam.pawlinski@gmail.com', 'adam.pawlinski@gmail.com', 'adam.pawlinski@gmail.com', 'adam.pawlinski@gmail.com', 'adam.pawlinski@gmail.co... | true |
a2c0377bcd52ea8d367aa02aa756010201d52ebb | JavaScript | kellysciandra/onBoard | /client/src/reducers/authReducer.js | UTF-8 | 1,096 | 2.578125 | 3 | [] | no_license | import { SET_CURRENT_EMPLOYEE, SET_CURRENT_ADMIN, EMPLOYEE_LOADING, ADMIN_LOADING, EDIT_EMPLOYEE, GET_EMPLOYEES } from "../actions/types";
const isEmpty = require("is-empty");
const initialState = { isAuthenticated: false, admin: {}, employee: {}, loading: false };
export default function(state = initialState, action... | true |
7b3301b3a710104eaa499f8b089b6da84a946aa3 | JavaScript | thinkful-ei-gecko/Daniel-Leon-object-drills | /drills.js | UTF-8 | 5,415 | 3.5 | 4 | [] | no_license | 'use strict';
/*// Drill #1
let loaf = {
flour: 300,
water: 210,
hydration() {
return this.water / this.flour * 100;
}
};
console.log(loaf.flour);
console.log(loaf.water);
console.log(loaf.hydration());
//Drill #2
const myObj = {
foo : 'bar',
bar : 'foo',
fum : 'fee',
quux : 'quix',
spam : 'd... | true |
379bd9c48e0dd9dfe883565ef56c7fca23c1470d | JavaScript | domenicocubeddu/facebrain-api | /controllers/register.js | UTF-8 | 1,013 | 2.703125 | 3 | [] | no_license |
const handleRegister = (req, res, db, bcrypt) => {
const { email, name, password } = req.body;
if (!email || !name || !password) {
return res.status(400).json('Incorrect form submission')
}
const hash = bcrypt.hashSync(password);
db.transaction(trx => { //.transaction is used when you need to do more than tw... | true |
82c87de363751c13e1a698f9e09495f5e880fa4f | JavaScript | DB-ArenaOfValor/e-market | /js/util.js | UTF-8 | 6,133 | 3.015625 | 3 | [] | no_license | function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return "";
return decodeURIComponent(... | true |
0882ea865b02cbd01f39cff7ef33cc2621114408 | JavaScript | shrutiuppin/courseraAngular | /module3-solution/app.js | UTF-8 | 2,183 | 2.53125 | 3 | [] | no_license | (function () {
angular.module('NarrowItDownApp', [])
.controller('NarrowItDownController', NarrowItDownController)
.service('MenuSearchService', MenuSearchService)
.directive('foundItems', FoundItems)
;
NarrowItDownController.$inject = ['MenuSearchService'];
function NarrowItDow... | true |
1de13160fcbe50b622d1d1e167f0a692677c3ca2 | JavaScript | brendanekane/whiteboarding_solutions | /leet_code/trees/maximum_depth.js | UTF-8 | 412 | 2.96875 | 3 | [] | no_license | const maxDepth = root => {
if (!root) return 0;
let ans = 0,
depth = 0;
const traverse = (node, depth) => {
if (!node) return depth;
const left = traverse(node.left, depth + 1);
const right = traverse(node.right, depth + 1);
const tempMax = Math.max(left, right);
... | true |
19f2525b9046ca63e805fe2d63c165b4eac4a06c | JavaScript | M-Ekrim/codeSignal | /tournaments/higherVersion/higherVersion.js | UTF-8 | 294 | 2.984375 | 3 | [
"MIT"
] | permissive | function higherVersion(ver1, ver2) {
const [a, b] = [ver1, ver2].map(ver => ver.split('.'));
for (let i = 0; i in a; ++i) {
if (+a[i] > +b[i]) {
return true;
} else if (+a[i] < +b[i]) {
return false;
}
}
return false;
}
| true |
ecbfe75a29e9253d924e198c886c096788cb19e5 | JavaScript | yadagiri1125/angular_js_training_yash | /angular js samples/plunk-c9V9qGmNvPqgzWbbpGdz/script.js | UTF-8 | 783 | 2.84375 | 3 | [] | no_license | // Code goes here
var app=angular.module('myApp', []);
app.constant('MOVIE_TITLE', 'The Matrix');
/*app.constant('userService', { user: {
name:'Pavan',
city:'Hyd',
state:'TS'
}
... | true |
de543328c397077e29f6a89c8ddada2c62a328f1 | JavaScript | creatshare/creatshare-training-2016 | /group_2/WebContent3/resource/js/sellerPage.js | UTF-8 | 7,887 | 2.75 | 3 | [] | no_license | //3个jax请求
$(document).ready(function(){
var jsonArray = [{//传递过来的第一个json是用户姓名,若该用户并没有登陆,则返回空串""即可
"userName":"李小华"
},{
"src" : "./resource/pic/logo1.png",
"name" : "蜀香园",
"introduce": "黄焖鸡拥有多年的历史,是中华美食的代表之一。本店现推出新活动,凡是双十一凡是在本店购买黄焖鸡者,买一送一!且只需支付998!",
"address" : "美食广场"
},{
"src" : "... | true |
f8f9e13ff7e9ec73b316ec13fbce462fa060de4a | JavaScript | IsaacCruzLM/TriviaGame | /src/components/Timer.jsx | UTF-8 | 2,009 | 2.578125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import './Timer.css';
import { decreaseTime, stopTime } from '../redux/actions';
const ONE_SECOND = 1000;
const intervals = [];
class Timer extends React.Component {
constructor() {
super();
this.updateTheT... | true |
5ad0aa7b0215fe5062b0a52e1605088646099eb8 | JavaScript | dcbriccetti/web-games | /canvas/how-many-squares/squares.js | UTF-8 | 1,644 | 3.453125 | 3 | [] | no_license | function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function draw() {
const canvas = document.getElementById('board');
const boardLen = canvas.width;
const cellLen = boardLen / 8;
const ctx = canvas.getContext('2d');
let totalSquares = 0;
function drawBoar... | true |
3dbaafdf493ca168add56d7f1aa77cecc4f5f332 | JavaScript | justjs/just | /src/lib/removeEventListener.js | UTF-8 | 975 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Remove multiple events from multiple targets using
* EventTarget#removeEventListener().
*
* @namespace
* @memberof just
* @since 1.0.0-rc.24
* @param {Element|Element[]} targets - The targets of the attached events.
* @param {string|string[]} eventTypes - Name of the attached events, like "click", "focus"... | true |
beddbbfdd0503310ce4749a56e82ddd93dd19b04 | JavaScript | Zachary-paulson/Fitness_Monsters | /public/jsg/game.js | UTF-8 | 3,129 | 3.046875 | 3 | [] | no_license | var game = new Phaser.Game(800,800,Phaser.AUTO);
var height = 800;
var width = 800;
var buttonDispX = 50;
date = new Date();
var tickCounter = 0 ;
var time;
//---------------------------STATES---------------------------------------
var main = {
preload: function(){
},
create: function(){
//round pixels, s... | true |
97b16ec9b31c7a81aefb8b847497f9ad23b330c7 | JavaScript | rudydimacali/algorithms-ds | /section8/fib.js | UTF-8 | 786 | 4.3125 | 4 | [] | no_license | const assert = require('assert');
/* Write a function that takes a number n and returns the nth number
in the Fibonacci sequence.
I: Number
O: N number in the Fibonacci sequence.
C: N/A
E: N/A
*/
const fib = (n) => {
if (n === 1 || n === 2) return 1;
const fibs = [1, 1];
const addFib = () => {
fibs.pu... | true |
8e9ad00bf83550432acb59fb97853864a302d7ee | JavaScript | cormac-finnegan/HORUS | /server/controllers/auth.js | UTF-8 | 1,525 | 2.6875 | 3 | [] | no_license | var authModel = require('../models/auth.js');
module.exports = function (app) {
app.post("/rest/auth/", function (req, res) {
let user = req.body;
let passwordIn = req.body.password;
console.log('User: ' + JSON.stringify(user))
authModel.getPasswordByUsername(user.username, func... | true |
e18c0cf696ff9f30443e244f15d7f735168228a5 | JavaScript | priyaprafful/lab-hello-ironhack | /starter-code/src/App.js | UTF-8 | 495 | 2.59375 | 3 | [] | no_license | import React, {Component} from "react";
import "./App.css";
class App extends Component {
//every component class needs a "render ()" method
//(determines the components content)
render(){
//return the HTML of this component in "render()"
return(
//USe "className" instead of "c... | true |
41c048d26cba3e8f28338c72b153c9c88f4c2dbf | JavaScript | MRchenkuan/getIp | /test.js | UTF-8 | 445 | 2.640625 | 3 | [] | no_license | function getLocalIplist(){
var ips = [];
var os=require('os');
var ntwk = os.networkInterfaces();
for(var k in ntwk){
for (var i=0;i<ntwk[k].length;i++){
var _add = ntwk[k][i].address;
if(_add&&_add.split('.').length==4&&!ntwk[k][i].internal&&ntwk[k][i].family=='IPv4'){
... | true |
52e62460e92f3b9f197602062fff0c70cb7dcc1d | JavaScript | 4epToB/Yagupov-JS | /3 dz/js/idex.js | UTF-8 | 8,501 | 3.8125 | 4 | [] | no_license | /* Заданы два массива
A = [ 12, 4, 3, 10, 1, 20 ]
B = [-3, -7, -100, -33]
необходимо их объединить
в один массив C добавив
массив B в конец(в начало) A. */
let A = [ 12, 4, 3, 10, 1, 20 ]
let B = [-3, -7, -100, -33]
let C=A.concat(B) //let C=B.concat(A)
/* Одномерным массивом задана доска 3 на 3
var area = [ null,... | true |
01d69d459b6c9f79dd7c3d74b81705e328630fd9 | JavaScript | saketverma-03/tshirtShopBackend | /routes/auth.js | UTF-8 | 929 | 2.546875 | 3 | [] | no_license | // #AUTHANTICATIN_ROUTES
const express = require("express");
const { signup, signin ,signout ,isSignedIn} = require("../controllers/auth");
const { body } = require('express-validator')
const route = express.Router();
//signup route
route.post("/signup",
[ //in body email property must be of type ema... | true |
44ef6bf384ba5c77feda85d461a75968d66cf194 | JavaScript | abdullatheef/cookiestore | /core_app/static/js/scripty.js | UTF-8 | 2,577 | 2.796875 | 3 | [] | no_license | $(function(){
//init local storage
storage = $.localStorage;
//retreive data from stoarge if exist
var udata = storage.get(userid);
var user_data = udata && typeof(udata) === 'object' ? udata : JSON.parse(storage.get(userid)) || {};
$('button').each(function(in... | true |
dc443660e187ec02ad171edc1dd37d2d648e484f | JavaScript | hongdeyuan/javascript_fullstack | /WoNiu/react/learnshopcart/src/Cart.jsx | UTF-8 | 1,600 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
export default class Cart extends Component {
constructor(props){
super(props)
this.state = {
goodsList:[],
good: '',
cartList: []
}
this.handleAdd =this.handleAdd.bind(this)
this.handlechange = this.handlechange.bind(this)
this.han... | true |
c91933aef44ad29cb4f875bd1029a8521679e5f8 | JavaScript | remane/chrome-extension-betaseries | /background.js | UTF-8 | 3,617 | 2.625 | 3 | [] | no_license | /**
* Background.js
* Init & auto-update processes
*
* @author Menencia
*
*
*/
var url_api = "http://api.betaseries.com"; // Url API
var site_url = "http://betaseries.com"; // Url site
var key = "6db16a6ffab9"; // Developer key
/**
* Initialise le badge
*
*/
var initBadge = function(){
chrome.b... | true |
b5cedd8010a9319c2004b73881b30b238640d507 | JavaScript | alinepasetti/Project-1 | /P1/scripts/bikeObstacle.js | UTF-8 | 1,667 | 3.125 | 3 | [] | no_license | const imageBike = new Image();
imageBike.src = './images/bike_sprite.png';
class Bikes extends Obstacle {
constructor(game) {
super(game);
this.game = game;
this.height = 112;
this.width = 122.5;
this.positionX = 900; //this.game.context.canvas.width - this.width;
this.positionY;
this.spe... | true |
2b76aa9dea62b5805ce62fb45fb74d4c361e66d2 | JavaScript | phamttthao3004/aviron | /src/user/components/shared/challenge-parameter.js | UTF-8 | 1,671 | 2.703125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import GLOBAL_FUNCTIONS from '../../scripts/apps/global-functions';
export const TYPES = new (function() {
this.NUMBER = 'number';
this.TIME = 'time';
this.MINUTE = 'minute';
})();
const ChallengeParameter = ({ value, title, type }) => {
c... | true |
ba9ffc33b906511e2f796661745483acdb899d53 | JavaScript | callmecavs/headscratch.js | /src/headscratch.js | UTF-8 | 748 | 2.65625 | 3 | [
"MIT"
] | permissive | const headscratch = (func, {
// default options
cache = {},
serialize = JSON.stringify
} = {}) => {
// caches for intermediate calculations
// prevents memory leaks if memoized function is called frequently
let parsed
let hit
let miss
const memoized = (...args) => {
// determine cache key based o... | true |
983f840ccb5f2c9b0851f84c8b300dc11a98436f | JavaScript | MikaelAbehsera/diy-garage-secuirty | /app/Face-Detection/js/mic.js | UTF-8 | 2,147 | 3.15625 | 3 | [] | no_license | let recognizer;
let words;
const wordList = [
"one",
"two",
"three",
];
let modelLoaded = false;
document.addEventListener("DOMContentLoaded", () => {
const wrapperElement = document.getElementById("sp-cmd-wrapper");
for (let word of wordList) {
wrapperElement.innerHTML += `<div class='col-3 col-md-6'><d... | true |
7940833ef0c8dafee0b13ee051afbbb95e68aaef | JavaScript | LPG-Partners/apt-app | /server/index.js | UTF-8 | 293 | 2.53125 | 3 | [
"MIT"
] | permissive | const express = require('express');
const parser = require('body-parser');
let app = express();
app.set('port', 3000);
app.use(parser.json());
app.use(express.static(__dirname + '/../public'));
app.listen(app.get('port'), ()=> {
console.log('connected, listening on port number 3000');
})
| true |
c195ff60ec0011325c06eb8054c4c66bbcb45f5e | JavaScript | hamadshigri/JavaScript-Assignment-1 | /app.js | UTF-8 | 27,369 | 3.734375 | 4 | [] | no_license | // Chapter # 01
// Task No. 1
// Solution:
// alert("Hello, Thankyou for visiting our website");
// Task No. 2
//Solution:
// alert("Error! Please enter a valid password.");
// Task No. 3
//Solution:
// alert("Welcome to JS Land...\nHappy Coding!");
// Task No. 4
//Solution:
// alert("Welcome... | true |
442dbd174260e870194bf35cffd6ab4463d1cfd9 | JavaScript | lam09/threegraph | /js/model/sea.js | UTF-8 | 943 | 2.828125 | 3 | [] | no_license | // Định nghĩa đối tượng Sea
Sea = function(){
// tạo khối hình trụ
// các tham số:
// bán kính mặt trên, bán kính mặt đáy, chiều cao, số lượng phân khúc trên bán kính, số lượng phân khúc theo chiều dọc
var geom = new THREE.CylinderGeometry(600,600,800,40,10);
// xoay trên trục X
... | true |
3ad7b3ccd597c064e40e9795aab2895bbce00c13 | JavaScript | Narasimha-Veera/aug_ui_mrng_21 | /Javascript/37interval.js | UTF-8 | 389 | 2.609375 | 3 | [] | no_license | setInterval(function() {},time);
var myinterval = setInterval(function() {
console.log(Math.random())
}, 3000)
0.09726987593295222
VM130:2 0.009438373182914406
VM130:2 0.39099258118264135
VM130:2 0.6049116834362103
VM130:2 0.48372298715970374
clearInterval(myinterval)
///////
run only once after given amount of... | true |
256de79ea888e28359a77f6acce2a3cd688d8fca | JavaScript | mjmsantos95/tese | /S1.js | UTF-8 | 18,254 | 2.546875 | 3 | [] | no_license |
var http = require('http');
var url = require('url');
var mysql = require('mysql');
var express = require('express');
var server = express();
server.use('/', express.static(__dirname + '/'));
var con = mysql.createConnection({
host: "localhost",
user: "tese", //colocar "tese" ou "root"
password: "581995",
d... | true |
3e282f98f3ec0714caf96e2786f76f4f459fe453 | JavaScript | 2638885943/biao-class | /practice/053-github-search/js/util/helper2.js | UTF-8 | 560 | 3.6875 | 4 | [] | no_license | // 创建一个查找和删除元素的函数
// 传入 从哪删(列表本身) 和 删哪个(需要被删除的元素)
function find_and_delete(list,element){
// 用findIndex遍历list 检查其中的每一条
var index = list.findIndex(function (item){
// 当表单中的元素有一条等于传进来的元素是 将该元素的索引返回
return element == item;
});
// 传入表单中被找到的那个索引的内容list[index] 和 1(表示删除一条) 用splisce方法删除 ... | true |
8846a58bb314e3ede58222bb52b96a87500f9bdc | JavaScript | HandsomeOne/LeetCode | /Algorithms/202.HappyNumber.js | UTF-8 | 375 | 3.453125 | 3 | [] | no_license | /**
* @param {number} n
* @return {boolean}
*/
var isHappy = function(n) {
var a = [n];
while (n !== 1) {
n = n.toString().split('').reduce((s, num) => s + num * num, 0);
if (a.some(isN)) {
return false;
} else {
a.push(n);
}
}
return true;
... | true |
2363573f40048204b1d1d64aeb512eab1b24d277 | JavaScript | cccd-is/canvas-banner-grades | /src/server/CanvasApiClient.js | UTF-8 | 8,546 | 2.640625 | 3 | [] | no_license | 'use strict';
const HttpLinkHeader = require('http-link-header');
const lti_config = require('../../lti.config.json');
const Logger = require('winston');
let Request = require('request-promise');
Logger.level = 'debug';
// Configure request-debug to instrument HTTP traffic
require('request-debug')(Request, function (t... | true |
32254f07228318185f7d9aa1701b2774f05b8031 | JavaScript | haaaru22/js_test | /main.js | UTF-8 | 477 | 3.984375 | 4 | [] | no_license | // number
// string
// boolean
// function add(n1:number, n2:number){
// return n1 + n2;
// }
// const number1= 5;
// const number2 = 1.8;
// const result = add(number1, number2)
// console.log(result);
// const array: number [] = [1,2,3];
// console.log(array);
// let sum = (s1:number, s2:number, s3:boolean) => {
... | true |
19823e28c840e68c4cd48b5e5f59cbca73c8b542 | JavaScript | Mihir-Karbelkar/datagrid | /Solution.js | UTF-8 | 1,453 | 3.375 | 3 | [] | no_license | class Solution {
constructor(a, b, c, d) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
}
// Checks for (a, a+b) recursively
static valueCheckerOne(a, b, c, d) {
if (a == c && b == d) {
return true;
} else if (Math.abs(a) > Math.abs(c) || Math.abs(b) > Math.abs(d)) {
retur... | true |
fc4cf21e258589e9c09500669574a727cf141f7c | JavaScript | cwp10/micronode | /ch03/tcpServer.js | UTF-8 | 483 | 2.8125 | 3 | [] | no_license | var net = require('net') // net모듈 로드
var server = net.createServer((socket) => { // TCP서버 생성
socket.end('hello world') // 접속시 hello world 응답
})
server.on('error', (err) => { // 네트워크 에러 처리
console.log(err)
})
server.listen(9000, () => { // ... | true |
5b81cea9988ed1b002cd83bba827d4f5a246cd46 | JavaScript | rhr3032/Show-Date-Time-byUsing_javaScript | /script.js | UTF-8 | 371 | 3.28125 | 3 | [] | no_license | //[01]-------------------------//
const date = new Date();
const day = date.getDate()
const month = date.getMonth() + 1
const year = date.getFullYear()
console.log(`${day}/${month}/${year}`);
//[02]-------------------------//
console.log(new Date().toJSON().slice(0,10))
//[03]-------------------------//
co... | true |
9181e5e4d732e9e9458ec73a91135b0b7729105b | JavaScript | jurczakn/1903Java-Nick | /Week4/TypeScriptExamples/typing.js | UTF-8 | 487 | 3.296875 | 3 | [] | no_license | // TypeScript - well - strong typing
//allows us to define types of our variales
var myString;
myString = "This is a string";
//myString = 4;
//TS infering the type
var yetAnotherString = 'This is another string';
//yetAnotherString = 4;
//type any, don't do
var maybeAString;
maybeAString = "a string for now";
maybeAS... | true |
929b9859da5bb1bec05cefea3b15dcbbb7e54456 | JavaScript | enikakis/Topsis | /ui/main.js | UTF-8 | 9,473 | 3.328125 | 3 | [] | no_license | //Ui state
class State {
constractor(choicesNames, weightNumber, critiriaNames, matrix, results, numberOfCritiria, choicesNumber, max, weight) {
this.choicesNames = choicesNames;
this.weightNumber = weightNumber;
this.critiriaNames = critiriaNames;
this.matrix = matrix;
this.result = results;
... | true |
d612b409915ff7e0795634e1eeeb14682c4e7b35 | JavaScript | Hyakon/algojs | /problem1.js | UTF-8 | 336 | 3.59375 | 4 | [] | no_license | const data = [10, 15, 3, 7];
const k = 17;
// const data = [1, 8, 10, 21];
// const k = 19;
const containsSum = (data, k) => {
for (let i = 0; i < data.length - 1; i++) {
for (let j = i + 1; j < data.length; j++) {
if (data[i] + data[j] === k) return true;
}
}
return false;
};
console.log(contain... | true |
98810003917cec217c2d81da78d3ba05fa151453 | JavaScript | irevived1/flatiron-rails-assessment | /app/assets/javascripts/main.js | UTF-8 | 1,580 | 2.609375 | 3 | [] | no_license | //smooth scrolling
function jump(h){
$('html, body').animate({
scrollTop: $('#'+h).offset().top
}, 750);
}
function capitalizeEachWord(str) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
function viewnote(data) {
return '<div i... | true |
cffa5eb1dc98da51fe5b9c4b12eba3c11e7b77c6 | JavaScript | Africa4Days/YouTube-Sub-Counter-Chrome-Extension | /main.js | UTF-8 | 382 | 2.90625 | 3 | [] | no_license | function getYouTubeSubs() {
let url =
"https://www.googleapis.com/youtube/v3/channels?part=statistics&id=UCMWAPrl4Jif3aGmgrzHtulg&key=AIzaSyCQrDuIj5h-7ohInAoeVhGceSxN2s8DmyU";
fetch(url)
.then(res => res.json())
.then(res => {
console.log(res);
let data = res.items[0].statistics.subscriberC... | true |
dda36179fb795a409866825b844caf20fa7855d2 | JavaScript | kamilbalti/new-todo | /Reducer.js | UTF-8 | 1,634 | 2.703125 | 3 | [] | no_license | import { PUSH_DATA, SET_CHECK_EDIT, SET_DEL, SET_EDIT, SET_INPUTVAL, SET_RESULT, SET_UPDATE } from "./ActionType"
export const initialState = ({
inputVal: "",
result: [],
checkEdit: false,
})
export default function Reducer (state = initialState, action) {
switch(action.type){
case SET_CHE... | true |
86745e470723719b439806b4ea36f38b43219e79 | JavaScript | Shaww/partitions | /src/partitioning.js | UTF-8 | 12,336 | 3.546875 | 4 | [] | no_license | function factorial (n) {
// factorial of 0 is 1
let fact = 1
while (n > 0) {
fact = fact * n
n--
}
return fact
}
/*
* Calculates the number of permutations of k-subsets of n sample space
*
* runs is an array. The value at each index representing the number of
* times an item in the event sampl... | true |
c7584fd2849339ab089c5cff6cedf560f0698912 | JavaScript | tai1235/pizza-delivery-api | /lib/data.js | UTF-8 | 3,382 | 2.78125 | 3 | [] | no_license | // Dependencies
const fs = require('fs');
const path = require('path');
const helpers = require('./helpers');
// Container for the module
const lib = {};
lib.baseDir = path.join(__dirname, "../.data/");
// Write data to a file
lib.create = (dir, file, data, callback) => {
// Open the file to write to
fs.open... | true |
beffc9e7c7fa5f8a0be2036ad9301c8775d35ee3 | JavaScript | lobosan/akkaserverless-ecommerce-javascript | /users/test/users.test.js | UTF-8 | 3,931 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import { MockEventSourcedEntity } from './testkit.js';
import { expect } from 'chai';
import users from '../users.js';
describe('Test Users', () => {
const entityId = '1';
const newUser = { 'id': entityId, 'name': 'retgits', 'emailAddress': 'retgits@example.com'}
describe('Commands', () => {
it('S... | true |
99150dc548c7f2286aa5df8f7516c531ec985b00 | JavaScript | im5K/algorithm | /leetcode for offer/q15 offer13 机器人运动/q15.js | UTF-8 | 1,196 | 3.125 | 3 | [] | no_license | /**
* @param {number} m
* @param {number} n
* @param {number} k
* @return {number}
*/
var movingCount = function(m, n, k) {
//各位数字之和
getNum = function(num){
let sum = 0
while(num){
it = num%10
sum += it
num = (num-it)/10
}
return sum
... | true |
c76e1a34cd1412b79e02cd8916e4cc2ed2b2b62e | JavaScript | joebegley15/codewars_js | /hashtag_generator/main.js | UTF-8 | 287 | 3.09375 | 3 | [] | no_license | function generateHashtag(str) {
const strArr = str.match(/[0-9A-Z]+/gi);
if (!strArr || strArr.join("").length >= 140) return false;
const capitalize = word => {
return word[0].toUpperCase() + word.slice(1);
};
return `#${strArr.map(word => capitalize(word)).join("")}`;
}
| true |
ebf82ebe55db9699b673792b2d38ba15288042fd | JavaScript | RafaelCes/trybe-exercises | /exercises/introdução/bloco-4/4.1-JavaScript-primeiros-passos/triangle.js | UTF-8 | 188 | 3.1875 | 3 | [] | no_license | let a = 60;
let b = 60;
let c = 50;
if(a <= 0 || b <= 0 || c <=0 ){
console.log("angulos invalidos");
}
else if (a+b+c == 180){
console.log(true);
}
else{
console.log(false);
} | true |
d255b76c7aaa7948db7c968020e3a176573e72c8 | JavaScript | Inviz/sandbox | /source/Value.js | UTF-8 | 2,297 | 3.34375 | 3 | [] | no_license | //
/*
Function to pack a dictionary item, value and a reference
into a single 64bit number. It means 16 digits we can
use to store data. Data format is the following:
- 4 first digits for type (kind of effect or entity)
- 3 for integer 0...999 (power of effect)
- 1 byte for reference type (reference, p... | true |
f2855ea31fedbff26df0d0a09415608912cefc9d | JavaScript | ldarren/pico-canvas-game2d | /piGeoData.js | UTF-8 | 5,153 | 2.625 | 3 | [
"MIT"
] | permissive | var
ACCURACY = 15,
watchId,
geohashes,
optionHi = {maximumAge:1000, timeout:30000, enableHighAccuracy:false},
optionLo = {maximumAge:1000, timeout:30000, enableHighAccuracy:false};
// latlong to binary
function reduce(input, output){
var center = (input[1] + input[2]) * 0.5;
if (input[0] > center){
... | true |
72001d0a060739210be9744b36e12adb8bc0b7fe | JavaScript | almibiakmal/challengeNewProgrammingLanguage | /javascript/challenge_6.js | UTF-8 | 1,661 | 3.625 | 4 | [] | no_license | const readlineSync = require('readline-sync')
console.log("====================================\nWelcome to Sorting Program\n====================================\n");
let angkas = [];
let jumlahGerbong = readlineSync.questionInt("Jumlah gerbong : ");
while(jumlahGerbong > 0){
let temp = readlineSync.questionInt(... | true |
faaf0d991301921fe6c3a8d4fd31d15d67311f44 | JavaScript | hunterfoulk/MovieDB | /src/components/Search.js | UTF-8 | 809 | 2.546875 | 3 | [] | no_license | import React, { useState } from "react";
import "./Search.css";
const Search = ({ search }) => {
const [searchValue, setSearchValue] = useState("");
const handleSearchValue = e => {
setSearchValue(e.target.value);
};
const callSearchValue = e => {
e.preventDefault();
search(searchValue);
setSe... | true |
d12c59f16046baa6cb76b4c6441d0872a1256df4 | JavaScript | ajoyM/Problem-Solving-HackerRank | /includes/JavaScript/noOf-differentCharecters.js | UTF-8 | 212 | 3.25 | 3 | [] | no_license | var s='aabaacddaahag';
var a = new Array(26).fill(0);
s.split('').forEach((e, i) => {
a[s.charCodeAt(i)-97]++;
})
a.forEach((d, i) => {
if(d){
console.log(String.fromCharCode(i+97) +" is " + d);
}
})
| true |
f20c004081d69f560a9ccc60b3384fe3b49acff6 | JavaScript | mabay919/COVID-dashboard | /src/death_health_block.js | UTF-8 | 2,282 | 2.84375 | 3 | [] | no_license | import { getTotalDeaths, getTotalRecovered } from './data';
import { countryArr } from './country-name-data';
export function deathBlock() {
const wrapper = document.querySelector('.death_health_wrapper');
const death = document.createElement('div');
const deathInnerBlock = document.createElement('div');
const... | true |
1cabc89df21e8259f8fd8bf5c859afdc046c5fca | JavaScript | dastardlylemon/trabant | /trabant.js | UTF-8 | 4,660 | 2.625 | 3 | [] | no_license | var util = require('util');
var fs = require('fs');
var readline = require('readline');
var request = require('request');
var table = require('easy-table');
var cheerio = require('cheerio');
var CONST_REG_URL = 'http://www.registrar.ucla.edu/schedule/schedulehome.aspx';
var CONST_SUBJ_SRCH_URL = 'http://www.registrar.... | true |
92097898287b7c32d7dbcacf68aa2e4cfed13fda | JavaScript | mandystar018/Programming-Language-Suggester | /js/scripts.js | UTF-8 | 1,266 | 3.125 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("form#form").submit(function(event) {
event.preventDefault();
const userName = $("#person").val();
const userInput1 = parseInt($("input:radio[name=question1]:checked").val());
const userInput2 = parseInt($("input:radio[name=question2]:checked").val());
const userInp... | true |
e9f531318e7f8c8c525de3d163c9f9e3e45629db | JavaScript | Gaffari02/hyf-javascriptintro1 | /Week2/morejs12-14.js | UTF-8 | 272 | 2.921875 | 3 | [] | no_license | /12
var myObject = {};
//13
myObject = {
lesson1: "Philip",
lesson2: "Hardit",
lesson3: ["Unmesh", "Bonan"],
lesson4: ["Mauro", "Daan"]
};
console.log(myObject);
//14
myObject.languages = ["1-html/css", "2-cli", "3-git", "4-javascript"];
console.log(myObject); | true |
121485a9435605613d2d137c8eef037b9e9f721c | JavaScript | ikramikram91/Front-LaBoutique | /script.js | UTF-8 | 2,420 | 3.453125 | 3 | [] | no_license | const stars = document.querySelectorAll(".fa-star");
const rating = document.querySelector('.rating')
init();
function init(){
stars.forEach(star => {
star.addEventListener("click", saveRating)
star.addEventListener("mouseover", addCss);
star.addEventListene... | true |
7a630bcc7637e66d82b5730cb86a284d4a86d6b7 | JavaScript | Yarema91/React | /practice/TodoApp/src/App.jsx | UTF-8 | 1,339 | 2.640625 | 3 | [] | no_license | import React from "react"
import TodoItems from './TodoItems.jsx'
import todosData from './todosData'
// function App() {
// const todoComponents = todosData.map(item => {
// return(
// <TodoItems key={item.id} item={item}/>
// )
// })
// return (
// <div className="todo... | true |
3ed829c2e1f47fa7a5c02f7b72bf672828a4bdda | JavaScript | ptannos/grace-shopper | /client/store/order.js | UTF-8 | 1,375 | 2.546875 | 3 | [
"MIT"
] | permissive | import axios from "axios";
const TOKEN = "token";
// action
const CREATE_ORDER = "CREATE_ORDER";
const FETCH_ORDERS = "FETCH_ORDERS";
// action creator
const createOrder = (order) => ({
type: CREATE_ORDER,
order,
});
const fetchOrders = (orders) => ({
type: FETCH_ORDERS,
orders,
});
// thunk
export const _... | true |
56d7e94c03c3daa76dc8c3a9685aa6dea9b954a5 | JavaScript | sebas095/react-testing-practice | /src/utils/pokemon-utils.js | UTF-8 | 360 | 2.578125 | 3 | [] | no_license | export const sanitizePokemonId = (pokemonId) => {
let sanitizedId = pokemonId;
if (pokemonId < 10) sanitizedId = `00${pokemonId}`;
else if (pokemonId < 100) sanitizedId = `0${pokemonId}`;
return sanitizedId;
};
export const getPokemonImage = (pokemonId) => {
return `https://assets.pokemon.com/assets/cms2/i... | true |
5ee99736d480a07d9d547e9d6223897e43094787 | JavaScript | monisriz/DC-Exercises | /WK06/Tue/JS Closure/counter3.js | UTF-8 | 550 | 4.25 | 4 | [] | no_license | //Counter 3
// Allow the counter to either increment 1 or decrement by 1 by calling the
// increment and decrement methods, respectively. Note: now the counter needs to
// return an object rather than a function.
function mainCounter (x) {
var count = x;
function increment () {
count+=1;
return count;
}... | true |
0d378356dc6f8110fd3fbdc561bc3a085f311626 | JavaScript | aallalajr/React-Redux-Starter | /src/api/mockMemberApi.js | UTF-8 | 2,274 | 3.453125 | 3 | [] | no_license | import delay from './delay';
// This file mocks a web API by working with the hard-coded data below.
// It uses setTimeout to simulate the delay of an AJAX call.
// All calls return promises.
const members = [
{
id: 'john-smith',
firstName: 'John',
lastName: 'Smith'
},
{
id: 'john-doe... | true |
c063c19ec32177495861ce8a782b2016f886db5a | JavaScript | Neno-Chen/RNG | /src/js/dateFormat.js | UTF-8 | 2,298 | 3.3125 | 3 | [] | no_license | /*
* @Author: Marte
* @Date: 2017-11-03 19:42:45
* @Last Modified by: Marte
* @Last Modified time: 2017-11-03 21:05:04
*/
//格式化时间,以下形式输出
//YYYY-MM-DD ,YY-MM-DD , YY-M-D hh:mm:ss
if(!Date.prototype.formate){
//扩展Date.prototype的内置方法
Date.prototype.format = function(fmt){
//预订字符对应的时间,使用对象的方式储存相应月,日,时... | true |
ec5f2d5469e81490ee60e5002a018af649990738 | JavaScript | jstrutz/mbasic | /test/parser_test.js | UTF-8 | 1,375 | 2.734375 | 3 | [] | no_license | var assert = require('chai').assert;
var PEG = require('pegjs');
var fs = require('fs');
var BasicInterpreter = require('../src');
describe('BasicJS', function() {
// var parser;
var vm;
beforeEach(function() {
// var grammar = fs.readFileSync('src/grammar.pegjs', 'utf-8');
// parser = PEG.buildParser(g... | true |
7ee4da29d4e5804c6c7542341935578cb7f0676e | JavaScript | fullStackDevs/Angular_Project_1 | /calculator/calculatorApp.js | UTF-8 | 843 | 3.203125 | 3 | [] | no_license |
var app = angular.module("calculatorApp", []);
app.controller("CalculatorController", CalculatorController);
function CalculatorController() {
var ctrl = this;
ctrl.result = 0;
ctrl.operator = '+';
ctrl.calculateResult = function () {
var val_1 = parseFloat(ctrl.param_1);
var val_2 ... | true |
72ce23311ca302f6773cddb14f6c088bc6985236 | JavaScript | GiovanniASC21/ProjectRedLotus | /script.js | UTF-8 | 3,146 | 3.234375 | 3 | [] | no_license | let state = document.querySelector("#userState")
let submitButton = document.querySelector("#submitButton")
// function myMap(){
// let location = zipcode.value;
// let map = new google.maps.Map(document.getElementById("map"),{
// zoom: 4,
// center: location
// });
// }
function getCoordinates(locatio... | true |
88d04444f17c9619427a305cb141b99ed4b4d694 | JavaScript | arielBravoEc/Eiteck-prueba-frontend | /src/actions/characters_actions.js | UTF-8 | 1,878 | 2.984375 | 3 | [] | no_license | /*
Acciones:
- Las acciones se conectan a la Api realizan el dispatch al reducer
- Los componentes o pantallas usan estas acciones para actualizar las peticiones y estados
*/
import {
CHARACTER_DETAILS,
CHARACTER_FETCH_PAGE,
CHARACTER_FETCH_PAGE_ERROR,
CHARACTER_SEARCH_ERROR,
CHARACTER_SEARCH,
} from "../co... | true |
c912146f1b3425d0124c5f8766a55071bb897828 | JavaScript | Shaktyka/4660-barbershop | /js/cards-generation.js | UTF-8 | 5,801 | 2.578125 | 3 | [] | no_license | // const Categories = {
// care: `Средства для ухода`,
// shavings: `Бритвенные принадлежности`,
// accessories: `Аксессуары`
// };
let arr_EN = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
// Группы
const groups = [
`care`... | true |
e3d787a9601088a938f077506af481ceae03d11d | JavaScript | SpencerB3/launch_school | /JS101_programming_foundations/small_problems/06_easy_6/ex_04.js | UTF-8 | 660 | 4.9375 | 5 | [] | no_license | // Write a function that takes a non - empty string argument, and returns the middle character(s) of the string.If the string has an odd length, you should return exactly one character.If the string has an even length, you should return exactly two characters.
function centerOf(string) {
let middle = Math.floor(stri... | true |
8ea8582b5d3f071d76a1c76800a9dc22c7a44970 | JavaScript | Avishek-kr/1-Texting | /src/components/TextForm.js | UTF-8 | 1,653 | 3.171875 | 3 | [] | no_license | import React, {useState} from 'react'
function TextForm(props) {
const [text, setText] = useState("")
const UpperCase=()=>{
let newText= text.toUpperCase()
setText(newText)
props.showAlert("Changed to Upper Case 👍", "success")
}
const LowerCase=()=>{
let newText= text.... | true |
63c5edbcc2eb5f06cd74a90456410749c04ff047 | JavaScript | Nandini2007/newtons-craddle | /Chain.js | UTF-8 | 2,564 | 2.875 | 3 | [] | no_license | /*class Rope{
constructor(body1,body2,offsetX,offsetY){
this.offsetX = offsetX
this.offsetY = offsetY
var opts ={
bodyA: body1,
bodyB: body2,
pointB : {x:this.offsetX,y :this.offsetY}
}
this.rope = Constraint.create(opts);
... | true |
401aa50a62600bd06156a015327d4f3f2f394d30 | JavaScript | LibrifyOrg/librify-backend | /src/net/games/get.js | UTF-8 | 1,546 | 2.734375 | 3 | [] | no_license | const semver = require("semver");
module.exports = class GamesGetServer {
constructor(app) {
this.app = app;
}
initialize() {
this.app.server.addRoute({path: "/games/get", method: "POST", handle: this.handle.bind(this)});
}
async handle(req, res) {
this.app.logger.timing("GamesGetServer.handle");
let ... | true |
ce02e27ad3d5be300705fef85bc6416b0e52ae66 | JavaScript | YehorLebed/Stage1-node-rest-api | /middleware/authMiddleware.js | UTF-8 | 357 | 2.671875 | 3 | [] | no_license | module.exports.checkToken = (req, res, next) => {
const token = req.headers['x-token'];
if (token !== process.env.TOKEN) {
return res.status(401).json({ message: 'Please authorize' })
}
next();
}
module.exports.giveToken = (req, res, next) => {
const token = process.env.TOKEN;
res.setHe... | true |
3baee5bbcf7f72242aad29e03cca1480c245b3de | JavaScript | Himanshu0499/YelpCamp | /seeds/index.js | UTF-8 | 1,953 | 2.78125 | 3 | [] | no_license |
const mongoose = require('mongoose');
const campgrounds = require('../models/campgrounds');
const cities = require('./cities');
const {descriptors, places, images} = require('./seedHelpers')
mongoose.connect('mongodb://localhost:27017/yelp-camp', {
useNewUrlParser: true,
useUnifiedTopology: true,
useCr... | true |
d163491d1b633ddc740d17fb32df9da55ecc1eaf | JavaScript | ravigajera/tarzango_2 | /themes/tarzango/js/javascript.js | UTF-8 | 2,875 | 3.296875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive |
$(document).ready(function() {
// Some Variables
var noBoxes = $('#holder .box');
var randNumber, prev;
var i = 0;
//Run a while loop to go through all the boxes
while(i < noBoxes.length) {
// ensure the random number is different every time
do {
randNumber = Math.floor(Math.random() * (6 ... | true |
7ab6c79d185bfd04b7beee40029fdd9add1d7021 | JavaScript | adbono/Documentacion | /CursoJS/js/09-ventanas.js | UTF-8 | 256 | 2.859375 | 3 | [] | no_license | 'use strict'
/*** Alerta ***/
alert("ALERTA!");
/*** Confirmacion ***/
var result = confirm("Esta seguro de querer continuar?")
console.log(result)
/*** Ingreso de datos ***/
result = prompt("Cual es tu edad?", "18")
console.log(result) | true |
6fee21607c03ec1443b5217694a0ee00fd39d02c | JavaScript | corymspears/bluebadgeclient | /src/auth/signup.js | UTF-8 | 2,120 | 2.515625 | 3 | [] | no_license | import React, {useState} from 'react';
import {Form, FormGroup, Label, Input, Button } from 'reactstrap'; //1
import APIURL from '../helpers/environment';
import '../App.css'
import { Link } from 'react-router-dom';
const Signup = (props) => {
const [email, setemail] = useState(''); //1
const [fName, setfName] ... | true |
708ede2e0af3df19d390e2d0243aec74e11d6c28 | JavaScript | d-vu/programming-exercises | /fastHashTable.js | UTF-8 | 676 | 2.984375 | 3 | [] | no_license | class fastHashTable {
constructor() {
this.hashTable = {};
this.keys = [];
this.length = 0;
}
insert(key, value) {
let index = this.length;
this.hashTable[key] = [value, index];
this.length++;
this.keys.push(key);
}
delete(key) {
let in... | true |
4c02159e6015d2810081025f298a17e3b7c14222 | JavaScript | domnguyen87/PersonalProject | /src/components/Home.js | UTF-8 | 1,312 | 2.515625 | 3 | [] | no_license | import React from "react";
import UserService from '../services/UserAccountService'
import {Redirect} from 'react-router-dom'
class Home extends React.Component {
constructor(props) {
super(props)
this.state = {
username: "",
userId: "",
isLoggedIn: false
}
UserService.getCurrentUs... | true |
8578cea002149f6e1e2024e9048aa3f243e93ad5 | JavaScript | Atuitjr/lyrics | /src/components/Form.jsx | UTF-8 | 3,139 | 2.53125 | 3 | [] | no_license | import { useState } from 'react';
import Error from './Error';
const Form = ({ setLyricsSearch }) => {
const [search, setSearch] = useState({ artist: '', song: '' });
const [error, setError] = useState(false);
const { artist, song } = search;
const changeHandle = (e) => {
setSearch({ ...sear... | true |
5a84145d801a358087afe986dae554b1b795511b | JavaScript | louiseeriksson/project-movies | /code/src/MovieDetails.js | UTF-8 | 1,515 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'
import { Link } from 'react-router-dom'
export const MovieDetails = () => {
const { movieId } = useParams()
const [movie, setMovie] = useState(undefined)
useEffect(() => {
fetch(`https://api.themoviedb.org/3/movi... | true |
ddb60844e1c43d0c8cf3b9a1035396d8e079e40c | JavaScript | Pleisterman/mbAdmin | /public/modules/common/js/jsProject/functions/xorStringFunction.js | UTF-8 | 3,473 | 3.015625 | 3 | [] | no_license | /*
* Project: jsProject
*
* File: /js/jsProject/functions/xorStringFunction.js
*
* Last revision: 02-01-2017
*
* Purpose:
* this module xor's 2 strings
*
* Author: Pleisterman
* Web: www.pleisterman.nl
* Mail: info@pleisterman.nl
* GitHub: Pleisterman
*
* Copyright (C) 2016 P... | true |
0f7909cf43cb51e7302f560319efb198bc798022 | JavaScript | smile168/JsLearning | /src/js-2/precompile.js | UTF-8 | 196 | 3.125 | 3 | [] | no_license | // 1.review hosting
// 1.1 function declaration moved up
test();
function test() {
console.log(1);
};
// 1.2 var declaration moved up
// but assignment not moved up
console.log(a);
a = 10; | true |
6ebca19b3614aa0fcc598b3b9d4089a61ae149b7 | JavaScript | sjfox26/weather-app-react | /src/components/CurrentWeatherBox/CurrentWeatherBox.js | UTF-8 | 972 | 2.515625 | 3 | [] | no_license | import React from 'react';
import classes from './CurrentWeatherBox.css';
import SearchButton from '../../components/SearchButton/SearchButton';
const convertTemp = (tempToConvert) => {
return (9/5 * (tempToConvert - 273) + 32).toFixed(1);
}
const CurrentWeatherBox = (props) => {
return (
<div>
<p>The... | true |
8f678d1079c102e3137a18018a21f8980606fb1a | JavaScript | occmundial/occ-atomic | /lib/ButtonAlign/ButtonAlign.js | UTF-8 | 1,158 | 2.734375 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
/**
* The Input component and the Button component have different sizes. That's why they wouldn't be aligned with each other when putting them side to side. Use this component to align the Button correctly with the Input.
* To align it correctly, use the s... | true |
028616cd9149d3b09e46ef31d7182db07b3d4af9 | JavaScript | towersxu/js-pattern | /C-1/univSingleton.js | UTF-8 | 445 | 2.9375 | 3 | [] | no_license | /**
* Created by jhy on 16/5/27.
*/
var getSingle = function (fn) {
var result;
return function(){
return result || (result = fn.apply(this,arguments))
}
}
var createDiv = function(){
var div = document.createElement('div');
div.textContent = this.name;
div.style.display = 'none';
document.body.app... | true |
03241b3f0614bb9b26a3a2200a7b42d5722f0771 | JavaScript | phillipluther/html-rpg-demo | /src/engine/create-scene.js | UTF-8 | 2,563 | 2.640625 | 3 | [
"MIT"
] | permissive | import {debounce} from './utils';
const DEFAULT_PROPS = {
aspectX: 16,
aspectY: 10,
clearColor: 'rgba(0, 0, 0, 1)',
root: document.body
};
export default (userProps = {}) => {
const props = Object.assign({
canvas: document.createElement('canvas')
}, DEFAULT_PROPS, userProps... | true |
5fae56a86e3bf59367ddd88396380d3a32ce52e7 | JavaScript | uareurapid/trackme_mobile | /www/js/DevicesModule.js | UTF-8 | 5,901 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Created by paulocristo on 09/05/16.
*/
angular.module('trackme.DevicesController', ['ionic','ionic-material','PreferencesService','DevicesService'])
.controller('DevicesController',function ($scope, $state, $http, $ionicPopover,Preferences,DevicesService) {
//clean the form fields
$scope.formData... | true |
02e57075760560befea5ea7e9054677ca479f8d4 | JavaScript | mmhinz/dreaminvest-lwc | /js-apps/trader-desktop/modules/feed-mock.js | UTF-8 | 2,105 | 3.15625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | var subscribers = [];
var stocks = [
{symbol: "GM", open: 38.87},
{symbol: "GE", open: 25.40},
{symbol: "MCD", open: 97.05},
{symbol: "UAL", open: 69.45},
{symbol: "WMT", open: 83.24},
{symbol: "AAL", open: 55.76},
{symbol: "LLY", open: 76.12},
{symbol: "JPM", open: 61.75},
{symbol:... | true |
37dd6e0dafc0661242db51664275200ac875b5c0 | JavaScript | TAGraves/adventofcode2016 | /day4.js | UTF-8 | 1,963 | 3.5 | 4 | [] | no_license | const ROOMLIST = ``;
function getRooms(roomList) {
return roomList.split('\n').map((room) => {
const split = room.split(/\[|\]/g);
const sector = room.match(/\-(\d+)\[/);
return {
name: split[0].replace(/\d/g, ''),
checksum: split[1],
sector: parseInt(sec... | true |
06f8e39bb04c8f1e455c2cdb43d2c329de587c0d | JavaScript | namexiha/namexiha.github.io | /js/http.js | UTF-8 | 2,520 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive |
let baseUrl = "https://mawD1nNf.api.lncld.net";
var sessionToken = null;
function loginRequest(account,password) {
let loginMap = {
"username":account,
"password":password,
};
let heads = {
"X-LC-Id":"mawD1nNfec9ssngKlMKUl32F-gzGzoHsz",
"X-LC-Key":"zjEY8jWIn5zXUEQigCSShal... | true |