Skip to content

Instantly share code, notes, and snippets.

Richard Kiss richardkiss

Block or report user

Report or block richardkiss

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

Idempotent clarifications

Here are a bunch of changes you can make for humans only. None of these changes should change how it compiles, so you should be able to change anything in this section and compare the resultant compile. It should be identical.


I've really love an automated pretty-printer akin to "black" for python or "cargo fmt" for rust so you can write whatever mess you want and have a computer indent it so it looks nice, but I haven't been able to find one yet.

from pycoin.encoding.hexbytes import b2h
from pycoin.intbytes import int2byte
from pycoin.key import Key
from pycoin.networks.registry import network_for_netcode
from pycoin.satoshi.der import sigencode_der
network = network_for_netcode('XTN')
Tx = network.tx
TxIn = network.tx.TxIn
richardkiss / sl
Created Mar 30, 2018
A "mirror-image" ls in python, as discussed at
View sl
#!/usr/bin/env python
import subprocess
import sys
output = subprocess.check_output(["ls"] + sys.argv[1:])
lines = output.split("\n")

Chia FAQ

Q: Where does the name "Chia" come from?

A: See Wikipedia.

View Secure Pi
- install Raspian
- expand filesystem
- get on wifi
(zfec dependencies)
$ sudo apt-get install python-dev
$ curl | sudo python
View f(f(n)) =
#!/usr/bin/env python
The obvious way is to do it with complex numbers.
def f(x):
# remember, in Python 1j means sqrt(-1)
return 1j * x
View f(f(n)) = -n
#!/usr/bin/env python
The obvious way is to do it with complex numbers.
def f(x):
# remember, in Python 1j means sqrt(-1)
return 1j * x
richardkiss / time_picker.js
Created Feb 16, 2013
jQuery extension for a time picker that has a small <select> menu with a small number of times that should handle 90% of cases, plus an "other time" option that allows any time to be entered.
View time_picker.js
/*global $ */
(function( $ ){
$.fn.time_picker = function( method ) {
if ( methods[method] ) {
return methods[ method ].apply( this, arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
View App Engine Direct Export
#!/usr/bin/env python
import sys
import time
import csv
import sqlite3
from google.appengine.datastore import entity_pb
from google.appengine.api import datastore

Keybase proof

I hereby claim:

  • I am richardkiss on github.
  • I am richardkiss ( on keybase.
  • I have a public key whose fingerprint is 1BE0 3D39 4138 A2C2 E2EF 64D4 E0F4 3326 DBD8 AB6A

To claim this, I am signing this object:

You can’t perform that action at this time.