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 / super-flatten.sh
Created August 17, 2012 14:52
A #shell #script : clean the eZ Publish database
#!/bin/bash
# UTILS
usage() {
echo ""
echo "SUPER FLATTEN"
echo "-------------"
echo "This script clean your eZ Publish database by removing unused entries"
@tzi
tzi / README.md
Created August 17, 2012 11:23
A #javascript #userscript: Fix redirect twitter link
@tzi
tzi / .bashrc
Created August 14, 2012 13:26
#Shell aliases: show and clean .svn folders
show_svn() {
if [ -d "$1.svn" ]
then
echo "$1.svn"
fi
for file in `ls -p $1 2>/dev/null | grep "/$"`
do·
show_svn "$1$file"
done
}
@tzi
tzi / index.php
Created July 31, 2012 15:09 — forked from Simounet/index.php
subval array sort function
<?php
function subval_sort( $array, $subkey ) {
$compare = function( $a, $b ) use ( $subkey ) {
return strcasecmp( $a[ $subkey ], $b[ $subkey ] );
}
uasort( $array, $compare );
return $array;
}
@tzi
tzi / SalutMadame.user.js
Created July 17, 2012 22:31
A #javascript #userscript : To add Keyboard controls & Ajax navigation to BonjourMadame
// ==UserScript==
// @name FluidBonjourMadame
// @description Add Keyboard controls to BonjourMadame
// @id me.zilliox.FluidBonjourMadame
// @homepageURL http://userscripts.org/scripts/show/138650
// @supportURL http://userscripts.org/scripts/discuss/138650
// @updateURL http://userscripts.org/scripts/source/138650.meta.js
// @author tzi
// @namespace http://zilliox.me
// @include http://www.bonjourmadame.fr/*
@tzi
tzi / old_view.js
Created July 7, 2012 21:29
A #javascript #bookmarklet : To change CSS
(function(){
var is_old_view = false;
var current_css_href = "./themes/SilverScreen2/css/common.css";
var old_css_href = "./themes/SilverScreen2/css/common_old.css";
var link = document.querySelector( '[href="' + current_css_href + '"]' );
if ( link ) {
var popin = new bm_popin( 3068137 );
var switch_view = function() {
is_old_view = ! is_old_view ;
if ( is_old_view ) {
@tzi
tzi / convert.js
Created June 29, 2012 13:41
A #javascript unit converter
(function(){
var current_question = 1;
var questions = document.getElementById( 'questions' );
var question1 = document.getElementById( 'question1' );
var question2 = document.getElementById( 'question2' );
var answer = document.getElementById( 'answer' );
document.converter.onsubmit = function(){
if ( current_question == 1 ) {
var origin = document.converter.value.value;
if ( document.converter.unit.value == 'm' ) {
@tzi
tzi / autocomplete.js
Created June 26, 2012 09:40
How to add an autocompletion in javascript
(function(){
// TODO
})();
@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
}
@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>