Skip to content

Instantly share code, notes, and snippets.

.ask{
color:#99a3b1;
font-size:30px;
line-height:50px;
}
<div class="ask" contenteditable="true" id="ask_k" >
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="cp">
<head>
<title>Rtest</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style type="text/css">
body {
background: #FFF;
def callfunction(name):
def warp(f):
def warp1(*args):
print "the caller is "+ name
f()
return warp1
return warp
@callfunction("xman")
def f(*args):
print "f start"
import datetime
def timeit(func):
def warp(*args):
print "begin at " + str(datetime.datetime.now())
func(*args)
print "end at " + str(datetime.datetime.now())
return warp
@timeit
def decorator_whith_params_and_func_args(arg_of_decorator):
def handle_func(func):
print "start handle"
def warp():
print "start warp"
func()
print "end warp"
print "end handle"
return warp
return handle_func
import math
class Point(object):
def __init__(self, x=0, y=0):
try:
int(x) + 1
except TypeError:
self.x = 0
else:
class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
a = Point(1, 4)
b = Point(4, 4)
c = Point(1, 2)
d = Point(4, 2)
a1 = Point(1, 5)
b1 = Point(4, 5)
c1 = Point(1, 2)
d1 = Point(4, 2)
r = Rectangle(a1, b1, c1, d1)
@jianghu52
jianghu52 / addtime
Created June 14, 2014 09:20
简单的一个算时间的小程序,主要是用于发日报用
<?php
date('H');
date('Y-m-d H:i:s');
$endTime_h = date('H');
$endTime_m = date('i');
echo $endTime_m;echo "<br/>";
if($endTime_m > 30){
$work_m = 0.5;
}else{