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
# power | |
IRSend {"Protocol":"NEC","Bits":32,"Data":"0x4040C03F"} | |
# sleep | |
IRSend {"Protocol":"NEC","Bits":32,"Data":"0x404040BF"} | |
# hdmi tv | |
IRSend {"Protocol":"NEC","Bits":32,"Data":"0x404022DD"} | |
# hdmi 1 | |
IRSend {"Protocol":"NEC","Bits":32,"Data":"0x4040E01F"} |
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 | |
function pipe($value, ...$funcs) { | |
return array_reduce($funcs, fn($v, $f) => $f($v), $value); | |
} | |
?> |
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
#!/bin/bash | |
v=$(wget -qO- https://api.github.com/repos/go-gitea/gitea/releases/latest | jq --raw-output '.tag_name') | |
readonly VER="${v#v}" | |
readonly BIN="gitea-${VER}-linux-amd64" | |
readonly SIG="${BIN}.asc" | |
readonly URL="https://dl.gitea.io/gitea/${VER}/" | |
verify_signature() { |
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
#!/bin/bash | |
csv-table2 () { | |
awk \ | |
-F':' \ | |
'{ printf "%-*s%*s\n",'$1',$1,'$2',$2}' | |
} | |
csv-table4 () { | |
awk \ | |
'{ printf "%*s %-*s%*s%*s\n",'$1',$1,'$2',$2,'$3',$3,'$4',$4}' |
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
RewriteEngine On | |
RewriteCond %{SCRIPT_FILENAME} !-d | |
RewriteCond %{SCRIPT_FILENAME} !-f | |
RewriteRule ^(.*)$ ./router.php/$1 [QSA] |
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
abby | |
ada | |
adel | |
adi | |
adrian | |
aida | |
ali | |
alice | |
alina | |
alla |
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
String.prototype.escapeHTML = function() { | |
var map = { | |
'&': '&', | |
'<': '<', | |
'>': '>', | |
'"': '"', | |
"'": ''' | |
}; | |
return this.replace(/[&<>"']/g, function(m) { return map[m]; }); | |
}; |
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
function UUID() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = (c == 'x') ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} |
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
String.prototype.template = function (d) { | |
return this.replace(/\{([^\}]+)\}/g, function (m, n) { | |
var o = d, p = n.split('|')[0].split('.'); | |
for (var i = 0; i < p.length; i++) { | |
o = typeof o[p[i]] === "function" ? o[p[i]]() : o[p[i]]; | |
if (typeof o === "undefined" || o === null) return n.indexOf('|') !== -1 ? n.split('|')[1] : m; | |
} | |
return o; | |
}); | |
}; |