Skip to content

Instantly share code, notes, and snippets.

@cliffwoo
cliffwoo / chat.rb
Created October 30, 2012 08:59 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
@cliffwoo
cliffwoo / gist:3942793
Created October 24, 2012 00:04 — forked from huacnlee/gist:3936299
Mac 清理 TextMate 2 不断升级带出一堆多余的打开方式
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@cliffwoo
cliffwoo / gist:3904152
Created October 17, 2012 07:08
查看内存插槽数及内存大小
#http://blog.chinaunix.net/uid-7270462-id-3226111.html
dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
dmidecode|grep -P 'Maximum\s+Capacity'
dmidecode|grep -A16 "Memory Device"
@cliffwoo
cliffwoo / 12306.user.js
Created September 19, 2012 01:59 — forked from xczdx/12306.user.js
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011-2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
@cliffwoo
cliffwoo / 12306AutoLogin.user.js
Created September 19, 2012 01:59
12306 Auto Login
/*
12306 Auto Login => A javascript snippet to help you auto login 12306.com.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js