Skip to content

Instantly share code, notes, and snippets.

Avatar

Sandip Bhattacharya sandipb

View GitHub Profile
View gist:123032f12052520aaccab752bd3e78cc
##
## HTTP Router benchmarks -- Jan 9, 2019 with Go 1.11.4 on Linux X1 Carbon laptop
##
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
##
## We use the most up-to-date version of each router available in the tests below.
##
@CJEnright
CJEnright / gzip.go
Last active Aug 6, 2020
Idiomatic golang net/http gzip transparent compression, an updated version of https://gist.github.com/bryfry/09a650eb8aac0fb76c24
View gzip.go
package main
import (
"net/http"
"compress/gzip"
"io/ioutil"
"strings"
"sync"
"io"
)
@cimmanon
cimmanon / psql.md
Created May 2, 2017
PostgreSQL cheat sheet for MySQL users
View psql.md

I use PostgreSQL via the psql client. If you use a different client (eg. pgAdmin, etc.), I don't know how much will translate over.

One nice difference between psql and mysql (cli) is that if you press CTRL+C, it won't exit the client.

User administration

Login as superuser (via shell)

psql -U postgres
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active Aug 9, 2020
Demo of some useful tips for using Asciidoc on GitHub
View GitHub Flavored Asciidoc (GFA).adoc

GitHub Flavored Asciidoc (GFA)

@vans163
vans163 / virtualbox.sh
Last active May 20, 2019
Virtualbox Commandline stuff
View virtualbox.sh
#Create storage
VBoxManage createhd --filename VMName.vdi --size 40000 --format VDI
VBoxManage modifyhd GoDial.vdi --resize 30500
VBoxManage list hdds
VBoxManage closemedium disk $(UUID) --delete
#Create VM
VBoxManage createvm --name "VMName" --ostype Windows7_64 --register
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active Aug 10, 2020
Self Signed Certificate with Custom Root CA
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@jace
jace / denoise.sh
Last active May 26, 2020
Remove noise from video using sox and ffmpeg
View denoise.sh
# 1. extract audio from all videos (assuming .mp4 videos).
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done
# 2. use the first second of the first audio file as the noise sample.
sox `ls *.wav | head -1` -n trim 0 1 noiseprof noise.prof
# Replace with a specific noise sample file if the first second doesn't work for you:
# sox noise.wav -n noiseprof noise.prof
# 3. clean the audio with noise reduction and normalise filters.
@romainl
romainl / .ctags
Last active Jul 13, 2020
My ctags config
View .ctags
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
@sdague
sdague / imaway
Last active Mar 11, 2019
dbus xchat integration
View imaway
#!/usr/bin/python
import dbus
import dbus.glib
import gobject
import subprocess
def lock():
print "Screen saver turned on"
@davisford
davisford / setup-avahi.sh
Created Jul 12, 2013
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
View setup-avahi.sh
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
You can’t perform that action at this time.