Skip to content

Instantly share code, notes, and snippets.

set nonumber
syntax on
filetype plugin indent on
augroup myfiletypes
autocmd!
autocmd BufNewFile,BufRead *.jinja set filetype=jinja
autocmd BufNewFile,BufRead *.sql set filetype=psql
autocmd BufNewFile,BufRead *.migration set filetype=psql
autocmd BufNewFile,BufRead *.vcl set filetype=vcl
@russss
russss / gist:8aa174669b2b8345eaed
Last active August 29, 2015 14:09
keybase.md
### Keybase proof
I hereby claim:
* I am russss on github.
* I am russss (https://keybase.io/russss) on keybase.
* I have a public key whose fingerprint is BE75 264B 665E D97E A5DB EFD5 F52F C56D D906 FEB1
To claim this, I am signing this object:
@russss
russss / commands.cfg
Created May 17, 2015 09:22
Icinga plugin for IRCCat
define command {
command_name notify-host-by-irccat
command_line /usr/local/share/nagios-plugins/icinga-irccat.py $HOSTNAME$ $HOSTSTATE$ | /bin/nc -q0 irccat-host 12345
}
define command {
command_name notify-service-by-irccat
command_line /usr/local/share/nagios-plugins/icinga-irccat.py -s "$SERVICEDESC$" -o "$SERVICEOUTPUT$" $HOSTNAME$ $SERVICESTATE$ | /bin/nc -q0 irccat-host 12345
}
@russss
russss / ukpolitics-code-of-conduct.md
Last active May 5, 2016 22:16
##ukpolitics Code of Conduct
  • Sexist, homophobic, racist, transphobic, ableist, sexist or otherwise offensive remarks are not allowed. (Swearing is allowed, but never targeting another user, and never in a hateful or sexually explicit manner.)
  • Remarks that make any of the ops go “Hm, that’s inappropriate”, whether on the above list or not: also not allowed.
  • You get a warning.
  • If the warning is not taken seriously, you might get a second sterner warning in PM, if you’re lucky, and the op is feeling generous, and this is the first time. But don’t count on that.
  • If the warning is unheeded, you get kicked.
  • If you come back and continue to make trouble, you get banned.
  • If you contact the offended party, and are truly apologetic, and it was the first offense, and the op who banned you feels it’s appropriate, then you may get un-banned.
  • If an op bans you, I’m definitely not going to unban you unless they agree it’s a good idea.
  • If an op bans someone, and you think it was unjustified, take it up with that op, or with a differe
# coding=utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
import csv
import boto3
from zipfile import ZipFile
import io
import tempfile
from decimal import Decimal
import datetime
from collections import defaultdict
@russss
russss / deskew.py
Created September 10, 2018 12:05
Automatic scanned image rotation/deskew with OpenCV
import cv2
import numpy as np
def deskew(im, max_skew=10):
height, width = im.shape
# Create a grayscale image and denoise it
im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
im_gs = cv2.fastNlMeansDenoising(im_gs, h=3)
import proj4 from 'proj4'
proj4.defs([
[
'CCCAMP2019',
'+proj=tmerc +ellps=GRS80 +lat_0=0 +lon_0=15 +k=0.9996 +x_0=114350 +y_0=-5877600 +units=m +no_defs',
],
])
type CoordsLike = [number, number] | maplibregl.LngLat