Skip to content

Instantly share code, notes, and snippets.

View ento's full-sized avatar

ento

View GitHub Profile
@ento
ento / se-better-search-animation.user.js
Created August 10, 2011 17:27 — forked from NickCraver/se-disable-search-animation.user.js
Stack Exchange search box animation disabler
// ==UserScript==
// @name Stack Exchange search box grower 1.0
// @namespace stackoverflow
// @description Make Stack Exchange search box grow incrementally
// @include http://stackoverflow.com/*
// @include http://*.stackoverflow.com/*
// @include http://*.stackexchange.com/*
// @include http://serverfault.com/*
// @include http://superuser.com/*
// @include http://stackapps.com/*
@ento
ento / gist:960370
Created May 7, 2011 09:43
Add homebrew.pth to activate Python packages installed with homebrew
echo '/usr/local/lib/python2.6/site-packages/' | sudo tee /Library/Python/2.6/site-packages/homebrew.pth
@ento
ento / gist:903098
Created April 5, 2011 05:57
Steps to install pep8 pre-commit hook managed by git-hooks
# Repository developers
cd /path/to/somewhere
git clone https://github.com/kergoth/git-hooks
export PATH=/path/to/somewhere/git-hooks:$PATH
cd /path/to/project
git hooks --install
@ento
ento / buildlibxml.diff
Created March 19, 2011 13:54
Installing lxml on a Mac OS X 10.6 that has no PPC support (read: Xcode 4)
diff --git a/buildlibxml.py b/buildlibxml.py
index bfcf3e4..7bf36e5 100644
--- a/buildlibxml.py
+++ b/buildlibxml.py
@@ -284,8 +284,11 @@ def build_libxml2xslt(download_dir, build_dir,
})
else:
env.update({
- 'CFLAGS' : "-arch ppc -arch i386 -arch x86_64 -O2",
- 'LDFLAGS' : "-arch ppc -arch i386 -arch x86_64",
@ento
ento / gist:875768
Created March 18, 2011 08:16
MySQL popcount
SELECT LENGTH(REPLACE(BIN(7), '0', ''));
@ento
ento / gist:849569
Created March 1, 2011 18:11
My latest .emacs
;(global-set-key "\C-h" 'backward-delete-char)
;
;(global-font-lock-mode t)
;(setq transient-mark-mode t)
;(set-face-background 'region "indianred")
;(tool-bar-mode 0)
;(show-paren-mode t)
;(setq w3m-home-page "http://www.google.com")
@ento
ento / set_exif_datetime_to_ctime.sh
Created February 26, 2011 07:45
Requires exiv2
#!/bin/sh
for f in $@
do
ctime=`stat -f "%SB" -t "%Y:%m:%d %H:%M:%S" "$f"`
exiv2 -k -M"set Exif.Image.DateTime Ascii $ctime" "$f"
done
(println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))
@ento
ento / py_traceback.py
Created March 31, 2010 09:19
printing traceback info on python
import traceback, StringIO
fp = StringIO.StringIO()
traceback.print_exc(file=fp)
print fp.getvalue()
<html>
<head>
<meta id="viewport" name="viewport" content="width=320, height=500" />
</head>
<body>
<div>Here comes an iframe.</div>
<iframe src="../336c3060c233f1662ad7461e0f0514543bc79093/included.html">
</iframe>
<div>End of iframe.</div>
</body>