Skip to content

Instantly share code, notes, and snippets.

View neilmiddleton's full-sized avatar
🏠
Working from home

Neil Middleton neilmiddleton

🏠
Working from home
View GitHub Profile
.browserslistrc
.dockerignore
.editorconfig
.env
.env.development
.env.test
.envrc
.gitconfig
.github/CODEOWNERS
.github/pull_request_template.md

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@neilmiddleton
neilmiddleton / deployments.rake
Created October 15, 2010 16:18
Integrates CodebaseHQ deployment notifications into Heroku-san
desc 'After_deploy callback'
task :before_deploy => :environment do |t, args|
username = `git config codebase.username`.chomp.strip
api_key = `git config codebase.apikey`.chomp.strip
if username == '' || api_key == ''
puts " * Codebase is not configured on your computer. Bundle the codebase gem and run 'codebase setup' to auto configure it."
puts " * Deployments will not be tracked."
next
@neilmiddleton
neilmiddleton / gist:1295384
Created October 18, 2011 13:11
Wildcard selectors in sass
To produce:
.blah[class*='span'] {
text-align: center;
}
use:
.blah
&[class*='span']
@neilmiddleton
neilmiddleton / gist:0603cb03554b3e1e1815a1e3d80a90ed
Created October 13, 2020 10:27
iRacing results to drivers CSV
require 'csv'
require 'chronic_duration'
teams = []
results = CSV.read('./eventresult.csv',
encoding: 'windows-1251:utf-8',
headers: true)
team = {}
results.each do |row|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JRT Dashboard</title>
<meta charset="UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
<meta name = "viewport" content = "width = device-width, shrink-to-fit=no, initial-scale = 1, maximum-scale=1, user-scalable=no, minimal-ui">
Currently Modelled
Some items are only available for certain vehicles, tracks, etc.
Vehicles - Officially licensed and modelled using CAD drawings, photos (1000 to 3000) and 3D laser scanning.
• cockpit modelled - including switches, dials, lights, steering wheel, shifters etc.
• exterior modelled
• colour
• working gauges
my_hash = {}
my_hash[:one] = 'foo'
my_hash[:two] = 'bar'
my_hash[:three] = 'baz'
my_hash.keys.each{|k| puts k}
my_hash = {}
my_hash[:three] = 'baz'
my_hash[:two] = 'bar'
@neilmiddleton
neilmiddleton / gist:6428450
Created September 3, 2013 19:29
RTanque bot
class MyHarmlessBot < RTanque::Bot::Brain
NAME = 'Fred West'
include RTanque::Bot::BrainHelper
CORNERS = [:NW, :NE, :SE, :SW]
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 3.0
SWITCH_CORNER_TICK_RANGE = (200..400)
def tick!
self.hide_in_corners
$ curl -H 'Accept: application/json' http://foaas.herokuapp.com/off/cancer/everyone | prettyjson
message: Fuck off, cancer.
subtitle: - everyone