Skip to content

Instantly share code, notes, and snippets.

View hammerdr's full-sized avatar

Derek Hammer hammerdr

View GitHub Profile
moby:~# docker pull ubuntu
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/library/ubuntu/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&service=registry.docker.io: dial tcp: lookup auth.docker.io on 192.168.65.1:53: dial tcp 192.168.65.1:53: getsockopt: connection refused
@hammerdr
hammerdr / sort.rb
Created March 13, 2015 19:27
Fancy sort in ruby
Animal = Struct.new(:name, :height, :legs)
animals = [
Animal.new('dog', 10, 4),
Animal.new('cat', 5, 4),
Animal.new('snake', 2, 0),
Animal.new('sloth', 5, 4),
Animal.new('ant', 1, 6)
]
ASCENDING = 'ascending'
@hammerdr
hammerdr / keybase.md
Created February 25, 2015 19:46
keybase.md

Keybase proof

I hereby claim:

  • I am hammerdr on github.
  • I am hammerdr (https://keybase.io/hammerdr) on keybase.
  • I have a public key whose fingerprint is CEBF 4AE9 C5A6 68E5 B63B 1017 31AD F61C 5756 35AD

To claim this, I am signing this object:

@hammerdr
hammerdr / fig-ci.py
Last active August 29, 2015 14:13
fig-ci.py
from fig.cli.main import TopLevelCommand
fig = TopLevelCommand()
project = fig.get_project('fig-ci.yml')
project.build()
service = project.get_service('web')
container_options = {
'command': ['pwd'],
'tty': False,
'stdin_open': True,
'detach': False
@hammerdr
hammerdr / Vagrantfile
Created December 10, 2014 05:29
Vagrantfile for GoCD Dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "go.v2"
config.vm.box_url = "http://download01.thoughtworks.com/go/vagrant/v2/go.v2.box"
config.vm.box_download_checksum = "931e6b5f4ed2697324ea523bf7f06ffece87a428aec9914fb639c093c2aad31c"
@hammerdr
hammerdr / nginx.conf
Created December 9, 2014 22:56
GoCD Server Nginx Proxy
worker_priority -5;
worker_processes auto;
worker_rlimit_nofile 16384;
events {
worker_connections 8192;
}
http {
server {
{"menu": {
"header": "SVG Viewer",
"items": [
{"id": "Open"},
{"id": "OpenNew", "label": "Open New"},
null,
{"id": "ZoomIn", "label": "Zoom In"},
{"id": "ZoomOut", "label": "Zoom Out"},
{"id": "OriginalView", "label": "Original View"},
null,
n=$(cat /usr/share/dict/words | wc -l); while true; do cat -n /usr/share/dict/words | grep -w $(jot -r 1 1 $n) | cut -f2 | say; done;
@hammerdr
hammerdr / 01_hammer.haml
Created November 19, 2012 20:36
hammer time grid special
%ul
%li{style: "background-image: #{dynamic_image}"}>
= link_to :article_url do
%span.caption "Yanul Kabak brings to Afgan children... "
%span.details
Yanul Kabak brings to Afgan children
%small
The panel says it has 1,000 pages of evidence showing
Lance Armstrong's role in a...
%span.read-more
class PlainRubyObject
class Renderer < ApplicationController
def render(locals)
@locals = locals
ERB.new(File.open(...)).result(binding)
end
end
def plain_ruby_method
Renderer.new.render(stuff)