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
class Bol | |
def getPin(pins, index) | |
if index > pins.length - 1 | |
0 | |
elsif pins[index] == 'G' | |
0 | |
elsif pins[index] == '/' || pins[index] == 'x' | |
getPin(pins, index + 1) | |
else | |
pins[index] |
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
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_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
gem("rspec-rails", :group => "test") | |
gem("guard-rspec', :group => "test") | |
remove_file public/index.html | |
generate("rspec", "install") | |
generate("guard", "init") |
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
-- ~/Library/Application\ Support/iTerm/Scripts/setup_rails.scpt | |
-- Thanks to http://www.worldgoneweb.com/2011/iterm2-advanced-features/#comment-20560 | |
-- http://www.iterm2.com/#/section/documentation/scripting | |
tell application "iTerm" | |
activate | |
set myterm to (make new terminal) | |
set cd_to_my_project_path to ("cd ~/Projekte/my_awesome_project") | |
-- you can altenativly tell the first terminal | |
tell the first terminal | |
launch session "Panes" |
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
gem "haml-rails" | |
gem 'simple_form' | |
gem_group :development do | |
gem 'i18n_generators' | |
gem 'commands' | |
gem 'pry-rails' | |
gem 'hirb-unicode' | |
gem 'growl' # Mac OS only |
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
# coding: utf-8 | |
class AddCountCacheToPublications < ActiveRecord::Migration | |
def change | |
add_column :publications, :concerns_count, :integer, null: false, default: 0 | |
add_column :publications, :publication_comments_count, :integer, null: false, default: 0 | |
Publication.reset_column_information | |
Publication.all.each do |p| | |
Publication.update_counters p.id, concerns_count: p.concerns.count, publication_comments_count: p.publication_comments.count | |
end |
OlderNewer