Skip to content

Instantly share code, notes, and snippets.

@zinglax
zinglax / example.in.txt
Last active August 29, 2015 13:57 — forked from decitrig/example.in.txt
Generates a test file for MeeshQuest veeeerrry easy
1024 1024 1 4
city A 100 100
city B 1020 1020
city C 100 1020
city Cp 450 900
city D 800 500
city E 100 1021
city F 2048 1023
city G 2048 1000
road A B
import java.util.LinkedList;
import java.util.Queue;
public class AVLTree<T extends Comparable<T>> {
Node<T> root;
public AVLTree() {
root = null;
}
@zinglax
zinglax / tmux.cheat
Created January 29, 2017 19:02 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@zinglax
zinglax / Makefile
Created May 3, 2018 16:40 — forked from h4cc/Makefile
Ubuntu 18.04 Bionic Beaver - Basic packages i usually install
#
# Ubuntu 18.04 (Bionic Beaver)
#
# Basic packages i usually install.
#
# Author: Julius Beckmann <github@h4cc.de>
#
# Upgraded Script from 17.04: https://gist.github.com/h4cc/09b7fe843bb737c8039ac62d831f244e
# Upgraded Script from 16.04: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b
@zinglax
zinglax / JsBlobSaveJson
Created January 9, 2019 17:13 — forked from yiwenl/JsBlobSaveJson
Javascript using Blob to save json file
var saveJson = function(obj) {
var str = JSON.stringify(obj);
var data = encode( str );
var blob = new Blob( [ data ], {
type: 'application/octet-stream'
});
var url = URL.createObjectURL( blob );
var link = document.createElement( 'a' );