Pythonbrew is now deprecated. So we should use pyenv then.
pyenv is inspired by rbenv and ruby-build, and is pretty handy.
cd ~
## note that all of this config could be found | |
## http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs | |
## | |
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 3.10.1 Kernel Configuration | |
# | |
CONFIG_64BIT=y | |
CONFIG_X86_64=y |
Pythonbrew is now deprecated. So we should use pyenv then.
pyenv is inspired by rbenv and ruby-build, and is pretty handy.
cd ~
#!/usr/bin/env python | |
from sys import stdin | |
from cdiff import PatchStream, DiffParser, markup_to_pager | |
diff_hdl = stdin | |
stream = PatchStream(diff_hdl) | |
class Option: | |
def __init__(self, **kwargs): |
# | |
# lazy loading decorator and class, idea stolen from ruby's lazy class and | |
# http://stackoverflow.com/questions/3012421/python-lazy-property-decorator | |
# | |
from __future__ import print_function | |
# | |
# lazy loading decorator for class property | |
# |
// javascript:function | |
iprl5 () { | |
var d=document, z=d.createElement('scr'+'ipt'), b=d.body,l=d.location; | |
try { | |
if (!b) throw(0); | |
d.title='(Saving...) ' + d.title; | |
z.setAttribute('src', | |
'https://www.instapaper.com/j/xxxxxxxxxxxxx=' + encodeURIComponent(l.href) + '&t=' + (new Date().getTime()) | |
); | |
b.appendChild(z); |
// javascript: | |
( | |
function () { | |
var d = (new Date); | |
var s = document.createElement('script'); | |
s.charset = 'UTF-8'; | |
s.src = 'http://b.hatena.ne.jp/js/Hatena/Bookmark/let.js?' + d.getFullYear() + d.getMonth() + d.getDate(); | |
(document.getElementsByTagName('head')[0] || document.body).appendChild(s); | |
} | |
)(); |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from urllib.request import urlopen | |
from lxml import etree | |
res = urlopen('http://www.baidu.com/s?wd=keywords') | |
if res.code != 200: | |
sys.exit() |
import sys | |
if sys.version_info[0] == 3: | |
xrange = range | |
import functools | |
registered_functions = {} | |
def register_function(params): |
usually ctrl-d
(or cmd-d
on OSX) when booted with GUI mode in virtualbox.
if the vagrant box has been booted, then open virtualbox GUI => modify machine settings => select storage, insert the additions image(iso file) by hand