Skip to content

Instantly share code, notes, and snippets.

@mapix
mapix / sublime_text_2_useful_shortcuts.md
Created November 17, 2017 13:31 — forked from bdargan/sublime_text_2_useful_shortcuts.md
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@mapix
mapix / demo.txt
Created December 7, 2016 02:21 — forked from mgedmin/demo.txt
Fixing Mako tracebacks (version 2)
$ virtualenv /tmp/sandbox
...
$ /tmp/sandbox/bin/pip install mako
...
$ /tmp/sandbox/bin/python mako_tb.py
= Default traceback =
@mapix
mapix / comm.py
Created November 2, 2016 09:06 — forked from drocco007/comm.py
Python generator rate limiter using token bucket
from time import time, sleep
_128k = 128 * 1024
_256k = 256 * 1024
_512k = 512 * 1024
_1024k = 1024 * 1024
class TokenBucket(object):
#!/bin/bash
#
# bash < <(curl -s https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash)
# Adapted from http://mervine.net/nginx-with-lua-module
# REQUIREMENT - uncomment if PCRE library is not already installed
# apt-get install libpcre3 libpcre3-dev
set -x
@mapix
mapix / sshtunnel.go
Created March 1, 2016 08:38 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@mapix
mapix / ssh_client.go
Created March 1, 2016 08:31 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@mapix
mapix / .gitconfig
Last active August 29, 2015 14:15 — forked from mat/.gitconfig
[alias]
# bread and butter
st = status
s = status -sb
d = diff
dc = diff --cached
p = pull --rebase
ir = rebase -i origin/master
amend = commit --amend
l = log --pretty=format:'%Cred%h%Creset %C(bold blue)<%an> -%C(yellow)%d%Creset %s %Cgreen(%cr) %Creset' --abbrev-commit --date=relative
@mapix
mapix / INSTALL
Last active August 29, 2015 14:15 — forked from mat/INSTALL
TODO:
- edit /opt/statsd/local.js
- correct the graphite host to localhost
- if desired, put 'debug: true' in there
- make the box accessible via the hostname 'graphite'
- update conf/storage-schemas.conf, see example for these retention rules:
6 hours of 10 second data
1 week of 1 minute data
5 years of 10 minute data
#!/bin/bash
if [[ `uname -s` == 'Darwin' ]]; then
brew update
brew install libtool autoconf automake
else
sudo apt-get update
sudo apt-get install -y libtool autoconf automake uuid-dev git-core
fi