#Play vs Game
Play = freedom
Game = rules + constraints
Play is fun.
Games can be work.
// before | |
mainWindow.menu("File", function(err, file) { | |
if(err) throw err; | |
file.openMenu(function(err, menu) { | |
if(err) throw err; | |
menu.item("Open", function(err, item) { | |
if(err) throw err; | |
item.click(function(err) { | |
if(err) throw err; | |
mainWindow.getChild(type('Window'), function(err, dialog) { |
ABStruct = {}; | |
ABStruct.create = function(def) { | |
var f = function(dataView) { | |
this.dataView = dataView; | |
}; | |
f.prototype = {}; | |
var idx = [0]; | |
for (var i in def) { | |
Object.defineProperty(f.prototype, i, ABStruct.getter(def[i], idx)); | |
} |
#Play vs Game
Play = freedom
Game = rules + constraints
Play is fun.
Games can be work.
On why stateful code is bad | |
=========================== | |
STUDENT: Sir, can I ask a question? | |
TEACHER: Yes! | |
STUDENT: How do you put an elephant inside a fridge? | |
TEACHER: I don't know. | |
STUDENT: It's easy, you just open the fridge and put it in. I have another question! | |
TEACHER: Ok, ask. | |
STUDENT: How to put a donkey inside the fridge? |
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
// Players | |
class ClickCounter { | |
constructor() { this.clicks = 0; } | |
onclick(e) { this.clicks += (e.type === 'click') ? 1 : -1; } | |
} | |
class Handler extends ClickCounter { | |
constructor(currentTarget) { | |
super(); | |
currentTarget.addEventListener('click', this); |
####lsauer.com
###Overview of all chrome://
pages.
chrome://about/
###List of Pages as per v20.xxx
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* @author paulirish / http://paulirish.com/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
/* | |
* Pre-ECMAScript 1, JavaScript didn't have native arrays. | |
* Those who needed them frequently used functions such as the following. | |
* Also note that there was no special "undefined" value. | |
*/ | |
function makeArray(len){ | |
var array = new Object(); | |
Some updates to Angelina Fabbro's tremendous original reference document. The most notable additions are shadow pseudoclasses for scroller pseudoelements.
A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:
-webkit-appearance:none;
video::-webkit-media-controls-panel