Skip to content

Instantly share code, notes, and snippets.

View ilstar's full-sized avatar

Fred Liang ilstar

  • Instacart
  • San Francisco
View GitHub Profile
@ilstar
ilstar / gitconfig
Created October 14, 2010 08:44
~/.gitconfig
[user]
name = your_name
email = your@email.com
[alias]
co = checkout
ci = commit
st = status
br = branch
last = log -p -1
[color]
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@xdite
xdite / gist:758319
Created December 29, 2010 07:56
Ruby / Rails Convention of Techbang

Rails 開發注意要點

About Ruby Syntax

  • 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
  • 函式如果只有一個參數,就不強制打()
  • 函式如果有二個以上的參數,通通都要有 ()
    • (避免發生奇怪的paser bug跟保持專案一致性)
  • 字串限定用雙引號包覆
  • 善用 "#{str1} #{str3} " 等字串改寫技巧取代不需要的字串加法。
@huacnlee
huacnlee / yupoo_backup.rb
Created January 28, 2011 07:37
Yupoo 图片备份工具
# coding: UTF-8
#
# Yupoo 照片备份工具
# 此工具不需要API,直接就能备份你的照片信息,下载后以图片 + 一个文本文件的方式存放
# 备份包括内容:
# 原图,标题,说明,Tag,当然有 Exif 信息
#
# Jason Lee <huacnlee@gmail.com>
# http://huacnlee.com
# 2011-01-28
@ilstar
ilstar / tiny_mce config
Created March 14, 2011 09:00
tiny_mce config
theme: advanced
theme_advanced_toolbar_location : 'top'
theme_advanced_buttons1 : "fontselect, fontsizeselect,|, forecolor, backcolor, bold,italic,underline,strikethrough,|, justifyleft,justifycenter,justifyright,justifyfull,|, bullist,numlist,|, link,unlink,image,|, undo, redo, |, cleanup, code"
theme_advanced_buttons2: ""
theme_advanced_buttons3: ""
theme_advanced_toolbar_align : "left"
theme_advanced_statusbar_location: "bottom"
theme_advanced_fonts : "宋体=\'宋体\', sans-serif; 黑体=\'黑体\', sans-serif; 楷体=\'楷体_GB2312\', sans-serif; 隶书=\'隶书\', sans-serif;幼圆=\'幼圆\', sans-serif; 新宋体=\'新宋体\',sans-serif;微软雅黑=\'微软雅黑\', sans-serif; Arial=Arial; Arial Black=Arial Black; Arial Narrow=Arial Narrow; Brush Script MT=Brush Script MT; Century Gothic=Century Gothic; Comic Sans MS=Comic Sans MS; Courier=Courier; Courier New=Courier New; MS Sans Serif=MS Sans Serif; Script=Script; System=System; Times New Roman=Times New Roman; Verdana=Verdana; Wide Latin=Wide Latin; Wingdings=Wingdings;"
diff --git a/thread_pthread.c b/thread_pthread.c
index d3c2609..0ac4f42 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -103,10 +103,23 @@ native_cond_destroy(pthread_cond_t *cond)
}
}
+/*
+ * In OS X 10.7 (Lion), pthread_cond_signal and pthread_cond_broadcast return
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@kevintop
kevintop / 12306AutoLogin.user.js
Created January 6, 2012 15:05
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
@ghostbar
ghostbar / app.coffee
Created February 12, 2012 01:49
How to read session from Redis with Express + Socket.IO in CoffeeScript
class App
express = require 'express'
redis = require 'redis'
RedisStore = require('connect-redis')(express)
sessionStore = new RedisStore()
# These will be used only on ioController()
fs = require 'fs'
parseCookie = require('connect').utils.parseCookie