Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ilovezfs.mac.zfs.zpool-import</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/zpool</string>
<string>import</string>
boxes = [
{ :name => :default, :role => 'default', :ip => '10.11.12.13' },
{ :name => :stats, :role => 'stats', :ip => '10.11.12.14' },
{ :name => :something, :role => 'something', :ip => '10.11.12.15' },
{ :name => :jenkins, :role => 'jenkins', :ip => '10.11.12.16', :http_forward => 8080 },
{ :name => :buildagent, :role => 'buildagent', :ip => '10.11.12.17', :http_forward => 8080 },
{ :name => :something, :role => 'something', :ip => '10.11.12.18' }
]
Vagrant::Config.run do |config|
@dch
dch / gist:7965086
Created December 14, 2013 21:26 — forked from davisford/gist:5039064

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:

@dch
dch / .gitignore
Created November 28, 2013 17:33 — forked from karmi/.gitignore
.DS_Store
Gemfile.lock
@dch
dch / atkin.erl
Created November 27, 2013 14:27 — forked from nox/atkin.erl
-module(atkin).
-export([primes_smaller_than/1]).
primes_smaller_than(Limit) ->
primes_smaller_than(Limit, sieve(Limit), []).
primes_smaller_than(0, _, Acc) ->
Acc;
primes_smaller_than(N, Bin, Acc) ->

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dch
dch / async_nif.h
Created October 19, 2013 16:06 — forked from gburd/async_nif.h
/*
* async_nif: An async thread-pool layer for Erlang's NIF API
*
* Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
* Author: Gregory Burd <[email protected]> <[email protected]>
*
* This file is provided to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
; -*- mode: lisp;eval: (rainbow-delimiters-mode) -*-
; vim: filetype=clojure
(logging/init)
; doesn't work
(def email (mailer {:host "smtp.gmail.com"
:user "[email protected]"
:pass "my-pass"
:from "[email protected]"
; -*- mode: lisp;eval: (rainbow-delimiters-mode) -*-
; vim: filetype=clojure
(logging/init)
; doesn't work
(def email (mailer {:host "smtp.gmail.com"
:user "[email protected]"
:pass "my-pass"
:from "[email protected]"
APPDIRS := $(wildcard apps/*)
## Example hack to filter one out:
## APPDIRS := $(filter-out apps/fooapp, $(APPDIRS))
define PROXY_TARGET
$(1):
$(foreach appdir,$(APPDIRS),$(MAKE) -C $(appdir) $(1) ;)
endef