Skip to content

Instantly share code, notes, and snippets.

# Disable crontab -r
function crontab ()
{
# Replace -r with -e
/usr/bin/crontab "${@/-r/-e}"
}
$ cat /proc/cpuinfo | grep "model name" | uniq
model name : Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
$ uname -a
Linux Q8400 3.5.0-37-generic #58-Ubuntu SMP Mon Jul 8 22:07:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 2.7.3
$ python -m timeit '"-".join(str(n) for n in range(100))'
10000 loops, best of 3: 24.4 usec per loop
@baojie
baojie / app.py
Created August 4, 2013 20:49 — forked from saghul/app.py
import os
from autobahn.resource import WebSocketResource, WSGIRootResource
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol
from flask import Flask, render_template
from twisted.application import internet, service
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
from twisted.web.server import Site
@baojie
baojie / install_node.sh
Last active December 19, 2015 18:08 — forked from chiragchamoli/install node.js on ubuntu
install node.js on ubuntu
#install node.js on ubuntu
sudo add-apt-repository ppa:chris-lea/node.js -y
sudo apt-get update
sudo apt-get install nodejs
# http://stackoverflow.com/questions/748324/python-convert-those-tinyurl-bit-ly-tinyurl-ow-ly-to-full-urls
#############
# urllib2
import urllib2
fp = urllib2.urlopen('http://bit.ly/rgCbf')
fp.geturl()
# ==> 'http://webdesignledger.com/freebies/the-best-social-media-icons-all-in-one-place'
@baojie
baojie / index.html
Created February 15, 2013 20:12 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">Comix Sample</tspan>
</label>
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59">