Top of Mind BIPs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://twitter.com/w_s_bitcoin/status/1651779628619509765 | |
# Target pubkey: bc1q0navdwrt7jry46a0zzpekaf5ey8u9hzlfdtgtk | |
# Path: m/84'/0'/0'/0/0 | |
import hashlib | |
import bech32 | |
import numpy as np | |
from bip32 import BIP32, HARDENED_INDEX | |
from mnemonic import Mnemonic | |
TARGET = "bc1q0navdwrt7jry46a0zzpekaf5ey8u9hzlfdtgtk" |
I hereby claim:
- I am miketery on github.
- I am miketery (https://keybase.io/miketery) on keybase.
- I have a public key ASA-nW7tdKl8yYz_QJWJDQqiAhDe4hxBXeQqDIFoTrBf6Ao
To claim this, I am signing this object:
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>I code stuff with my bare hands</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
Hi there | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert input.png -resize 100x100 -background white -gravity center -extent 100x100 -format png output.png | |
// -quality 75 //optional? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://30secondsofpythoncode.ml/#count_by | |
def count_by(arr, fn=lambda x: x): | |
key = {} | |
for el in map(fn, arr): | |
key[el] = 0 if el not in key else key[el] | |
key[el] += 1 | |
return key | |
from math import floor | |
count_by([6.1, 4.2, 6.3], floor) # {4: 1, 6: 2} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.horizontal-and-vertical-centering { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
.truncate-text { | |
overflow: hidden; | |
white-space: nowrap; | |
text-overflow: ellipsis; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source https://bradenmacdonald.com/blog/2015/uwsgi-emperor-multiple-python | |
Building a uWSGI Emperor for multiple python versisons | |
September 5, 2015 | |
This is a quick update to my tutorial on hosting Django Apps on Ubuntu with Nginx and uWSGI. I recently wanted to move to a mix of Python 3.4 and Python 2.7 web apps on one of my servers that was set up as described in that tutorial. Here's how to do that. | |
Normally, I just install uWSGI using pip. The big downside of that approach is that it only builds uWSGI for the version of Python with which you install it. So to get one emperor that can run apps (vassals) with different versions of Python, we need to compile uWSGI. Luckily it's really easy. | |
Here is an example of the required steps. Just run the following commands as root. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# collapse multi line file | |
# e.g. | |
# col 1 | |
# col 2 | |
# col 3 | |
# col 1... | |
# OUTPUT: col1, col2, col3 | |
sed 'N;N;s/\n/ /g' file | |
# show pots used by sys (source: https://unix.stackexchange.com/questions/62247/how-do-i-know-what-service-is-running-on-a-particular-port-in-linux) |