Skip to content

Instantly share code, notes, and snippets.

@grigs
grigs / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@grigs
grigs / gist:2039654
Created March 14, 2012 21:28
Apple’s Features.js -- prettified version of http://images.apple.com/v/ipad/a/scripts/features.js
AC.AmbientVR = Class.create({
__defaultOptions: {
imageIndexOffset: 0,
initialPos: 0,
throwable: false,
invert: false,
infiniteAxis: false,
grabRotateDistance: 780,
allowMobileScroll: true,
introSpins: 0,
@grigs
grigs / gist:3015fd4ebebbefbbbb7e
Created May 20, 2015 20:45
Facebook Instant Article JSON Example
{
"672858856170909": {
"id": "672858856170909",
"latest_version": {
"id": "994845887216565",
"article_canonical_url": "http:\/\/www.theatlantic.com\/magazine\/archive\/2015\/06\/the-execution-of-clayton-lockett\/392069\/",
"article_version_number": 78,
"cover_media": {
"__type__": {
"name": "DocumentVideoElement"
@grigs
grigs / gist:e4ea58be46134cdb0729
Created May 20, 2015 21:28
Facebook Instant Article JSON Buzzfeed Example
{
"700554543387711": {
"id": "700554543387711",
"latest_version": {
"id": "455210147987840",
"article_canonical_url": "http:\/\/www.buzzfeed.com\/expresident\/steps-to-instantly-improve-your-day",
"article_version_number": 2,
"cover_media": {
"__type__": {
"name": "DocumentVideoElement"
@grigs
grigs / gist:5778632
Last active September 24, 2017 08:49
Quick notes on TVs and standards

I need to write this up in more detail soon, but in chatting with Patrick, it is clear that 140 chars isn't cutting it.

The way I've been thinking about the web on TVs and consoles is something like this:

  • What are the design patterns and interaction models that would make for a successful experience?
  • Can we build those experiences now? If not, what would need to change to make it possible?

In my mind, this starts with the basics of designing an interface that works well on a TV and can be interacted with using a remote control. Once we have the basics out of the way, we can proceed to multiscreen interactions.

A basic television layout

@grigs
grigs / browserdetect.js
Created March 13, 2012 17:12
Apple's Browser Detection Script - prettified from http://images.apple.com/global/scripts/browserdetect.js
if (typeof (AC) === "undefined") {
AC = {}
}
AC.Detector = {
getAgent: function () {
return navigator.userAgent.toLowerCase()
},
isMac: function (c) {
var d = c || this.getAgent();
return !!d.match(/mac/i)