Skip to content

Instantly share code, notes, and snippets.

@jedy
jedy / Monokai.tmTheme
Created June 25, 2012 12:34 — forked from anateus/Monokai.tmTheme
Monokai for Sublime Text: Markdown supported + some additional element differentiation
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
@jedy
jedy / ip_addr.py
Created June 5, 2012 09:55
get ip address
import socket
import fcntl
import struct
def get_ip_address(ifname):
"""
>>> get_ip_address('lo')
'127.0.0.1'
>>> get_ip_address('eth0')
@jedy
jedy / tail_recurse.py
Created June 5, 2012 09:53
python尾递归
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
class TailRecurseException:
def __init__(self, args, kwargs):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<style>
table {
border-collapse: collapse
}
</style>
<script src="jquery.min.js"></script>
<script>
function add_float_head(tid){
@jedy
jedy / tc.sh
Created May 24, 2012 02:35
tc带宽控制
#!/bin/bash
#脚本文件名: tc2
#########################################################################################
#用TC(Traffic Control)解决ADSL宽带速度技术 Ver. 1.0 by KindGeorge 2004.12.27 #
#########################################################################################
#此脚本经过实验通过,更多的信息请参阅http://lartc.org
#tc+iptables+HTB+SFQ
#
#一.什么是ADSL? ADSL(Asymmetric Digital Subscriber Loop,非对称数字用户环路)
#用最简单的话的讲,就是采用上行和下行不对等带宽的基于ATM的技术.