Skip to content

Instantly share code, notes, and snippets.

@brightredchilli
brightredchilli / print-all.rb
Created June 5, 2018 18:00
Rails print all models
ActiveRecord::Base.send(:subclasses).map(&:name)
@brightredchilli
brightredchilli / countlines.sh
Created June 11, 2018 21:58
Count lines in files matching a certain criteria
"grep all filenames containing Interactor.swift, quote the output so that we can pass to xargs
"then sort by line count, then use awk again to remove some unnecessary columns
find Code | grep Interactor.swift | awk '{printf("\"%s\"\n", $0);}' | xargs wc | sort --reverse -k 1 | awk '{$2=$3=""}1'