View indexer-wrapper.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$db = mysqli_connect($_SERVER['MYSQL_HOST'],$_SERVER['MYSQL_USER'],$_SERVER['CONF_DB_PWD'],$_SERVER['MYSQL_DATABASE']); | |
if (mysqli_connect_errno()) { | |
throw new RuntimeException('mysqli connection error: ' . mysqli_connect_error()); | |
} | |
$server_id = db_Quote(trim(`hostname`)); |
View gist:e42f0c4756e34d5d07db4a170c7ec680
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L.TileLayer2 = L.TileLayer.extend({ | |
_refreshTileUrl: function(tile, url) { | |
//use a image in background, so that only replace the actual tile, once image is loaded in cache! | |
var img = new Image(); | |
img.onload = function() { | |
L.Util.requestAnimFrame(function() { | |
tile.el.src = url; | |
}); | |
} | |
img.src = url; |
View gist:437b661faa92174eb45a9f578fec4512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var layerUrl='https://t0.geograph.org.uk/tile/tile-density.php?z={z}&x={x}&y={y}&match=&l=1&6=1'; | |
overlayMaps["Coverage - Dots"] = new L.TileLayer(layerUrl, {user_id: 0, minZoom: 5, maxZoom: 19, attribution: layerAttrib, bounds: bounds}); | |
function j() { //L.template can use callback function. | |
return (map.getZoom()>16 && overlayMaps["Coverage - Dots"] && map.hasLayer(overlayMaps["Coverage - Dots"]))?1:0; | |
} | |
var layerUrl='https://t0.geograph.org.uk/tile/tile-viewpoint2.php?z={z}&x={x}&y={y}&match=&l=1&6=1&j={j}'; |
View query.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sphinxQL>insert into pq (id,query) VALUES (12345, 'full text query terms'); | |
Query OK, 0 rows affected (0.01 sec) | |
sphinxQL>pager grep 'full text query terms' | |
PAGER set to 'grep 'full text query terms'' | |
sphinxQL>select * from pq; | |
| 1 | full text query terms | | | | |
| 12345 | full text query terms | | | | |
10024 rows in set (0.02 sec) |
View gist:1a69c46dd5fdb350be6c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# grep -P '^[a-f]{6}$' /usr/share/dict/british-english | |
accede | |
beaded | |
bedded | |
beefed | |
cabbed | |
dabbed | |
decade | |
deeded | |
deface |