- Your class can be no longer than a hundred lines of code.
- Your methods can be no longer than five lines of code
- You can pass no more than four parameters and you can't just make it one big hash.
- In your controller, you can only instantiate one object, to do whatever it is that needs to be done.
- Your view can only know about one instance variable.
- Your Rails view should only send messages to that object i.e., no Demeter violations.[ "thunder dome principal". Translated: one model in, one model out! ]
- Rules are meant to be broken if by breaking them you produce better code. [ ...where "better code" is validated by explaining why you want to break the rule to someone else. ]
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading…</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/5834741/raw/grablinks.js?x="+(Math.random());})(); |
require 'rspec' | |
class TicTacToe | |
def initialize | |
@x_moves = [] | |
@o_moves = [] | |
end | |
def play space | |
return false unless (1..9).include?(space) |
Code Triage: gemhttp://www.codetriage.com/ | |
budle open gemName | |
puts caller.inspect #where it came from | |
object#method | |
object.method(:method_name).source_location | |
method.source_location | |
self.class.ancestors #get superclass names in order |
# Rake file tricks for timing and notifying task completion | |
# at the top of the file with other config settings | |
run_time = Time.now | |
# quick function to determine diff between passed time and now | |
def finish_timer(start_time) | |
finish_time = Time.now - start_time | |
total_min = "%d" % (finish_time / 60) |
I was getting the error E576: viminfo: Missing '>' in line: [file names]
about ten times with various file names whenever I opened or saved a buffer in Vim. This happened both in normal vim and with MacVim. This was followed by the line E136: viminfo: Too many errors, skipping rest of file
. Other than these obnoxious messages, Vim itself worked fine.
To fix it, I opened ~/.viminfo
and deleted everything in the section labeled # History of marks within files (newest to oldest):
. I lost all my history of marks within files, but that was acceptable for me since I was starting a new coding session for the day.
So far, I'm not sure how my viminfo got into this state.
#!/bin/sh | |
TODAY=$(date +%m) | |
FILE=~/.duesoon | |
# This may be more complex than need be, but it permits months with or without leading zeroes | |
let THISMO=$TODAY-0 | |
if [ $THISMO = 12 ]; then | |
let NEXTMO=01 | |
else |
Miles recently wrote a post on the Indy Hackers Blog appropriately titled, Why Indy? In the post (http://blog.indyhackers.org/post/7262445527/why-indy) Miles (along with several other hoosiers) enumerates the various great things about why a developer/business might want to live in/stay in/come to Indiana. Having spent 10 of my 31 years in Indiana (4 in West Lafayette, 6 in Indianapolis) I definitely think of myself as a hoosier but despite that I moved to NYC in May. I am in the defector group, but maybe not in the dissenter group.
While I was in Indianapolis I held leadership roles at 3 different startups including ChaCha and Compendium, witnessed a very successful exit at one of my startups (3GUpload.com in 2004), and consulted for a half-dozen other various companies. That is to say, I think I have a pretty good feeling for what Indy has to offer in terms of work. Additionally, I participated in a variety of volunteer organizations (Big Brothers Big Sisters, Leukemia/Lymphoma society, ADA, etc) as well a
--- | |
layout: nil | |
--- | |
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text" xml:lang="en">{{ site.root_desc }}</title> | |
<link type="application/atom+xml" href="http://paulstamatiou.com/feed/" rel="self"/> | |
<link type="text" href="http://paulstamatiou.com" rel="alternate"/> | |
<updated>{{ site.time | date_to_xmlschema }}</updated> |