⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# Scenario 1: remote resource returns a binary file; | |
# the last part of the uri represents the file name | |
# e.g. http://someurl.com/artists/jeanlucponty/tracks/elephants-in-love.mp3 | |
class Audio < ActiveRecord::Base | |
has_attached_file :file | |
def file_from_url(url) | |
self.file = download_remote_file(url) | |
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
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
/* | |
* Starts jetty for scalatra programatically | |
* | |
* Replace YourApplicationEndpointFilter with the filter in your application | |
*/ | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.servlet.{DefaultServlet, ServletContextHandler} | |
object JettyLauncher { | |
def main(args: Array[String]) { |
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
[ | |
{ "keys": ["command+alt+k"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }, | |
] |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
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
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Remove the RVM stuff from your .profile - It probably looks like... | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
# Ensure your homebrew is working properly and up to date | |
brew doctor |
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
(function(d){ | |
var scrs=d.getElementsByTagName("script"); | |
var scr=scrs[scrs.length-1]; | |
var w=window; | |
function n(){ | |
var e=d.createElement("script"); | |
e.async=true; | |
e.src=("https:"==d.location.protocol?"https://":"http://")+"example.org/path/to/javascript.js"; | |
scr.parentNode.insertBefore(e,scr); | |
} |
OlderNewer