- iOS (even iPad) won't autoplay
- An element with
background-attachment: fixed
won't respect that property when it's over a video in webkit - IE10 will show a black image while it's loading unless you set a poster property
- In IE9, loop only works if the video is also autoplay
- If you try to play a video in IE10 before it's ready, you will see black for a bit. This is a bummer, because autoplay is probably turned on for IE9.
- I had mixed results getting videos to autoplay on Android. And a fair amount of browser crashing. In fact, in the end, I just disabled video altogehter.
- On iOS, I created a play button (just an
a
) link, that when clicked takes the video fromdisplay:none
todisplay:block
while triggering the.play()
API on the video element. This made the video go fullscreen on iPhone and play inline on iPad. - How to detect the fullscreen close on iPhone: http://stackoverflow.com/a/12169341/59160
- A newer article on the subj: http://www.sitepoint.com/essential-audio-and-video-events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
// Dependencies | |
var $ = require('jquery') | |
, _ = require('underscore') | |
, Backbone = require('backbone') | |
; | |
// Setup view | |
var View = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(options) { | |
options = _.defaults(options || {}, { | |
offset: 0, | |
hesitate: false | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://github.com/umdjs/umd/blob/master/returnExports.js | |
(function (root, factory) { | |
// AMD | |
if (typeof define === 'function' && define.amd) { | |
define([ | |
'jquery' | |
, 'lodash' | |
], factory); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change the page | |
View.change = function(e, new_page) { | |
// Make sure old page has lower z-index and stop any trams. | |
// Note: calling set() invokes stop() | |
var old = this.$slides.eq(e.previous('page')).tram() | |
.set({'z-index': 1}) | |
; | |
// Hide the old one after the transition is done. Don't use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"keys": ["super+shift+r"], "command": "browser_refresh", "args": { | |
"auto_save": true, | |
"delay": 0.0, | |
"activate_browser": true, | |
"browser_name" : "Google Chrome" | |
} | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Homepage feed | |
public function index($filter = null) { | |
// Tell Laravel where to find the mustache views for post | |
app('view')->addNamespace('js', public_path().'/js'); | |
// Render the view | |
$this->layout->nest('content', 'gadget.index', array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path | |
export PATH="~/.composer/vendor/bin:/usr/local/bin:/Applications/MAMP/bin/php/php5.5.26/bin:$PATH" | |
# Change prompt | |
export PS1="\[\e[0;36m\]\w \[\e[33m\]⇢\[\e[49m\] \[\e[m\]" | |
# Use atom as editor | |
export EDITOR='atom --wait' | |
export GIT_EDITOR='atom --wait' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
// Dependencies | |
var $ = require('jquery') | |
, _ = require('lodash') | |
, Backbone = require('backbone') | |
; | |
// Setup view | |
var View = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/js/libs/modernizr.js"></script> | |
<script type="text/javascript"> | |
var ua = navigator.userAgent; | |
Modernizr.addTest('retina', window.devicePixelRatio > 1); | |
Modernizr.addTest('webkit', navigator.userAgent.match(/AppleWebKit/i)); | |
Modernizr.addTest('ipad', navigator.userAgent.match(/iPad/i)); | |
Modernizr.addTest('iphone', navigator.userAgent.match(/iPhone/i)); | |
Modernizr.addTest('ipod', navigator.userAgent.match(/iPod/i)); | |
Modernizr.addTest('ios', Modernizr.ipad || Modernizr.ipod || Modernizr.iphone); | |
Modernizr.addTest('android', navigator.userAgent.match(/Android/i)); |