Skip to content

Instantly share code, notes, and snippets.

View ardcore's full-sized avatar
🏠
<3 rust

Szymon Piłkowski ardcore

🏠
<3 rust
View GitHub Profile
@isaacs
isaacs / callbacksarehard.js
Created January 12, 2011 02:29
let's go shopping!
// 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) {
@kig
kig / ABStruct.js
Created May 22, 2012 21:29
ArrayBuffer struct overlay
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));
}
@randompast
randompast / eduMMObbg.md
Created October 20, 2012 02:01
BarCamp - Coding the Future of Educational Browser Based Games and More! Q+A/chat/demos

#Play vs Game


Play = freedom

Game = rules + constraints

Play is fun.

Games can be work.

@josteink
josteink / on_stateful_code.txt
Last active October 21, 2020 05:37
On why stateful code is bad
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?
@ericandrewlewis
ericandrewlewis / 32.asm
Last active November 24, 2020 08:54 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /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
@WebReflection
WebReflection / benchmark-dom-classes.js
Last active November 13, 2021 20:52
Classes VS DOM Events Handling Benchmark
// 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
lsauer / gist:2907369
Last active January 17, 2022 09:59
Google Chrome special pages for memory, debug, resources, profiling, downloads...

####lsauer.com


###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per v20.xxx

@mrdoob
mrdoob / RequestAnimationFrame.js
Created February 22, 2011 14:50
Provides requestAnimationFrame in a cross browser way.
/**
* 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>

video::-webkit-media-controls-panel