Skip to content

Instantly share code, notes, and snippets.

(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
@CrookedNumber
CrookedNumber / gist:c5a6f08c34ac1740d8b9
Created October 20, 2014 15:05
Brussels Sprout Salad with Cheddar, Hazelnuts, and Apple
SERVES 8
Slice the sprouts as thin as possible. Shred the cheddar on the large holes of a box grater.
INGREDIENTS
3 tablespoons lemon juice
2 tablespoons Dijon mustard
1 small shallot, minced
1 garlic clove, minced
@CrookedNumber
CrookedNumber / gist:9254367
Created February 27, 2014 17:03
Rename existing branch
git branch -m <newname>
@CrookedNumber
CrookedNumber / gist:8978018
Last active August 29, 2015 13:56
RESTful

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).

Now,

@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

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.

Gently seasoned with a touch of chile powder, cinnamon and vanilla, this fragrant hot chocolate recipe is not too sweet and very complex. Using both cocoa powder and chocolate gives the roundest, deepest chocolate flavor while a mix of whole milk and cream makes it wonderfully rich and thick.
TOTAL TIME10 minutes plus 1 hour steeping
FACEBOOK
TWITTER
GOOGLE+
SAVE
EMAIL
SHARE
PRINT
REPRINTS
@CrookedNumber
CrookedNumber / trello
Last active November 16, 2020 17:36
Sample bash script to add tickets to Trello
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage is: $0: <board> <title>"
echo "For example: trello wedding 'Taste cakes'"
exit 1
fi
if [ $1 != 'work' -a $1 != 'homeprojects' -a $1 != 'wedding' ]
@CrookedNumber
CrookedNumber / gist:8856939
Last active September 12, 2022 17:33
How to create Trello Cards from the Command Line (with a ~10 minute set-up)
  1. This is quick and dirty and not terribly maintainable. But it's very useful for creating quick cards from the terminal. Requires familiarity with Trello and a basic understanding of bash.
  2. Log-in to Trello.
  3. Go to: https://trello.com/1/appKey/generate
  4. Make note of your key. Replace any mention of YourTrelloKey with this hash.
  5. Create a token. Go to https://trello.com/1/authorize?key=YourTrelloKey&name=SimpleBASHScript&expiration=never&response_type=token&scope=read,write in your browser and follow directions.
  6. Make note of the token. Replace any mention of YourTrelloToken with this looong hash.
  7. Pick a reasonable number of the most popular boards you use. Grab the URLs of those boards. At the same time, think of short, one-word, easy-to-remember names for each board (e.g., work, homeprojects, wedding).
  8. Grab the board IDs of the boards you chose. It'll be the ~8 character hash-like string in the URL. E.g., for https://trello.com/b/aWsGTrsD/work the ID is aWsGTrsD
  9. One by one, plug thos
function composer_fix_music_programs() {
$use_composer2_data = variable_get('pi_guide_use_composer2_data');
if ($use_composer2_data) {
$music_program_nids = composer_get_nids_of_music_programs();
foreach ($music_program_nids as $music_program_nid) {
$music_program_node = node_load($music_program_nid);
$music_program_node->field_display_playlist_block['und'][0]['value'] = '1';
@CrookedNumber
CrookedNumber / gist:6343955
Created August 26, 2013 17:10
MAMP kill all mysql
killall -9 mysqld