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
%p | |
Here, some code! | |
~ render_some_code |
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 Team < ActiveRecord::Base | |
has_many :memberships, :class_name => 'TeamMembership', :before_add => :set_up_team | |
has_many :players, :through => :memberships, :class_name => 'User', :source => :use | |
scope :singles, lambda { | |
# Want to find the teams with only a single membership | |
} | |
end |
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
########################## Shell Prompt #################################### | |
LIGHT_BLUE="\[\033[1;34m\]" | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
parse_git_branch (){ | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} |
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 'dragonfly/rails/images' | |
app = Dragonfly[:images] | |
app.configure_with(:rmagick, :use_filesystem => false) |
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
module Admin::SnippetHelper | |
def render_snippet(snippet_name, args = nil) | |
RedCloth.new(Liquid::Template.parse(Snippet.find_by_title!(snippet_name).content).render args).to_html.html_safe | |
rescue ActiveRecord::RecordNotFound => error | |
error.message.html_safe | |
end | |
end |
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
AttributeNormalizer.configure do |config| | |
config.normalizers[:squish] = lambda do |value, options| | |
value.is_a?(String) ? value.squish : value | |
end | |
config.default_normalizers = :squish, :blank | |
end |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!-- Created with Inkscape (http://www.inkscape.org/) --> | |
<svg | |
xmlns:svg="http://www.w3.org/2000/svg" | |
xmlns="http://www.w3.org/2000/svg" | |
version="1.0" | |
width="450pt" | |
height="450pt" | |
id="svg1522"> | |
<defs |
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
<html> | |
<head> | |
<title>Header test for PDFKit</title> | |
</head> | |
<body> | |
<h3>This is your header.</h3> | |
</body> | |
</html> |
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
module I18n | |
def self.reload! | |
end | |
end |
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/bash | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
Multi-Firefox Fixer - v0.2 - 4/26/2011 | |
http://benalman.com/ | |
Usage: `basename "$0"` | |
Run this shell script from beside (in the same parent directory as) one or more | |
Firefox*.app or Aurora*.app applications and it will "fix" those Firefoxes to |