Skip to content

Instantly share code, notes, and snippets.

View mtodd's full-sized avatar
🔐
[redacted]

Matt Todd mtodd

🔐
[redacted]
View GitHub Profile
@mtodd
mtodd / sample.geojson
Created July 26, 2017 19:23 — forked from landonreed/sample.geojson
Playing around with http://geojson.io #osm github etc.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mtodd
mtodd / Bug.md
Created August 5, 2014 16:38 — forked from HansNewbie/Bug.md

[ ] a [ ] b

  • c
  • d

If user is careless, forgetting to put "- " before "[ ]", TODO list could get buggy.

Steps to reproduce bug:

  • on parsed MD page of list above, tick "c" to note that "c" is done.
  • Now, edit the file.
  • First option
  • Parent option
  • Nested option
  • Last option

Based on the article: Using checklists for code review

In general, people are pretty good at the code review process, but it's sometimes surprising what can slip through. A natural consequence of the way our brains look at the world is that it's easy to pay a lot of attention to small details and code style flubs, and completely miss the big picture.

Obviously, not everything is applicable for every change. If the review request isn't making any changes to UI, then skip the first two checklists entirely. If a change is a bug fix, typically don't review it for architecture and design principles.

Put the big stuff first (e.g. architecture). You don't want to work through a ton of small issues before realizing that everything has to be rewritten.

Do a pass through the code for each and every item in the checklist. By only looking for a very specific type of defect, each pass goes relatively quickly, even for large changes. Focu

@mtodd
mtodd / .irbrc
Created January 8, 2010 16:45 — forked from jacqui/.irbrc
require 'rubygems'
require 'pp'
unless self.class.const_defined? "IRB_RC_HAS_LOADED"
# Log to STDOUT if in Rails
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
on run argv
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down -- open a new tab
tell application "Terminal" to do script "cd " & item 1 of argv in front window -- change directory
end run
-- in your profile
-- alias newtab='osascript ~/.applescripts/newtab.applescript `pwd`'
@mtodd
mtodd / gist:180398
Created September 3, 2009 16:49 — forked from mperham/gist:180381
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
@mtodd
mtodd / after-use
Created August 17, 2009 07:20 — forked from defunkt/after-use
#!/usr/bin/osascript
on run_command(command)
tell application "Terminal"
do script "clear" in selected tab of front window
do script command in selected tab of front window
end tell
end run_command
tell application "System Events"
my run_command("cd ~/Projects/nudge")
class ActionController::Request # ActionController::AbstractRequest in Rails < 2.3
# Returns true if the request seems to come from a bot
def bot?
user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i
end
end
#
# Then in your controllers you can do :
#