Skip to content

Instantly share code, notes, and snippets.

type type type

Beau Gunderson beaugunderson

type type type
View GitHub Profile
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 / .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 / 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:;; path=/; expires=Fri, 24 Feb 2012 23:15:45 GMT
x-powered-by: Express, Express
set-cookie:; 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 / 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)"
beaugunderson /
Created Oct 15, 2012 — forked from kristjan/
Load a .env file into your current shell. Handy when you need to skirt Foreman.
function loadenv_inner() {
cat .env | while read line; do
echo export $line
function loadenv() {
if [ -f .env ]; then
eval `loadenv_inner`
View gist:4005443
[] sudo: npm shrinkwrap
[] out: npm ERR! Error: Problems were encountered
[] out: npm ERR! Please correct and try again.
[] out: npm ERR! extraneous: mime-magic@0.3.0 /srv/singly/hallway/node_modules/mime-magic
[] out: npm ERR! extraneous: libxml-to-js@0.3.10 /srv/singly/hallway/node_modules/libxml-to-js
[] out: npm ERR! extraneous: aws2js@0.7.4 /srv/singly/hallway/node_modules/aws2js
[] out: npm ERR! at shrinkwrap_ (/usr/lib/nodejs/npm/lib/shrinkwrap.js:28:15)
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"] =
+ headers["Host"] =;
+ headers["Referer"] = 'http://localhost:8042';
while [ $RETURN == 0 ]; do
COUNT=$(($COUNT + 1))
echo "Test run $COUNT"
View wrap.js
var original = cb;
cb = function wrapper() {
var args = arguments;
process.nextTick(function () {
original.apply(wrapper, args);