Skip to content

Instantly share code, notes, and snippets.

View codegangsta's full-sized avatar

Jeremy Saenz codegangsta

View GitHub Profile
<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>
<div class='embed-container'>
<iframe src='https://www.youtube.com/embed//{ YOUR VIDEO CODE }' frameborder='0' allowfullscreen></iframe>
</div>
@codegangsta
codegangsta / og_tags.liquid
Created February 10, 2016 01:16
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 }}">
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 {
package main
import (
"github.com/codegangsta/inject"
"reflect"
"testing"
)
func helloWorld(val string) {
i := 0
// folder structure
// - templates/
// - admin/
// - index.tmpl
// - rendering.go
package main
import (
"github.com/codegangsta/martini"
"github.com/codegangsta/martini-contrib/render"
package auth
import (
"encoding/base64"
"net/http"
)
func Basic(username string, password string) http.HandlerFunc {
var siteAuth = base64.StdEncoding.EncodeToString([]byte(username + ":" + password))
return func(res http.ResponseWriter, req *http.Request) {
package main
import (
"github.com/codegangsta/martini"
)
func main() {
m := martini.Classic()
m.Get("/", func() string {
return "hello world"
@codegangsta
codegangsta / main.go
Created July 7, 2015 23:08
JSON and Middleware
package main
import (
"encoding/json"
"net/http"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
)
package models
import (
"net/http"
"labix.org/v2/mgo"
)
type DB struct {
Database string