Skip to content

Instantly share code, notes, and snippets.


Guillaume Bartolini guizmo

View GitHub Profile
guizmo / nc_list.php
Created Jan 17, 2013
List commune New Caledonia
View nc_list.php
function nc_opt_list_communes() {
$options = array(
'98812' => 'Boulouparis',
'98870' => 'Bourail',
'98813' => 'Canala',
'98830' => 'Dumbéa',
'98881' => 'Farino',
'98815' => 'Hienghène',
'98816' => 'Houaïlou',
'98811' => 'îles Belep',
View resize.js
// This prevents the execution of the code before the document is finished loading.
jQuery(document).ready(function() {
    // The 'A+' element  in the page is associated with the jQuery click() event.
    jQuery('#increase-font').click(function(event) {
        // This prevents the default action of the click() event from being triggered.
        // The jQuery each() event interates over each elements belonging to the 'resize' class
        jQuery('.resize').each(function() {
            // Call to a custom function to increase the text size
# Remove all files and directories (recursive removal)
rm -rf path/to/folder
# Remove / Delete directory called /tmp/foo
rmdir /tmp/foo
guizmo /
Created Aug 16, 2012
Upload file via ssh
scp someFile someUser@someServer:/somePath/someFile
guizmo /
Created Aug 16, 2012
Merge 2 movie files
cat video1.avi video2.avi videon.avi > output.avi (this merges them but only playes length of 1st mov)
mencoder -forceidx -oac copy -ovc copy output.avi -o output_final.avi (this commands rebuilds the header file. One unqiue point about this commands is that it only copies the frames and audio across, it doesn’t re-encode them )
View dabblet.html
<h1>Split view feature box with CSS skew transform and transitions</h1>
<div class="box sunrise"><a href="#box2"></a></div>
<div class="slider">
<div class="box sunset"><a href="#box1"></a></div>
<p>Handcrafted by <a href="">@dstorey</a> for
<a href=""></a>. Sunset image, <a href="">Some rights reserved</a> by <a href="">najeebkhan2009</a>. Sunrise image, <a href="">Some rights reserved</a> by <a href="">3dpete</a>.</p>
guizmo / disable-plugins-when-doing-local-dev.php
Created Jul 17, 2012 — forked from markjaquith/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
View disable-plugins-when-doing-local-dev.php
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI:
guizmo / Asset.php
Created Jul 6, 2012
Creating ZIP File with PHP
View Asset.php
// source
$error = ""; //error holder
$post = $_POST;
$file_folder = "files/"; // folder to load files
if(extension_loaded('zip')){ // Checking ZIP extension is available
if(isset($post['files']) and count($post['files']) > 0){ // Checking files are selected
$zip = new ZipArchive(); // Load zip library
$zip_name = time().".zip"; // Zip name
guizmo / Asset.php
Created Jul 5, 2012
Openlayers showPopup()
View Asset.php
Drupal.settings.nid = Drupal.settings.nid || [];
function my_map() {
var all_layers = Drupal.openlayers.popup.popupSelect.layers;
for(var key1 in all_layers) {
var current_layer = all_layers[key1];
var all_features_in_layer = current_layer.features;
for(var key2 in all_features_in_layer) {
guizmo / Asset.php
Created Jun 30, 2012
Print category tree
View Asset.php
foreach( get_categories('hide_empty=1') as $cat ) :
if( !$cat->parent ) {
echo '<ul><li><strong>' . $cat->name . '</strong></li>';
process_cat_tree( $cat->term_id );
wp_reset_query(); //to reset all trouble done to the original query
function process_cat_tree( $cat ) {
You can’t perform that action at this time.