Skip to content

Instantly share code, notes, and snippets.

Nadav Ivgi shesek

Block or report user

Report or block shesek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shesek
shesek / bitcoin-address-utxo.html
Last active Feb 18, 2019
Bitcoin address UTXO extractor based on Blockstream's API
View bitcoin-address-utxo.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Bitcoin address UTXO extractor</title>
<style>
table, .csv { display: none }
</style>
<div class="container py-5">
<h2>Bitcoin address UTXO query</h2>
<form class="mt-3">
<div class="form-group">
@shesek
shesek / index.pug
Last active Feb 18, 2019
Bitcoin address UTXO extractor based on Blockstream's API
View index.pug
.container.py-5
h2 Bitcoin address UTXO query
form.mt-3
.form-group
label(for='address') Bitcoin address
input.form-control#address(type='text', name='address')
input.btn.btn-primary(type='submit', value='Get UTXOs')
table.table.mt-5
thead: tr #[th txid:vout] #[th value] #[th block height] #[th block time]
View bitcoin-ATH.txt
$ curl 'https://bitcoincharts.com/charts/chart.json?m=bitstampUSD&r=360&c=1&s=2017-01-01&e=2017-12-16' | jq -c '.[] | [(.[0]|strftime("%Y-%m-%d")),.[7]]' | tr -d '"[]' | awk -F, 'BEGIN{ath=0;total=0;aths=0;in20p=0}{total++;if ($2>ath*0.8) in20p++; if ($2>ath){print $1 " " $2; ath=$2; aths++ } } END { print "\nTotal "total" days\nATH in "aths" days (" (aths/total*100) "%)\n20% range from ATH in "in20p" days ("(in20p/total*100)"%)" }'
2017-01-01 987.468055790686
2017-01-02 1013.002448970431
2017-01-03 1020.555479651876
2017-01-04 1088.449474525684
2017-02-21 1104.602728943062
2017-02-22 1126.242226009392
2017-02-23 1153.559162275172
2017-02-24 1174.774405556085
@shesek
shesek / reproducible-archiver.js
Created Aug 28, 2017
Reproducible zip builds for Archiver
View reproducible-archiver.js
var Zip = require('archiver/lib/plugins/zip')
, date = new Date(0)
, mode = 0755
// Set static timestamp/mode and append to queue instead of actually appending to zip
Zip.prototype.append = function(source, data, cb) {
(this._queue || (this._queue=[])).push([ source, Object.assign(data, { date, mode }) ]);
cb();
}
@shesek
shesek / bower-lock-versions.sh
Last active Sep 16, 2017
Lock-down bower.json to the currently installed package versions (semi shrinkwrap)
View bower-lock-versions.sh
cp bower.json bower.json.old
cat bower.json.old | \
jq "$(cat bower_components/*/.bower.json | \
jq -r '".dependencies[\"" + .name + "\"]=\"" + (._source+"#"+._resolution.commit) + "\"|.resolutions[\"" + .name + "\"]=\"" + ._resolution.commit + "\""' |paste -d'|' -s -)" \
> bower.json
@shesek
shesek / exif.txt
Last active May 6, 2016
EXIF metadata for images posted on drcraigwright.net. More info and reproduction: https://www.reddit.com/r/Bitcoin/comments/4i76ut/exif_metadata_for_images_posted_on_craig_wrights/
View exif.txt
======== 08fb5101c50f322723b6c5a64b1eba6c35f7d729.png
ExifTool Version Number : 10.10
File Name : 08fb5101c50f322723b6c5a64b1eba6c35f7d729.png
Directory : .
File Size : 12 kB
File Modification Date/Time : 2016:05:06 20:21:20+03:00
File Access Date/Time : 2016:05:06 23:36:21+03:00
File Inode Change Date/Time : 2016:05:06 23:34:19+03:00
File Permissions : rw-rw-r--
File Type : PNG
@shesek
shesek / keybase.md
Created May 27, 2015
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am shesek on github.
  • I am nadav (https://keybase.io/nadav) on keybase.
  • I have a public key whose fingerprint is 948A C570 261E 66CA 7291 0A0A 4B33 3941 E3B4 3EDD

To claim this, I am signing this object:

@shesek
shesek / README.md
Last active Aug 29, 2015
A simple approach for handling the dom-ready event
View README.md

A simple approach for handling the dom-ready event

This script is a simple, lazy and hacky replacement for dealing with the dom-ready event (DOMContentLoaded and friends). Basically, it relies on DOM parsing and script execution order by simply putting a script tag at the very end of the document and having it call a list of registered callbacks.

Because of the way the DOM rendering process works, we can guarantee that by the time that script gets executed the DOM is fully ready for use.

Usage

@shesek
shesek / install.sh
Created Sep 15, 2014
Install all nodejs packages contained in sub-directories
View install.sh
find . -type f -name package.json ! -path ./package.json ! -path '*node_modules*' | xargs -I '{}' sh -c 'cd $(dirname {}) && npm install'
@shesek
shesek / merge-connect.coffee
Last active Dec 26, 2015
Merge multiple connect middlewares into a single middleware that calls them in order
View merge-connect.coffee
connect_middlewares = (fns...) -> (req, res, out) ->
curr = 0
do next = (err=null) ->
return out err if err? or not fn = fns[curr++]
fn req, res, next
You can’t perform that action at this time.