Skip to content

Instantly share code, notes, and snippets.

@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
#! /usr/bin/php -q
<?php
define ('MYSQL_ROOT', 'root');
define ('MYSQL_PASS', 'passwd');
# connexion a la base
$conn = mysql_connect('localhost', 'root', 'tapioca');
if (!$conn) die ('erreur connexion DB '.mysql_error());
@Fil
Fil / svg2png
Created January 25, 2013 17:12
<?php
## Service Web de conversion d'un SVG (passéen URL) en png
## ?url=http://......./svg2png.php?url=(adresse du svg)
## renvoie le png converti
## TODO : gestion d'entete en cas d'erreur quelconque
## utilise : SPIP
## utilise : rsvg ou ImageMagick http://seenthis.net/messages/86415
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fil
Fil / map.geojson
Created August 18, 2013 09:55
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fil
Fil / map.geojson
Created August 27, 2013 14:59
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Fil
Fil / point_in_polygon.php
Created August 28, 2013 06:28
point in polygon
<?php
/* is (lon, lat) inside the polygon $p?
* use ray casting algorithm (http://en.wikipedia.org/wiki/Point_in_polygon)
* ie. project a horizontal line from our point to each segment
* code adapted from http://stackoverflow.com/questions/14149099/raycasting-algorithm-with-gps-coordinates
*/
function inside_polygon($test_point, $points) {
@Fil
Fil / sync.php
Last active January 3, 2016 04:19
<?php
# seenthis sync:
# export
define('_DIR_EXPORT', 'export/');
# import
@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