Skip to content

Instantly share code, notes, and snippets.

@klange
klange / _.md
Last active April 19, 2024 16:24
12 Years of ToaruOS

12 Years of ToaruOS

This is a repost and update to an imgur album with screenshots of ToaruOS throughout its development, as imgur is no longer a viable platform for maintaining this collection.

Early Development

My first commit in the ToaruOS repository, ecd4fe2bc170b01ad700ff76c16da96993805355, was made on January 15th, 2011. This date has become ToaruOS's "birthday". It would be another six years and two weeks before ToaruOS's first real release, 1.0.

1 - eL4aHBZ - Humble Beginnings

@maratori
maratori / .golangci.yml
Last active April 24, 2024 16:59
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.57.2
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@ribice
ribice / caller.go
Last active July 7, 2023 07:07
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active April 12, 2024 06:24
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active April 10, 2024 07:46
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@binura-g
binura-g / single-line-cert.sh
Last active April 20, 2024 00:09
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@shaneutt
shaneutt / LICENSE
Last active April 26, 2024 00:14
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@miguelmota
miguelmota / go_decode.go
Created January 7, 2019 05:14
Golang gob encoding and decoding example
package main
import (
"bytes"
"encoding/gob"
"fmt"
"log"
)
func main() {
@181192
181192 / increase_root_fedora.md
Last active March 1, 2024 03:24
How to increase the root partition size on Fedora

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
@thiagozs
thiagozs / gomock.md
Last active April 19, 2024 03:45
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.