Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)
- Some utilities:
sudo apt-get install vim tmux git curl- Copy/paste from the command line:
| /* sans-serif */ | |
| font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; | |
| font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; | |
| font-family: Verdana, Geneva, Tahoma, sans-serif; | |
| font-family: Trebuchet, Tahoma, Arial, sans-serif; | |
| font-family: GillSans, Calibri, Trebuchet, sans-serif; | |
| font-family: "DejaVu Sans", "Bitstream Vera Sans", "Segoe UI", "Lucida Grande", Verdana, Tahoma, Arial, sans-serif; | |
| font-family: Geneva, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | |
| font-family: Geneva, Verdana, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; | |
| font-family: "HelveticaNeue-Roman", "Helvetica 55 Roman", Helvetica, Arial, sans-serif; |
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
| import sublime, sublime_plugin | |
| import os.path, string | |
| VALID_FILENAME_CHARS = "-_.() %s%s%s" % (string.ascii_letters, string.digits, "/:\\") | |
| # { "keys": ["alt+o"], "command": "open_filename_under_cursor" } | |
| # https://gist.github.com/1186126 | |
| class OpenFilenameUnderCursor(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| for region in self.view.sel(): |
| #config/initializers/redis.rb | |
| require 'redis' | |
| require 'redis/objects' | |
| REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys | |
| dflt = REDIS_CONFIG[:default].symbolize_keys | |
| cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym] | |
| $redis = Redis.new(cnfg) | |
| Redis::Objects.redis = $redis |
sudo apt-get install vim tmux git curl| upstream plex-upstream { | |
| # change plex-server.example.com:32400 to the hostname:port of your plex server. | |
| # this can be "localhost:32400", for instance, if Plex is running on the same server as nginx. | |
| server plex-server.example.com:32400; | |
| } | |
| server { | |
| listen 80; | |
| # server names for this server. |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>name</key> | |
| <string>TestConsoleTheme</string> | |
| <key>settings</key> | |
| <array> | |
| <dict> | |
| <key>settings</key> |
Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.
// Locks the page if it's currently unlocked
$.scrollLock();
// ...or vice versa
| # Clear existing task so we can replace it rather than "add" to it. | |
| Rake::Task["deploy:compile_assets"].clear | |
| namespace :deploy do | |
| desc 'Compile assets' | |
| task :compile_assets => [:set_rails_env] do | |
| # invoke 'deploy:assets:precompile' | |
| invoke 'deploy:assets:precompile_local' | |
| invoke 'deploy:assets:backup_manifest' |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |