Skip to content

Instantly share code, notes, and snippets.

@Fil
Fil / gist:9103500
Created February 19, 2014 23:03
Bermuda bug
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fil
Fil / charsethero.pl
Created June 8, 2014 10:16
charsethero : convert mixed utf-8 and iso-latin content to utf-8
#!/usr/bin/perl
# source: http://www.perlmonks.org/?node_id=642617
#use strict;
# mixed string with ISO 8859-1 und UTF-8:
#my $test_string = "Das Å (auch \"bolle-Å\" genannt, was soviel bedeutet wie \"Kringel-Å\") ist mit der ".
#D force_latin("dänischen Rechtschreibreform von 1948 eingeführt worden.");

Keybase proof

I hereby claim:

  • I am fil on github.
  • I am fil (https://keybase.io/fil) on keybase.
  • I have a public key whose fingerprint is 4135 B776 D395 52D0 8A44 A57F ADBE 58EB 174F 9505

To claim this, I am signing this object:

@Fil
Fil / track.sh
Created August 26, 2014 10:10
livraison mondialisation apple
#! /bin/bash
bon=$1
(
echo "stage,time,place,lat,lon" &&
(
lynx -dump "http://www.tnt.fr/public/suivi_colis/recherche/visubontransport.do?bonTransport=$bon" \
| sed 's/^\(.*\) \([0-9][0-9].[0-9][0-9].2014 ..:..\) \(.*\)/\1,\2,\3/' \
2>/dev/null \
| grep "/201[0-9] "
@Fil
Fil / zoompan.js
Created September 21, 2014 20:37
d3 zoom and pan from the keyboard
d3.select('body').on('keydown', function () {
var step = 200;
var key = d3.event.key || d3.event.keyCode; // safari doesn't know .key
switch (key) {
case 'Esc':
case 27:
zoom.translate([0, 0]).scale(1).event(mapsvg.transition());
break;
case '+':
case '=':
@Fil
Fil / recolle.php
Last active August 29, 2015 14:10
make a large png from map tiles
<?php
# stitch tile images together to form a large image
# see also https://github.com/ericfischer/tile-stitch
function usage($err= null) {
echo "php recolle.php 'http://TILES_SERVER/%z/%x/%y.png' z x1 y1 [+nx] [+ny]\n";
if ($err)
@Fil
Fil / backup_mysql.php
Created December 7, 2014 21:32
mysql backup cron
#! /usr/bin/php -q
<?php
define('_STATEDIR', '/data/state/');
define('_ROOTPASS', 'root password for mysql');
# connexion a la base
$conn = mysql_connect('localhost', 'root', _ROOTPASS);
if (!$conn) die ('erreur connexion DB '.mysql_error());
<!DOCTYPE html>
<html>
<!--
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@Fil
Fil / lunr_save.js
Created April 18, 2015 10:27
save lunr.js state
/*
* Paste this is the console to get an indexed JSON
*/
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
@Fil
Fil / interfaces.php
Created April 18, 2015 19:38
logo d'article
<?php
# (trouver le pipeline qui va bien ou patcher public/interfaces.php)
$table_des_traitements['LOGO_ARTICLE'][]= 'traiter_logo_article(%s, $Pile[$SP][\'id_article\'])';