View gist:0dcfb7e5490caecb4c0a458851b8f49f
function srv {
if [ $# -eq 0 ]
php -S "localhost:$port"
View pluck
function pluck {
arr=($(echo `git ls-files -m`))
echo $plucked | tr -d '\n' | pbcopy
echo $plucked >&1
View gist:193d0be6657ccbf3a7b0
3 eggs
½ vanilla bean, split, or 1/2 teaspoon vanilla extract
⅓ cup sugar, preferably organic fair-trade sugar
Pinch of salt
⅔ cup sifted unbleached all-purpose flour
½ cup plain yogurt
¾ cup low-fat milk
35-40 @375
View gist:8ee6591b64141e9893a7
git branch -u upstream/foo
// e.g., git branch -u origin/master
View gist:570832461862bd4d3337
(Makes 10-12 crepes, depending on the size of your pan)
1 c. flour (all-purpose or whole wheat)
Pinch of salt
1 1/4 c. milk
2 eggs
2 Tbsp. butter, melted and cooled
View gist:c5a6f08c34ac1740d8b9
Slice the sprouts as thin as possible. Shred the cheddar on the large holes of a box grater.
3 tablespoons lemon juice
2 tablespoons Dijon mustard
1 small shallot, minced
1 garlic clove, minced
View gist:9254367
git branch -m <newname>
View gist:8978018

The short answer is that no one talks about RESTful websites because websites are RESTful by default. You really have to try to make a non-RESTful website (though it has been done--see below).

The setup you're describing takes a lot of elements from REST, but it's not "REST" per se: it's a set of conventions designed for the convenience of server-side programmers. Most of today's web APIs only use a subset of the REST constraints, and it's a subset that doesn't include the main driving principle behind websites.

Let me back up a bit. Here's what websites and web APIs have in common: they both expose functionality through resources. Each resource is identified by a URL, and each responds to an appropriate subset of the standard HTTP methods. (This may seem obvious, but look at XML-RPC or SOAP, where there's only one URL for the whole system.) A resource might send documents to the client (in response to a GET request) and/or it might accept documents from the client (along with a POST or PUT request).


View gist:8964442

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.