Skip to content

Instantly share code, notes, and snippets.

@evolve2k
evolve2k / example.html
Created December 8, 2011 11:24
Sideways Text Styling Example
<!DOCTYPE html>
<html>
<head>
<title>Sideways Example</title>
<link href='stylesheets/global.css' media='all' rel='stylesheet' />
</head>
<body>
<h2 class="rotate">Look Ma Im sideways</h2>
</body>
</html>
@evolve2k
evolve2k / gist:2702222
Created May 15, 2012 14:31
(Really really basic) Tips for hiring a ruby coder.
1. Utilise a good programmer task management tool
I strongly recommend you utilise pivitol tracker.
Have the developer keep the tasks they are working on up to date and ask them to communicate with you through pivitol tracker.
2. Have the developer keep their source code in an online repository that you both have access to all the time.
I strongly recommend that the code is kept at github.com in a private repository that you maintain.
(It will costs you aprx $9 per month to do so).
Have the developer tag each batch of code they work on with the specific task(story) they are working on at the time.
3. Ensure your developer writes tests.
@evolve2k
evolve2k / ethical_clearance_letter.txt
Created June 20, 2012 13:38
Ethical Clearance Letter
<date>
<Previous Developers’s Name>
<Previous Developers’s Position>
<Company Name>
Dear <Previous Developers Name>
Ethical Clearance Letter
Re: <Name of client>
@evolve2k
evolve2k / gist:3367641
Created August 16, 2012 07:16
Recovering from a Git DISASTER!!!!!!!!!!!!!!!
$ git reflog
5ee192a HEAD@{0}: checkout: moving from master to 5ee192a62f39323c61a3b2527bbda1b6fbd669c8
63322f5 HEAD@{1}: merge suite_spike_1: Fast-forward
58c63d4 HEAD@{2}: checkout: moving from suite_spike_1 to master
63322f5 HEAD@{3}: merge master: Merge made by the 'ours' strategy.
713e4ae HEAD@{4}: commit: Update ProductSuite with website, discount text and omnium code
ef7eb28 HEAD@{5}: checkout: moving from master to suite_spike_1
58c63d4 HEAD@{6}: checkout: moving from suite_spike_1 to master
(copy the head part for the commit I want to restore to)
@evolve2k
evolve2k / rspec_recipies.md
Last active October 13, 2015 12:07
RSpec Recipies

Subject

We can use an implicit subject, meaning we don't need to specify the subject (and we revert back to #it):

subject { Customer.new(:name => "Frank Reynolds") }  

it { should be_valid }  

We can also use an implicit subject based on the object we are describing:

Steps to get postgres working on OSX (as I currently understand it)
1. Install Postgres
- A bunch of files are placed in uknown places?
- A service starts running which is the database service
- An initial conf file and conf database file are created?
It's not working, steps to find out what exactly is not working.
Eg which level the problem is at
@evolve2k
evolve2k / code documenting tips.md
Last active December 13, 2015 18:48
A few documenting code guidelines from the Ruby Rogues http://rubyrogues.com/079-rr-documenting-code/

Code Comments

Don’t do it, a comment is a lie waiting to happen

  • If a comment is needed because the code is unclear, move it into it's own method with a nice name.
  • Write a unit test to explain things instead of using code comments.
  • Unit tests are executable, self verifying documentation.

README

It’s the universal ‘check here first’

  • introduce the project
  • show basic usage
@evolve2k
evolve2k / TPP TDD 'Rules'.md
Last active December 15, 2015 12:19
Uncle Bob introduced the idea of TPP and in his literature referrs to a number of rules. Here I document some 'coding rules'.

Meditations

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
@evolve2k
evolve2k / Handing Off a Ruby App
Created April 2, 2013 22:24
Steps to complete when handing off a Ruby Application
1. Add versions to all the gems in the Gemfile.
(This app may be picked up again months or years later, its terrible to try to compile it when the versions aren't present.)
2. Update the README
3. Ensure the test suite is passing.
4. Add a 'handover' note in the README which outlines the state of the specs and the pointy bits of the project and in non-political terms where things are at.
@evolve2k
evolve2k / OO_TDD_Rules.md
Last active December 16, 2015 21:29
OO TDD Rules

Today's approach

RED PHASE (Transformation)

FAIL

  1. Write a failing test starting from the smallest simplist thing you have certainty about (inside out approach)
  2. Get the test to report the failed state that you EXPECT.

EXPECT