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:
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 |
# !/bin/sh | |
user="$(whoami)" | |
bin_dir="/Users/$user/bin" | |
if [ ! -d "$bin_dir" ] | |
then | |
echo "Create directory $bin_dir\n" | |
mkdir "$bin_dir" | |
fi | |
command_line="/Applications/Sublime Text 2.app/Contents/SharedSupport/bin" |
int potency(int basis, int exponent) { | |
if(exponent == 1) return basis; | |
else return this.potenz(basis, exponent-1)*basis; | |
} |
public function array_multi_unique($multiArray){ | |
$uniqueArray = array(); | |
foreach($multiArray as $subArray) { | |
if(!in_array($subArray, $uniqueArray)) { | |
$uniqueArray[] = $subArray; | |
} | |
} | |
return $uniqueArray; | |
} |