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
My iTunes Match Track upgrading and process info: | |
If you have less than 25,000 tracks: | |
1. First let iTunes Match do its things and find all possible matches in your library and finish uploading any non-matching tracks. | |
2. Once its done, make a new Smart Playlist (I made a folder for all my Smart iTunes Match Related Playlists) | |
Name this one: iCloud-Upgradeable | |
Criteria: | |
MATCH ALL: | |
Bit Rate is less than 256kbps |
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
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'rspec/autorun' | |
require 'machinist/active_record' | |
require 'machinist/caching/active_record' | |
# Requires supporting ruby files with custom matchers and macros, etc, | |
# in spec/support/ and its subdirectories. | |
spec_support = Rails.root.join("spec/support/**/*.rb") |
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 Person < ActiveRecord::Base | |
include Tire::Model::Search | |
include Tire::Model::Callbacks | |
has_many :addresses | |
accepts_nested_attributes_for :addresses, :allow_destroy => true | |
def to_indexed_json | |
{ | |
:addresses => adresses.map{|p| p.name}.compact.reject(&:blank?).uniq, |
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 Application < ActiveRecord::Base | |
attr_accessible :checksum, :name, :size, :configuration_attributes | |
has_one :configuration, :dependent => :destroy | |
accepts_nested_attributes_for :configuration, :allow_destroy => :true | |
after_initialize :create_new_configuration | |
private |
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
<%= form_for @application, :html => { :class => 'form-horizontal' } do |f| %> | |
<div class="control-group"> | |
<%= f.label :name, :class => 'control-label' %> | |
<div class="controls"> | |
<%= f.text_field :name, :class => 'text_field' %> | |
</div> | |
</div> | |
<div class="control-group"> | |
<%= f.label :checksum, :class => 'control-label' %> | |
<div class="controls"> |
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
brew remove mysql | |
brew cleanup | |
launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist | |
rm ~/Library/LaunchAgents/com.mysql.mysqld.plist | |
sudo rm -rf /usr/local/var/mysql |
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
#!/usr/bin/env bash | |
INSTALL_DIR="${INSTALL_DIR:-/opt/local}" | |
VERSION=$2 | |
YAML_VERSION="0.1.4" | |
APP_NAME="ruby" | |
URL="http://ftp.ruby-lang.org/pub/ruby/ruby-$VERSION.tar.bz2" | |
YAML_URL="http://pyyaml.org/download/libyaml/yaml-$YAML_VERSION.tar.gz" | |
PREFIX="$INSTALL_DIR/$APP_NAME/$VERSION" | |
YAML_PREFIX="$INSTALL_DIR/yaml" |
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
# (...) | |
Rails.boot! | |
# The code below allow to use Thin as the webserver | |
if $0 == 'script/server' | |
# commands/server.rb (#45) is not cooperative, so we patch Rack itself | |
require 'rack' | |
module Rack::Handler | |
class << self |
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
# Navigating | |
visit '/projects' | |
visit post_comments_path(post) | |
# Clicking links and buttons | |
click_link 'id-of-link' | |
click_link 'Link Text' | |
click_button 'Save' | |
click 'Link Text' # Click either a link or a button | |
click 'Button Value' |
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
require 'rdoc' | |
converter = RDoc::Markup::ToMarkdown.new | |
rdoc = File.read(ARGV[0] || 'README.rdoc') | |
puts converter.convert(rdoc) | |
# ruby rdoc2md.rb > README.md | |
# ruby rdoc2md.rb ABC.rdoc > abc.md |