Skip to content

Instantly share code, notes, and snippets.

View tomByrer's full-sized avatar
🎦
researching video players

Tom Byrer tomByrer

🎦
researching video players
View GitHub Profile
@Naatan
Naatan / auto-braces.js
Created May 7, 2014 17:39
Komodo IDE - Auto Braces
/**
* @fileoverview Auto completes curly braces to start on a new line - experimental
* @author Nathan Rijksen
* @version 0.1
*/
/**
* Komodo Extensions Namespace.
* This namespace was suggested by JeffG. More information is available at:
* {@link http://community.activestate.com/forum-topic/extension-s-namespace}
@masak
masak / git-edit-commit
Created June 11, 2014 11:51
A git-edit-commit subcommand
COMMIT="$1"
echo "${COMMIT:=HEAD}"
OLD_HEAD=`git rev-parse HEAD`
git reset --hard $COMMIT
git reset --mixed HEAD~
git commit --patch || (git reset --hard $OLD_HEAD && exit)
git checkout .
git rebase -X theirs $OLD_HEAD
@lzcabrera
lzcabrera / steps
Last active August 29, 2015 14:06
woff2 font-compression
*Download the reference codebase*
$ git clone https://code.google.com/p/font-compression-reference/
*Build the project*
cd font-compression-reference/woff2
make clean all
*Run the tool over a given font*
$ ./woff2_compress telusdings.ttf
############################################################################################################
### % [ title ] ( src ) ###
video_matcher = /^%\[([^\]]*)\]\s*\(([^)]+)\)/
#-----------------------------------------------------------------------------------------------------------
parse_video = ( state, silent ) ->
return false if state.src[ state.pos ] isnt '%'
match = video_matcher.exec state.src[ state[ 'pos' ] .. ]
return false unless match?
unless silent
@wilmoore
wilmoore / iife.js
Created October 24, 2011 03:20
IIFE Variations (JavaScript)
// from: http://jsfiddle.net/SubtleGradient/Qfawx/
// copied here only because "gists" are slightly easier for me to read
// classic (oldschool)
(function(){/*IIFE*/})();
// new standard
(function(){/*IIFE*/}());
// lol, square
@aseemk
aseemk / url.coffee
Created April 27, 2012 05:51
Simplified wrapper around Node's native 'url' module
# url.coffee
# by Aseem Kishore ( https://github.com/aseemk ), under MIT license
#
# A simplified wrapper around the native 'url' module that returns "live"
# objects: updates to properties are reflected in related properties. E.g.
# updates to the `port` property will be reflected on the `host` property.
#
# The public API and behavior are pretty close to the native 'url' module's:
# http://nodejs.org/docs/latest/api/url.html Currently lacking / known issues:
#
@asciidisco
asciidisco / getTitle.js
Created January 31, 2013 16:19
Access PhantomJS via WebDriver/JSONWireProtocol from node to receive the title of a webpage
// before you launch this script, make sure you have phantomjs v1.8 installed
// and launch it with the port specified in the options: ´$ phantomjs --webdriver=3456´
var http = require('http');
// request body for "/wd/hub/session" request
var body = JSON.stringify({desiredCapabilities: {browserName: 'firefox', version: '', platform: 'ANY'}});
// base options for post requests
var options = {
@redchair123
redchair123 / find_unlicensed_repos.sh
Last active December 16, 2015 11:19
Simple shell script to find unlicensed repos on github
#!/bin/bash
# Copyright (c) 2013 Niggler
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW
@iliadraznin
iliadraznin / istype.js
Created June 8, 2013 15:28
Simple function to detect type Array. JavaScript return type "object" whether you give it an actual object like { red:44, green:57, blue:220 }, or an array like [44, 57, 220]. So I wrote this small function to separate the two.
function istype(obj) {
return (typeof obj !== 'object' || typeof obj[0] === 'undefined')
? typeof obj
: 'array';
}

Lesson's learnt building the Guardian

Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?

Daithi O Crualaoich

  • Work with great people.
  • Deploy like crazy. This means the team has to control the infrastructure as well as code.
  • Design is not a service. Designers have to sit in the team.
  • Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
  • Use your CDN for HTML too.
  • Don't always do as you are told.