Skip to content

Instantly share code, notes, and snippets.

View hoelzro's full-sized avatar

Rob Hoelz hoelzro

View GitHub Profile
apiVersion: 1
providers:
- name: example-provider
options:
path: /etc/dashboards
foldersFromFilesStructure: true
@hoelzro
hoelzro / sunset.lua
Last active November 1, 2023 20:40
local ceil = math.ceil
local floor = math.floor
-- trigonometric functions that work in terms of degrees
local function sin(degrees)
return math.sin(math.rad(degrees))
end
local function asin(x)
return math.deg(math.asin(x))
@hoelzro
hoelzro / gist:3919bc2d579f94bf19ad61a2afd259a0
Created August 27, 2023 14:21
Killing this loop messes with zsh stdout
seq 1 5 | while read n ; do
sleep 5
done > /dev/null
local rules = named_rule_builder() -- *waves hands*
rules.manager_logger = {
rule = {},
callback = manage_log.record,
}
rules.generic_properties = {
rule = {},
properties = {
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{}

Dutch

  • Heidevolk

Estonian

  • Metsatöll

Faroese

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'
package main
import (
"fmt"
)
var basePattern = []int{0, 1, 0, -1}
const input = "59708072843556858145230522180223745694544745622336045476506437914986923372260274801316091345126141549522285839402701823884690004497674132615520871839943084040979940198142892825326110513041581064388583488930891380942485307732666485384523705852790683809812073738758055115293090635233887206040961042759996972844810891420692117353333665907710709020698487019805669782598004799421226356372885464480818196786256472944761036204897548977647880837284232444863230958576095091824226426501119748518640709592225529707891969295441026284304137606735506294604060549102824977720776272463738349154440565501914642111802044575388635071779775767726626682303495430936326809"
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;
}
/*
title: $:/custom/ui/wikiparser/rules/emoji.js
type: application/javascript
module-type: wikirule
*/
(function() {
exports.name = 'emoji';
exports.types = {inline: true};