Skip to content

Instantly share code, notes, and snippets.

View joho's full-sized avatar
At harbour

John Barton joho

At harbour
View GitHub Profile
@tels7ar
tels7ar / gist:1760969
Created February 7, 2012 17:47 — forked from jtimberman/gist:881058
i can has ruby-1.9.3 package with fpm
sudo apt-get install libssl-dev
sudo gem install fpm
wget --timestamp ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar -zxvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
time (./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir)
fpm -s dir -t deb -n ruby -v 1.9.3-p0 -C /tmp/installdir \
-p ruby-VERSION_ARCH.deb -d "libstdc++6 (>= 4.4.3)" \
@hughevans
hughevans / Procfile
Last active December 31, 2015 02:39
web: bundle exec puma -p $PORT -C config/puma.rb
@lox
lox / soa_thoughts.md
Last active December 28, 2015 10:49
Thinking on SOA

Aggregating multiple top-level web applications

Ideally we'd be able to compose 99designs.com out of several top-level web applications. There are many challenges with this, for instance:

  • How do we manage routing and route generation, cross-application?
  • How do we manage sessions without shared db access?
  • How do we handle shared UI like alert bars and unified headers?

On the whole, these problems are solvable. For routing we could just use Varnish, with some custom code to read routemaps from the apps, or we could use something like Mongrel2. Alternately, a Go-lang HTTP/SPDY terminator would be pretty damn quick and flexible.

@benhoskings
benhoskings / gist:7192000
Created October 28, 2013 05:59
sublime config.py
{
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 30,
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/User/Ben's Solarized (light).tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"drag_text": false,
@bmizerany
bmizerany / http.go
Last active December 22, 2015 16:39
Graceful shutdown example in regards to https://groups.google.com/forum/#!topic/golang-nuts/vLHWa5sHnCE
package main
func main() {
// ... setup ...
l, err := net.Listen("tcp", *laddr)
if err != nil {
log.Fatal(err)
}
@joho
joho / front-end-envato.markdown
Created April 20, 2011 01:47
Front End Developer @ Envato

Front End Developer @ Envato

Hi, we're Envato and we want to expand the number of front-end developers working on our marketplaces by 200%. That's right, you'll be the second one we've got!

The easiest way to describe the role is to just explain what Stu, our current front-end hotshot does: pretty much everything. You'll be working directly with our template code (ERB if you already know rails), with the design coming from any or all of: nice photoshop designs, wireframes, and vague suggestions of "make that work and be pretty". There's the occasional marketing style landing page to be made, the occasional HTML email template, and a whole bunch of design iteration on our marketplaces.

As this is the role that takes us from a front-end dev to a front-end "team", exactly how we're going to share out that work and run things are a bit up in the air right now, but that gives us some freedom to arrange things to play to the strengths of whichever candidate comes through the front door.

Possibly the best p

@mtcmorris
mtcmorris / gist:3082609
Created July 10, 2012 10:42
20 top films in the past 5 years
The Artist
Senna
Hanna
Headhunters (Hodejegerne)
The Help
Best Exotic Marigold Hotel
District 9
Crazy Stupid Love
The Social Network
Black Swan
@ozeias
ozeias / unicorn.rb
Created May 16, 2012 11:21 — forked from jamiew/unicorn.rb
Unicorn config for use with bundler and capistrano - fixes issues with environment pollution.rb
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30
@plasticine
plasticine / grid.scss
Created August 15, 2011 01:49
Generate a grid.
$grid_col_names:(
'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'
);
@function col($count:1){ @return (($grid_col_width + $grid_gutter) * $count) - $grid_gutter; }
@mixin pre_col($count:1){ margin-left: col($count); }
@mixin post_col($count:1){ margin-right: col($count); }
@mixin make_grid_classes{
@for $index from 1 through $grid_num_cols {

Remove trailing whitespace, convert tabs to spaces and file format to unix (remove ugly ^M carriage returns) from files using a single command:

vim -es -c 'set et ts=2 | bufdo retab | %s/\s\+$//e | set ff=unix | w' -c 'q' FILES

You could get your FILES using find

vim -es -c 'set et ts=2 | bufdo retab | %s/\s\+$//e | set ff=unix | w' -c 'q' $(find scripts -name '*.sh' -type f)

If in doubt, ask man.