Skip to content

Instantly share code, notes, and snippets.

@Gohan
Gohan / techparty_weibo_post
Created November 30, 2011 06:51
techparty_shenzhen_2011.12.04
珠三角技术沙龙2011.12.04深圳场-电商专题开始接受报名! techparty.org/?p=1323 主题:1.传统企业的电子商务策略by龚文祥, 2.基于中间件技术平台构建企业化电子商务系统by黄浩. ... 微博叙述有限, 请跳至官网查看详情.
@Gohan
Gohan / ipython.log
Created February 1, 2012 16:06
sqlalchemy test
In [8]: %edit main.py
Editing... done. Executing edited code...
2012-02-02 00:04:48,288 INFO sqlalchemy.engine.base.Engine PRAGMA table_info("members")
2012-02-02 00:04:48,288 INFO sqlalchemy.engine.base.Engine ()
2012-02-02 00:04:48,291 INFO sqlalchemy.engine.base.Engine PRAGMA table_info("cast_types")
2012-02-02 00:04:48,291 INFO sqlalchemy.engine.base.Engine ()
2012-02-02 00:04:48,296 INFO sqlalchemy.engine.base.Engine PRAGMA table_info("persons")
2012-02-02 00:04:48,296 INFO sqlalchemy.engine.base.Engine ()
2012-02-02 00:04:48,297 INFO sqlalchemy.engine.base.Engine PRAGMA table_info("movies")
2012-02-02 00:04:48,297 INFO sqlalchemy.engine.base.Engine ()
@Gohan
Gohan / main.py
Created February 1, 2012 16:08
sqlalchemy test IMDB cast
# coding: utf-8
from sqlalchemy import *
from sqlalchemy.orm import relationship, Session
from sqlalchemy.ext.declarative import declarative_base
metadata = MetaData()
Base = declarative_base(metadata = metadata)
class Member(Base):
__tablename__ = 'members'
@Gohan
Gohan / bilibili001.js
Created February 9, 2012 05:12
呃,bilibili逆反弹幕
for (i=0;i<Player.commentList.length;i++){
if(Player.commentList[i].mode != 8){
if(Player.commentList[i].txt.search("([逆反]向)|([渣垃拉啦哇呀压鸭吔蛤哈].*){3}") == -1){
Player.commentList[i].mode = 6;
} else{
Player.commentList[i].mode = 0;
}
if(Math.random() > 0.5){
Player.commentList[i].color = 0x000000;
}else{
@Gohan
Gohan / valentine.js
Created February 14, 2012 02:57
小解谜
// copy from http://www.matrix67.com/data/scripts/valentine.js
var hint = new Array(1,1,1,1,2,1,1,1,1,2,1,2,3,3,4,5,4,3,3,2,4,2,3,5,5,7,8,7,5,5,3,6,3,3,5,5,8,9,8,5,5,3,6,3,3,4,3,6,7,6,3,4,4,7,4,2,2,1,3,4,3,1,2,3,5,3,1,1,0,1,1,1,0,1,2,3,2);
function getTd(id)
{
return document.getElementById("td" + id.toString());
}
function init()
{
for (i=0; i<7; i++)
{
# hello hubot, 回音体演示
fs = require 'fs'
module.exports = (robot) ->
robot.respond /(回音体) (.*)/i, (msg) ->
@output = ['主人, 回音体就来啊~']
@origin = msg.match[2]
for i in [[email protected]]
@output.push @origin.substring i
msg.send @output.join('\n')
@Gohan
Gohan / douban_movie.coffee
Created February 25, 2012 16:34
hubot_script douban movie
# hello hubot, another example
showResult = (msg, entries, images) ->
if entries.length == 0
return
msg.send entries.shift()
msg.send images.shift()
setTimeout ( ->
showResult msg, entries, images
), 500
@Gohan
Gohan / 2012-04-15.markdown
Created March 22, 2012 14:29
Techparty@深圳 群公告

2012.04.25小沙龙聚会完结

活动总结准备中.

@Gohan
Gohan / gist:3712751
Created September 13, 2012 07:58
simple c++ snippets for demo
#include <algorithm>
#include <utility>
#include <vector>
typedef void* GzPointer;
typedef float GzCoord[3];
class Vertex
{
public:
@Gohan
Gohan / gist:4085033
Created November 16, 2012 07:13
Gohan's css modify from dilinger.io For md file rendering
<style type="text/css">
/* Gohan's css modify from dilinger.io */
[hidden]{display:none}
::-moz-selection{background:#087185;color:#fff;text-shadow:none}
::selection{background:#087185;color:#fff;text-shadow:none}
a:visited{color:#551a8b}
b{font-weight:bold}
dfn{font-style:italic}
hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}
ins{background:#ff9;color:#000;text-decoration:none}