I hereby claim:
- I am fnitschmann on github.
- I am fnitschmann (https://keybase.io/fnitschmann) on keybase.
- I have a public key whose fingerprint is F6F8 4EB1 FD20 30EA EF23 EF93 FC33 7F44 5276 D063
To claim this, I am signing this object:
require "openssl" | |
# could also be different | |
key_length = 4096 | |
new_key = OpenSSL::PKey::RSA.generate(key_length) | |
public_key = new_key.public_key | |
public_key_string = public_key.to_s |
module UuidAsPrimaryKey | |
extend ActiveSupport::Concern | |
included do | |
before_create :assign_uuid | |
end | |
protected | |
def assign_uuid |
I hereby claim:
To claim this, I am signing this object:
# This is a quick and dirty script for Max OS X Mavericks to install | |
# the Ruby rmagick Gem (Version 2.12.2) correct with Homebrew and ImageMagick | |
# Uninstall current ImageMagick (if installed) | |
if brew list -1 | grep -q "imagemagick"; then | |
brew uninstall imagemagick --force | |
fi | |
# Get all versions of ImageMagick via Homebrew | |
brew versions imagemagick |
function ajax(url, method, data, async) { | |
method = typeof method !== 'undefined' ? method : 'GET'; | |
async = typeof async !== 'undefined' ? async : false; | |
if (window.XMLHttpRequest) { | |
var xhReq = new XMLHttpRequest(); | |
} | |
else { | |
var xhReq = new ActiveXObject('Microsoft.XMLHTTP'); | |
} |
import java.util.Calendar; | |
import java.util.Date; | |
public Date dateIn(int days) { | |
Date date = new Date(); | |
Calendar cal = Calendar.getInstance(); | |
cal.setTime(date); | |
cal.add(Calendar.DATE, days); | |
cal.set(Calendar.MINUTE, 0); |
require "date" | |
# anonymous gregorian algorithm (http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm) | |
def easter_day(year) | |
if year.is_a?(Integer) | |
y = year | |
# calculation | |
a = y % 19 | |
b = y / 100 | |
c = y % 100 |
#!/bin/sh | |
# This script uninstalls HomeBrew from your Mac completly | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
class String | |
# Print a String in a specfic color | |
def colorize(text, color_code) | |
"#{color_code}#{text}\e[0m" | |
end | |
# Green String | |
def green | |
colorize(self, "\e[1m\e[32m") | |
end | |
end |
ENV["RAILS_ENV"] ||= "test" | |
require File.expand_path("../dummy/config/environment.rb", __FILE__) | |
require "rubygems" | |
require "spork" | |
require "rspec/rails" | |
require "rspec/autorun" | |
Spork.prefork do |