I hereby claim:
- I am jletourneau on github.
- I am jlet (https://keybase.io/jlet) on keybase.
- I have a public key whose fingerprint is 4B2D AA0A 3C84 DD6C 05D5 DA48 C307 2D17 4882 FA40
To claim this, I am signing this object:
#!/usr/bin/python | |
from pyquery import PyQuery as pq | |
import re | |
import datetime | |
print datetime.datetime.now().strftime('%c') | |
doc = pq(url='http://www.beermenus.com/places/4733-the-ruck') |
I hereby claim:
To claim this, I am signing this object:
tell application "Finder" | |
eject (every disk whose ejectable is true) | |
end tell |
(defun unfill-region (start end) | |
"Unfill the current region; i.e. remove all newlines within paragraphs. | |
If an active region is not present, unfill the entire buffer." | |
(interactive "r") | |
(let ((fill-column (point-max))) | |
(if (use-region-p) | |
(fill-region start end) | |
(fill-region (point-min) (point-max))))) |
This documentation explains how to build Hydra profile support into an existing game. As our example, we’ll be working with a very simple “game” called Masher, written in Python, which prompts the user for their name, reads lines of input one at a time, and adds up the number of characters the user has entered.
The original version of the game stores the user’s name, rounds played, and count of characters typed in a data structure which is saved to a file on disk using Python’s pickle module. Our goal is to modify this game to store the player’s data in Hydra instead.
#!/usr/bin/env python | |
import sys, os, pickle | |
from collections import defaultdict | |
class Masher: | |
def __init__(self, savefile): | |
self._savefile = savefile | |
self._read_profile() |
#!/usr/bin/env python | |
import subprocess, re | |
def battery_info(): | |
ioreg = subprocess.check_output( | |
['ioreg', '-r', '-w0', '-cAppleSmartBattery'] | |
).split("\n") | |
d = dict() | |
for line in ioreg: |
import utils | |
@utils.memoize | |
def fib(n): | |
if n < 3: | |
return 1 | |
return fib(n - 2) + fib(n - 1) | |
(i, sum) = (1, 0) | |
while True: |
def iecc_visible(condition, &block) | |
output = capture_haml(&block) | |
"<!--[#{condition}]><!-->#{output.chomp}<!--<![endif]-->\n" | |
end |
perl -ne 'print "https://$1/$2" if (/(github\.com):(.+)\.git/)' .git/config | xargs open |