$ cd ~/.dotfiles/
$ git submodule add http://github.com/scrooloose/nerdtree.git vim/bundle/nerdtree
$ git submodule init
$ git commit -m 'Add nerd tree plugin as submodule'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readonly FILE='domains.list' | |
readonly MAX_CHAIN_LENGTH=5 | |
readonly PORT=443 | |
while IFS= read -r domain; do | |
echo -ne "${domain} $(/usr/bin/dig ${domain} +short | tail -n 1)\n" | |
echo QUIT | /usr/bin/openssl s_client -verify ${MAX_CHAIN_LENGTH} -connect ${domain}:${PORT} 2>1 | grep 'Verify return code' | |
done < "$FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stderr: E: Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/a/arpack/libarpack2_3.1.5-2_amd64.deb 403 Forbidden |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# delete-ami | |
# | |
# A script to deregister an Amazon Machine Image (AMI) and | |
# delete its corresponding root device snapshot. | |
# | |
##### Functions |
I hereby claim:
- I am elasticdog on github.
- I am elasticdog (https://keybase.io/elasticdog) on keybase.
- I have a public key whose fingerprint is 5FC9 160D A643 E0E9 B83A F4BB 5E34 0427 C31E 7946
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Uses the Bhattacharyya coefficient to determine if text is likely to be English. | |
/// | |
/// Higher is better. | |
pub fn probability_english(text: &str) -> f64 { | |
// count of the number of times a character occurs in the given text | |
let mut count: BTreeMap<char, f64> = BTreeMap::new(); | |
for letter in text.chars() { | |
match count.entry(char::to_uppercase(letter)) { | |
Vacant(entry) => { entry.set(1f64); }, | |
Occupied(mut entry) => *entry.get_mut() += 1f64, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var%20ps=document.getElementsByTagName("pre");for(var%20i=0;i<ps.length;i++){ps[i].style.whiteSpace="pre-wrap";ps[i].style.width="600px";}})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule HttpRequester do | |
use GenServer | |
def start_link(_) do | |
GenServer.start_link(__MODULE__, nil, []) | |
end | |
def fetch(server, url) do | |
# Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/ | |
timeout_ms = 10_000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
##### Functions | |
# print this script's usage message to stderr | |
usage() { | |
cat <<-EOF >&2 | |
usage: vagrant-box-clean [-p PREFIX] [-d] [-h] | |
EOF | |
} |
I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.
- Two developers working on independent features must never be blocked by each other
- No code freeze! Ever! For any reason!
- A developer must be able to base derivative work on another developer's work, without waiting for any third party
- Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
- Developers must be able to work on multiple features simultaneously, or at lea