hey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isObject = (o) => (o instanceof Object && !Array.isArray(o)); | |
const areObjects = (...o) => !o.some(oo => !isObject(oo)); | |
const areArrays = (...a) => !a.some(aa => !Array.isArray(aa)); | |
function typeCheck(source, mock) { | |
if (areArrays(source, mock)) { | |
if (!source.length) return true; | |
return !mock.some((v, i) => !typeCheck(source[i], v)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Provide string of type 12.333.333-k|123456789|12345678-9|12.345678-9 | |
* ??? | |
* profit. | |
* @param {string} _rut | |
* @returns {boolean} | |
*/ | |
function isValidRUT(_rut) { | |
const isRegexValid = _rut.match(/^\d{1,2}\.?\d{3}\.?\d{3}\-?[0-9kK]$/ig); | |
if (!isRegexValid) return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Replaces value inside {value} with a spaced representation of the masked array | |
* and then replaces the Nth caret with the provided key, returning the new masked | |
* value. | |
* @param {(RegExp | string)[]} mask | |
* @param {string} key | |
* @param {number} caretPos | |
* @param {string} value | |
* @returns <{str: string, pos: number}> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
import {DiceTransformations} from './roll-transforms.js'; | |
const Dice = new require('roll')(); | |
const BASE_HEALTH = 10; | |
const BASE_SKILL_MODIFIER = 1.25; | |
const MINIMUM_SKILL_MODIFIER = 0.1; | |
const BASE_CRITICAL_FAILURE = -3; | |
const CRITICAL_DICES = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Mosh Mage on 10/14/2016. | |
* quick and dirty handshaker between twitter and an application | |
* this could be loaded by modules, but time if of the essence | |
* todo: module loader, add express, make a decent api | |
*/ | |
"use strict"; | |
var http = require('http'); | |
var request = require('request'); | |
var url = require('url'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Agenda { | |
constructor() { | |
this._AGENDA = [new Pessoa()]; | |
} | |
/** | |
* | |
* @param name {String} | |
* @param address {String} | |
* @param mobileNumber {String} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* is One Point within Another | |
* @param point {Object} {latitude: Number, longitude: Number} | |
* @param interest {Object} {latitude: Number, longitude: Number} | |
* @param kms {Number} | |
* @returns {boolean} | |
*/ | |
function withinRadius(point, interest, kms) { | |
'use strict'; |