Skip to content

Instantly share code, notes, and snippets.

View josephdburdick's full-sized avatar
😇
Mentally present

Joe josephdburdick

😇
Mentally present
View GitHub Profile
/**
* An implementation for Mergesort. Less efficient
* than Quicksort. Again, you'd just use Array.sort
* but if you found yourself unable to use that
* there's always this option.
*
* Tests with:
*
* var array = [];
* for(var i = 0; i < 20; i++) {
class BottlesOfBeer
def pluralize? n
if n != 1
"bottles"
else
"bottle"
end
end
def count_off
class BottlesOfBeer
def count_off
puts "How many bottles of beer have you got?"
numbers = gets.chomp.to_i
word_bottles = "bottles"
numbers.downto(1) do |number|
puts "\n#{number} #{word_bottles} of beer on the wall"
puts "#{number} #{word_bottles} of beer!"
puts "You take one down and pass it around,"
@josephdburdick
josephdburdick / Anti-Soshe.rb
Created November 15, 2013 22:51
Running this returns the following error. Any ideas? /Users/jb/.rvm/gems/ruby-2.0.0-p247/gems/twilio-ruby-3.11.4/lib/twilio-ruby/rest/client.rb:139:in `initialize': undefined method `strip' for nil:NilClass (NoMethodError) from /Users/jb/Sites/code/class/BEWD_NYC_5_Homework/Joe_Burdick/midterm/Anti-Soshe-runner.rb:7:in `new' from /Users/jb/Sites…
class Call
def initialize name="Stranger"
@name = name
@account_sid = ENV["TWILIO_SID"]
@auth_token = ENV["TWILIO_TOKEN"]
@client = Twilio::REST::Client.new(@account_sid, @auth_token)
@account = @client.account
introduce
@josephdburdick
josephdburdick / gist:8072172
Created December 21, 2013 17:10
NameError in SessionsController#create uninitialized constant Admin::AdminsEvent
def store_admin_names admins
admin_names = []
admins.each do |admin|
admin_names << admin["name"]
new_admin = Admin.find_or_initialize_by(fb_id: admin["id"])
new_admin.name = admin["name"]
new_admin.save!
#new_admin.events << Event.last["id"] #this is the line giving me problems
end
end

Mouse Scroll Notify

Handy dandy CSS3 only notifier that a person is supposed to scroll to see something happen.

The coolest part of this is that by using REM size units and percentages you can easily size this mouse by changing the WIDTH value of the mouse-container class.

A Pen by Joe on CodePen.

License.

@josephdburdick
josephdburdick / flipsnap.styl
Last active August 29, 2015 13:56
Code of Blue Chair Bay Rum Flipsnap implementation.
.viewport
width: 100%
overflow: hidden
margin: 0 auto
position: relative
.bullets-container
size: 100% 25px
absolute: bottom 13px left 0px right 0px
text-align: center
@media lt-sm
@media xs
.column.full,
.column.two-thirds,
.column.half,
.column.one-third,
.column.one-fourth
float: none;
margin: 0;
width: 100%;
@josephdburdick
josephdburdick / _mediaqueries.styl
Last active August 29, 2015 13:57
Stylus Utility Belt: _mediaqueries.styl
// Responsive + Retina
retina = '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dppx)'
xs = '(max-width: 767px)'
sm = '(min-width: 768px) and (max-width: 991px)'
md = '(min-width: 992px) and (max-width: 1199px)'
lg = '(min-width: 1200px)'
lt-lg = '(max-width: 1199px)'
lt-md = '(max-width: 991px)'
lt-sm = '(max-width: 767px)'
@josephdburdick
josephdburdick / _breakpoint-inspector.styl
Created March 17, 2014 01:10
Stylus Utility Belt: _breakpoint-inspector.styl
body
&:after
padding : 5px 20px
display : inline-block
position : fixed
bottom : 0
right : 5px
background: black
color : white
z-index : 999