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 Data.Char | |
telephoneWords :: String -> [String] | |
telephoneWords [] = [[]] | |
telephoneWords (digit : digits) = | |
[letter : rest | |
| letter <- digitToLetters digit, rest <- telephoneWords digits] |
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
var util = require("util"), | |
zmq = require("zmq"), | |
events = require("events"); | |
function Socket(zmqSocket) { | |
var self = this; | |
self._zmqSocket = zmqSocket; | |
self._zmqSocket.on("error", function(error) { | |
self.emit("error", error); |
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
var zmq = require("zmq"); | |
var socket = zmq.socket("xrep"); | |
socket.bindSync("ipc:///tmp/zmq-issue"); | |
socket.on("message", function(envelope, _, name) { | |
socket.send([envelope, new Buffer(0), "Hello, " + name.toString()]); | |
}); |
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 System.Random | |
import Data.Set (Set, unions, fromList, member) | |
import Data.Map (Map, singleton, elems, (!), insert) | |
import Debug.Trace (trace) | |
main :: IO () | |
main = do | |
rng <- newStdGen | |
layout <- return (createRandomLayout rng 0.1) | |
putStr (stringifyLayout layout) |
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
from tornado import auth, httpclient, httputil, escape | |
import urllib.request | |
import urllib.parse | |
import urllib.error | |
import functools | |
REQUEST_TIMEOUT = 20.0 | |
class LinkedInMixin(auth.OAuth2Mixin): |
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
ag foobar --files-with-matches | while read filename; do subl $filename; done |
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
# This has been turned into a full-fledged repo: | |
# https://github.com/dailymuse/torender |
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 os | |
import re | |
import sys | |
TRY_PATTERN = re.compile(r"try!\(") | |
def replace_try(contents): | |
match = TRY_PATTERN.search(contents) | |
if match: |
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
<html> | |
<body style="text-align: center"> | |
<img id="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtoAAALaCAYAAAAP7vQzAAGx+0lEQVR42uydd5xdVdn9175TEyChgwoi0kvovSm9CoReRak2quCL5RVff4Ki0kQRFAUEAkS69N577yVUEZAOaZNp+/dHCpM75+z9tH3unWQ/n4+Sueecfc6dhMz3LtZeyyFPnjx58pBnl82B9g4A/TO//oPd0bbuWpgLXZgLHnMBmHPa/+aAx9wA5gUwEsBIeMwJYC7ATT3HYxgw43+d8OgA0AagDR5tAGoAWgA4eACAn/YE/fDoA9ANoAdANzymAOgCMBnAJHhMAjARwHh4Px7AZ9P+9zE8PgIwAcAE+Gn/BMYDGI8OTLjjAeCv/6r7BtSAyZOBK+7OfxaabQ455BCceeaZ+RuRJ08Tjcvfgjx58uQBRs4FrL0qgN5pfzk64OBdMOfcc2ME+jACwIjWGuZdf1Us1NKK+dCP+QA3zzSAng/9mKsOljsBdALoANA+DZA/n9DXnHM51w4+1gdgyrT/dcHPAPSp//T4EA4fTYPyDwH/IRw+6OnGf+97Gp/1+WnQXsOnH3yE3r9dN2DtFuC+p4AJk/OfrQzaefJk0M6TJ0+eWXra2oBtNvz86y8sgM4DdsX86MN8AOabbyQWW3x5fAl9+ALgvgDgS+jDvNPU5+nK81QE9TGodY2DaZNzffhcB6Ad3cBMKvg7qOEdAG+j37+DFrw57gW888kEfATgAzh8dNbVwPufTr2+vw+47iGgrz//2cygnSdPBu08efLkGRKz1GLAKisB6AE2Xgsj1lsHC6MLC3d24CvLjMJXAXwZcF+Gx5fRi5HANCV6uraLIrh09rAMlw7Eg2t5G2gPrTn9eDv6UcN4eHwK4H204HUA/wb8G+jHy8+/gHe6u/EuOvDuHQ+j/95nAbQCjzwHvPZu/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
#!/usr/bin/env python3 | |
# Uses python3. Example: `python3 mixed_tabs_spaces.py '**/*.py'` | |
import glob | |
import sys | |
def has_mixed_tabs_spaces(f): | |
has_spaces = False | |
has_tabs = False |
OlderNewer