I hereby claim:
- I am mpdroog on github.
- I am mpdroog (https://keybase.io/mpdroog) on keybase.
- I have a public key ASCAECt2B8dGFQJtmjIIPjKV_tBYUUT6Hj23-ug-YCVTNwo
To claim this, I am signing this object:
package sql | |
import ( | |
"database/sql" | |
"net/http" | |
"github.com/julienschmidt/httprouter" | |
"log" | |
"github.com/mpdroog/invoiced/writer" | |
) |
<?php | |
/** | |
* TOML to PO converter. | |
*/ | |
$args = $_SERVER["argv"]; | |
if ($args[0] === "php") { | |
array_shift($args); | |
} | |
array_shift($args); | |
$args = array_values($args); // php-file |
[Unit] | |
Description=Headless Chrome | |
Requires=network.target | |
After=multi-user.target | |
[Service] | |
LimitNOFILE=100 | |
Restart=on-failure | |
Type=simple |
I hereby claim:
To claim this, I am signing this object:
<?php | |
// Search&Replace all occurrences of a given string | |
// Got tired of all the harship with sed -i so made this | |
// small script to get the same result. | |
$search = "Fn"; | |
$replace = "Shared"; | |
$rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.')); | |
foreach ($rii as $file) { | |
if (in_array($file->getFilename(), [".", "..", "findreplace.php", ".git"])) continue; // Ignored files (in curdir) |
<?php | |
/** | |
* Dump received HTTP-request to console for quickly | |
* seeing what we're trying to send. | |
*/ | |
$address = '127.0.0.1'; | |
$port = 8080; | |
$sock = socket_create(AF_INET, SOCK_STREAM, 0); | |
socket_bind($sock, $address, $port) or die('Could not bind to address'); |
<?php | |
/** | |
* PO to JSON. | |
*/ | |
$lang = "fr"; | |
$lines = explode("\n", file_get_contents(__DIR__ . "/text.po")); | |
array_shift($lines); array_shift($lines); // Ignore first two lines | |
$out = []; |
// https://stackoverflow.com/questions/30928770/marshall-map-to-xml-in-go | |
// https://stackoverflow.com/questions/33486725/golang-xml-unmarshal-interface-types | |
package main | |
import ( | |
"fmt" | |
"encoding/xml" | |
) | |
// StringMap is a map[string]string. |
#!/usr/bin/env bash | |
# Using lock-file to ensure only one instance can be running | |
# at the same time. | |
# DevNote: The trap is used to ensure we ALWAYS remove the lock upon completion | |
set -x | |
set -e | |
if ! mkdir /tmp/MYSCRIPT.lock; then | |
printf "MYSCRIPT already running.\n" >&2 | |
exit 1 | |
fi |
var global = { | |
carousels: [], | |
slide: 0, | |
}; | |
function nextSlide() { | |
console.log("nextSlide", global); | |
global.carousels[global.slide].classList.toggle("active"); | |
global.slide++; |