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
# using rvm with ruby-1.8.7-p249 | |
# latest version 2.7.7 2010-06-17 | |
brew install libxml2 | |
# installing libxslt from source code | |
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz | |
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7 | |
make | |
sudo make install |
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
// Assumption: You have a model with a name. | |
comparator: function (User) { | |
if (User.get("name")) { | |
var str = User.get("name"); | |
str = str.toLowerCase(); | |
str = str.split(""); | |
str = _.map(str, function(letter) { return String.fromCharCode(-(letter.charCodeAt(0))) }); | |
return str; | |
}; |
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
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
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
iPad | |
1024 × 690 In landscape on iOS 4.3 | |
1024 × 672 In landscape on iOS 5 | |
768 × 946 In portrait on iOS 4.3 | |
768 × 928 In portrait on iOS 5 | |
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3 | |
1024 × 644 Always showing bookmarks bar in landscape on iOS 5 | |
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3 |
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
require 'rubygems' | |
require 'bcrypt' | |
require 'haml' | |
require 'sinatra' | |
enable :sessions | |
userTable = {} | |
helpers do |
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
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
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
# gem install mongo bson_ext json | |
require 'rubygems' # if less than Ruby 1.9 | |
require 'mongo' | |
require 'uri' | |
require 'json' | |
def get_connection | |
return @db_connection if @db_connection | |
db = URI.parse(ENV['MONGOHQ_URL']) | |
db_name = db.path.gsub(/^\//, '') |
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
# See http://jordan.broughs.net/archives/2012/07/enumerablecount_by-for-ruby | |
# Ruby >= 1.8.7 (incl 1.9.x) | |
module Enumerable | |
def count_by(&block) | |
Hash[group_by(&block).map { |key,vals| [key, vals.size] }] | |
end | |
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
require 'sinatra' | |
require 'action_mailer' | |
class Mailer < ActionMailer::Base | |
def contact | |
mail( | |
:to => "[email protected]", | |
:from => "[email protected]", | |
:subject => "Test") do |format| | |
format.text |
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
Show hidden characters
[ | |
// Drawn from http://www.sublimetext.com/forum/viewtopic.php?f=2&t=7477#p31755 | |
// Kills the annoying default of cmd-left jumping to the start of a line's | |
// code, rather than column 0. | |
{ "keys": ["super+left"], "command": "move_to", "args": {"to": "hardbol", "extend": false} }, | |
{ "keys": ["super+right"], "command": "move_to", "args": {"to": "hardeol", "extend": false} } | |
] |
OlderNewer