Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
haproxytechblog / haproxy-config-2-0.cfg
Created June 13, 2019 20:41
HAProxy 2.0 configuration
#
# This is the ultimate HAProxy 2.0 "Getting Started" config
# It demonstrates many of the features available which are now available
# While you may not need all of these things, this can serve
# as a reference for your own configurations.
#
# Have questions? Check out our community Slack:
# https://slack.haproxy.org/
#
@ChristopherThorpe
ChristopherThorpe / nestedmaplookup.go
Created October 31, 2018 05:40
Nested Map Lookup: find elements in golang maps of arbitrary depth
// NestedMapLookup implementation and usage example
// Run it at https://play.golang.org/p/VHRgMcLf0b1
//
// JSON is not required, but used to show the example in a "real" setting.
//
// This gist is copyright (c) 2018 Brightgate Inc.
// and licensed under the Creative Commons Attribution 4.0 International license
// https://creativecommons.org/licenses/by/4.0/legalcode
//
@christophlehmann
christophlehmann / prometheus-operator-kubernetes.yaml
Last active April 29, 2024 11:44
Example: Monitoring external server with Prometheus Operator
# First install prometheus-operator:
#
# helm install coreos/prometheus-operator --name prometheus-operator
#
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: node-exporter
# Namespace of prometheus operator
@andreibosco
andreibosco / creative-cloud-disable.md
Last active January 3, 2024 02:37
disable creative cloud startup on mac
@parmentf
parmentf / GitCommitEmoji.md
Last active June 7, 2024 18:35
Git Commit message Emoji
@robertoestivill
robertoestivill / .profile
Last active November 9, 2022 22:17
Fix Android Studio Case Sensitive IDE Warning on OSx
alias intellij-case-patch='printf '\''\nidea.case.sensitive.fs=true'\'' >> /Applications/Android\ Studio.app/Contents/bin/idea.properties'
@tejainece
tejainece / cgo1.go
Last active March 27, 2024 04:29
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@sstur
sstur / dom-to-json.js
Last active October 8, 2023 04:17
Stringify DOM nodes using JSON (and revive again)
function toJSON(node) {
let propFix = { for: 'htmlFor', class: 'className' };
let specialGetters = {
style: (node) => node.style.cssText,
};
let attrDefaultValues = { style: '' };
let obj = {
nodeType: node.nodeType,
};
if (node.tagName) {
@dmitshur
dmitshur / gist:6927554
Last active September 17, 2023 07:35
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.

WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},