rvm get stable
rvm install ruby-1.9.3-p484
rvm use --default ruby-1.9.3-p484
rvm gemset create GemsetName
gem update --system --no-ri --no-rdoc
gem install passenger --no-ri --no-rdoc
If Apache:
passenger-install-apache2-module
def truncate_words(text, length = 100, truncate_string = '...') | |
return if text.nil? | |
trim = length – truncate_string.chars.length | |
text.length > length ? text[/\A.{#{trim}}\w*\;?/m][/.*[\w\;]/m] + truncate_string : text | |
end |
#!/usr/bin/env ruby -wKU | |
# Paste this code into a TextExpander snippet to have the Shakespeare Insult Kit a keystroke away | |
# Just set the Content of the TextExpander snippet to 'Shell Script', and give it an abbreviation | |
# Shakespeare Insult Kit: http://www.pangloss.com/seidel/shake_rule.html | |
print "Thou " + ["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty","cullionly","fusty","caluminous","wimpled","burly-boned","misbegotten","odiferous","poisonous","fishified","Wart-necked"].sample + " " + ["base-court","bat-fowling","beef-witted","beetle-headed","b |
<VirtualHost *:80> | |
ServerAdmin admin@example.com | |
ServerName example.com | |
ServerAlias example.com | |
RewriteEngine on | |
RewriteCond %{SERVER_PORT} ^80$ | |
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R] | |
</VirtualHost> |
{ | |
"sublimelinter_executable_map": | |
{ | |
"ruby": "rvm-auto-ruby" | |
} | |
} |
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then | |
source "$rvm_path/scripts/rvm" | |
source ".rvmrc" | |
fi |
Railsappname::Application.routes.draw do | |
root :to => "home#index" | |
devise_for :users, :skip => [:sessions, :registrations] | |
devise_scope :user do | |
# make some pretty URLs | |
get "login" => "devise/sessions#new", :as => :new_user_session | |
post 'login' => 'devise/sessions#create', :as => :user_session | |
delete "logout" => "devise/sessions#destroy", :as => :destroy_user_session |
[ | |
{ "keys": ["ctrl+shift+g"], "command": "git_add_current_file_and_git_commit" } | |
] |
class DeferredGarbageCollection | |
DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || 15.0).to_f | |
@@last_gc_run = Time.now | |
def self.start | |
GC.disable if DEFERRED_GC_THRESHOLD > 0 |
rvm get stable
rvm install ruby-1.9.3-p484
rvm use --default ruby-1.9.3-p484
rvm gemset create GemsetName
gem update --system --no-ri --no-rdoc
gem install passenger --no-ri --no-rdoc
If Apache:
passenger-install-apache2-module
class Photo < ActiveRecord::Base | |
attr_accessible :caption, :image, :image_file_name, :image_content_type, :image_file_size | |
end |