Skip to content

Instantly share code, notes, and snippets.

View chexov's full-sized avatar

Anton P. Linevich chexov

  • Los Angeles
View GitHub Profile
@chexov
chexov / vim tabnumbering
Created September 10, 2010 13:08
vim with tabs config
" http://ja.pastebin.ca/raw/1243579
" }}}
" MyTabLine {{{
" This is an attempt to emulate the default Vim-7 tabs as closely as possible but with numbered tabs.
" TODO: set truncation when tabs don't fit on line, see :h columns
if exists("+showtabline")
function! MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
" set up some oft-used variables
"""
http://elonen.iki.fi/code/misc-notes/python-gaussj/
"""
def gauss_jordan(m, eps = 1.0/(10**10)):
"""Puts given matrix (2D array) into the Reduced Row Echelon Form.
Returns True if successful, False if 'm' is singular.
NOTE: make sure all the matrix items support fractions! Int matrix will NOT work!
Written by Jarno Elonen in April 2005, released into Public Domain"""
(h, w) = (len(m), len(m[0]))
@chexov
chexov / gist:1351458
Created November 9, 2011 13:43
Hosting howto for Dmirti
http://gitref.org/creating/
http://help.github.com/git-cheat-sheets/
cd myproj
git init
git add *
git commit -m 'init commit' -a
git remote add origin user@hosting:myproj.git
@chexov
chexov / .muttrc
Created March 7, 2012 23:59
Muttrc global config
# attributes when using a mono terminal
mono header underline ^(From|Subject):
mono quoted bold
macro index \cb "<pipe-message> urlview<Enter>" # simulate the old browse-url function
# Mairix
#macro generic ,f "<shell-escape>mairix " "search via mairix"
macro generic S "<enter-command>set my_cmd = \`mairix-search\`<return><enter-command>push \$my_cmd<return>
@chexov
chexov / git-post-update.sh
Created March 26, 2012 20:12
git-post-update.sh
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@chexov
chexov / mixpanel.error.tracking.js
Created April 5, 2012 17:23
Mixpanel js error tracking
<script>
window.onerror = function(message, file, line) {
var prop = {}
prop.message = message;
prop.file = file;
prop.line = line;
mpq.track('js-err'r,track_properties);
}
</script>
@chexov
chexov / gist:3388785
Created August 18, 2012 18:08
mytcat1
#!/usr/bin/env python
a = [1,2,3,45,-5,-5,6,5,0,-100, 1, 2, 3, 45, -5, -5, 6, 5, 0, -100, -5, -5, -5, -5, -5, -5,-5, -5, -5, -5]
def foo(myArray, count, isMin):
# creating unique array
mySet = set(myArray)
# if requested count > than number of elements
import Image, ImageDraw, ImageFont
import clipboard
# Simple script to create SysML frame around the image
# Define non-configurable options here
H_TEXT_OFFSET = 20
V_TEXT_OFFSET = 20
H_CUT_OUT = 20
V_CUT_OUT = 20
@chexov
chexov / id_rsa.pub
Created September 23, 2013 15:40
public keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAub5SK07tTVMOep6JyaVCwPRuW6saAjl1gTa7WLbXcQw86tp4h4w3A81xtDDM5SchhDE9fqBeVvlSZ5jsgF/M9JYjYaFFbkgIoySTch9w5OXNzGei81jS3AtbyRYSUHr6QyXiya/wFKSX9LXamFbqwhw90fZaExIV6SK0dsHBqu1mOCIMhwQozNMbrd5MpTEYjZRqf8Z+GpukqveXh/6DDWcSarnUcJSXdGiB38EtNQq12HZ//yP7zkw+TeQgpnZoOM27/LH6Ya7wG5RmaPs+dipRdTIEJcqUnjYmiPJOQ+aMETYySwptMfSMQsh8izIHm06mh5v6vYRyrqBtzvccCQ==
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXlFVSBLnBHY8sFTeEXLKtM17eFySnV5lrCY52s/bv9adRz8aM8y1TLMj36BZU+Cde+cBAncmDxPV9Rl5F+aV/Allvu3dVzgm9+XLFUu/gfVk9GMoVHAtD5rpjsCOHjoycPeBtjA6hTQ8qgb0u8k8vzx85x9Qvu8gcZ4Hwjgw+RsnNW+JGWty7t7CjQQG+i9GmADgsyYLiMXOQk5Ngs1DtBCk7exWoKBfAUIejoFlCjr2AFSC30YvBTg+SiT7sNPG27poHzLl+8s0GKNevQQ0riKOTTp0uWK1xpnsYA3kT1bKhR0OuKZTxYLz81HpX+mixPS9w6LeqhyCr+cs86jNV anton@ip-10-2-8-211