Skip to content

Instantly share code, notes, and snippets.

View kebot's full-sized avatar
🏠
Working from home

Keith Yao kebot

🏠
Working from home
View GitHub Profile
# first we build a 20 * 20 table
# each table contains a char value that can be '*' or '-'
table = [['-' for i in range(0, 20)] for i in range(0, 20)]
def print_table(table):
""" then we define a function that can print the table into screen"""
for row in table:
print " ".join(row)
-- Author: Michael Bianco <http://mabblog.com/>
-- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317
on create_vpn_service(vpn_name)
tell application "System Preferences"
reveal pane "com.apple.preference.network"
activate
tell application "System Events"
tell process "System Preferences"
@kebot
kebot / Makefile
Last active December 11, 2015 05:58
Make file for rsync, it's a simple dropbox
#
# Makefile for rsync
#
# [help with rsync](http://bbs.chinaunix.net/thread-2116588-1-1.html)
RSYNC_SERVER = <username>@<server>:~/Cloud
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import session, g, Flask, request, abort
app = Flask(__name__)
urls = (
'/song/<int:sid>', 'Song',
)
var bingCW_ht_pop_el = document.getElementById("bingCW_ht_pop");
if (bingCW_ht_pop_el == null)
BingCW = new function() {
this.Config = {Disabled: false,DisableHover: false,DisableSelection: false,DisablePharse: false,WebDefinition: true,MachineTranslation: true,ICON: "ZH"};
var I = "D1CB4BBF472140DE99370A52F1F8F554", o = [document.body], F = {}, n = null, a = null, m = [], l = [], v = null, q = [], h = null, E = false, p = "dict.bing.com.cn", ab = "#bingCW_ht_pop,#bingCW_ht_box,#bingCW_ht_content,#bingCW_ht_QWA,#bingCW_ht_footer,.bingCW_ht_QueryWord,.bingCW_ht_attr,.bingCW_ht_pos,.bingCW_ht_list,.bingCW_ht_list2,.bingCW_ht_listItem,.bingCW_ht_listItem2,.bingCW_ht_link,#bingCW_ht_badge{margin:0px;padding:0px;width:auto;height:auto;white-space:normal;border:0px solid #ace;background-color:White;background-image:none;text-indent:0px;line-height:17px;font-family:arial, helvetica, sans-serif;font-size:13px;color:Black;float:none;visibility:visible;text-align:left;vertical-align:baseline;display
jQuery.fn.letsFixed = function(options){
// make default settings
var settings = {}
return this.each(
function(){
// let them fixed
var t=$(this);
var width=t.css('width');
var height = t.css('height');
var offset = t.offset();