Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Kreeftmeijer jeffkreeftmeijer

View GitHub Profile
View gist:d243932dd41ef1f94aa48567cf50e83c
iPhone 5 still looking good. Source: NölSch.de
I own a 2012 iPhone 5 and today I decided that I won’t be buying a new iPhone. I do like the new iPhones, it’s just that I don’t see the added value for me to buy a new one, and I think I’m not the only one in this situation. My “old” iPhone 5 holds up perfectly to my current needs. And I say “current needs” because “Back in the day” I would basically try out all the apps and play all the games. But Today, more than 80% of those apps are long gone. Either I lost interest or they made a really good mobile website that does the job just fine. Today, next to the native apps like Safari and mail, I only regularly use Reddit, Youtube and the mirror apps for Sketch and Photoshop. I have other apps installed, but those are just there when I need them. "You never know when you might need that QR scanner"? Wrong! You never need a QR scanner, so you can safely delete it.
That said, I don’t really need the newest A10 processor or a double photo lens in my daily use. It woul
View options.rb
# Option 1
info = if publication
"Title: #{ publication.title } (ID: #{ publication.id })"
else
'N/A'
end
# Option 2
info = case publication
when Publication then puts "Title: #{ publication.title } (ID: #{ publication.id })"
View arnold.rb
require 'tempfile'
module Arnold
def edit
YAML.load(change).each { |key, value| write_attribute(key, value) }
end
def edit!
edit
View QTKit-capturefix.bridgesupport
<?xml version="1.0"?>
<!DOCTYPE signatures SYSTEM
"file://localhost/System/Library/DTDs/BridgeSupport.dtd">
<signatures version="0.9">
<cftype name='CVBufferRef' type='^{__CVBuffer=}'/>
</signatures>
View squareup_spec.rb
module PaymentExampleHelpers
def when_amount_is(amount, &block)
context "with an amount of $#{amount}" do
instance_eval(&block)
end
end
end
View inheritance.rb
class TheUppermostClass
def initialize(one, two, three, four)
end
end
class TheInheritingClass < TheUppermostClass
def initialize(one, two, three)
super(one, two, three, 'four')
end
View nuke.rb
require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"
View nuke.rb
require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"
View is_the_apple_store_still_down.rb
require 'rubygems'
require 'httparty'
loop do
response = HTTParty.get 'http://store.apple.com/'
if response.body.include? "We'll be back soon"
puts '.'
else
`say OMG! It\\'s back!`
end
You can’t perform that action at this time.