I hereby claim:
- I am skym on github.
- I am sky (https://keybase.io/sky) on keybase.
- I have a public key ASBZNGF2pctkh7znZPGb9eVT5rai9mAEquN009PIiWlOhQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| require "digest/md5" | |
| module App | |
| module Tools | |
| class ShortCodeGenerator | |
| attr_reader :max_code_length | |
| def initialize(max_code_length) | |
| if max_code_length < 2 | |
| raise "Code length needs to be a value of AT LEAST '2'!" |
| ### Keybase proof | |
| I hereby claim: | |
| * I am skym on github. | |
| * I am sky (https://keybase.io/sky) on keybase. | |
| * I have a public key whose fingerprint is E33C B378 6984 63A7 0004 8301 9B97 5C85 B43C 7610 | |
| To claim this, I am signing this object: |
| To convert camelCase to underscores, in TextMate, replace ([a-z])([A-Z]) with $1_\l$2 | |
| To convert underscores to camelCase, replace ([a-z]+)_([a-z]+) with $1\u$2 |
| body { | |
| margin: 0; | |
| background-image: url(http://subtlepatterns.com/patterns/groovepaper.png); | |
| } | |
| body > center > table { | |
| width: 100%; | |
| background-color: transparent; | |
| } |
| #!/usr/bin/env ruby | |
| FORBIDDEN = [ | |
| /\bdebugger\b/, | |
| /\bfuck\b/, | |
| /\bshit\b/, | |
| /\bbitch\b/, | |
| /\bwtf\b/, | |
| /\bconsole\.debug\b/, | |
| /\bLorem\.ipsum\.dolor\.sit\.amet\b/, |
| ################### | |
| ~/.bash_profile | |
| ################### | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
| } | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
| } |
| def self.import_data_from_quickbase | |
| quickbase = QuickBase::Client.init("username" => QB_USERNAME, "password" => QB_PASSWORD, "apptoken" => QB_APP_TOKEN, "printRequestsAndResponses" => true) | |
| #pull down the entire list of products like a boss | |
| quickbase_products = quickbase.doQuery(QB_PRODUCTS_TABLE,nil, nil, nil, "1.2.3.4.6.7.13.17.55.63.82.92.114.115.128.131.11.132.54.133.134.8.127.135.136.137.138.139.140.141.143.144.145.146.147.148.149.150.151.152.153.154.155.156.157.12.158.159.160.161.162.163.164.165.166.167.10.168.169.170.16.171.172.9.184.185.186.187", nil, nil, nil ) | |
| product_count = quickbase_products.count | |
| (0...product_count).each do |i| | |
| puts "Doing #{i} / #{product_count}" | |
| quickbase_product = quickbase_products[i] | |
| product = Product.find_or_initialize_by_quickbase_record_id(:quickbase_record_id => quickbase_product.record_id_) | |
| if product.id |