Skip to content

Instantly share code, notes, and snippets.

View tzi's full-sized avatar
👨‍🎓
enseigner les CSS

Thomas ZILLIOX tzi

👨‍🎓
enseigner les CSS
View GitHub Profile
@tzi
tzi / index.html
Created March 1, 2012 16:13
Dectection of Internet Explorer version
<!DOCTYPE html>
<html>
<head>
<title>Test navigator</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<script type="text/javascript" src="internet_explorer_version.js"></script>
<body>
</html>
@tzi
tzi / eraser.css
Created March 3, 2012 22:14
A #javascript #widget to share on Diaspora
/*! eraser.css 2012-01-20T12:53 UTC - http://github.com/necolas/eraser.css */
/*
* TODO?:
* :after, :before, :first-letter, :first-line
* any other critical proprietary properties (within reason)
*/
.x-widget,
@tzi
tzi / CrazyReturn.js
Created March 4, 2012 00:44
A #fun #javascript #bookmarklet : simulate crazy capslock
(function(){
// UTILS
var capslocked = function( event ) {
// UTILS
var key_handler = function( event ) {
// UTILS
var random_value = function( min, max ) {
@tzi
tzi / BetterRunKeeper.user.js
Created March 21, 2012 15:20
A #javascript #userscript : Add kilometer speed to #RunKeeper
// ==UserScript==
// @name BetterRunKeeper
// @description Add kilometer speed to RunKeeper
// @id me.zilliox.BetterRunKeeper
// @homepageURL http://userscripts.org/scripts/show/128831
// @supportURL http://userscripts.org/scripts/discuss/128831
// @updateURL http://userscripts.org/scripts/source/128831.meta.js
// @version 2012.03.21
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / direction.js
Created March 28, 2012 21:26
A simple example of #bit operator
window.onload = function(){
Compass = { North:1, South:2, Est:4, West:8 };
var move = function(step) {
dir = [];
if (step & Compass.North) dir.push('North');
else if (step & Compass.South) dir.push('South');
if (step & Compass.Est) dir.push('Est');
else if (step & Compass.West) dir.push('West');
document.write( step + ': ' + dir.join(' ') + '<br/>' );
}
@tzi
tzi / direction.js
Created March 28, 2012 21:44
A second example of #bit operator
window.onload = function(){
Compass = { North:131, South:56, West:224, Est:14 };
var move = function(step) {
dir = [];
var pow = Math.pow( 2, step);
if ( pow & Compass.North ) dir.push('North');
if ( pow & Compass.South ) dir.push('South');
if ( pow & Compass.Est ) dir.push('Est' );
if ( pow & Compass.West ) dir.push('West' );
document.write( step + ': ' + dir.join(' ') + '<br/>' );
@tzi
tzi / dabblet.css
Created May 11, 2012 14:49
An #example of before #css pseudo-element : Background is not always applied on children
a {
}
a:hover {
background-color: #F5F2F0;
}
a:before {
content: 'coco ';
}
a.absolute:before {
position: absolute;
@tzi
tzi / BetterThoughtBoxes.user.js
Created June 6, 2012 16:07
A #javascript #userscript: Improve thoughtboxes UI
// ==UserScript==
// @name BetterThoughtBoxes
// @description Improve thoughtboxes UI
// @id me.zilliox.BetterThoughtBoxes
// @homepageURL http://userscripts.org/scripts/show/135446
// @supportURL http://userscripts.org/scripts/discuss/135446
// @updateURL http://userscripts.org/scripts/source/135446.meta.js
// @version 2012.06.07
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / index.html
Created June 19, 2012 08:44
How to detect the Data-Uri support in javascript
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to detect the Data-Uri support in javascript</title>
<link href="no-data-uri.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript" src="no-data-uri.js"></script>
<body>
@tzi
tzi / important.css
Last active March 21, 2023 08:54
How to set an !important css property in javascript
.test {
height: 139px;
width: 96px
}