Skip to content

Instantly share code, notes, and snippets.

View utrack's full-sized avatar
🤽‍♂️
Wahoo

Nick Koptelov utrack

🤽‍♂️
Wahoo
View GitHub Profile
@vadv
vadv / Golang.md
Last active August 29, 2019 15:45

This article is about how to plan connections to PostgreSQL in Golang applications.

Recommended libraries

The standard PostgreSQL library is de-facto: lib/pq

Also, the quite popular library is: pgx

I do not impose the use of any libraries, and I make a description of how to use the specified.

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active April 16, 2024 12:18
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be

Fix absolutely positioned divs when people turn their phones sideways

The problem

In Safari, if you have a layout container that's absolutely positioned to take up, at a minimum, its whole container (which isn't unheard of in "appey" internet home page thingies) using CSS like this:

.absolutely
@agreatfool
agreatfool / book.proto
Created February 6, 2018 07:52
Sample proto file
syntax = "proto3";
package com.book;
message Book {
int64 isbn = 1;
string title = 2;
string author = 3;
}
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@zer4tul
zer4tul / weechat.md
Last active August 21, 2021 21:12
A Simple, Base16 Friendly, Weechat Setup

A Simple, Base16 Friendly, Weechat Setup

Scripts

  • Some must-have scripts
  /script install buffers.pl buffer_autoclose.py iset.pl go.py colorize_nicks.py
@p120ph37
p120ph37 / vpn.expect
Last active December 19, 2021 23:08
Expect script to connect to an AnyConnect VPN server on OSX using only oathtool and openconnect (not the Cisco AnyConnect client)
!/usr/bin/expect -f
set timeout 30
log_user 0
puts stderr "Generating OTP"
spawn oathtool --totp YOUR_SECRET_KEY_HERE
expect -re \\d+
set otp $expect_out(0,string)
puts stderr "Connecting to VPN server $server"
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results