a.k.a. what to do when your ISP starts blocking sites :(
Set the SOCKS proxy to local SSH tunnel
networksetup -setsocksfirewallproxy "Ethernet" localhost 8080
To clear the domain and port
(defconst top-window-height 10 "Height to set top window to when splitting") | |
(defun ensure-top-window () | |
(interactive) | |
(let* ((w (selected-window)) | |
(is-top (and | |
(eq (window-parent w) (frame-root-window)) | |
(eq (window-top-child (frame-root-window)) w)))) | |
; Make sure we're the top window, and default our height to | |
; top-window-height. This is a little destructive (loses all window state) | |
; but generally only happens once per session. |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
-- For anyone who liked the PRIME DETECTOR puzzle included in some of the early access | |
-- builds of TIS-100... | |
-- INSTALLATION: Copy everything in this file. Open TIS-100. Go to the SPECIFICATION | |
-- EDITOR. Click on IMPORT SPECIFICATION FROM CLIPBOARD. Done! | |
-- The function get_name() should return a single string that is the name of the puzzle. | |
-- | |
function get_name() | |
return "PRIME DETECTOR" |
#!/usr/bin/env python | |
import fileinput, re, sys, binascii, struct | |
hexword = '([A-Fa-f0-9]{4})' | |
pattern = '%(hexword)s:' + 8*'\s*%(hexword)s' | |
pattern = pattern % locals() | |
write = sys.stdout.write | |
unhex = binascii.unhexlify | |
word = lambda b: struct.unpack('!H', b)[0] |
#!/bin/bash | |
echo "This script prints the filenames of any dylibs in your /usr/local/ that depend on the System Python" | |
for f in `find /usr/local/lib`; do | |
otool -L "$f" 2> /dev/null| grep Python | grep System &> /dev/null | |
status=$? | |
if [ $status -eq 0 ]; then | |
echo "$status: $f" | |
fi | |
done |
#!/bin/sh | |
ProgName=$(basename $0) | |
sub_help(){ | |
echo "Usage: $ProgName <subcommand> [options]\n" | |
echo "Subcommands:" | |
echo " bar Do bar" | |
echo " baz Run baz" | |
echo "" |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <netj@sparcs.org> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |