- GitHub Staff
- twitter.com/jurretweet
View bench.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler" | |
require "active_model_serializers" | |
require "roar" | |
require "roar/json/json_api" | |
require "benchmark" | |
require "ffaker" | |
Post = Struct.new(:id, :author, :body, :draft) do | |
include ActiveModel::Serializers::JSON | |
end |
View DateParsingPerformanceComparison.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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(); |
View happy2014.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
formatted_time() { | |
local total_seconds=${1} | |
((hours=total_seconds/3600)) | |
((minutes=total_seconds%3600/60)) | |
((seconds=total_seconds%60)) | |
printf "%02d:%02d:%02d\n" $hours $minutes $seconds | |
} |
View gist:8030430
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pastel_color_for_string(string) | |
start_color = 128 | |
total_offset = 64 | |
hex_value = [ | |
0, | |
string_to_integer_hash(string) % total_offset, | |
string_to_integer_hash(string.reverse) % total_offset, | |
total_offset | |
].sort.each_cons(2).map do |a, b| | |
"%02x" % (start_color + b - a) |
View devise.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/devise.rb | |
Devise.setup do |config| | |
# .. snip | |
config.warden do |manager| | |
manager.default_strategies(:scope => :user).unshift :unwrapped_authenticatable | |
end | |
end |
View gist:7155759
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# 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. | |
ZSH_THEME="agnoster" | |
# Example aliases |
View set-local-ip.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
HEADER="${SRCROOT}/LearningSpaces-iPad/ip_address.h" | |
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}'`" |
View gist:6810338
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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, | |
"ignored_packages": | |
[ | |
"Vintage" |
View nl.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nl: | |
viewer: | |
comment_on_twitter: 'Reageer op Twitter' | |
older: 'Ouder' | |
newer: 'Nieuwer' | |
feed: 'Feed' | |
share: 'Deel' | |
close: 'Sluit' | |
next_post: 'Next Post' | |
previous_post: 'Volgende Post' |
View application.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*= 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 */ | |
} |
NewerOlder