Skip to content

Instantly share code, notes, and snippets.

View diamondburned's full-sized avatar

Diamond diamondburned

View GitHub Profile
@diamondburned
diamondburned / main.go
Created August 2, 2020 08:41
Shitty 2-bit meme text writer on GIF, optimized for speed
package main
import (
"bytes"
"image"
"image/color"
"image/gif"
"io"
"io/ioutil"
"os"
@diamondburned
diamondburned / instructions.md
Created May 19, 2020 21:19
gtkcord3 AppImage instructions by ProTheory8

So instructions to make gtkcord 3 AppImage:

  1. Make a directory called AppDir
  2. Make a directories AppDir/usr/bin
  3. Compile gtkcord3 binary into that directory, for example go build -o AppDir/usr/bin/gtkcord3
  4. Make directory AppDir/usr/lib
  5. Make directories AppDir/usr/share/{applications,icons,metainfo}
  6. Make file AppDir/usr/share/metainfo/gtkcord3.appdata.xml and insert this: https://pastebin.com/08xGTPne
  7. Make file AppDir/usr/share/applications/gtkcord3.desktop and insert this:
+------------------------------------------+
| Server index |
| |
| 1. Node 40ms 14.x.x.x |
| 2. Node 275ms 275.2.51.x +--------v
| 3. Node 175ms x.x.x.x +----+ |
| | | | 2. Node 2 shows an already connected
| * Nodes shown here are already verified | | | node, which is listed on the umbrella
| and can be "trusted" when connecting to | | | server
| other nodes. | | |
var reflectCache sync.Map
type cacheKey struct {
t reflect.Type
f string
}
func getID(v reflect.Value, thing string) discord.Snowflake {
if !v.IsValid() {
return 0
@diamondburned
diamondburned / item.go
Last active April 4, 2020 01:37
A second attempt at a better Gtk API for Golang.
package main
type TodoItem struct {
gtk.ListBoxRow
Entry gtk.Entry // acts as label
Remove gtk.Button
item string
@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
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"strings"
"unicode"
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]
@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
@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;