graph TD; A-->B; A-->C; B-->D; C-->D;
This file contains 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/env python3 | |
""" | |
A little script to quickly identify the worst offenders. Easily extensible to | |
find and sort by other issues. Expects you to have results available in an | |
easily consumable JSON file, which you can generate by running: | |
rubocop --format progress --format json --out rubocop.json | |
""" |
This file contains 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
require "window_management" | |
require "sleep_management" | |
hs.loadSpoon("SpoonInstall") | |
spoon.SpoonInstall:andUse("CircleClock") | |
-- spoon.SpoonInstall:andUse("ClipboardTool", | |
-- { | |
-- config = { show_in_menubar = false, }, | |
-- hotkeys = { toggle_clipboard = { { "cmd", "shift" }, "v" } }, |
This file contains 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
#Sort the Ruby files in your project by number of has_many | |
ack " has_many " -c | awk -F ":" '{print $2,$1}' | grep -v "0" | sort -rn |
This file contains 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
#Count the lines of Ruby code in your app | |
find . -iname "*.rb" -type f -exec cat {} \; | wc -l |
This file contains 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
#Sort the Ruby files in your project by LOC | |
find . -iname "*.rb" -type f -exec wc -l {} \; | sort -rn |
This file contains 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
File: lib/tasks/bar.rake | |
class BarOutput | |
def self.banner text | |
puts '*' * 60 | |
puts " #{text}" | |
puts '*' * 60 | |
end | |
def self.puts string | |
puts string |
This file contains 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 --login | |
ensure() { | |
"$@" || exit 1 | |
} | |
cd r4ia_examples/ticketee; | |
git checkout . && git clean -fd |
This file contains 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
<% if Rails.env != 'production' %> | |
document.addEventListener("DOMContentLoaded", function() { | |
$('body').append($('<div>').css({ | |
display: 'block', | |
position: 'fixed', | |
left: '20px', | |
top: '500px', | |
'-webkit-transform': 'rotate(-90deg)', | |
'-moz-transform': 'rotate(-90deg)', | |
'-o-transform': 'rotate(-90deg)', |
This file contains 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
#lives in spec/support/object_creation_methods.rb | |
# Source: https://pivotallabs.com/users/jdean/blog/articles/1900-rolling-your-own-object-creation-methods-for-specs | |
module ObjectCreationMethods | |
def new_post(overrides = {}) | |
defaults = {:title => "Some title #{counter}"} | |
Post.new { |post| apply(post, defaults, overrides) } | |
end |
NewerOlder