Skip to content

Instantly share code, notes, and snippets.

View morozgrafix's full-sized avatar

Sergey Morozov morozgrafix

View GitHub Profile
@morozgrafix
morozgrafix / command_line_one_liners.md
Last active August 29, 2015 14:14
handy command line one liners
@morozgrafix
morozgrafix / var_dump.py
Last active August 29, 2015 14:02
var_dump in python
def var_dump(obj):
'''return a printable representation of an object for debugging'''
newobj=obj
if '__dict__' in dir(obj):
newobj=obj.__dict__
if ' object at ' in str(obj) and not newobj.has_key('__type__'):
newobj['__type__']=str(obj)
for attr in newobj:
newobj[attr]=var_dump(newobj[attr])
return newobj
@morozgrafix
morozgrafix / CasperJS Test.sublime-build
Created March 18, 2014 18:56
CasperJS Build System for Sublime Text 2
{
"cmd": ["casperjs", "--no-colors", "test", "$file"],
"selector": "source.js"
}
@morozgrafix
morozgrafix / wgetclone
Last active August 29, 2015 13:56
Clone the site with wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains site.com \
--no-parent \
site.com
@morozgrafix
morozgrafix / fix_open_with
Last active January 2, 2016 12:49
Fix "Open With" duplicate entries in the OS X
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"
@morozgrafix
morozgrafix / pil-on-mac.md
Last active December 20, 2015 13:19
Steps to Install PIL on Mac OS X 10.8.4
Install JPEG library:
curl -O -L http://www.ijg.org/files/jpegsrc.v9.tar.gz
tar -zxvf jpegsrc.v9.tar.gz
cd jpeg-9/
sudo CC="gcc -arch x86_64" ./configure -enable-shared -enable-static
sudo make
sudo make install
cd ..