Skip to content

Instantly share code, notes, and snippets.


Milo Wielondek mwielondek

View GitHub Profile
mwielondek /
Created Sep 24, 2020
Transform csv-export from Airtable onto Roam readable format with proper indentation
#!/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 =
mwielondek / ThingsStats.scpt
Last active Mar 26, 2017
Javascript for Automation (JXA) task to compute what percentage of completed tasks fall into which Area in Cultured Code's Things
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 = {};
mwielondek /
Last active Jan 17, 2016
Reads (max 6) urls from text files in a given directory and opens them in Safari
cat * | head -n 6 | xargs open -a 'Safari'
mwielondek /
Last active Aug 20, 2019 — forked from jkp/
Simple WebSocket server. Can be run independently or as a module import.
import struct
import SocketServer
import sys
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
mwielondek /
Last active Aug 29, 2015
Shell function for capitalizing filenames. Accepts multiple args.
# 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 }
mwielondek /
Last active Aug 29, 2015
A function for diagonal matrix traversal. (python3)
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)