Skip to content

Instantly share code, notes, and snippets.

View ganwell's full-sized avatar
💭
Gluing elephants to the ceiling

Jean-Louis Fuchs ganwell

💭
Gluing elephants to the ceiling
View GitHub Profile
http://ls10-www.cs.uni-dortmund.de/~menge/vimquick.pdf
@ganwell
ganwell / gist:1754954
Created February 6, 2012 21:18
Quick Look to TIFF
CFUrl url = CFUrl.FromUrlString("file:///Users/ganwell/Desktop/Untitled.png", null);
CGImage img = QuickLook.ThumbnailImageCreate(url, new SizeF(256, 256), new NSDictionary());
NSImage nsimg = new NSImage(img, new SizeF(256, 256));
NSObject obj = Runtime.GetNSObject
(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (nsimg.Handle, Selector.GetHandle("TIFFRepresentation")));
NSData data = obj as NSData; //-> null.
@ganwell
ganwell / gist:1755521
Created February 6, 2012 22:35
Add tracing output
using System;
using Mono.Cecil;
using Mono.Cecil.Cil;
using System.Reflection;
namespace ch.fangorn.LUI.AddTrace
{
class MainClass
{
public static bool verbose = false;
@ganwell
ganwell / .vimrc.vim
Created August 6, 2012 10:28
My vim config
call pathogen#infect()
syntax on
filetype plugin on
set tw=80
set autoindent
set noeb vb t_vb=
set guifont=Menlo\ Regular:h13
set number
@ganwell
ganwell / profile.sh
Last active October 8, 2015 03:48
Bash history of unique commands
# 5000 unique bash history lines that are shared between
# sessions on every command. Happy ctrl-r!!
shopt -s histappend
# Well the python code only does 5000 lines
export HISTSIZE=10000
export HISTFILESIZE=10000
export PROMPT_COMMAND="history -a; unique_history.py; history -r; $PROMPT_COMMAND"
@ganwell
ganwell / .tmux.conf
Created September 4, 2012 12:27
tmux.conf fast pane rearrange
bind-key C-v select-layout 72af,238x64,0,0{119x64,0,0[119x32,0,0,119x31,0,33],118x64,120,0}
bind-key v select-layout even-vertical
bind-key b select-layout even-horizontal
@ganwell
ganwell / ipython_tools.py
Created September 23, 2012 18:59
Prints tables and objects as html-tables / Hide input-boxes from notebooks.
This git got too large. I created a repo: https://github.com/adfinis-sygroup/adsy-python
@ganwell
ganwell / solarized.py
Created October 9, 2012 11:19
Solarized theme for IPython code mirror editor
from IPython.core.display import HTML
def solarized():
"""Solarized code mirror theme."""
html = """
<style type="text/css">
.cm-s-ipython { background-color: #002b36; color: #839496; }
.cm-s-ipython span.cm-keyword {color: #859900; font-weight: bold;}
.cm-s-ipython span.cm-number {color: #b58900;}
.cm-s-ipython span.cm-operator {color: #268bd2; font-weight: bold;}
@ganwell
ganwell / install.sh
Created October 14, 2012 11:51
Installing inspyred on python3
git clone https://github.com/rkruppe/paver.git
cd paver/
git checkout python3
cd ..
pip-3.2 install inspyred
cd build/inspyred
cp ../../paver/paver-minilib.zip .
python3 setup.py install
@ganwell
ganwell / bug.py
Last active December 9, 2015 09:19
import gc
import asyncio
import traceback
import inspect
loop = asyncio.get_event_loop()
class A(object):
def __del__(self):
print("Del A")