Skip to content

Instantly share code, notes, and snippets.

View borismus's full-sized avatar

Boris Smus borismus

View GitHub Profile
content/posts/.../my-new-post/index.txt
My new post
===========
posted: 2012-03-01
Just **testing**
1. Hello
2. World
What is the variance in pixel sizes across devices? Compute it.
Since we have so many devices, pixels don't make sense anymore. Leave it
to somebody else.
I'd like to just say "this button is 5x5cm" and scale stuff
appropriately. CSS pixels suck since they aren't really pixels. Apple
guidelines say 44x44px as min size but this is fundamentally about the
real size of the display, not pixels. Actually double check iPad vs
iPhone.
@borismus
borismus / gist:2918946
Created June 12, 2012 17:38
Pinch-zoom recognizer
/**
* Gesture recognizer for compound multi-touch transformations.
*
* 1. pinch/zoom/scale gesture.
* 2. rotate gesture.
*/
function TransformRecognizer(element) {
// Reference positions for the start of the transformation.
this.referencePair = null;
@borismus
borismus / pointer-events-spec
Created July 24, 2012 08:57
A proposal for the pointer events specification. Started based on http://goo.gl/i32Q9
Interfaces
==========
Jargon... "Persistent points" will be mouse, pen tablets, and other pointing devices that
leave a "cursor" even when it's not being used. "Volatile points" are input points in the
context of surface based input devices, or others that do not leave a cursor when
inactive. (i.e. Wiimotes) Surface input devices may or may not have proximity support,
and the event firing model should be different based on that.
TODO: The names "persistent" and "volatile" sound pretty bad. Personally would like to change it.
@borismus
borismus / precompile.py
Created September 14, 2012 18:55
Ember handlebars template precompilation
#!/usr/bin/env python
import os
JS_FORMAT = """
Ember.TEMPLATES.%(name)s = Ember.Handlebars.compile('%(template)s');
"""
output = ''
# Get all templates with the name *.handlebars
for filename in os.listdir('.'):
@borismus
borismus / gist:3939311
Created October 23, 2012 15:10
High DPI CSS image backgrounds with robust fallbacks
compass-image-set(W, H, IMG1, BP1, IMG2, BP2, ..., IMG_N, BP_N)
/** Default fallback */
sel {
background-image: url($IMG1);
background-size: $W, $H;
}
/* First pixel ratio breakpoint */
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2173.0 Safari/537.36 | WebGL 1.0 (OpenGL ES 2.0 Chromium) | WebKit | WebKit WebGL | WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Three.js:760 WebGL: INVALID_OPERATION: getAttribLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getAttribLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:760 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:761 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
Three.js:761 WebGL: INVALID_OPERATION: getUniformLocation: program not linked
The provided value '1' is not a valid enum value of interface OscillatorType.
main.js:191 Uncaught TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite.
(Should be a super easy fix. Check out http://www.w3.org/TR/webaudio/changelog.html)
let text = `
A taster of HSC 1
=================
readers: 3-4
This is a wild read that requires some intimacy with strangers. You'll be anonymous.
---- page ----
@borismus
borismus / enormous_wings.md
Last active June 7, 2018 00:58
A Very Old Man with Enormous Wings
title participants
A Very Old Man with Enormous Wings
2-5

Written by Gabriel Garcia Marquez

Translated by Gregory Rabassa