Skip to content

Instantly share code, notes, and snippets.

View johnthethird's full-sized avatar

John Lynch johnthethird

View GitHub Profile
// FYI this will currently allow you to only import to the same addr you exported from
func (w *Wallet) buildExportTxC2P(srcAddr common.Address, amount uint64, amountPlusFee uint64, nonce uint64) (*evm.UnsignedExportTx, error) {
exportTx := &evm.UnsignedExportTx{
NetworkID: w.ChainConfig.NetworkID,
BlockchainID: w.ChainConfig.CChainID,
DestinationChain: ids.Empty,
Ins: []evm.EVMInput{
{
Address: srcAddr,
Amount: amountPlusFee,
@johnthethird
johnthethird / gist:ba2ca3cf8287de8f57cfd62616be261a
Created October 6, 2020 00:06
Avalanche Memos As Of 2020-10-05
(base) ❯ cat avm_transactions.json | jq '.[] | select(.memo!="" and .memo!="\u0000\u0000\u0000\u0000") | .memo' | sort | uniq 2.7.1
"0"
"03cf4d640442dd05a5"
"074e7490ad5656f4d4"
"1 Auftrag Binance"
"1"
"10% Cédric"
"10% of 5040 (mainnet day 1 unlock)"
"10% of 5353"
"10% of 996.11"
@johnthethird
johnthethird / markdown2json.js
Created March 9, 2018 23:53
Convert directory of Markdown files with front matter to JSON
const fs = require('fs')
const path = require('path')
const glob = require('glob-fs')()
const moment = require('moment')
const matter = require('gray-matter')
const processFile = filename => {
const fileObj = matter(fs.readFileSync(filename, 'utf8'))
const dataObj = {
content: fileObj.content,
@johnthethird
johnthethird / save_restore_dependencies.sql
Created January 30, 2018 22:42 — forked from mateuszwenus/save_restore_dependencies.sql
PostgreSQL: How to handle table and view dependencies
create table deps_saved_ddl
(
deps_id serial primary key,
deps_view_schema varchar(255),
deps_view_name varchar(255),
deps_ddl_to_run text
);
create or replace function deps_save_and_drop_dependencies(p_view_schema varchar, p_view_name varchar) returns void as
$$

Keybase proof

I hereby claim:

  • I am johnthethird on github.
  • I am johnrlynch (https://keybase.io/johnrlynch) on keybase.
  • I have a public key ASBo023xGXVGYnASIYE69LPp_p71hr2WcgGGa38wwgF_0wo

To claim this, I am signing this object:

@johnthethird
johnthethird / index.js
Created March 30, 2017 02:03
Microservice in Micro with livenessProbe
'use strict'
import {send, json} from 'micro'
import jwtAuth from 'micro-jwt-auth'
import visualize from './visualize'
// Import your custom command here
import cmd from './cmd'
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)))
@johnthethird
johnthethird / gist:d13c547b7feca044a8192cf70e7933ef
Created July 21, 2016 22:47
Forward port 80 to a local Rails app on port 3000
echo "rdr pass proto tcp from any to any port {80,3000} -> 127.0.0.1 port 3000" | sudo pfctl -a "com.apple/250.ApplicationFirewall" -Ef -
@johnthethird
johnthethird / react_rails_benchmark.rb
Last active August 29, 2015 14:22
React-Rails Benchmark Script
Runtime Threads Pool Renders user system total real
JavaScriptCore 1 1 100 0.060000 0.140000 3.590000 ( 3.621248)
JavaScriptCore 10 1 100 0.060000 0.180000 3.760000 ( 3.913241)
JavaScriptCore 1 10 100 0.060000 0.160000 4.100000 ( 4.511085)
JavaScriptCore 10 10 100 0.070000 0.230000 6.000000 ( 1.366264)
Node.js (V8) 1 1 100 0.050000 0.140000 10.390000 ( 10.602247)
Node.js (V8) 10 1 100 0.070000 0.190000 10.510000 ( 10.632389)
Node.js (V8) 1 10 100 0.050000 0.150000 10.150000 ( 10.297540)
Node.js (V8) 10 10 100 0.060000 0.210000 17.010000 ( 3.465977)
therubyrhino (Rhino) 1 1 100 0.980000 0.030000 1.010000 ( 0.651000)
@johnthethird
johnthethird / Gemfile
Last active August 29, 2015 14:13 — forked from bf4/Gemfile
gem 'lograge' # more readable logs
gem 'logstash-event' # for logstash json format
gem 'mono_logger' # threadsafe logging
@johnthethird
johnthethird / torquebox_logger.rb
Created May 29, 2014 13:59
TorqueBox Logger that respects tagged logging
# Copy of TorqueBox::Logger
# Try to unfrak it
require 'logger'
module TorqueBox
# @api private
class FallbackLogger < ::Logger