Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
" http://recursivedream.com/blog/2012/auto-completing-google-contacts-in-vim/ | |
" Escape query and handle goobook errors | |
function! mailcomplete#Complete(findstart, base) | |
if a:findstart == 1 | |
let line = getline('.') | |
let idx = col('.') | |
while idx > 0 | |
let idx -= 1 | |
let c = line[idx] | |
" break on header and previous email |
"""Simple utility script for semi-gracefully downgrading v3 notebooks to v2""" | |
import io | |
import os | |
import sys | |
from IPython.nbformat import current | |
def heading_to_md(cell): | |
"""turn heading cell into corresponding markdown""" |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/bin/bash | |
mkdir /tmp/curl-ca-bundle | |
cd /tmp/curl-ca-bundle | |
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2 | |
tar xzf curl-7.22.0.tar.bz2 | |
cd curl-7.22.0/lib/ | |
./mk-ca-bundle.pl | |
if [ ! -d /usr/share/curl/ ]; then | |
sudo mkdir -p /usr/share/curl/ | |
else |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
@black: #002b36; | |
@grayDarker: #586e75; | |
@grayDark: #657b83; | |
@gray: #839496; | |
@grayLight: #93a1a1; | |
@grayLighter: #eee8d5; | |
@white: #fdf6e3; | |
@blue: #2aa198; | |
@blueDark: #268bd2; |
// Characters that are considered to separate words – does not include periods. | |
// Place comma at the end of the line if there are multiple keybindings. | |
{"word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"} |
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX | |
% Author: Honza Ustohal <[email protected]> | |
% | |
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter | |
% This might be reworked into a full blown package in the near future | |
% | |
% Prerequisite: | |
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX | |
% | |
% Usage: |