Skip to content

Instantly share code, notes, and snippets.

View nhoizey's full-sized avatar
👋

Nicolas Hoizey nhoizey

👋
View GitHub Profile
@mattdenner
mattdenner / card.css
Created August 11, 2010 10:10
How to do backface hiding when -webkit-backface-visibility doesn't work!
/*
The back of the card is rotated 180 degrees from the card itself, giving
the illusion that it really is the back! Unfortunately hiding the back
face of both "faces" doesn't work with webkit builds (requires Snow Leopard!)
but we set it anyway.
*/
.card #back { -webkit-transform: rotateY(180deg); }
.card .face { -webkit-backface-visibility: hidden; }
/*
@remy
remy / gist:539433
Created August 20, 2010 02:01
Random hex colour with correct padding for small colours
(function(h){return '#000000'.substr(0,7-h.length)+h})((~~(Math.random()*(1<<24))).toString(16))
@cowboy
cowboy / very-small-ie-detect.js
Created August 21, 2010 13:26 — forked from padolsey/gist:527683
Very small IE detect (aka type coersion ftw)
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 6) then:
// ie === 0
// If you're in IE (>=6) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
(function () {
try {
if (!google.doodle) google.doodle = {};
var a = 200,
g = -200,
j = -200,
k, l, m, n = 0,
o = 0,
p = 0,
q = 35,
anonymous
anonymous / Votes
Created September 9, 2010 14:01
On vote pour des couleurs.
Exemple 1 :
- 10% votent pour le rouge foncé, refusent quoi que ce soit d'autre que du rouge
- 10% votent pour du rouge primaire, acceptent pas mal de versions de rouge
- 25% votent pour du rose, pourraient accepter du rouge, du violet, du blanc, mais pas vraiment du bleu
- 20% votent pour du violet clair, pourraient accepter du rose, du bleu clair, pas de foncé
- 30% votent pour du bleu clair, pourraient accepter une couleur clair, mais pas du rouge
- 5% votent pour du bleu foncé, refusent quoi que ce soit d'autre que du bleu.
@paulirish
paulirish / gist:603681
Created September 29, 2010 22:25
html5 and friends - a bigass bulleted list of features

HTML5 and friends.

A bigass bulleted list of features.

I commonly need to get a big list of all the stuff people think of when they think new and shiny these days. This list is for that.

I take a very inclusionist approach to it. 1

javascript APIs

  • Web Storage (localStorage, sessionStorage)
  • Web SQL Database

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@andrew8088
andrew8088 / oop.js
Created December 12, 2010 02:15
OOP in JS
var tooltip_button = {
show : function () {
this.panel.show();
},
hide : function () {
this.panel.hide();
},
bind_events : function () {
var that = this;
this.button.bind("mouseover.Tooltip_Button", function () { that.show.call(that); });
@remy
remy / audiosprite.js
Created December 23, 2010 13:54
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
@piouPiouM
piouPiouM / project-skel.html
Created January 7, 2011 16:03
Squelette Zen Coding pour un projet et son rendu.
html[xmlns=http://www.w3.org/1999/xhtml xml:lang=fr lang=fr dir=ltr]>
(head>
meta[http-equiv=Content-Type content="text/html;charset=utf-8"]+
title+
link[rel=stylesheet href=css/screen.css? type=text/css media=screen,projection charset=utf-8]
)+
(body#top.home>
(div#header>
(div#logo>
h1