Skip to content

Instantly share code, notes, and snippets.


Frank Kany kany

  • Rickman, TN
View GitHub Profile
kany / yaml output rails console
Created Dec 13, 2012
Yaml Output in Rails Console
View yaml output rails console
1) rails c
2) YAML::ENGINE.yamler = 'syck'
3) y @user.participant
--- !ruby/object:Participant
id: 9
employee_hashed_ssn: "hashed ssn: 00001"
ch_member_id: 100
first_name: Test Employee 00001
kany / airbrake.rb
Created Oct 26, 2015
Test Airbrake From Rails Development Environment
View airbrake.rb
# Add 'config.development_environments = []' to config/initializers/airbrake.rb
Airbrake.configure do |config|
config.api_key = "1234"
config.environment_name = AppConfig.environment if AppConfig.environment = true
config.development_environments = []
# Test it out in the console
1) rails console
kany / Taming Git
Last active Dec 10, 2015
Taming Git
View Taming Git
Taming GIT
Using Git - and Git Flow
First up: Git for Agile Teams (pdf) should be considered required reading :)
Second, keep this diagram in mind while reading the following text (image source)
Git Flow
There is nothing special about Git Flow - everything is still commits, branches and tags, but the toolset does add some convenient shortcuts for common operations. Examples include making a hotfix for the current production version, and keeping track of multiple features under concurrent development. Git Flow does nothing special to commits, nor are the branches any different from branches you create by other means. A strict naming standard does make things easier to follow, though.
kany / Search Git Logs
Last active Dec 10, 2015
Search Git Logs
View Search Git Logs
Search git logs for tickets = 5803,5804,or5805 using regex.
git log --grep=580[345] --stat -p --author=frank
kany / Reset MySQL 'root' user password
Last active Dec 11, 2015
Reset MySQL 'root' user password
View Reset MySQL 'root' user password
This method only works if currently logged in as root. Sometimes when working with older ruby 'mysql' gems, after the 'mysql' gem is installed, the previous password doesn't work.
1) Already logged into Mysql
2) gem jacked up your mysql password
3) mysql > use mysql;
4) mysql > UPDATE user SET Password=PASSWORD('') WHERE User='root'; FLUSH PRIVILEGES;
kany / Look for items hogging disk space on Mac
Last active Dec 11, 2015
Look for items hogging disk space on Mac
View Look for items hogging disk space on Mac
Change to root directory
1) cd /
See size of each file/folder in directory with sorting
2) sudo du -sh * | sort -gr
If /SomeFolder is over 1gb
3) cd SomeFolder && sudo du -sh *
kany / foreign_keys
Created Mar 4, 2013
Find Foreign Keys - Mysql
View foreign_keys
concat(table_name, '.', column_name) as 'foreign key',
concat(referenced_table_name, '.', referenced_column_name) as 'references'
referenced_table_name is not null AND
referenced_table_name = 'org_units';
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
curl -O
curl -O
View resque.rake
# see - old version
# see
# see - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
kany / index.txt
Created Dec 30, 2015 — forked from gus/index.txt
Ruby/Clojure analogs
View index.txt
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from,
ruby-to-clojure.*/* functions can be obtained from the source files in this
If no method symbol is given, we use the following notation: