Skip to content

Instantly share code, notes, and snippets.

@dims
dims / README.md
Last active July 21, 2024 11:36
Kubernetes Resources
@alexedwards
alexedwards / main.go
Last active February 19, 2024 07:16
JSON encoding benchmarks
package main
import (
"encoding/json"
"net/http"
)
func main() {}
func healthcheckHandlerEncoder(w http.ResponseWriter, r *http.Request) {
@alexedwards
alexedwards / _tree
Created October 27, 2020 07:52
Dependency injection via closure (handlers in multiple packages)
.
├── go.mod
├── handlers
│ ├── books
│ │ └── books.go
│ └── env.go
├── main.go
└── models
└── models.go
@alexedwards
alexedwards / _tree
Created October 27, 2020 07:40
Config package with global variable
.
├── config
│ └── config.go
├── go.mod
├── go.sum
├── main.go
└── models
└── books
└── books.go
@krisleech
krisleech / renew-gpgkey.md
Last active July 10, 2024 14:14
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@mattharrison
mattharrison / gist:90dcbe5f37de7148533989fb4b8e3e69
Last active March 26, 2021 21:31
Mastering Pytest README
=====================
Intermediate Pytest
=====================
http://bit.ly/2019-07-01-pytest
These assignments are based on a Python implementation
that models a lift at a ski resort.
@edgimar
edgimar / archive-with-ancestors.el
Last active June 30, 2024 16:45
Org-mode archive function that includes ancestor tree structure when copying
(require 'org-archive)
; Set the function to use for org-archive-default (C-c C-x C-a)
; (setq org-archive-location (concat org-directory "/archive/%s_archive::"))
; (setq org-archive-location "archive/archived_%s::")
(setq org-archive-location "::* ARCHIVED")
; unmap org-archive-subtree
(define-key org-mode-map (kbd "C-c C-x C-s") nil)
@rabajaj0509
rabajaj0509 / gist:c9c35a3e626e857c99d540bfccfa55b5
Created December 8, 2017 11:07
Ansible meetup 9/12/2018
## Create a folder by the name Ansible:
$ mkdir Ansible
## Create a vagrant env:
$ vagrant init
# After creating a vagrant env, you will see a `Vagrant File`
$ vi Vagrantfile
##press dG to delete all contents of the file
##paste the following contents into the file:
@Killeroid
Killeroid / gpg-import-and-export-instructions.md
Created October 18, 2017 11:51
How to export and import gpg keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc

@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 27, 2024 10:31
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.