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
<% if @chapter == 'first' %> | |
<p>Welcome to your adventure page. This is where you'll be able to see what all has happened in the story, in addition to being able to work through it (at your own pace, of course).</p> | |
<p>The first thing you should do is probably go check out <%= link_to "the Mine", :controller => :mine, :action => :index %>.</p> | |
<% end %> |
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
/* | |
* Sweet sugar for jQuery's $.data API. | |
* http://yehudakatz.com/2009/04/20/evented-programming-with-jquery/ | |
* | |
* Instead of this: | |
* | |
* $("#foo").data("foo"); // Get foo | |
* $("#foo").data("foo", 'bar'); // Set foo | |
* | |
* Do this: |
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
python -m smtpd -n -c DebuggingServer localhost:1025 |
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
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} |
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
## How to create a user in Authlogic | |
User.create(:username => 'foo', :password => 'bar', :password_confirmation => 'bar') |
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
# encoding: utf-8 | |
from bottle import route, request, run, redirect, get, post | |
@get('/') | |
def home(): | |
return """ | |
<form action='' method='post'> | |
<input type='hidden' name='things' value='éøéóí' /> | |
Some unicodé! | |
<input type='submit' /> |
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
def converse(body) | |
link_to body, '#', :class => 'converse' | |
end |
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
def converse(body) | |
link_to body, '#', :class => 'converse' | |
end |
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
from django.conf import settings | |
from django.core.mail import mail_admins | |
def pdb_replacement(): | |
import inspect | |
current_frame = inspect.currentframe() | |
info = inspect.getframeinfo(current_frame.f_back.f_back) | |
mail_admins("pdb left in %s" % info[0], "%s, line #%s" % (info[0], info[1])) | |
return |
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
#!/usr/bin/env bash | |
# ---------------------------------------------------- | |
# | |
# Automated setup for a Ubuntu server with git, ruby, rvm, nginx. | |
# (Used at Carbonmade) | |
# | |
# Usage: | |
# - SCP this file to your server: scp ubuntu_setup.sh you@server:~ | |
# - Make it executable: chmod +x ubuntu_setup.sh | |
# - Run it: bash ubuntu_setup.sh |