Skip to content

Instantly share code, notes, and snippets.

@Plutor
Plutor / pinary.py
Last active October 21, 2020 10:56
Decimal to pinary conversion
"""Convert decimal numbers to pinary (base pi).
Fractional and even irrational bases are possible, but aren't really useful for
anything. Base pi has four digits: 0, 1, 2, and 3. What's interesting is that
there's some "space" between the highest digit and the base, which means that
there are numbers with multiple valid representations. You'll notice:
decimal 7.000000 = pinary 20.2021120021
decimal 8.000000 = pinary 21.2021120021
decimal 9.000000 = pinary 22.2021120021
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jiffyclub
jiffyclub / jdutil.py
Created October 18, 2011 02:03
Functions for converting dates to/from JD and MJD
"""
Functions for converting dates to/from JD and MJD. Assumes dates are historical
dates, including the transition from the Julian calendar to the Gregorian
calendar in 1582. No support for proleptic Gregorian/Julian calendars.
:Author: Matt Davis
:Website: http://github.com/jiffyclub
"""
@mbostock
mbostock / .block
Last active May 9, 2020 16:58
Polymaps + D3
license: gpl-3.0
@jgomezdans
jgomezdans / random.py
Created May 15, 2010 23:24
Random colormap for matplotli
import matplotlib,numpy
import pylab
# A random colormap for matplotlib
cmap = matplotlib.colors.ListedColormap ( numpy.random.rand ( 256,3))
pylab.imshow ( Z, cmap = cmap)
pylab.show()
# implementation
from pymouse import PyMouseEventMeta
import systembridge
from threading import Thread
class PyMouseEvent(PyMouseEventMeta):
def __init__(self):
click_tap = systembridge.get_event_tap(mousepress | mouserelease)
move_tap = systembridge.get_event_tap(mousemove)