Skip to content

Instantly share code, notes, and snippets.

View brandon-beacher's full-sized avatar
💭
🦑

Brandon Beacher brandon-beacher

💭
🦑
View GitHub Profile
# this is a bit of a hack to make a join on two keys:
# classroom_id and student_id
# we pretend classroom_id is the primary key
# then we add a condition for student_id
# the result is an association joined on two keys
has_many :enrollments,
foreign_key: :classroom_id,
primary_key: :classroom_id,
conditions: Proc.new { { enrollments: { student_id: student_id } } }
namespace :test do
namespace :tddium do
desc "tddium"
Rake::TestTask.new(:all => "db:test:prepare") do |t|
t.libs << "test"
t.test_files = Rake::FileList[
'test/integration/pathway_integration_test.rb',
'test/integration/activity_admin_integration_test.rb',
'test/integration/school_integration_test.rb',
'test/integration/student_csv_upload_integration_test.rb',
Hello,
I love Podcatcher - thanks!
I made a Playlist with Max per Podcast set to 3 episodes and Unplayed Only turned on. When I do this, a Podcast only shows 2 episodes after I play one, even though there are lots more older unplayed episodes left.
Here are some screenshots:
Podcast has 5 episodes - 3rd episode is played:
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@brandon-beacher
brandon-beacher / gist:3078769
Created July 9, 2012 20:42
sublime text settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
---
gem: --no-rdoc --no-ri
32163 ttys003 0:04.99 /Users/brandon/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /Users/brandon/.rvm/gems/ruby-1.9.3-p0@global/bin/rake test
32265 ttys003 0:19.90 /Users/brandon/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -Ilib:test -I/Users/brandon/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib /Users/brandon/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/rake_test_loader.
32399 ttys003 0:01.03 /Users/brandon/.rvm/gems/ruby-1.9.3-p0@apangea/gems/capybara-webkit-0.12.1/bin/webkit_server
class AgencyImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
version :resized do
process resize_and_pad: [571, 197]
end
version :resized_for_featured do
process resize_and_pad: [457, 156]
end
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
def link_to_with_icon(icon_class, *args)
link_to *args do
content_tag "i", class: icon_class
end
end