Skip to content

Instantly share code, notes, and snippets.

View diamondburned's full-sized avatar

Diamond diamondburned

View GitHub Profile

Keybase proof

I hereby claim:

  • I am diamondburned on github.
  • I am diamondburned (https://keybase.io/diamondburned) on keybase.
  • I have a public key whose fingerprint is 3F6B 5F01 929B 0070 A033 11FE 8FE8 0C63 DF38 DD28

To claim this, I am signing this object:

bruh.moment
bruh
@diamondburned
diamondburned / strip.go
Last active December 23, 2019 00:28
Escaping @everyone in Go
// EscapeEveryone escapes @everyone and @here mentions.
func EscapeEveryone(s string) string {
var mentionBuf string
var mentionInd int
for i, r := range s {
if r == '@' && i != len(s)-1 {
mentionBuf += string(r)
mentionInd = i
continue
@diamondburned
diamondburned / README.md
Created January 26, 2020 23:55
Caddy folder downloader

go run . -auth username:password https://domain.com/directory/to/download/

@diamondburned
diamondburned / influxdb.nix
Last active February 2, 2020 21:02
InfluxDB users and databases automation in Nix
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.influxdb;
configOptions = recursiveUpdate {
http = {
enabled = true;
@diamondburned
diamondburned / tablet-conf.sh
Created February 7, 2020 02:29
Wacom tablet config script
#!/usr/bin/env bash
config() {
orig[X]=15200
orig[Y]=9500
offset[X]=0
offset[Y]=0
# relative/absolute
mode=absolute
Debug: 14:42:36.325801 1475 ::: messages.go:160 > message.go:301 > pixbuf.go:22 > IdleAdd() called.
Info: 14:42:36.325833 1475 ::: messages.go:160 > message.go:301 > pixbuf.go:22 > took 18.444µs
Debug: 14:42:36.325917 1476 ::: asm_amd64.s:1357 > messages.go:160 > message.go:269 > IdleAdd() called.
Info: 14:42:36.325963 1476 ::: asm_amd64.s:1357 > messages.go:160 > message.go:269 > took 40.858µs
Debug: 14:42:36.329277 1477 ::: messages.go:160 > message.go:301 > pixbuf.go:22 > IdleAdd() called.
Info: 14:42:36.329314 1477 ::: messages.go:160 > message.go:301 > pixbuf.go:22 > took 22.303µs
Debug: 14:42:36.371884 State error: Failed to delete a message in state: item not found in store
Debug: 14:42:36.467257 State error: Failed to delete a message in state: item not found in store
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x7fb665274b86]
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"strings"
"unicode"
@diamondburned
diamondburned / main.go
Last active April 4, 2020 00:37
A better Gtk
package main
import (
"fmt"
"math/rand"
"time"
)
type IncrementThing struct {
gtk.Box