Peter Schröder phoet

View bacon_infused.rb
1 2 3 4 5 6 7 8 9 10
# application.rb
#
# config.middleware.use "BaconInfused"
 
class BaconInfused
def initialize(app)
@app = app
end
 
def call(env)
View vrtucar.md

A lot of people @Shopify would love to use VRTUCAR. Some of them already do so.

The Business-Plan does not cut it, because Shopify does not want to pay for all the trips of the Employees. They want something that can be used as a perk with a fixed price.

For example: pay a monthly fee and provide reduced rates on driving per employee

If you can help with that please contact brittany AT shopify.com.

View readme.md

Nexus 5 usage report

I just switched from iPhone 5 to a Nexus 5 32GB for 399€ from the Google Play Store.

I used the Nexus for about a Month now and I am pretty impressed.

It's a lot of phone for the price.

Pros:

View pdf_support.rb
1 2 3 4 5 6 7 8 9 10
module PDF
class Loader
def self.content_for(body)
temp_pdf = Tempfile.new('pdf')
temp_pdf << body.force_encoding('UTF-8')
temp_pdf.close
 
receiver = PDF::SimplePageTextReceiver.new
PDF::Reader.file(temp_pdf.path, receiver)
receiver.content
View geocoder_stub.rb
1 2 3 4 5 6 7 8 9 10
require 'geocoder'
 
Geocoder.configure(:lookup => :test)
Geocoder::Lookup::Test.add_stub(
"Nantes, France", [
{
'latitude' => 47.218371,
'longitude' => -1.553621,
'address' => '4 Rue de la Commune, 44000 Nantes, France',
'state' => 'Pays de la Loire',
View menu.rb
1 2 3 4 5 6 7 8 9 10
require "curses"
include Curses
 
init_screen
start_color
noecho
 
def draw_menu(menu, active_index=nil)
4.times do |i|
menu.setpos(i + 1, 1)
View gist:6916641
1 2 3 4 5 6 7 8 9
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'sqlite3'
GEMFILE
 
system 'bundle'
end
View readme.md

responding to this conversation on twitter: https://twitter.com/phoet/status/383552370015485952

it would be awesome if the RubyMotion toolchain would help me fail fast when submitting stuff to apple.

i have had several issue when doing this in the past:

  • i used an ad_hoc profile for distrubition (don't know if it's possible to know from the certificate)
  • info_plist entries were empty
  • CFBundleShortVersionString was not set properly
  • Icons and LaunchImages were missing, had a bad format (not PNG) or the wrong resolution
View bahn.rb
1 2 3 4 5 6 7 8 9 10
class Bahn
URL = 'http://reiseauskunft.bahn.de/bin/bhftafel.exe'
 
def initialize
@now = Time.now
@date = @now.strftime('%d.%m.%y')
@time = @now.strftime('%H:%M')
end
 
def scrape
View acceptance_spec_helper.rb
1 2 3 4 5 6 7 8 9 10
require 'simplecov'
SimpleCov.command_name "acceptance"
 
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
 
require 'capybara/rails'
require 'capybara/poltergeist'
Something went wrong with that request. Please try again.