Skip to content

Instantly share code, notes, and snippets.

View xiangzhuyuan's full-sized avatar
🤗

Mathew P. Jones xiangzhuyuan

🤗
View GitHub Profile
@xiangzhuyuan
xiangzhuyuan / gist:1909106
Created February 25, 2012 15:34
list comperhension
for i in range(4):
for j in range(5):
a=i*j
print a
print [i*j for i in range(4) for j in range(5)]
@xiangzhuyuan
xiangzhuyuan / routing
Created October 14, 2012 14:18
Werkaeug routing
# -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
When it comes to combining multiple controller or view functions (however
you want to call them) you need a dispatcher. A simple way would be
applying regular expression tests on the ``PATH_INFO`` and calling
registered callback functions that return the value then.
@xiangzhuyuan
xiangzhuyuan / gist:5133140
Created March 11, 2013 09:51
about date
package com.demo;
import java.util.Calendar;
import java.util.Date;
public class DemoDateUtil {
//static DateUtil du = new DateUtil();
/**
* @param args
<html><head>
<meta charset="utf-8&quot;"> <title>
CakePHP: the rapid development php framework:
Posts </title>
<link href="/favicon.ico" type="image/x-icon" rel="icon"><link href="/favicon.ico" type="image/x-icon" rel="shortcut icon"><link rel="stylesheet" type="text/css" href="/css/cake.generic.css"><link type="text/css" rel="stylesheet" href="chrome-extension://imamemhokkdleoelohnmkimbmpfglcil/css/capture.css"></head>
<body huaban_screen_capture_injected="true">
<div id="container" style="
">
<div id="header">
<h1>CakePHP 学习demo</h1>
海拉尔
金帐汗
额尔古纳
根河
满归
漠河
北极村/北红村
莫尔道嘎国家森林公园
室韦
临江
template<typename T>
class Singleton
{
public:
static T &instance()
{
if (!instance)
instance_ = new T;
return *instance_;
}
@xiangzhuyuan
xiangzhuyuan / prepare-mac-for-os-x-mavericks
Created October 21, 2013 12:03
是时候升级到OSX 10.9
是时候准备升级到OSX 10.9( OS X Mavericks )了.
-------
> Written with [StackEdit](https://stackedit.io/).
Git目录
----------
'Git目录'是为你的项目存储所有历史和元信息的目录
-
包括所有的对象
@xiangzhuyuan
xiangzhuyuan / xml_sax.py
Created December 23, 2013 14:40
尼瑪凡是讓我看不懂的代碼就是壞代碼!
class FakeRoot(object):
thrift_spec = ((0, 'XXX', 'xxx', (123, 123), None, ), 1)
a = FakeRoot()
print a.thrift_spec[0][1]
print a.thrift_spec[1]
print type(a.thrift_spec)
@xiangzhuyuan
xiangzhuyuan / main.rb
Created March 12, 2014 15:59
ruby script lesson-1
class Student
attr_reader :id, :name, :age
def initialize(id, name, age)
@id = id
@name = name
@age = age
end
def id