boot2docker
$ brew install boot2docker
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
- hosts: localhost | |
remote_user: dirn | |
vars: | |
ansible: ~/.ansible | |
dotfiles: "{{ ansible }}/dotfiles" | |
rc_file: ~/.extra | |
pyenv: /Users/{{ ansible_ssh_user }}/.pyenv | |
python_version: 3.4.3 | |
python_versions: [2.6.9, 2.7.9, 3.3.6, 3.4.3, pypy-2.5.0, pypy3-2.4.0] |
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
- host: localhost | |
remote_user: dirn | |
roles: | |
- osx | |
tags: osx, configuration | |
- role: vim | |
dotfiles: "{{ dotfiles }}" | |
tags: vim | |
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 csv | |
from bs4 import BeautifulSoup | |
import requests | |
in_url = 'http://rangers.nhl.com/club/schedule.htm' | |
# in_filename = 'schedule.html' | |
out_filename = 'schedule.csv' | |
resp = requests.get(in_url) |
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
SELECT | |
TO_CHAR(s.start, 'HH12:MIAM') AS start, | |
TO_CHAR(s.end, 'HH12:MIAM') AS end, | |
u.name, | |
t.name | |
FROM | |
rooms r | |
JOIN rooms_slots rs ON r.id = rs.room_id | |
JOIN slots s ON rs.slot_id = s.id | |
JOIN presentations p ON s.id = p.slot_id |
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
struct Foo {} | |
struct Bar { | |
var data: [Foo] | |
init() { | |
data = [Foo](count: 5, repeatedValue: Foo()) | |
} | |
mutating func test() { |
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 random | |
import string | |
characters = string.ascii_letters + string.digits | |
s = set() | |
while len(s) < 200: | |
s.add(''.join(random.choice(characters) for _ in range(6))) |
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
class Base(object): | |
def name(self): | |
return 'Base' | |
class Subclass(Base): | |
def name(self): | |
return 'Subclass' | |
def parent_name(self): | |
return super(Subclass, self).name() |
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 | |
from django.core.exceptions import ImproperlyConfigured | |
# Shortcuts courtesy of @kennethlove | |
here = lambda *x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) | |
PROJECT_ROOT = here('..') | |
root = lambda *x: os.path.join(os.path.abspath(PROJECT_ROOT), *x) | |
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 bash | |
cd ./$(git rev-parse --show-cdup) | |
find . -name '*.pyc' - delete |