Skip to content

Instantly share code, notes, and snippets.

@Fil
Fil / newton.js
Last active August 29, 2015 13:56
newton function to solve f(V)=0
/*
* Newton's method for finding roots
*
* code adapted from D.V. Fedorov,
* “Introduction to Numerical Methods with examples in Javascript”
* http://owww.phys.au.dk/~fedorov/nucltheo/Numeric/11/book.pdf
* (licensed under the GPL)
* by Philippe Riviere <philippe.riviere@illisible.net> March 2014
* modified for compatibility with Chrome/Safari
* added a max iterations parameter
@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 / 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());
@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\'])';
@Fil
Fil / .gitignore
Last active September 26, 2015 16:08
Outil pour créer une copie locale statique de "mes" seens
# ma config
seen-local-config.php
# stockage de mon backup xml
tmp/
# mes fichiers exportes
seen/
# mes fichiers downloades
@Fil
Fil / corpus-seenthis.py
Created March 23, 2012 08:23
import seenthis into gensim
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# adapted from ensim-0.8.4-py2.7.egg/gensim/corpora/wikicorpus.py
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html