Skip to content

Instantly share code, notes, and snippets.


Jurre jurre

View GitHub Profile
jurre / bench.rb
Created January 13, 2015 10:51
roar vs ams
View bench.rb
require "bundler"
require "active_model_serializers"
require "roar"
require "roar/json/json_api"
require "benchmark"
require "ffaker"
Post =, :author, :body, :draft) do
include ActiveModel::Serializers::JSON
View DateParsingPerformanceComparison.m
#import <Foundation/Foundation.h>
#import "sqlite3.h"
typedef int64_t timestamp;
NSUInteger randomNumberInRange(NSUInteger start, NSUInteger end);
// Create a sample date using the ISO-8601 format.
// 2013-04-23T16:29:05Z
NSString* generateSampleDate();
jurre /
Created December 31, 2013 13:41
Happy 2014!
formatted_time() {
local total_seconds=${1}
printf "%02d:%02d:%02d\n" $hours $minutes $seconds
jurre / gist:8030430
Last active December 31, 2015 18:59
string to pastel color
View gist:8030430
def pastel_color_for_string(string)
start_color = 128
total_offset = 64
hex_value = [
string_to_integer_hash(string) % total_offset,
string_to_integer_hash(string.reverse) % total_offset,
].sort.each_cons(2).map do |a, b|
"%02x" % (start_color + b - a)
jurre / devise.rb
Last active December 31, 2015 18:22
After removing all the root elements from our JSON API I ran into an issue with devise expecting the `sign_in` params to be wrapped in their respective scope (`user` in our case), so: ```ruby { user: { email: "", password: "whatever } } ``` But with our new JSON API we wanted to get rid of the root element wrapping and wante…
View devise.rb
# config/initializers/devise.rb
Devise.setup do |config|
# .. snip
config.warden do |manager|
manager.default_strategies(:scope => :user).unshift :unwrapped_authenticatable
jurre / gist:7155759
Created October 25, 2013 14:42
View gist:7155759
# Path to your oh-my-zsh configuration.
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# Example aliases
jurre /
Created October 19, 2013 15:39
An easy way to set a macro with your local IP address, just add it as a build phase in Xcode.
set -e
echo "// This file is generated by a build script." > $HEADER
echo "// Updated on "`date` >> $HEADER
echo "" >> $HEADER
ip_address="`ifconfig en0 | grep "inet " | cut -d: -f2 | awk '{print $2}'`"
jurre / gist:6810338
Last active December 24, 2015 14:09
sublime settings
View gist:6810338
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Base16/base16-default.dark.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 12.0,
"highlight_line": true,
jurre / nl.yml
Last active December 21, 2015 18:49 — forked from soffes/en.yml
View nl.yml
comment_on_twitter: 'Reageer op Twitter'
older: 'Ouder'
newer: 'Nieuwer'
feed: 'Feed'
share: 'Deel'
close: 'Sluit'
next_post: 'Next Post'
previous_post: 'Volgende Post'
jurre / application.css
Created December 30, 2011 19:40 — forked from lucapette/application.css
twitter bootstrap rails 3.1 notes
View application.css
*= require_self
html, body {
background-color: #eee;
body {
padding-top: 40px; /* 40px to make the container go all the way to the bottom of the topbar */