Skip to content

Instantly share code, notes, and snippets.

Avatar
type type type

Beau Gunderson beaugunderson

type type type
View GitHub Profile
View aws-reinvent-2014-gender.md

gender statistics for aws re:invent 2014

totals

spreadsheet here, culled from the videos here

  • 245 presentations
  • 231 all male presentations (94.29%)
  • 4 all female presentations (1.63%)
  • 10 presentations with men and women (4.08%)
View Update-Exchange-User-Images.ps1
# I used the following command to generate my images:
# mogrify -resize 96x96 -gravity center -extent 96x96 -format jpg \
# -path outlook -background black -strip -coalesce -quality 95 *.jpg
# Add the Quest AD and Exchange snap-ins
Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox | ForEach {
$username = $_.SamAccountName
@beaugunderson
beaugunderson / .vimrc
Created Jul 31, 2011
Prompt to edit a corresponding .scss file when opening a .css file in vim
View .vimrc
function! EditScss()
" The current file
let file = expand("%")
" The current file's basename plus .scss
let scss = expand("%:r") . ".scss"
" If the file exists
if filereadable(scss)
" Prompt the user and store the user's choice (1-indexed) in a variable
View gist:1714950
error publishing - {"stack":"Error: forbidden Maintainer should have name and email: {\"name\":\"beaugunderson\"}: beaugunderson-spearmint\n at Request._callback (/var/locker/node_modules/npm/lib/utils/npm-registry-client/request.js:180:12)\n at Request.callback (/var/locker/node_modules/npm/node_modules/request/main.js:99:22)\n at Request. (/var/locker/node_modules/npm/node_modules/request/main.js:361:18)\n at Request.emit (events.js:64:17)\n at IncomingMessage. (/var/locker/node_modules/npm/node_modules/request/main.js:327:16)\n at IncomingMessage.emit (events.js:81:20)\n at HTTPParser.onMessageComplete (http.js:133:23)\n at Socket.ondata (http.js:1227:22)\n at Socket._onReadable (net.js:683:27)\n at IOWatcher.onReadable [as callback] (net.js:177:10)","message":"forbidden Maintainer should have name and email: {\"name\":\"beaugunderson\"}: beaugunderson-spearmint"}
@beaugunderson
beaugunderson / gist:1793921
Created Feb 10, 2012
Double Access-Control-Allow-Origin
View gist:1793921
HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Set-Cookie: singly.id=REDACTED; domain=.singly.com; path=/; expires=Fri, 24 Feb 2012 23:15:45 GMT
x-powered-by: Express, Express
set-cookie: locker.project.id=REDACTED; path=/; expires=Sat, 11 Feb 2012 03:15:46 GMT; httpOnly
access-control-allow-origin: *
access-control-allow-headers: X-Requested-With
content-type: image/jpeg
content-length: 58752
@beaugunderson
beaugunderson / gist:2054996
Created Mar 17, 2012
Human-readable long epoch dates in vim
View gist:2054996
" Human-readable long epoch dates (long meaning those that include milliseconds)
function! DateFromLongEpoch()
" Let the shell divide because vim only supports 32 bit ints
let sdate=system("echo $((". expand("<cword>") ."/1000))")
" Format the date
let human=tolower(substitute(strftime("%m/%d/%y %I:%M:%S%p", sdate), "\\\<0", "", "g"))
return human ." (". (sdate - localtime()) ." seconds from now)"
endfunc
@beaugunderson
beaugunderson / loadenv.sh
Created Oct 15, 2012 — forked from kristjan/loadenv.sh
Load a .env file into your current shell. Handy when you need to skirt Foreman.
View loadenv.sh
function loadenv_inner() {
cat .env | while read line; do
echo export $line
done
}
function loadenv() {
if [ -f .env ]; then
eval `loadenv_inner`
else
View gist:4005443
[ec2-23-20-4-55.compute-1.amazonaws.com] sudo: npm shrinkwrap
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! Error: Problems were encountered
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! Please correct and try again.
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: mime-magic@0.3.0 /srv/singly/hallway/node_modules/mime-magic
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: libxml-to-js@0.3.10 /srv/singly/hallway/node_modules/libxml-to-js
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! extraneous: aws2js@0.7.4 /srv/singly/hallway/node_modules/aws2js
[ec2-23-20-4-55.compute-1.amazonaws.com] out: npm ERR! at shrinkwrap_ (/usr/lib/nodejs/npm/lib/shrinkwrap.js:28:15)
[ec2-23-20-4-55.compu
@beaugunderson
beaugunderson / gist:4052252
Created Nov 10, 2012
oauth 0.9.6 vs. zeo/oauth
View gist:4052252
diff -r -u node_modules/oauth/lib/oauth.js oauth/lib/oauth.js
--- node_modules/oauth/lib/oauth.js 2012-03-02 13:38:30.000000000 -0800
+++ oauth/lib/oauth.js 2012-11-10 11:42:55.000000000 -0800
@@ -309,7 +309,8 @@
headers["Authorization"]= authorization;
}
- headers["Host"] = parsedUrl.host
+ headers["Host"] = parsedUrl.host;
+ headers["Referer"] = 'http://localhost:8042';
View loop-tests.sh
#!/bin/bash
RETURN=0
COUNT=0
while [ $RETURN == 0 ]; do
COUNT=$(($COUNT + 1))
echo "Test run $COUNT"