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
import en from './en'; | |
import pt from './pt'; | |
import es from './es'; | |
const Locale = { | |
sharedMessages: { | |
en, | |
pt, | |
es | |
} |
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 monthNames = [ | |
'Capricornus', | |
'Aquarius', | |
'Pisces', | |
'Aries', | |
'Taurus', | |
'Gemini', | |
'Cancer', | |
'Leo', | |
'Virgo', |
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
exports.chain = function (subject) { | |
const proxy = new Proxy(subject, { | |
get(target, name, receiver) { | |
const member = Reflect.get(target, name, receiver); | |
if (typeof member === 'function') { | |
return function () { | |
const value = member.apply(subject, arguments); | |
if (typeof value !== 'undefined') | |
return value; |
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
(function () { | |
function prmze() { | |
let thenCallback = null; | |
let catchCallback = null; | |
let child = null; | |
return { | |
ready: false, | |
then: function (callback) { | |
this.ready = true; |
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 OTP = (() => { | |
function xorStrings(a, b) { | |
let c = ""; | |
for (let i = 0; i < a.length; i++) | |
c += String.fromCharCode(a.charCodeAt(i) ^ b.charCodeAt(i)); | |
return c; | |
} |
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
export namespace RNG { | |
let seq = 1; | |
export function random(seed ?:number) { | |
if (typeof seed != 'undefined') { | |
seq = seed; | |
} | |
let x = Math.sin(seq++) * 10000; | |
return x - Math.floor(x); | |
} | |
} |
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
(function(){ | |
module.exports = function scope(block) { | |
const deferred = []; | |
const defer = function(callback, args) { | |
deferred.unshift({target: this, callback, args}); | |
} | |
try { | |
return block(defer); | |
} finally { |
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 SEPARATOR = ':::'; | |
module.exports = (function() { | |
const cls = function() { | |
this.userVisits = {}; | |
}; | |
const parseSequences = function(userVisits, length) { | |
const sequences = {}; | |
const size = length - 1; |
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
<?php | |
function array_delete(&$array, $key) { | |
if (!isset($array[$key])) { | |
return null; | |
} | |
$value = $array[$key]; | |
unset($array[$key]); | |
return $value; | |
} |
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
exports.unchain = function unchain(subject) { | |
const proxy = new Proxy(subject, { | |
get(target, name, receiver) { | |
if (name === '_') { | |
return new Proxy(subject, { | |
get(target, name, receiver) { | |
const member = Reflect.get(target, name, receiver); | |
if (typeof member === 'function') { | |
return function () { |