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
| if application "Messages" is running then | |
| tell application "Messages" | |
| log in service "transue@gmail.com" | |
| set status of service "transue@gmail.com" to available | |
| set status message to "%Track - %Artist" | |
| end tell | |
| end if |
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
| # Load plugins (only those I whitelist) | |
| Pry.config.should_load_plugins = false | |
| Pry.plugins["doc"].activate! | |
| # Launch Pry with access to the entire Rails stack. | |
| # If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
| # If you don't, you can load it through the lines below :) | |
| rails = File.join Dir.getwd, 'config', 'environment.rb' | |
| if File.exist?(rails) && ENV['SKIP_RAILS'].nil? |
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 TouchMyScheme | |
| after_save :touch_my_scheme | |
| def touch_my_scheme | |
| scheme.touch | |
| end | |
| end | |
| include "lib/touch_my_scheme" |
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 add_rotator_to(hash) | |
| hash.define_singleton_method :rotator do | |
| inject({}) do |rotated, key_value| | |
| if key_value.first =~ /_rotate/ | |
| rotated.merge key_value.first[0..-8].to_sym => self[key_value.first].rotate!.first | |
| else | |
| rotated.merge key_value.first => key_value.last | |
| end | |
| end | |
| end |
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
| describe "copying" do | |
| context "within a cabinet_template" do | |
| let (:cabinet_template) { FactoryGirl.create :cabinet_template } | |
| let!(:ports) do | |
| FactoryGirl.create_list(:component, | |
| :with_ports, | |
| :number_of_ports => 1, | |
| :cabinet => cabinet_template).collect(&:ports).reduce(&:+).tap do |ports| | |
| FactoryGirl.create :cable, :connections => ports | |
| end |
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 Strands.Models.Site extends Backbone.Model | |
| url: -> | |
| if this.isNew() | |
| '/sites.json' | |
| else | |
| '/sites/' + this.id + '.json' | |
| link: -> '/sites/' + this.id | |
| name: -> @get('name') |
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 Cable < ActiveRecord::Base | |
| has_many :connections, :class_name => 'Port', :autosave => false | |
| end |
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 Cable < CopyableActiveRecord | |
| has_many :ports, :through => :connections | |
| belongs_to :type, :class_name => 'CableType' | |
| end |
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
| # See http://help.github.com/ignore-files/ for more about ignoring files. | |
| # | |
| # If you find yourself ignoring temporary files generated by your text editor | |
| # or operating system, you probably want to add a global ignore instead: | |
| # git config --global core.excludesfile ~/.gitignore_global | |
| # Ignore bundler config | |
| /.bundle | |
| # Ignore the default SQLite database. |
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 ApplicationHelper | |
| def navigator(*columns, &block) | |
| haml_tag :div, :id => "navigator", :class => "table" do | |
| haml_tag :div, :class => "header" do | |
| columns.each do |column| | |
| haml_tag :div do | |
| haml_concat column | |
| end | |
| end | |
| end |