Skip to content

Instantly share code, notes, and snippets.

View DanielVF's full-sized avatar

Daniel Von Fange DanielVF

View GitHub Profile
@DanielVF
DanielVF / header.py
Last active November 15, 2018 12:37
Jupyter notebook standard header
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import json
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
pd.options.mode.chained_assignment = None
@DanielVF
DanielVF / collect.js
Created September 28, 2018 11:36
Get origin contract address JSON from an origin DAPP
out = {}
for (const k in originTest.contractService.contracts) {
out[k] = {4: {address:originTest.contractService.contracts[k].networks[4].address}}
}
JSON.stringify(out)
@DanielVF
DanielVF / debug.js
Created August 1, 2018 02:35
Origin helper for debugging events
// Example usage:
//
// console.table(await debugEvents(origin.contractService, {fromBlock:175, topics:[]}))
//
async function debugEvents(contractService, options){
const web3 = contractService.web3
// Lookup table for contracts from bytecode
@DanielVF
DanielVF / Readme.md
Created May 26, 2015 02:21
Kerbin Altitude vs Pressure - KSP 1.0

Accurate to four decimal places. Verified through multiple data recorded flights. In CSV Format.

@DanielVF
DanielVF / gist:6299261a7413ec52a2e2
Created September 1, 2014 23:00
show a process's syscalls
strace -c -p {PID}
@DanielVF
DanielVF / gist:d07b081efadc472e1721
Created August 18, 2014 13:06
random line of input, os x
perl -MList::Util=shuffle -e 'print shuffle(<STDIN>);' | head -n 1
@DanielVF
DanielVF / gist:d715a290bc920a162d2a
Created June 4, 2014 12:12
ffmpeg losslessly trim H264 files
ffmpeg -i INPUT.MOV -ss 39 -to 52 -async 1 -acodec copy -vcodec copy OUTPUT.cut.MOV
@DanielVF
DanielVF / gist:61229d54311a42fe2a93
Last active August 29, 2015 14:01
Using imapsync to copy accounts
# Install and use imapsync to copy imap accounts between servers
# Known issues:
# - Same username on both servers
# - Same password on both servers
# - No special characters in passwords
# - You'll want to run in parallel on big moves.
aptitude install libmail-imapclient-perl libterm-readkey-perl libio-socket-ssl-perl libdigest-hmac-perl liburi-perl libfile-copy-recursive-perl
git clone https://github.com/imapsync/imapsync.git
@DanielVF
DanielVF / parser.peg
Last active August 29, 2015 13:57
peg.js parser for kerbal config files
start
= nodes
nodes
= node*
node
= list
/ stringkeyvalue
@DanielVF
DanielVF / gist:8370906
Created January 11, 2014 13:24
Collect all ebay prices on page, for pasting into excel/numbers.
$.makeArray($('div[itemprop=price]').map(function(){return $(this).text().replace(/[^0-9]/g,'');}) ).join("\n")