View at2r.py
#!/usr/bin/env python3 | |
# For transforming export from Airtable to Roam | |
import sys, re | |
filename = sys.argv[1] | |
filename_out = sys.argv[2] | |
with open(filename, 'r') as my_file: | |
str = my_file.read() |
View ThingsStats.scpt
// how many days to go back | |
var dayDiff = 21; | |
var d = new Date(); | |
d.setDate(d.getDate() - dayDiff); | |
var things = Application('Things'); | |
var logbook = things.lists[6].toDos; | |
var counter = {}; |
View openurls.sh
cat * | head -n 6 | xargs open -a 'Safari' |
View websocketserver.py
import struct | |
import SocketServer | |
import sys | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
DEFAULT_PORT = 9999 |
View capitalize.sh
# usage: `capitalize foo.txt bar.log` will rename files foo.txt bar.log => Foo.txt Bar.log | |
function capitalize() { for i; do echo $i | gsed -r 's/\w/\u&/' | xargs mv $i; done } |
View diagtravmat.py
def diag_trav_mat(mat,func): | |
# pretend to be working with a square matrix | |
# extend length to the largest of the sides | |
n = max(len(mat),len(mat[0])) | |
# for the amount of diagnoals | |
for x in range(0, 2*n-1): | |
# num of elements in diagonal | |
el = n - abs(n-1-x) | |