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
- (NSMutableAttributedString *)attributedStringFromMarkup:(NSString *)markup { | |
NSMutableAttributedString * mutableAttrString = [[[NSMutableAttributedString alloc] initWithString:@""] autorelease]; | |
NSString * nextTextChunk = nil; | |
NSString * defaultFont = @"Georgia"; | |
NSString * boldFont = @"Georgia-Bold"; | |
NSString * headingFont = @"Gill-Sans"; | |
CGFloat defaultFontSize = 18.0; | |
CGFloat headingFontSize = 22.0; |
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
// | |
// jQuery Slug Generation Plugin by Perry Trinier ([email protected]) | |
// Licensed under the GPL: http://www.gnu.org/copyleft/gpl.html | |
jQuery.fn.slug = function(options) { | |
// Only do something if the element exists | |
if(this.length != 0) { | |
var settings = { | |
slug: 'slug', // Class used for slug destination input and span. The span is created on $(document).ready() | |
hide: true // Boolean - By default the slug input field is hidden, set to false to show the input field and hide the span. |
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
################################################## | |
Install the passenger gem | |
################################################## | |
$ gem install passenger | |
############################################################################## | |
Install the Passenger-Nginx module | |
Choose all default options. (1. for Passenger to compile and install nginx) | |
############################################################################## |
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 CompetitionTest < ActiveSupport::TestCase | |
# Of course, you define a factory for Competition using FactoryGirl | |
# (outside the scope of this Gist) | |
subject { Factory(:competition) } | |
should_validate_uniqueness_of :permalink | |
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
class UserTest < ActiveSupport::TestCase | |
should "act as authenticated" do | |
module = Authlogic::ActsAsAuthentic::Login::Methods | |
User.included_modules.include?(module) | |
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
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export PATH=$PATH:~/.scripts/ | |
alias sshp='ssh -p 3456' | |
alias scpp='scp -P 3456' | |
alias ssho='ssh -p 443' | |
alias scpo='scp -P 443' |
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"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>0.082 0.087 0.109</string> | |
<key>InsertionPoint</key> | |
<string>1.000 1.000 1.000</string> |
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
$ brew install postgresql | |
==> Downloading http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.2/postgresql-8.4.2.tar.bz2 | |
######################################################################## 100.0% | |
==> ./configure --enable-thread-safety --with-bonjour --with-python --with-perl --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxsl | |
==> make install | |
==> Caveats | |
If this is your first install, create a database with: | |
initdb /usr/local/var/postgres | |
Automatically load on login with: |
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 'rubygems' | |
require 'friendly' | |
Friendly.configure :adapter => "mysql", | |
:host => "localhost", | |
:user => "root", | |
:password => "", | |
:database => "friendly_development" | |
class BlogPost |