Skip to content

Instantly share code, notes, and snippets.

@aj0strow
aj0strow / account_status.csv
Last active October 26, 2023 04:14
Metro2 Format for Canadian Reporting
Status Description Equifax Description Equifax Rate
DA Delete entire account None 9
DF Delete entire account None 9
ZA Financial counseling Credit Counseling 7
05 Account transferred to another office Transferred or sold 1
07 Too new to rate None 0
11 Account in good standing None 1
13 Paid or closed account / zero balance Account paid 1
61 Account paid in full / was voluntary surrender Account paid 8
62 Account paid in full / was collection account / insurance claim or government claim Account paid 9
@aj0strow
aj0strow / self-closing-jsx-tags.js
Created November 5, 2015 22:28
Codemod script to prefer self-closing JSX tags
// jscodeshift -t self-closing-jsx-tags.js ./src
module.exports = function(file, api) {
let j = api.jscodeshift
let root = j(file.source)
root.find(j.JSXElement)
.filter(function (path) {
return !path.value.children.length
})
@aj0strow
aj0strow / bench.rb
Created December 4, 2014 22:16
ruby curl benchmark
require 'dotenv'
Dotenv.load
require 'benchmark'
require 'multi_json'
require 'firebase'
require 'patron'
Benchmark.bmbm do |x|
@aj0strow
aj0strow / moment.js
Created November 27, 2014 23:27
Moment.js twitter-style fromNow
assert(typeof moment == 'function', 'moment dependency')
function gt (input, key) {
var dur = moment.duration(input, key)
return this.as('milliseconds') > dur.as('milliseconds')
}
function lt (input, key) {
var dur = moment.duration(input, key)
return this.as('milliseconds') < dur.as('milliseconds')
docker run -it --name tbears-container -p 9000:9000 -v $(pwd):/tbears iconloop/tbears
const axios = require("axios")
class HttpProvider {
constructor(url) {
this.url = url
this.id = 0
this.jsonrpc = '2.0'
}
// Call JSON RPC method. Get back { id, result } or { id, error }.
@aj0strow
aj0strow / DSToken.sol
Created October 1, 2018 22:19
EOS Token
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
) anonymous;
package main
import (
"fmt"
)
type whyNeedPointer struct {
Do func(string)
}
@aj0strow
aj0strow / firebase.go
Created August 17, 2017 20:16
Firebase Custom Tokens
package firebase
import (
"github.com/knq/jwt"
"github.com/knq/jwt/gserviceaccount"
"time"
)
// Firebase JWT Claims
type Claims struct {
@aj0strow
aj0strow / bin-component.js
Created July 15, 2016 16:26
Scaffold a new react component
#!/usr/bin/env node
const fs = require("fs")
const path = require("path")
const _ = require("lodash")
// setup
const root = path.resolve(__dirname, "..")
const args = process.argv.slice(2)