This file contains hidden or 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
#!/bin/sh | |
# pandoc -f markdown+lhs -t html5 --smart --css https://raw.github.com/richleland/pygments-css/master/default.css s5topdf.lhs | |
# pandoc -f markdown+lhs -t html5 --smart --css s5topdf.css s5topdf.lhs | |
pandoc -f markdown+lhs -t html5 --smart s5topdf.lhs |
This file contains hidden or 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
" Run PHP Unit tests. | |
nmap \Tu :w<CR>:call Send_to_Tmux("rake php:unit\n")<CR> | |
" Run Cucumber, vanilla. | |
nmap \Tc :w<CR>:call Send_to_Tmux("rake cucumber:default\n")<CR> | |
" Re-run Cucumber. | |
nmap \Tr :w<CR>:call Send_to_Tmux("rake cucumber:rerun\n")<CR> |
This file contains hidden or 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
desc = arcpy.Describe('poly_landmarks') | |
ext = desc.extent | |
ext.upperRight.x, ext.upperRight.y | |
# (-73.907820000000001, 40.882078) | |
ext.lowerRight.x, ext.lowerRight.y | |
# (-73.907820000000001, 40.679648) | |
ext.upperLeft.x, ext.upperLeft.y | |
# (-74.047184999999999, 40.882078) | |
ext.lowerLeft.x, ext.lowerLeft.y | |
# (-74.047184999999999, 40.679648) |
This file contains hidden or 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
# http://jashkenas.github.com/coffee-script/ | |
# https://developer.mozilla.org/en/JavaScript/Reference/ | |
# http://docs.jquery.com/Main_Page | |
# http://mbostock.github.com/d3/ | |
# 1. | |
# | |
# Alert! | |
alert('Danger, Will Robinson!') | |
# 2. |
This file contains hidden or 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 contextlib import closing | |
def db_exists(cxn, db_name): | |
"""\ | |
This takes a connection to a Postgres object and db name and tests whether it | |
exists or not. | |
""" | |
with closing(cxn.cursor()) as c: | |
c.execute('SELECT COUNT(*) FROM pg_database WHERE datname=%s;', [db_name]) | |
(count,) = c.fetchone() |
This file contains hidden or 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 arcpy | |
# Parameter 0, whatever the name, should have type "Feature Layer". | |
obj = arcpy.GetParameter(0) | |
# This prints out all of the properties and methods on the object that gets | |
# passed in as Parameter(0). I haven't looked closely, but we should be able | |
# to pass this directly to | |
arcpy.AddMessage('obj = %r' % (repr(dir(obj)),)) |
This file contains hidden or 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 Freq | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
attr_accessor :input_text | |
validates :input_text, :presence => true | |
def initialize(attributes = {}) |
This file contains hidden or 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 file should be name omg.ptl. | |
class PageTemplate(object): | |
def _corner [html] (self): | |
'This gets output too. What fun!<br />\n' | |
if self._project(): | |
return self._project().upper() | |
else: | |
'<font size="-1">Linguistic Atlas Projects</font>' |
This file contains hidden or 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 | |
"""\ | |
A short explanation of dependency injection and how to use to make testing | |
easier. | |
Maybe this should be a mocking guide, because everything's going to be a mock | |
object. |
This file contains hidden or 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
require 'pathname' | |
GVIMRC = <<EOF | |
" undefine all the custom NERDTree-aware commands. | |
" From https://github.com/carlhuda/janus/issues/174 | |
cunabbrev cd |