This file contains hidden or 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
<?php | |
while (!feof(STDIN)) { | |
$f = fgets(STDIN); | |
if ($f) { | |
echo ">> $f\n"; | |
} | |
} |
This file contains hidden or 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
<?php | |
$fd = inotify_init(); | |
$watch_descriptor = inotify_add_watch($fd, './watch', IN_CLOSE_WRITE); | |
while (true) { | |
$events = inotify_read($fd); | |
foreach ($events as $event) { |
This file contains hidden or 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
CREATE OR REPLACE FUNCTION public.prefixes(character varying) RETURNS character varying[] | |
LANGUAGE sql IMMUTABLE | |
AS $_$ | |
SELECT ARRAY(SELECT substring($1 FROM 1 FOR i) | |
FROM generate_series(1, GREATEST(length($1))) g(i))::varchar[]; | |
$_$ | |
SELECT MAX(prefix) FROM MY_TABLE WHERE prefix=ANY(content); |
This file contains hidden or 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
package main | |
// go play with my original code: https://go.dev/play/p/dt8WFHM1E8d | |
import ( | |
"fmt" | |
"regexp" | |
) | |
var validLPA = []string{ |
OlderNewer