Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob Hoelz hoelzro

View GitHub Profile
View bytes-no-mut.rs
use std::fs::File;
use std::io::Read;
fn validate_signature(_f: impl Read) {
}
struct Headers{}
fn read_database_headers(_f: impl Read) -> Headers {
Headers{}
View folk-metal.md

Dutch

  • Heidevolk

Estonian

  • Metsatöll

Faroese

View term-demo.lua
local term = require 'term'
term.cursor.save()
for i = 1, 10 do
term.cleareol()
term.cursor.restore()
io.stdout:write(tostring(i))
io.stdout:flush()
os.execute 'sleep 1'
View fast.go
package main
import (
"fmt"
)
var basePattern = []int{0, 1, 0, -1}
const input = "59708072843556858145230522180223745694544745622336045476506437914986923372260274801316091345126141549522285839402701823884690004497674132615520871839943084040979940198142892825326110513041581064388583488930891380942485307732666485384523705852790683809812073738758055115293090635233887206040961042759996972844810891420692117353333665907710709020698487019805669782598004799421226356372885464480818196786256472944761036204897548977647880837284232444863230958576095091824226426501119748518640709592225529707891969295441026284304137606735506294604060549102824977720776272463738349154440565501914642111802044575388635071779775767726626682303495430936326809"
View bookmarklet.js
function parsePrometheusLabels(s) {
s = s.substring(1, s.length - 1); // strip {...}
let re = new RegExp(/(\w+)=\"(.*?)\"[,]?\s*/, 'y');
let labels = {};
let labelSpans = {};
while(true) {
let m = re.exec(s);
if(!m) {
break;
}
View emoji.js
/*
title: $:/custom/ui/wikiparser/rules/emoji.js
type: application/javascript
module-type: wikirule
*/
(function() {
exports.name = 'emoji';
exports.types = {inline: true};
View gist:85eb705f4d95209128992564e3e40d7b
def ddb_unpack(item):
item |
with_entries({
key: .key,
value: (.value | to_entries[0] | if .key == "NULL" then
null
elif .key == "L" then
.value | map(ddb_unpack({key:.}).key) # XXX this sucks
elif .key == "M" then
ddb_unpack(.value)
View slacken-link.pl
View slices.go
package main
import (
"fmt"
)
func main() {
sliceOne := make([]byte, 10)
sliceTwo := sliceOne[0:5]
View bench.go
package main
import (
"bytes"
"crypto/aes"
"fmt"
"runtime"
"sync"
"time"
)