Skip to content

Instantly share code, notes, and snippets.

View phoet's full-sized avatar
:shipit:
Shippin Stuffs 🚀

Peter Schröder phoet

:shipit:
Shippin Stuffs 🚀
View GitHub Profile
@phoet
phoet / vrtucar.md
Last active August 29, 2015 13:56
VRTUCAR requirements

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.

@phoet
phoet / readme.md
Last active December 30, 2015 06:59
Nexus 5 pros/cons

Nexus 5 usage report (Jan 2014)

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:

@phoet
phoet / pdf_support.rb
Created October 25, 2013 12:14
RSpec PDF content matcher
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
@phoet
phoet / geocoder_stub.rb
Created October 16, 2013 15:15
example for stubbing geocoder calls
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',
@phoet
phoet / menu.rb
Created October 15, 2013 07:52
curses example drawing a menu
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)
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@phoet
phoet / readme.md
Last active December 24, 2015 07:19
i am stupid and lazy, RubyMotion to the rescue!

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
@phoet
phoet / bahn.rb
Created September 24, 2013 20:25
scrub the deutsche bahn website for trains leaving hamburg main station to bergedorf
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
@phoet
phoet / acceptance_spec_helper.rb
Last active December 23, 2015 19:29
don't put all your stuff in /spec
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'
@phoet
phoet / so_coded.md
Last active December 19, 2015 22:29
So Coded - A Web Conference in Hamburg

Hallo,

ich würde Euch gerne darauf aufmerksam machen, dass am 19. und 20. September in diesem Jahr erstmalig die "So Coded" Konferenz in der LOLA in Hamburg Bergedorf stattfindet.

Wenn ihr daran interessiert seid, dann könnt ihr hier mehr erfahren http://socoded.com/

Schöne Grüße, Peter Schröder