Skip to content

Instantly share code, notes, and snippets.

View idevyatovsky's full-sized avatar

Ilya Devyatovsky idevyatovsky

View GitHub Profile
@idevyatovsky
idevyatovsky / exclude
Created March 4, 2019 14:45 — forked from NV/exclude
Git global exclude file
# git config --global core.excludesfile /usr/local/git/exclude/exclude
# see http://groups.google.com/group/peepcode/browse_thread/thread/fe6f9c1fc9d6e725
# Rivals
.svn
.hg
# Archives
*.zip
*.gz
@idevyatovsky
idevyatovsky / ST2 Cycle Tabbing
Created February 27, 2019 09:33 — forked from jmnwong/ST2 Cycle Tabbing
Makes CTRL-Tab cycle tabs in order for Sublime Text.
Put in (Preferences -> Key Bindings - User):
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
@idevyatovsky
idevyatovsky / webserver.go
Created February 13, 2017 13:05 — forked from paulmdx/webserver.go
Simple golang web server - Serve files via HTTP and perform rewrite to default HTML page if file doesn't exist
// Serve files via HTTP and perform rewrite to default HTML page if file doesn't exist
// Usage: go run webserver.go index.html
package main
import (
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
@idevyatovsky
idevyatovsky / terminalsize.py
Created February 9, 2017 13:37 — forked from jtriley/terminalsize.py
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@idevyatovsky
idevyatovsky / nginx-cors.conf
Created February 3, 2017 11:58 — forked from himyouten/nginx-cors.conf
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@idevyatovsky
idevyatovsky / dedit.sh
Created January 20, 2017 12:35 — forked from dmohs/dedit.sh
#!/bin/bash
IFS=$'\n\t'
set -euox pipefail
CNAME="$1"
FILE_PATH="$2"
TMPFILE="$(mktemp)"
docker exec "$CNAME" cat "$FILE_PATH" > "$TMPFILE"