- Swap Control and Caps Lock in System Preferences -> Keyboard -> Modifier Keys
- Google Chrome http://www.google.com/chrome/
- iTerm2 http://www.iterm2.com/
- Oh my zsh https://github.com/robbyrussell/oh-my-zsh/
- XCode (from the mac app store)
- XCode command line tools (run XCode, go to Preferences -> Downloads -> Command Line Tools)
- Homebrew https://github.com/mxcl/homebrew/wiki/installation
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 | |
class Markov(object): | |
def __init__(self, open_file): | |
self.cache = {} | |
self.open_file = open_file | |
self.words = self.file_to_words() | |
self.word_size = len(self.words) | |
self.database() |
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
""" | |
One of our editors thought it would be fun to run a year-end list of our | |
most-shared stories. This script uses the Facebook API to fetch stats for | |
a given list of URLs. | |
The script will: | |
- create a csv file that's named based on the value of TOP_URLS_FILE. This | |
file logs URLs that have enough shares to surpass your TOP_THRESHHOLD number. |
Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info
like this: $ brew info postgresql
$ brew install python --universal
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 is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
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
#Global stuff | |
#First, install memcached and libmemcached using homebrew. This may require gcc, which may require you to update your XCode if it's not up to date. | |
brew install memcached | |
brew install libmemcached | |
#Python stuff, inside your virtual environment | |
pip install pylibmc, etc. |
- First download
dbfpy
: http://sourceforge.net/projects/dbfpy/files/latest/download?source=files - Then install:
sudo python setup.py install
To convert DBF file to CSV:
./dbf2csv database.dbf
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
# These are shell functions to quickly create pansharpened RGB images ready for color correction | |
# from a set of raw Landsat 8 TIF files in a given directory. | |
# For example: | |
# l8_pansharp LC81690352014169LGN00 | |
# Creates: | |
# LC81690352014169LGN00_rgb_pansharp.tif | |
# l8_rush_pansharp downloads a L8 tile from Google Storage (if they have it), extracts the relevant bands, then creates the pansharpened output. |
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 Document < ActiveRecord::Base | |
include HTTParty | |
format :json | |
base_uri "https://www.documentcloud.org" | |
debug_output $stdout # optional | |
def update_published_url | |
self.class.put("/api/documents/#{self.dc_id}.json", | |
basic_auth: { | |
username: ENV['DOCUMENTCLOUD_USERNAME'], |
OlderNewer