Skip to content

Instantly share code, notes, and snippets.

View dnlcrl's full-sized avatar

dnlcrl

View GitHub Profile
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@pazdera
pazdera / gist:1098129
Created July 21, 2011 20:29
Singleton example in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of Singleton design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@spudbean
spudbean / gist:1558257
Last active May 30, 2024 11:36
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons
@klange
klange / image-to-ansi.py
Created January 27, 2012 06:29 — forked from MicahElliott/colortrans.py
Convert images to ANSI escape sequences
#! /usr/bin/env python
""" Convert an image (argv[1]) to an ANSI text string (xterm-256color)
Original readme from colortrans.py follows:
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@jdunck
jdunck / s3_multipart.py
Last active May 15, 2019 13:55 — forked from BradWhittington/s3_multipart.py
upload to s3 with streaming, multi-part, threaded upload, with key rollover as you pass the 4gb limit, with adjustable buffering and pooling. Don't forget to call uploader.close() when you're done.
from multiprocessing.pool import ThreadPool
import logging, os, threading
from StringIO import StringIO
import boto.s3
logger = logging.getLogger('s3upload')
class MultiPartUploader:
upload_part = 0
@willwade
willwade / KeyCodes.csv
Created April 7, 2013 13:25
Character code translation table for Mac/PC/Linux From: http://web.archive.org/web/20100501161453/http://www.classicteck.com/rbarticles/mackeyboard.php NB: Some of these are wrong. Follow the spreadsheet for updates as and when I find them at https://github.com/willwade/MacroServerMac/blob/master/KeyCodes.csv
Key Mac Windows Linux Notes
rbKeyUp 126 26 103
rbKeyDown 125 28 108
rbKeyLeft 123 25 105
rbKeyRight 124 27 106
rbKeyBackspace 117 8 14
rbKeyEnter 76 * 28
rbKeyHome 115 36 102
rbKeyEnd 119 35 107
rbKeyPageDown 121 34 109
@baldwint
baldwint / hinton.py
Created September 13, 2013 00:46
Hinton diagrams in matplotlib
"""
Hinton diagrams in matplotlib.
A Hinton diagram is useful for visualizing a matrix of signed weights.
In the diagram, each matrix element is represented by a square whose
color indicates the sign and whose area represents the magnitude.
"""
import matplotlib.patches as mpatches