This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| du -hs $(ls -A) | sort -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Put this in your ~/.git/hooks folder to auto add branch name to git commit messages. | |
| # | |
| BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | grep -oE "[A-Z]+-[0-9]+") | |
| if [ -n "$BRANCH_NAME" ]; then | |
| if ! grep -q "$BRANCH_NAME" $1 ; then | |
| echo -en "[$BRANCH_NAME] " | cat - "$1" > /tmp/out && mv /tmp/out "$1" | |
| fi | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Monkey Patch for debugging code. | |
| if !Rails.env.production? | |
| class Object | |
| def yy( | |
| quick = nil, | |
| message: self.class, | |
| poke: nil, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'fileutils' | |
| NO_MOVE_LIST=%w{.directory} | |
| def cleanit(s) | |
| s =s.split('/')[-1] | |
| sub =s.split(/(s[0-9])|([0-9]+of)|([0-9]+x[0-9]+)|(201[0-9])|([0-9]{3})/i) | |
| show_name = sub[0] | |
| if show_name.size > 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.application.eager_load! | |
| puts ActiveRecord::Base.descendants.map {|m| [ m.name, m.reflections.values.map{|r| "#{r.macro} #{r.name}"} ]}.select{|k,v| v.size>0}.to_h.to_yaml |