[ Launch Inlet ]Gist #2958196 No Previous Gist
This file contains hidden or 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
| /* | |
| On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings, | |
| and don't need to be repeated here. Anything listed here will take precedence, however. | |
| */ | |
| [ | |
| { "keys": ["super+shift+n"], "command": "new_window" }, | |
| { "keys": ["super+shift+w"], "command": "close_window" }, | |
| { "keys": ["super+o"], "command": "prompt_open" }, | |
| { "keys": ["super+shift+t"], "command": "reopen_last_file" }, | |
| { "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} }, |
This file contains hidden or 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
| # ~/.tmuxinator/burnthis.yml | |
| # you can make as many tabs as you wish... | |
| project_name: burnthis | |
| project_root: ~/sites/burnthis | |
| tabs: | |
| - main: | |
| layout: tiled | |
| panes: | |
| - sleep 10; zeus console |
This file contains hidden or 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
| # ~/.tmuxinator/burnthis.yml | |
| # you can make as many tabs as you wish... | |
| project_name: burnthis | |
| project_root: ~/sites/burnthis | |
| tabs: | |
| - services: | |
| layout: main-vertical | |
| panes: | |
| - zeus start |
This file contains hidden or 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
| module Kaleidoscope | |
| module InstanceMethods | |
| def colors_for | |
| end | |
| def generate_colors | |
| Kaleidoscope.log("Generating colors.") | |
| end | |
| def destroy_colors |
This file contains hidden or 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 'rails' | |
| require 'spec_helper' | |
| require 'generator_spec/test_case' | |
| require 'generators/kaleidoscope/kaleidoscope_generator' | |
| describe 'TestMigration' do | |
| include GeneratorSpec::TestCase | |
| destination File.expand_path("../tmp", __FILE__) | |
| arguments %w(photo) |
This file contains hidden or 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
| alias gcb='git checkout -b' # Check out a new branch | |
| alias hack='bash ~/hack.sh' # Hack on the branch | |
| alias ship='bash ~/ship.sh' # Ship the feature | |
| alias dwf='bash ~/dwf.sh' # Delete the working feature | |
| alias hsd='hack && ship && dwf' # Hack, ship, delete |
This file contains hidden or 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
| class Whatever < ActiveRecord::Base | |
| before_validation :smart_add_url_protocol | |
| validates_format_of :url, | |
| :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, | |
| :message => "URL should be in this format: http://google.com" | |
| private | |
| def smart_add_url_protocol |
This file contains hidden or 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
| - tutorial = @tutorial || Tutorial.new | |
| = simple_form_for tutorial do |f| | |
| = f.input :title, input_html: { class: 'span4' } | |
| = f.input :url, label: 'URL', input_html: { class: 'span4' } | |
| = f.input :description, as: :text, input_html: { class: 'span4' } | |
| = f.submit "Add New Tutorial", class: 'btn btn-success' |
This file contains hidden or 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
| def show | |
| params[:page] ||= 1 | |
| @user = User.find_by_username!(params[:id].downcase) | |
| @artworks = @user.artworks.paginate(:page => params[:page], :per_page => 10).recent | |
| users_likes_ids = [] | |
| if signed_in? | |
| artwork_ids = [] |