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
for user in $(aws iam list-users --output text --no-cli-pager | awk '{print $NF}'); do | |
aws iam list-access-keys --user $user --output text --no-cli-pager | |
test $? -gt 128 && exit | |
done |
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
from itertools import tee, izip | |
from django.contrib.gis.db import models | |
from django.contrib.gis.measure import Distance | |
from geopy.distance import distance as geopy_distance | |
def pairwise(iterable): | |
"s -> (s0,s1), (s1,s2), (s2, s3), ..." | |
a, b = tee(iterable) |
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
/* Python(ish) string formatting: | |
* >>> format('{0}', ['zzz']) | |
* "zzz" | |
* >>> format('{x}', {x: 1}) | |
* "1" | |
*/ | |
var format = (function() { | |
var re = /\{([^}]+)\}/g; | |
return function(s, args) { | |
return s.replace(re, function(_, match){ return args[match]; }); |
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
// The outrageous totally awesomely unoptimized and hard way of doing | |
// the stuff :D | |
(function() { | |
var c, list | |
, letters = {} | |
, str = "ah, yes, for all the letters, you'll need" | |
+ "a loop... i read it wrong." | |
; | |
str.replace(/\s|\S/g, function(match) { |