Skip to content

Instantly share code, notes, and snippets.

View jmervine's full-sized avatar

Joshua Mervine jmervine

View GitHub Profile
@jmervine
jmervine / gist:154949a5d13b84694fc1
Created November 26, 2015 01:51
bootstrap missing files
not ok 63 functional public/**/*.* https://maxcdn.bootstrapcdn.com/bootstrap/2.1.0/js/bootstrap.min.js content-type
AssertionError: file missing
--
not ok 1070 functional public/**/*.* https://maxcdn.bootstrapcdn.com/twitter-bootstrap/3.3.2/css/bootstrap-theme.css content-type
AssertionError: file missing
--
not ok 1071 functional public/**/*.* https://maxcdn.bootstrapcdn.com/twitter-bootstrap/3.3.2/css/bootstrap-theme.min.css content-type
AssertionError: file missing
--
not ok 1072 functional public/**/*.* https://maxcdn.bootstrapcdn.com/twitter-bootstrap/3.3.2/css/bootstrap.css content-type
@jmervine
jmervine / test.log
Created November 26, 2015 01:25
bootstrap content type errors
1..1142
not ok 63 functional public/**/*.* https://maxcdn.bootstrapcdn.com/bootstrap/2.1.0/js/bootstrap.min.js content-type
AssertionError: file missing
at tests/functional_test.js:224:32
at tests/functional_test.js:50:9
at IncomingMessage.<anonymous> (tests/test_helper.js:97:13)
at endReadableNT (_stream_readable.js:905:12)
not ok 136 functional public/**/*.* https://maxcdn.bootstrapcdn.com/bootstrap/3.0.0-rc1/fonts/glyphiconshalflings-regular.otf content-type
AssertionError: invalid content-type for "otf", expected "application/x-font-otf" but got "application/octet-stream"
at Object.assertContentType [as contentType] (tests/test_helper.js:40:12)
@jmervine
jmervine / confirm.sh
Created November 16, 2015 22:44
confirm example
#!/usr/bin/env bash
source shml.sh
on_human() {
echo "$(color green "Hello, human! $(emoji beer)")"
}
on_not_human() {
confirm "$(color red "Do you come in peace?")" "on_friend" "on_enemy"
}
@jmervine
jmervine / main.go
Last active September 25, 2015 23:21
example in mem cache
package main
import (
"crypto/md5"
"encoding/json"
"fmt"
"log"
"net/http"
"time"
#############################################################
## !! WARNING!!!
#
# These functions are shared between bash and zsh, don't
# forget to test them in both shells.
#
# If you need to do something specific for one or the other
# move it in to either .profile (bash) or .zshrc (zsh).
#
#############################################################
@jmervine
jmervine / main.go
Last active September 25, 2015 17:22
example httprouter w/ instrumented middleware
package main
import (
"fmt"
"log"
"net/http"
"os"
"time"
"github.com/julienschmidt/httprouter"
@jmervine
jmervine / bah.go
Last active September 24, 2015 22:09
type User struct {
Address string `json:"address,omitempty"`
Email string `json:"email"`
ID string `json:"id"`
Label string `json:"label,omitempty"`
SendShortEmail bool `json:"send_short_email,omitempty"`
Type string `json:"type,omitempty"`
UserID string `json:"user_id,omitempty"`
}
@jmervine
jmervine / foo.go
Last active September 24, 2015 21:27
/*
{ // PayloadForRules
"total": 3,
"notification_rules": [ // NotificationRules []NotificationRule
{ // NotificationRule
"id": "PNTJQ3G",
"start_delay_in_minutes": 0,
"created_at": "2014-12-01T19:25:19Z",
"contact_method": { // User
"id": "P8RXXCC",
@jmervine
jmervine / serve.go
Created September 21, 2015 16:59
simple hugo server for heroku
package main
import (
// stdlib
"fmt"
"net/http"
// external
"github.com/jmervine/env"
)
@jmervine
jmervine / functionrc
Created September 2, 2015 22:40
tmate helper wrapper
# tmate
function tmate {
local _sock=/tmp/tmate.sock
local _tmate=/usr/local/bin/tmate
if [ -z "$@" ]; then
$_tmate -S $_sock
else
case $@ in
p|print|ssh|url)