Skip to content

Instantly share code, notes, and snippets.

@gethatgist
gethatgist / VIM - Shortcuts
Created November 16, 2012 23:54
Vim shortcuts
:e <some file>
:vsp <another file> " for vertical split
:sp <yet another file> " for horizontal split
:e path/to/file
:Rmodel <model name> # search for models
cmd + shift + f # Ack search word throughout files
@gethatgist
gethatgist / OSX Command Line
Created October 24, 2012 23:38
OSX Command Line
Test public/private keypairs
http://stackoverflow.com/questions/274560/how-do-you-test-a-public-private-keypair
@gethatgist
gethatgist / [ST2] shortcuts
Created October 16, 2012 18:17
[ST2] Shortcuts
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| *⌘T* | go to file |
| *⌘⌃P* | go to project |
| *⌘R* | go to methods |
| *⌃G* | go to line |
| *⌘KB* | toggle side bar |
| *⌘⇧P* | command prompt |
git diff --cached
## git diff of files that have been staged ie 'git add'ed
git reset HEAD <FILE>
## remove file from current index (commited area)
setup .git/config to include multiple remote locations
http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations
PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}%{$fg[green]%}⇒ %{$reset_color%}'
# RPS1='%{$fg[blue]%}%~%{$reset_color%} '
RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%} ⚡%{$fg[yellow]%}"
@gethatgist
gethatgist / ember-routes.md
Created June 27, 2012 07:14 — forked from wycats/ember-routes.md
EmberJs: Routing, Ember-Data

Routing in Ember

In Ember, the application's state manager handles routing. Let's take a look at a simple example:

App.stateManager = Ember.StateManager.create({
  start: Ember.State.extend({
    index: Ember.State.extend({
      route: "/",
@gethatgist
gethatgist / updates.md
Created June 27, 2012 07:11 — forked from wycats/updates.md
EmberJs: Routing, Nested Views

Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.

Routing

Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.

The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.

If you have already modeled your application state using Ember.StateManager, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.

@gethatgist
gethatgist / gist:3002075
Created June 27, 2012 06:49
RUBY: Rails Production Commands
# Collection of Rails snippets for use in production/deployment
bundle exec rails console production
# Restart Apache2
$ sudo /etc/init.d/apache2 restart