Forked from @agnoster's zsh theme. Incorporates changes from @smileart's fork.
- The current path is right aligned, so it's out of the way when working in deeply nested directories. The main, left-aligned prompt only the current directory's name.
" Modeline and Notes {{{ | |
" vim: set foldmarker={{{,}}} foldlevel=0 foldmethod=marker | |
" | |
" This is the personal .vimrc.local file of Will Mayner. | |
" | |
" It is meant to be used on top of Steve Francia's spf13-vim | |
" distribution, at https://github.com/spf13/spf13-vim. | |
" | |
" }}} |
" original github repos | |
Bundle 'wincent/Command-T' | |
Bundle 'sjl/gundo.vim' | |
Bundle 'tpope/vim-abolish' | |
Bundle 'tpope/vim-commentary' | |
Bundle 'digitaltoad/vim-jade' | |
Bundle 'tpope/vim-repeat' | |
Bundle 'tpope/vim-speeddating' | |
Bundle 'tpope/vim-unimpaired' | |
Bundle 'kchmck/vim-coffee-script' |
import json, StringIO, gzip, alfred, urllib, urllib2, datetime, time | |
def voiteImg(votes): | |
if votes < 0: | |
imgStr = 'so--1.png' | |
elif votes == 0: | |
imgStr = 'so-0.png' | |
elif votes >0 and votes <10: | |
imgStr = 'so-1-1.png' | |
elif votes >= 10 and votes <50: |
Forked from @agnoster's zsh theme. Incorporates changes from @smileart's fork.
#!/env/sh | |
# Test various ways of flipping '1's and '0's in a Python binary string. | |
TEST="'111101111010001000100100001'" | |
TESTINT="129831201" | |
echo "Bit manipulation given decimal int:" | |
PYSTRING="i = $TESTINT; bin((i ^ (2 ** (i.bit_length()+1) - 1)))[3:]" | |
echo "$PYSTRING\n" |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Memory-aware LRU Cache function decorator | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
A modification of the builtin ``functools.lru_cache`` decorator that takes an | |
additional keyword argument, ``use_memory_up_to``. The cache is considered full | |
if there are fewer than ``use_memory_up_to`` bytes of memory available. |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from itertools import permutations | |
def normalize_cm(connectivity_matrix): | |
"""Render a square connectivity matrix into a normal form. |
Elaborating on the reasons given in Dijkstra's memo on the topic, we observe the following:
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<style> | |
body { margin:0; padding:0; } | |
#map { width:960px; height:500px; background:cyan; } | |
</style> | |
</head> | |
<body> |