Keybase proof
I hereby claim:
- I am eskimag on github.
- I am eskimag (https://keybase.io/eskimag) on keybase.
- I have a public key whose fingerprint is D7DF 3426 8D5A 3781 3F8B 5054 7128 89AF 8B9F 420D
To claim this, I am signing this object:
class String | |
# "Příšerně žluťoučký kůň úpěl ďábelské ódy".strip_diacritics => | |
# "Priserne zlutoucky kun upel dabelske ody" | |
def strip_diacritics | |
self.mb_chars.normalize(:kd).to_s.gsub(/[^\x00-\x7F]/, '') | |
end | |
# Little hacks to allow using also decimal comma (used in EU) not only decimal point | |
# "3,75".to_d => 3.75 | |
# "3,75".to_f => 3.75 |
# Bishop -- IRC bot for channel irc://chat.freenode.net/rubyonrails.cz | |
# | |
# Source: http://gist.github.com/402123.txt | |
require 'rubygems' | |
require 'cinch' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'rack/utils' |
module UseMultiDB | |
def use_db(db_name, options={}) | |
begin | |
establish_connection "#{db_name}_#{RAILS_ENV}" | |
set_table_name options[:table_name] unless options[:table_name].blank? | |
self.inheritance_column = '_sti_type_disabled' unless options[:sti] | |
rescue | |
Rails.logger.info "ERROR unable to establish connection to database '#{db_name}_#{RAILS_ENV}'" | |
end | |
end |
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
import UIKit | |
extension UIViewController { | |
class func fromMainStoryboard () -> UIViewController { | |
var storyboardID = NSStringFromClass(self) | |
let dotRangeOptional = storyboardID.rangeOfString(".", options: NSStringCompareOptions.allZeros) | |
if let dotRange = dotRangeOptional { |