Skip to content

Instantly share code, notes, and snippets.

Jeremy Saenz codegangsta

View GitHub Profile
View wistia_video_example.html
<script>
// initialize the wistia queue if it hasn't already been initialized
window._wq = window._wq || [];
// Push your callback onto the queue
_wq.push({ "YOUR_WISTIA_VIDEO_ID": function(video) {
// Make any calls you want to the video handle
video.play();
}});
</script>
View gist:0e6818014ac33238db8046c6d1ecec47
<div class='embed-container'>
<iframe src='https://www.youtube.com/embed//{ YOUR VIDEO CODE }' frameborder='0' allowfullscreen></iframe>
</div>
View og_tags.liquid
{% if template contains 'sales_page' %}
<meta property="og:type" content="product">
<meta property="og:title" content="{{ sales_page.title | escape }}">
<meta property="og:description" content="{{ sales_page.body | strip_html | escape | truncate: 300 }}">
{% if sales_page.thumbnail_url %}
<meta property="og:image" content="{{ sales_page.thumbnail_url }}">
{% endif %}
{% elsif template contains 'blog_post' %}
<meta property="og:type" content="article">
<meta property="og:title" content="{{ blog_post.title }}">
@codegangsta
codegangsta / main.go
Created Jul 7, 2015
JSON and Middleware
View main.go
package main
import (
"encoding/json"
"net/http"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
)
View mongo_middleware_example.go
package models
import (
"net/http"
"labix.org/v2/mgo"
)
type DB struct {
Database string
View main.go
package main
import (
"flag"
"net/http"
"github.com/codegangsta/negroni"
)
func main() {
View main.go
package main
import (
"github.com/bmizerany/mc"
"github.com/codegangsta/envy/lib"
"github.com/codegangsta/negroni"
"github.com/crowdmob/goamz/aws"
"github.com/crowdmob/goamz/s3"
"github.com/disintegration/imaging"
View utils.go
package util
import (
"crypto/rand"
"fmt"
)
type UUID [16]byte
// create a new uuid v4
View martini-mgo.go
package main
import (
"github.com/codegangsta/martini"
"github.com/codegangsta/martini-contrib/binding"
"github.com/codegangsta/martini-contrib/render"
"labix.org/v2/mgo"
)
type Wish struct {
View sketch_test.go
package main
import (
"github.com/codegangsta/inject"
"reflect"
"testing"
)
func helloWorld(val string) {
i := 0
You can’t perform that action at this time.