- Dropbox
- 1Password
- Alfred
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
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def filter(filtering_params) | |
filtering_params.reduce(self) do |relation, (scope_name, value)| | |
relation.public_send(scope_name, value) if value.present? | |
end | |
end | |
end |
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 'securerandom' | |
codes = Array.new(200) { SecureRandom.hex(8) } # => ["de988ab34e9ac058", "423198812a0152ad", … ] |
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 Content | |
def initialize(options={}) | |
@notifier = options.fetch(:notifier) { | |
->(user) { puts "#{user.name}, you won!" } | |
} | |
end | |
def choose_winner | |
winner = User.new | |
@notifier.call(winner) |
- Open the iTunes subscription (itpc://rubytapas.dpdcart.com/feed)
- Authenticate with your Ruby Tapas username and password
- Plug in your device and select it from the Devices menu
- Open the Podcasts tab
- Enable "Sync Podcasts"
- Ensure that RubyTapas is included in the sync list
- Press Apply
- Enable Wi-Fi syncing to get the episodes without plugging into your computer (optional)
Note: iTunes Syncing only works with the Podcasts app (https://itunes.apple.com/us/app/podcasts/id525463029?mt=8)
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
Octokit.configure do |c| | |
c.api_endpoint = 'https://github.company.com/api/v3' | |
c.web_endpoint = 'https://github.company.com/' | |
end |
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
log | |
tags | |
tmp |
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
source :rubygems | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'coffee-script' |
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
Date.prototype.get12Hours = function() { | |
return this.getHours() % 12 || 12; | |
}; | |
Date.prototype.getMeridanIndicator = function() { | |
return this.getHours() >= 12 ? 'PM' : 'AM'; | |
}; |
NewerOlder