Skip to content

Instantly share code, notes, and snippets.

View brycemcd's full-sized avatar

Bryce McDonnell brycemcd

View GitHub Profile
diff --git a/activemerchant.gemspec b/activemerchant.gemspec
index 94d3847..5b81b4d 100644
--- a/activemerchant.gemspec
+++ b/activemerchant.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.has_rdoc = true
- s.add_dependency('activesupport', '>= 2.3.2')
+ s.add_dependency('activesupport', '>= 2.3.2', '< 3.0.0')
Boot Error
Something went wrong while loading config.ru
NameError: uninitialized constant ActiveMerchant::Validateable::HashWithIndifferentAccess
/home/brycemcd/.rvm/gems/ruby-1.8.7-p174@icnowcredit/gems/active_merchant-1.5.2/lib/active_merchant/lib/validateable.rb:31
/home/brycemcd/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/home/brycemcd/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/brycemcd/.rvm/gems/ruby-1.8.7-p174@icnowcredit/gems/active_merchant-1.5.2/lib/active_merchant.rb:33
@brycemcd
brycemcd / gist:669344
Created November 9, 2010 16:36
traceroute from comcast to dkb
traceroute to 74.218.90.182 (74.218.90.182), 30 hops max, 60 byte packets
1 10.10.1.254 (10.10.1.254) 0.208 ms 0.220 ms 0.251 ms
2 73.93.36.1 (73.93.36.1) 6.546 ms 6.570 ms 6.607 ms
3 ge-7-42-ur03.beaverton.or.bverton.comcast.net (68.85.151.1) 7.402 ms 7.414 ms 7.851 ms
4 te-5-2-ar01.beaverton.or.bverton.comcast.net (68.85.243.173) 6.809 ms 10.841 ms 10.854 ms
5 te-1-3-0-5-cr01.sacramento.ca.ibone.comcast.net (68.86.90.165) 23.815 ms 23.883 ms 23.916 ms
6 pos-0-8-0-0-cr01.sanjose.ca.ibone.comcast.net (68.86.85.78) 26.266 ms 23.840 ms 23.852 ms
7 68.86.87.6 (68.86.87.6) 23.913 ms 23.633 ms 23.630 ms
8 66.109.10.145 (66.109.10.145) 22.655 ms 22.676 ms 22.705 ms
9 ae-2-0.cr0.sjc10.tbone.rr.com (66.109.6.142) 31.050 ms 31.053 ms 31.082 ms
@brycemcd
brycemcd / slideIn-Out.js
Created January 19, 2011 17:47
a simple slide in / slide out script in jquery
$(function(){
$("#slider").slideOut();
$("#clickme").click(function(){
$("#slider").slideToggle();
});
});
@brycemcd
brycemcd / pseudo_code.php
Created April 21, 2011 21:15
some psuedo code to get you going on posts your users have already seen
<?php // the cookie should hold an array of post_ids ?>
<?php $seen_posts = unserialize( strip_tags( $_COOKIE["seen_posts"] ) ) ?>
<?php
// set up your WP "loop"
foreach $loop( "SELECT * FROM POSTS WHERE post_id NOT IN ( $seen_posts ) "): ?>
<?php
// you loop is empty. The SQL query returned no records
if( empty($loop) || count($loop) == 0 ){
$seen_posts = array();
class Person
has_many :groups
has_many :group_memberships, :foreign_key => "member_id", :through => :groups
scope :owned_groups, where(:is_owner => true).joins(:group_memberships) # gets all groups where this person is owner
end
class Group_Membership
belongs_to :member, :class_name => 'Person'
belongs_to :group
@brycemcd
brycemcd / ballroom.rb
Created June 27, 2011 00:37
Ruby Relationships without the database
class Ballroom
# returns an array of all the ballroom titles
def self.all_titles
tables.collect { |x| x[0] }
end
# returns an array of table ids.
def self.get(table)
tables[table]
@brycemcd
brycemcd / smb.conf
Created July 4, 2011 20:31
samba configuration
[global]
#set up what the end user would see on their desktop
workgroup = H4LSharedFiles
server string = common files for H4L
#general user perms
security = user
passdb backend = tdbsam
@brycemcd
brycemcd / application.css
Created July 4, 2011 21:33
Improved Content Slider in Mootools
/*** SLIDER ***/
#worksamples {
width:960px;
height:180px;
}
#workimgs{
width:900px;
overflow:auto;
overflow:hidden;
height:200px;
@brycemcd
brycemcd / style.rb
Created July 29, 2011 19:16
paperclip processors
has_attached_file :main, :styles => { :grid => "250x390>",
:detail => "400x600>",
:thumb => "75x75#",
:trans => { :processors => [:trans_to_dark] }
},
:default_url => "/images/missing.png",
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:bucket => "mybuck",
:path => "product_images/:id/main/:style.:extension"