This file contains 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
# Paste this into your /etc/hosts | |
# Then (if you're on a Mac) run 'sudo dscacheutil -flushcache' | |
# This will prevent your computer from accessing sites owned by Gawker Media, | |
# thus improving your internet experience. | |
0.0.0.0 gawker.com deadspin.com lifehacker.com gizmodo.com io9.com jalopnik.com jezebel.com kotaku.com io9.gizmodo.com |
This file contains 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
01-10 16:12:36.311 15315 15315 D AndroidRuntime: Shutting down VM | |
01-10 16:12:36.320 15315 15315 D HockeyApp: Writing unhandled exception to: /data/user/0/com.tumblr/files/202aa2c9-7325-4ec6-a2f1-45f96266dd92.stacktrace | |
01-10 16:12:36.332 15315 15315 W System.err: java.lang.AbstractMethodError: abstract method "int android.text.ParcelableSpan.getSpanTypeIdInternal()" | |
01-10 16:12:36.332 15315 15315 W System.err: at android.text.TextUtils.writeToParcel(TextUtils.java:653) | |
01-10 16:12:36.332 15315 15315 W System.err: at android.os.Parcel.writeCharSequence(Parcel.java:572) | |
01-10 16:12:36.332 15315 15315 W System.err: at android.view.accessibility.AccessibilityNodeInfo.writeToParcel(AccessibilityNodeInfo.java:2701) | |
01-10 16:12:36.332 15315 15315 W System.err: at android.os.Parcel.writeTypedList(Parcel.java:1148) | |
01-10 16:12:36.332 15315 15315 W System.err: at android.view.accessibility.IAccessibilityInteractionConnectionCallback$Stub$Proxy.setFindAccessibilityNodeInfosResult(IAccessibilityInteractionConnectio |
This file contains 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
#!/usr/bin/env runhaskell | |
module Main (main) where | |
-- When you copy a conversation out of your google chat logs, it looks like | |
-- this | |
-- | |
-- Alice | |
-- hi | |
-- how are you | |
-- Bob Smith |
This file contains 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
# Writing some unit tests in Python, I found myself homesick for Clojure's `reify`. | |
from functools import partial | |
class Blank(object): pass | |
def obj(*fs): | |
o = Blank() | |
for f in fs: | |
setattr(o, f.func_name, partial(f, o)) |
This file contains 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
import Control.Monad | |
chars :: [Char] | |
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ,.'\"-;:?!()" | |
incrementS :: [[Char]] -> [[Char]] | |
incrementS [] = [chars] | |
incrementS ([_] : r) = chars : (incrementS r) | |
incrementS ((c:cs) : r) = cs : r |
This file contains 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
(defn my-split-with [pred coll] | |
(let [p (promise) | |
passes ((fn step [c] | |
(lazy-seq | |
(if-let [[x & xs] (seq c)] | |
(if (pred x) | |
(cons x (step xs)) | |
(do (deliver p c) nil)) | |
(do (deliver p nil) nil)))) | |
coll)] |
This file contains 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
Initialized empty Git repository in /Users/michael.blume/workspace/git/t/trash directory.t3400-rebase/.git/ | |
expecting success: | |
git config core.logAllRefUpdates true && | |
echo First >A && | |
git update-index --add A && | |
git commit -m "Add A." && | |
git checkout -b force-3way && | |
echo Dummy >Y && | |
git update-index --add Y && | |
git commit -m "Add Y." && |
This file contains 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
(ns honeysql.extensions.returning | |
(:require | |
[honeysql.format :as f] | |
[honeysql.helpers :as h])) | |
(defmethod f/format-clause :returning [[_ fields] _] | |
(str "RETURNING " (f/comma-join (map f/to-sql fields)))) | |
(f/register-clause! :returning 225) |
This file contains 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
#!/usr/bin/env python | |
import envoy | |
import requests | |
import time | |
r = envoy.run("find /Users/mike/Dropbox/writing | grep -v DS_Store | xargs wc -c") | |
count = r.std_out.split()[-2] | |
kb_written = int(count) // 1024 | |
url = "https://www.beeminder.com/api/v1/users/mblume/goals/writing/datapoints.json" |
This file contains 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
#!/usr/bin/env runhaskell | |
import Data.List | |
import Control.Concurrent | |
import System.IO | |
takeBlock :: [String] -> (String, [String]) | |
takeBlock (firstLine:moreLines) = (block, restLines) where | |
block = intercalate "\n" (firstLine:indLines) | |
(indLines, restLines) = span (isPrefixOf " ") moreLines |