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 / bm_popin.js
Created February 15, 2012 21:21
A #javascript #bookmarklet : Provide a generic #popin for other bookmarklets
function bm_popin( id ) {
this.id = id;
this.construct = function() {
var bm = document.querySelector( '#bm_popin' );
if ( bm == null ) {
bm = document.createElement( 'div' );
bm.setAttribute( 'id', 'bm_popin' );
bm.setAttribute( 'style', 'position: fixed; bottom:10px; right: 10px; z-index: 9999; width: 200px; font-size: 12px; line-height: 16px; font-weight: normal; color: #EEEEEE; text-align: left;' );
document.body.appendChild( bm );
}
@tzi
tzi / HappyEzPublish.user.js
Created February 17, 2012 20:58
A #javascript #userscript : Add some happyness to your #ezpublish Back-Office
// ==UserScript==
// @name HappyEzPublish
// @description Add some happyness to eZ Publish Back-Office
// @id me.zilliox.HappyEzPublish
// @homepageURL http://userscripts.org/scripts/show/120420
// @supportURL http://userscripts.org/scripts/discuss/120420
// @updateURL http://userscripts.org/scripts/source/120420.meta.js
// @version 2012.02.18
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / create_element.js
Created February 20, 2012 11:32
A #javaScript #function : Create HTML element
function createElement( str ) {
var elem = document.createElement('div');
elem.innerHTML = str;
if ( elem.childNodes.length > 0 ) {
return elem.childNodes[0];
}
return elem;
}
function addImportantStyle( el, styles ) {
var style = '';
@tzi
tzi / bonzo_create.js
Created February 21, 2012 18:40
A #javaScript #function : Create HTML element inspired by #Bonzo
bonzo_create = function (node) {
return typeof node == 'string' && node !== '' ?
function () {
// Add context values
var win = window
, doc = win.document
, html = doc.documentElement
, parentNode = 'parentNode'
, query = null
@tzi
tzi / GistBlocksLink.user.js
Created February 22, 2012 02:55
A #javascript #userscript : Add a #bl.ocks.org link on #Gist
@tzi
tzi / GistBetterEdition.user.js
Created February 22, 2012 16:14
A #javascript #userscript : Improve the #github #gist edition view : Allow to use Tab, Shift+Tab & Ctrl+D
// ==UserScript==
// @name GistBetterEdition
// @description Improve the Gist edition view : Allow indentation & Enlarge
// @id me.zilliox.GistBetterEdition
// @homepageURL http://userscripts.org/scripts/show/126461
// @supportURL http://userscripts.org/scripts/discuss/126461
// @updateURL http://userscripts.org/scripts/source/126461.meta.js
// @version 2012.07.12
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / EmbedGithubFile.user.js
Created February 22, 2012 16:21
A #javascript #userscript : Add an embed link on every #github repository file
// ==UserScript==
// @name EmbedGithubFile
// @description Add an embed action on github repository. Like gist
// @id me.zilliox.EmbedGithubFile
// @homepageURL http://userscripts.org/scripts/show/121119
// @supportURL http://userscripts.org/scripts/discuss/121119
// @updateURL http://userscripts.org/scripts/source/121119.meta.js
// @version 2012.02.27
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / myAnchor.js
Created February 23, 2012 13:11
A #javascript #bookmarklet : Find the nearest anchor from your click
(function() {
// Attributes
var reg = new RegExp( '" id="([^"]*)"', 'g' ),
popin = new bm_popin( 1892731 );
popin.title( 'myAnchor' );
popin.text( 'Click on your page' );
// Recursive function
function get_previous_node_id( node, parse ) {
@tzi
tzi / GistFilterTag.user.js
Created February 23, 2012 17:55
A #javascript #userscript : Allow you to filter yours #gist by tag
// ==UserScript==
// @name GistFilterTag
// @description Allow you to filter yours gist by tag
// @id me.zilliox.GistFilterTag
// @homepageURL http://userscripts.org/scripts/show/126558
// @supportURL http://userscripts.org/scripts/discuss/126558
// @updateURL http://userscripts.org/scripts/source/126558.meta.js
// @version 2012.02.24
// @author tzilliox
// @namespace http://zilliox.me
@tzi
tzi / estimation.css
Created February 28, 2012 18:09
A #javascript page to make easily #estimation
.container {
width: 960px;
margin: 0 auto;
}
label {
display: block;
}
input {
width: 500px;
}