Skip to content

Instantly share code, notes, and snippets.

Sergey Silaev ssilaev

  • Russia, Moscow
Block or report user

Report or block ssilaev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ssilaev / .vimrc
Last active Jul 7, 2017
vim/macvim (solarized dark)
View .vimrc
let $PATH = '/usr/local/bin:'.$PATH
set nocompatible " be iMproved, required
filetype off " required
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
ssilaev /
Created Nov 24, 2016
CBV with Multiple forms. Based on UpdateView.
class MultipleFormsView(ItemUpdate):
model = MyModel
template_name = ''
success_url = reverse_lazy('')
form_class = Form1
second_form_class = Form2
third_form_class = Form3
ssilaev /
Created Dec 20, 2014
ctl memory report for yosemite
import subprocess
import re
ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0]
vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0]
processLines = ps.split('\n')
sep = re.compile('[\s]+')
rssTotal = 0 # kB
ssilaev /
Created Dec 20, 2014
Simple example of decrypt md5 (slowly)
import hashlib
import sys
def decryptMD5(testHash):
s = []
while True:
m = hashlib.md5()
for c in s:
ssilaev /
Created Dec 20, 2014
Getting current status (ISP
#!/usr/bin/env python
# coding=utf-8
import os, mechanize, cookielib, re
CURRENT_DIR = os.path.dirname(__file__)
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
You can’t perform that action at this time.