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
require 'unicorn'
require 'json'
config = Unicorn::Configurator.new(config_file: 'config/unicorn.rb')
config_hash = {
"timeout" => config[:timeout],
"worker_processes" => config[:worker_processes],
"preload_app" => config[:preload_app],
}
[
{
"name": "test",
"dataclip": "https://dataclips.heroku.com/xxxcgvztxgjwfcatoebjqhnpohhebch",
"type": "value",
"source": "paid"
}
]
<div ng-include="'/assets/application/_header.html'"></div>
<div class="container">
<form ng-submit="submit()">
<div class="form-group">
<input class="form-control" id="latitude" max="90" min="-90" ng-model="waypoint.latitude" placeholder="Latitude" required step="any" type="number">
</div>
<div class="form-group">
<input class="form-control" id="longitude" max="180" min="-180" ng-model="waypoint.longitude" placeholder="Longitude" required step="any" type="number">
</div>

Keybase proof

I hereby claim:

  • I am neilmiddleton on github.
  • I am neilmiddleton (https://keybase.io/neilmiddleton) on keybase.
  • I have a public key whose fingerprint is BDA8 5D45 2BCB 1205 66A7 7567 1A72 C599 9F27 98C2

To claim this, I am signing this object:

My Inbox zero system

  1. Check email

  2. Does the email warrant any interest/time at all?
    No? archive it immediately (e in Gmail).

  3. Is the email just informational?
    Read it. Archive it.

  4. Does the email require something which can be done quickly (< 2 mins) right now?

$ cd ~/.ssh
$ mkdir backup
$ cp id* backup/.
$ ssh-keygen -t rsa
$ heroku keys:clear
$ heroku keys:add id_rsa.pub
@neilmiddleton
neilmiddleton / search_guide.md
Last active August 29, 2015 14:06
Searching within Morpheus

Simple search

broken

This simple search returns all tickets which contain the word "broken" across any of the ticket fields and comments.

Not so simple searches

class DodgeitAndScarper < RTanque::Bot::Brain
NAME = 'dodgeit_and_scarper'
include RTanque::Bot::BrainHelper
RUN_AND_COVER = 80
def tick!
nearest = nearest_victim
command.speed = RTanque::Bot::MAX_SPEED
# download, from_repo, and commit_state methods swiped from
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb
require 'open-uri'
def download(from, to = from.split("/").last)
#run "curl -s -L #{from} > #{to}"
file to, open(from).read
rescue
puts "Can't get #{from} - Internet down?"
From 63254641c717dbdafdeb92fa0a3b70034d237a91 Mon Sep 17 00:00:00 2001
From: Neil Middleton <neil@monochrome.co.uk>
Date: Thu, 15 Oct 2009 14:32:33 +0100
Subject: [PATCH 2/2] Changes to enable bcms deploment on heroku
---
.gems | 1 +
config/environment.rb | 1 +
config/initializers/browsercms.rb | 7 ++++
config/s3.yml | 9 +++++