Skip to content

Instantly share code, notes, and snippets.

.vjs-paused .vjs-big-play-button {
display: block;
color: white;
}
(function (window, videojs) {
videojs.plugin('pauseOnCue', function() {
var myPlayer = this,
cuePointAra = [],
allCuePointData;
myPlayer.on('loadstart', function () {
cuePointAra = myPlayer.mediainfo.cue_points;
var tt = myPlayer.textTracks()[0];
if (tt) {

Keybase proof

I hereby claim:

  • I am shauns on github.
  • I am shauns (https://keybase.io/shauns) on keybase.
  • I have a public key whose fingerprint is 89B2 3B21 4B0F DB7E 3A7F 695B BAB7 22A2 3A5D 98FD

To claim this, I am signing this object:

@shauns
shauns / gist:1e08504b85b16a038a42
Created June 16, 2015 16:18
Snapshot site and convert to thumbnail
capturejs --uri="http://airbnb.com" --viewportsize="1152x720" --cliprect="0x0x1152x720" --output="airbnb.png" && gm convert airbnb.png -resize "576x" -unsharp 2x0.5+0.7+0 airbnb-preview.jpg && rm airbnb.png && open airbnb-preview.jpg
@shauns
shauns / sqlalchemy.py
Created April 20, 2015 14:39
Examples using SQLAlchemy for reference
from sqlalchemy import Column, Integer, Text, String, ForeignKey, \
UniqueConstraint, Table, inspect
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.orderinglist import ordering_list
from sqlalchemy.orm import relationship, backref, was_deleted
from conftest import Base, Session
def _unique(session, cls, hashfunc, queryfunc, constructor, arg, kw):
@shauns
shauns / github_visualise.py
Created April 8, 2015 17:21
Visual GitHub pull requests
from __future__ import unicode_literals
from collections import defaultdict
import random
import requests
from graphviz import Digraph
USERNAME = 'shauns'
PASSWORD = '****'
@shauns
shauns / sqlalchemy.diff
Created April 7, 2015 09:14
Diff to remove SQLAlchemy Sphinx errors
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py
index 8d6fe5a..e064b84 100644
--- a/lib/sqlalchemy/util/langhelpers.py
+++ b/lib/sqlalchemy/util/langhelpers.py
@@ -159,6 +159,9 @@ def %(name)s(%(args)s):
fn.__func__.__doc__ = doc
else:
fn.__doc__ = doc
+
+ decorated.__module__ = fn.__module__
##
## schema file for OpenLDAP 2.x
## Schema for storing Samba user accounts and group maps in LDAP
## OIDs are owned by the Samba Team
##
## Prerequisite schemas - uid (cosine.schema)
## - displayName (inetorgperson.schema)
## - gidNumber (nis.schema)
##
## 1.3.6.1.4.1.7165.2.1.x - attributetypes
@shauns
shauns / one_to_many_explicit_orm.py
Created November 8, 2014 09:57
One to Many, Explicit ORM
yield from fill_lazy_attribute(book.chapters)
chapters = book.chapters
do_something(chapters)
@shauns
shauns / one_to_many_orm.py
Created November 8, 2014 09:55
One to many ORM
chapters = book.chapters
do_something(chapters)