Skip to content

Instantly share code, notes, and snippets.

@nathan-osman
nathan-osman / win32.go
Last active August 31, 2023 22:01
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@polonskiy
polonskiy / 10-custom.conf
Last active June 4, 2021 22:36
sysctl tuning for docker & serf
# values from https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Welcome%20to%20High%20Performance%20Computing%20%28HPC%29%20Central/page/Linux%20System%20Tuning%20Recommendations
# install (root): curl -s https://gist.githubusercontent.com/polonskiy/00a71bab32360ffcb79f/raw/10-custom.conf > /etc/sysctl.d/10-custom.conf
# apply (root): sysctl -p /etc/sysctl.d/10-custom.conf
net.ipv4.neigh.default.gc_thresh1 = 30000
net.ipv4.neigh.default.gc_thresh2 = 32000
net.ipv4.neigh.default.gc_thresh3 = 32768
net.ipv6.neigh.default.gc_thresh1 = 30000
net.ipv6.neigh.default.gc_thresh2 = 32000
@rubo77
rubo77 / rotate-screen.sh
Last active October 9, 2023 11:30
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,