Skip to content

Instantly share code, notes, and snippets.

@7u4
7u4 / psql-with-gzip-cheatsheet.sh
Created August 2, 2018 16:37 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@7u4
7u4 / actionlist.vim
Created August 1, 2018 10:23 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@7u4
7u4 / JsonBinder.java
Created July 22, 2018 06:43 — forked from schaloner/JsonBinder.java
Supporting PostgreSQL JSON types in jOOQ using Jackson. Adapted from the GSON example found at https://www.jooq.org/doc/3.9/manual/code-generation/custom-data-type-bindings/
package be.objectify.example.jooq;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Types;
import java.util.Objects;
import com.fasterxml.jackson.databind.JsonNode;
import org.jooq.Binding;
import org.jooq.BindingGetResultSetContext;
import org.jooq.BindingGetSQLInputContext;
@7u4
7u4 / ALTERNATIVES.adoc
Created April 20, 2018 03:33 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@7u4
7u4 / pruneRemote.sh
Created March 18, 2018 13:25 — forked from lkopocinski/pruneRemote.sh
Git command for pruning remote branches
git remote prune origin
@7u4
7u4 / deleteMerged.sh
Created March 18, 2018 13:25 — forked from lkopocinski/deleteMerged.sh
Git command for deleting merged branches
git branch --merged | grep -E -v "master|develop" | xargs git branch -d
@7u4
7u4 / pr.md
Created July 28, 2017 13:13 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

public class UpdateService : IUpdateService
{
public async Task<UpdateInfo> CheckForUpdates()
{
try
{
bool restart = false;
string latestExe = "";
using (var mgr = new Squirrel.UpdateManager(@"http://x.y.z/AppName/Releases/"))

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default
@7u4
7u4 / docker_cheat.md
Created May 29, 2017 04:56 — forked from wsargent/docker_cheat.md
Docker cheat sheet