Skip to content

Instantly share code, notes, and snippets.

View nickyp's full-sized avatar
🛁
Editing my status

Nicky Peeters nickyp

🛁
Editing my status
  • Amsterdam, Netherlands
View GitHub Profile
@nickyp
nickyp / billing.rb
Last active December 11, 2015 08:28 — forked from vtim/billing.rb
#!/usr/bin/env ruby
require 'date'
re_line1 = /^\[b([\d,]+)h\](.*)/
re_line2 = /^scheduled (.*)/
total_hours = 0.0
STDIN.each_slice(3) { |entry| # iterate per 3 lines
hours_and_description, schedule = entry[0], entry[1]
@nickyp
nickyp / ExampleClass.m
Created February 24, 2012 11:56 — forked from lukeredpath/ExampleClass.m
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end
@nickyp
nickyp / gist:1231577
Created September 21, 2011 08:35 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@nickyp
nickyp / rspec-syntax-cheat-sheet.rb
Created August 30, 2011 08:38 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
require 'nokogiri'
# \
# \
# \\
# \\
# >\/7
# _.-(6' \
# (=___._/` \
# Package Maintainer: Increment phusion_release to match latest release available
%define phusion_release 2009.10
Summary: Ruby Enterprise Edition (Release %{phusion_release})
Name: ruby-enterprise
Vendor: Phusion.nl
Packager: Adam Vollrath <adam@endpoint.com>
Version: 1.8.7
Release: 2%{dist}
License: GPL