Skip to content

Instantly share code, notes, and snippets.

vid.addEventListener('error', function(evt) {
logEvent(evt,'red');
}, false);
...
function logEvent(evt, color) {
switch (evt.type) {
...
case 'error':
var error = document.querySelector('video').error;
switch (error.code) {
layout title date comments sharing footer
page
index
2013-08-30 12:07
false
false
true

Overview

@nifl
nifl / axlesofevil.md
Last active August 29, 2015 14:03
Some bike polo content lifted from the Axles of Evil, the origin of "Little Beirut" bike polo. Note this was taken from a 2004 snapshot from archive.org and as such the days and times are no longer valid AFAIK.

bike polo is dead. long live bike polo!

in our attempts to free ourselves from the harrassment and persecution we have endured from the city of Portland, we have fallen into their trap. Without paying excrutiating sums to the corrupt city department of parks and recreation, and the profiteering insurance companies, the city has told us, we can no longer play our beloved game on city property. FIE! FIE! to this challenge we say that we will never give up! we will never give in! Back to the underground. a change of venues, and and a adaption of strategy, and we're back on our feet. This means that in order find out about bike polo, you must SHOW UP to bike polo. There will be no more advertisement. We will be yr. sole source of information for all things in the bike polo revolution! VIVE LA RESISTANCE! RIDE BIKES THROW BRICKS!!!

until we are physically removed, we continue to play at the following places and times:

  • Wednesday 6:30pm -> Colonel Summers Park : SE 20th & Belmont
  • ~~Sunday 2pm -> Alberta
@nifl
nifl / paths
Created June 26, 2014 17:50
Order /etc/paths to give user-installed binaries precedence
# New
/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin
# Default
<?php
/**
* Custom configuration bootstrap file for ExpressionEngine
*
* Place config.php in your site root
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php
* If you have moved your site root you'll need to update the require_once path
*
@nifl
nifl / js-objects.md
Last active October 10, 2019 21:03
JS Objects

Objects

Object properties can refer to numbers, strings, arrays, functions, and other objects. Properties will also accept variables.

Creating objects

Literal notation - "Object Literal"

Literal objects can have properties and methods added to them on the fly, which we cannot do with a constructor. To add a method to a constructor we must extend its prototype chain.

@nifl
nifl / js-hoisting.md
Created April 3, 2014 18:01
JS Hoisting

Hoisting - Concept of program load order

First, memory is set aside for all necessary variables and declared functions.

// How a function is built by humans
function sumOfSquares (a, b) {
  
  var x = add(a*a, b*b);
 return x;
@nifl
nifl / js-closures.md
Created April 3, 2014 18:01
JS Closures

Closures

A closure is a function returned from a function complete with external variables.

The entire contents of an inner function will still be available outside the outermost function.

function simpleClosure () {
	var x = 4;
	function closeX (){
@nifl
nifl / js-functions.md
Last active September 17, 2022 04:24
JS Functions

Functions

Functions are first–class citizens in JS, meaning that they can be passed around like any other type of data, eg, variables. http://en.wikipedia.org/wiki/First-class_function

Declared function

Declared functions build in memory immediately when the program loads.

Basic syntax

@nifl
nifl / js-builtins.md
Created April 3, 2014 17:59
JS Built-ins

Built–Ins

alert() Sends message to user in small pop-up window

confirm() Asks for consent to move forward. Cancel returns false, OK returns true

prompt() Sends a message and retrieves an entry.

typeof() Useful for checking a variable's contents