Skip to content

Instantly share code, notes, and snippets.

View cazzerson's full-sized avatar

Jason Casden cazzerson

View GitHub Profile
anonymous
anonymous / gist:161265
Created August 4, 2009 14:09
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
@Packetslave
Packetslave / gist:191209
Created September 22, 2009 16:20
Make capistrano use SCP instead of SFTP
# Deployment uses SFTP by default when you use deploy_via :copy, and there
# doesn't seem to be any way to configure it. Unfortunately, we don't run
# SFTP on our servers, so it fails. This forces it to use SCP instead.
# http://www.capify.org/index.php/OverridingTaskCommands
#
module UseScpForDeployment
def self.included(base)
base.send(:alias_method, :old_upload, :upload)
base.send(:alias_method, :upload, :new_upload)
end
@netj
netj / memusg
Last active June 25, 2024 17:39
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@rmaceissoft
rmaceissoft / queryset_iterator
Created July 3, 2012 18:35
django queryset iterator
"""
Taken from (http://djangosnippets.org/snippets/1949/)
and made some adjustments for cases when queryset is empty
"""
import gc
def queryset_iterator(queryset, chunksize=1000):
'''''
Iterate over a Django Queryset ordered by the primary key
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@trevormunoz
trevormunoz / 2012-08-19-doing-dh-in-the-library.md
Created August 21, 2012 13:30
Digital humanities in the library isn't a service

Digital humanities in the library isn't a service

Framing digital humanities in libraries as a service to be provided and consequently centering the focus of the discussion on faculty members or others outside the library seem likely to stall rather than foster libraries engagement with digital humanities. I want digital humanities work in libraries that is innovative and iterative but that contributes back to the mission of (academic) libraries. The MITH-University Libraries Digital Humanities Incubator is a local effort to make that happen.

Last week, Miriam Posner started an interesting discussion online with a blog post about some of the [challenges of doing digital humanities in libraries][posner]. Posner identifies challenges rooted in the structure of libraries as organizations, in the organizational position of libraries within universities, and in (academic) library culture.

As a former Mellon Postdoctoral Fellow at Emory University Library, and someone who has done [research on digital humani

@domenic
domenic / promises.md
Last active June 24, 2024 03:11
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
Handlebars.registerHelper('quotify', function (string) {
var string = string.replace(/[\u2018\u2019]/g, "'").replace(/[\u201C\u201D]/g, '"');
return string;
});