Skip to content

Instantly share code, notes, and snippets.

View jakcharlton's full-sized avatar

Jak Charlton jakcharlton

View GitHub Profile
@jakcharlton
jakcharlton / launch_sublime_from_terminal.markdown
Created September 24, 2012 03:46 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@jakcharlton
jakcharlton / _media-queries.scss
Created September 18, 2012 23:32 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@jakcharlton
jakcharlton / comma_delimited_to_array.cs
Created July 26, 2012 05:23
comma_delimited_to_array
comma_delimited_to_array = (to_split) ->
return (to_split.split(",").map (c)-> c.replace(/^\s+|\s+$/g, "")) if to_split
[Step 1/2] Process exited with code 0
[10:42:42]Step 2/2: Test (NUnit) (running for 11m:36s)
[10:42:42][Step 2/2] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[10:42:42][Step 2/2] in directory: C:\TeamCity\buildAgent\work\cc73a2a1ac9bb9e7
[10:42:52][Step 2/2] JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[10:42:52][Step 2/2]
@jakcharlton
jakcharlton / gist:2488614
Created April 25, 2012 09:54
Mock S3 for Paperclip
@your_model.should_receive(:save_attached_files).and_return(true)
@jakcharlton
jakcharlton / controller_spec.rb
Created April 25, 2012 09:32
More complete rspec controller test
before(:each) do
@organisation = create(:organisation, owner: subject.current_user)
@request.host = @organisation.subdomain + ".example.com"
subject.current_user.stub(:organisations).and_return([@organisation])
subject.current_user.stub_chain(:organisations, :find_by_id).and_return(@organisation)
end
describe "GET index" do
it "assigns all organisations as @organisations" do
@jakcharlton
jakcharlton / rspec.rb
Created April 25, 2012 09:26
Simple controller mock
it "assigns all organisations as @organisations" do
org = double(Organisation)
org.stub!(:all).and_return([org])
get :index, {}, valid_session
assigns(:organisations).should eq([org])
end
@jakcharlton
jakcharlton / How to Make Yourself Loved and Relevant.md
Created April 24, 2012 21:26
How to Make Yourself Loved and Relevant

How to Make Yourself Loved and Relevant

Developers are a curious breed.

For all sorts of reasons we tend to have significantly elevated opinions of our own worth and value to an organisation.

And certainly we hold a huge amount of power over them, but it's usually that they fear us rather than embrace us.

In yet another opinionated rant, I'll explore some of the reasons why developers are so distrusted and feared, and show you ways to make yourself loved and relevant.

describe ProgramsController do
let(:programs) { [mock_model(Program)] }
describe "GET index" do
it { should paginate(Program).with_default_per_page(30) }
describe "after pagination" do
before(:each) do
Program.stub(:paginate).and_return(programs)
get :index
@jakcharlton
jakcharlton / gist:2231536
Created March 28, 2012 23:35
Bamboo install
is is purely a status request
jvm 1 | 2012-03-29 10:34:29,120 INFO [qtp1601766488-19] [AccessLogFilter] 127
.0.0.1 POST http://localhost:8085/setup/finishsetup.action 155194kb
jvm 1 | 2012-03-29 10:34:29,122 INFO [qtp1601766488-19] [ExecAndWaitWithJSONS
tatusUpdateInterceptor] Bypassing a completed/not started action finishsetup, th
is is purely a status request
jvm 1 | 2012-03-29 10:34:31,127 INFO [qtp1601766488-17] [AccessLogFilter] 127
.0.0.1 POST http://localhost:8085/setup/finishsetup.action 155016kb
jvm 1 | 2012-03-29 10:34:31,129 INFO [qtp1601766488-17] [ExecAndWaitWithJSONS
tatusUpdateInterceptor] Bypassing a completed/not started action finishsetup, th