I hereby claim:
- I am robyoder on github.
- I am robyoder (https://keybase.io/robyoder) on keybase.
- I have a public key whose fingerprint is EA47 BBDB 9DAC E8FA AB11 7C62 8A87 7635 A4A3 4878
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // I made this for something and ended up not needing it. | |
| // It was too much fun to throw away though. | |
| /** | |
| * intToOrdinalNumberString converts an integer to an ordinal | |
| * number string. For example: 1 => "1st", 12 => "12th", 23 => "23rd" | |
| */ | |
| export const intToOrdinalNumberString = (num: number): string => { | |
| num = Math.round(num); | |
| let numString = num.toString(); |
| /** Convenient utilities in functional form */ | |
| const reduce = Function.prototype.call.bind(Array.prototype.reduce); | |
| const filter = Function.prototype.call.bind(Array.prototype.filter); | |
| const pow = Math.pow; | |
| const log2 = Math.log2; | |
| const size = (set) => set.size; | |
| /** Iterable conversions */ | |
| const toSet = (iterable) => new Set(iterable); | |
| const toArray = (iterable) => [...iterable]; |
| // Here I can use `User` as a type, a function, or a namespace | |
| import { User } from "./functional_model"; | |
| const sayHi = (user: User): string => ( | |
| `Hi, ${user.name}!` | |
| ); | |
| const joe = User({ name: "Joe" }); | |
| User.isActive(joe) //=> true |
| const pk_a = { | |
| "alg": "RSA-OAEP", | |
| "d": "SEI7RlFFuwpNtM7OBbz-rakRPa8tA7JosHCFbDp8rpnPgaQqE3Nx3XkemNDn8eypqdwGXo1PSHRFn40BPOjidNb5QvsdLcp9fgwF66fyzT0tRAYWK14Fuh042WciYvb3wk55CcmIK1PI4-nsGiQW8flPHSnmJJowdD23qajcJDkSozm0I44AAiEgp9pNgAIgDfPWh8qvjm0dqq10U20aYTOVeMUZz_sDAr9N9pcl9yrItouqnuWVzRzs-S2P55JXgUj87KxvQtcMr4vl6Ek9p_Pqn2ktcJpBM5Qsx_Bu-_fEqVjpDZr34CgENY89OA3MxLsOiMIOC4sD3z7h6GNB", | |
| "dp": "YRLeNGJByvFv4Jpv2Ef-mmknlNmZdg2MCk7xsQh3-nufKxEssdN_jTF1lTR5mnYKJyaGfsuADRy-xzIuili91xx2631VXIpzO4EApt-_droErdjzwJiOVqbMQmEU9ithLWWbpa0IPm5HZCa7PD-2ctt79aMFualsmwQ2Auc2ET0", | |
| "dq": "KbWh0933yZ1ndCe5KW_QF0RlF57QsLL3Lc6bfOB2uY9AitUv5s4Q0BrHwdlS-0v1S0s3T_XJKjN5XRd-TEGOX0xZMRGuA99QyGm_arw4Rkrm27u3zBBUaN5Hm1rHMYugrbb4Ch1BQioCdlR1yfJwVR5w8cpp6J68jWl1ST0Oj7k", | |
| "e": "AQAB", | |
| "ext": true, | |
| "key_ops": [ | |
| "decrypt" | |
| ], |
| const child_process = require("child_process"); | |
| const output = child_process.execSync("git diff HEAD master --shortstat", { encoding: "utf8" }); | |
| // "6 files changed, 34 insertions(+), 4 deletions(-)" | |
| const matches = output.match(/\s*\d+ files? changed, (\d+)\D+(\d+)?/) | |
| // console.log(matches); | |
| const sum = matches ? parseInt(matches[1]) + (parseInt(matches[2]) || 0) : 0; | |
| console.log("\x1b[0m" + sum); |
| export default [ | |
| { | |
| linterOptions: { | |
| reportUnusedDisableDirectives: "error", | |
| }, | |
| rules: { | |
| "no-debugger": ["warn"], | |
| }, | |
| }, | |
| ]; |