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
@hughevans
hughevans / Procfile
Last active December 31, 2015 02:39
web: bundle exec puma -p $PORT -C config/puma.rb
@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)" \
@andrewk
andrewk / jasmine.md
Last active January 3, 2018 21:49
Jasmine 2.0 quick reference

Spies

Create a spy

// "bare" spy
var spy = jasmine.createSpy('spyName');

// Mock object of spies: spy.next(), spy.current(), etc
@kalbasit
kalbasit / das_download.rb
Created February 27, 2012 23:37 — forked from maca/das_download.rb
Script to download all Destroy All Software screencasts, account needed
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password [download_directory]
require 'mechanize'
# gem 'mechanize-progressbar'
email = ARGV[0] or raise('Please provide the email address for your account')
password = ARGV[1] or raise('Please provide the password for your account')
path = (ARGV[2] || './').gsub /\//,''
@xaviershay
xaviershay / github_requests.md
Last active April 11, 2018 03:20
Pull request feature requests

Hello Github,

Pull requests are not serving me well on large reviews. Here are some problems and suggested enhancements that would make me happy.

  • Mark comment as "resolved" (see google docs for an example). As code changes, comments get lost or made redundant, and it is not clear (to either the author or reviewers) which are still relevant and which have been addressed. Resolving a comment doesn't need to make it dissappear, but I need to be able to see "which comments have not been addressed" somehow. This feature would be the most useful to me.
  • Reply to a comment. This can be done in effect on line comments (assuming there is only one), but cannot on PR comments. Particularly with many threads, the lack of this makes a review hard to follow.
  • Explicit "approve/block" life cycle. The block is actually more important to me ... often on a PR that has been incrementally improved I want to "block" final merge of it until I get a chance to rebase/squash and generally pretty it up. The block can be over
@tpope
tpope / cloud2butt.vim
Created September 18, 2014 06:12
Cloud to Butt dot Vim
function! s:butt() abort
syn match cloud2butt "\<th\%(e cloud\>\)\@=" conceal cchar=m
syn match cloud2butt "\%(\<th\)\@<=e\%( cloud\>\)\@=" conceal cchar=y
syn match cloud2butt "\%(\<the \)\@<=c\%(loud\>\)\@=" conceal cchar=b
syn match cloud2butt "\%(\<the c\)\@<=l\%(oud\>\)\@=" conceal cchar=u
syn match cloud2butt "\%(\<the cl\)\@<=o\%(ud\>\)\@=" conceal cchar=t
syn match cloud2butt "\%(\<the clo\)\@<=ud\>" conceal cchar=t
endfunction

Preview build: Container grouping and stack composition

NOTE: this is out of date - refer to moby/moby#9694

Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups) and stack composition (docker up). Together, they will eventually form a complete replacement for Fig.

@joho
joho / deploy.rb
Created September 13, 2012 01:30
How to serve emergency "signed out" views from page cache without affecting signed in users in rails.
set :path_to_repo, "/path_to_repo/"
set :running_app_user, "appusername"
namespace :webscale do
desc "Cache a signed out version of the path. Usage: cap webscale:signed_out_cache_page -s path_to_cache=/films/on_netflix"
task :signed_out_cache, roles: :app do
cache_base_path = "#{path_to_repo}/public/signed_out"
cached_destination_path = "#{cache_base_path}#{path_to_cache}.html"
working_path = "#{cached_destination_path}.tmp"

How to combine AWS Elastic Beanstalk, Docker and AWS CloudFormation

Introduction

This text explains how to create and deploy a Docker-based AWS Elastic Beanstalk site and how to control it using CloudFormation.

Please find the CloudFormation template at the end of this Gist.

We assume that you are familiar with AWS ElasticBeanstalk, AWS CloudFormation and Docker.

@plasticine
plasticine / help.makefile
Last active August 28, 2019 11:30
Automatically extract help from your Makefiles using some fully sick awk hacks
# You're looking at it! :)
help:
@makehelp < $(MAKEFILE_LIST)
.PHONY: help