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 |
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) |
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}'; |
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; |
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`)); |
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
pip install protobuf | |
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protoc-26.0-linux-x86_64.zip | |
unzip protoc-26.0-linux-x86_64.zip | |
git clone https://github.com/T0ha/uprotobuf | |
git clone https://github.com/meshtastic/protobufs | |
cd protobufs/ | |
mkdir output | |
../bin/protoc --plugin=protoc-gen-custom=../uprotobuf/scripts/uprotobuf_plugin.py --custom_out=output/ meshtastic/mesh.proto |