Simple program to transform SQL queries to go structs.
The fields need to have a as
clause for now.
SELECT inbounds.count as inbounds_count,
package webhook | |
import ( | |
"bytes" | |
"encoding/json" | |
"net/http" | |
) | |
// Webhook is the toplevel webhook object | |
type Webhook struct { |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
"regexp" | |
"strings" | |
"github.com/iancoleman/strcase" |
#! /bin/bash | |
query=$(curl 'https://graphql.anilist.co/' \ | |
-s \ | |
-H 'content-type: application/json' \ | |
-d "{\"query\":\"query(\$id: Int) {Character(id:\$id){image{large}}}\",\"variables\":{\"id\":$1}}") | |
URL=$(echo $query | jq -r '.data.Character.image.large') | |
if [ $URL != "null" ]; then |
version: '3.9' | |
name: dragonfly | |
x-kraud-ui: | |
label: "DragonflyDB" | |
description: | | |
Dragonfly is an in memory data store built for modern application workloads. | |
Fully compatible with Redis and Memcached APIs, | |
Dragonfly requires no code changes to adopt. |
To build the derivation just run nix-build -A rustdesk ./rustdesk.nix
#/usr/bin/env bash | |
set -x +o pipefail | |
# Get the current output of hyprland monitors command | |
output=$(hyprctl monitors -j) | |
# Check if the HDMI-A-1 display exists in the output | |
# use grep because it fails if it doesn't find anything, unlike jq. | |
if echo "$output" | grep "HDMI-A-1"; then |
alias() { | |
mkdir -p .direnv/bin | |
echo "#!/usr/bin/env sh | |
$(which $2) \$@" >.direnv/bin/$1 | |
chmod +x .direnv/bin/$1 | |
} | |
alias k8 kubectl | |
alias k9 k9s |
package http | |
import ( | |
"context" | |
"log/slog" | |
) | |
// RequestAttrGrabber adds an attribute to each row produced by the logger when it can | |
type RequestAttrGrabber struct { | |
Sub slog.Handler |