Skip to content

Instantly share code, notes, and snippets.

View yszheda's full-sized avatar

Shuai YUAN yszheda

View GitHub Profile
@katta
katta / gitdiff-svnpatch.sh
Created June 16, 2011 08:10
Converts git diff to svn patch format
git diff --no-prefix | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" --ignore-space-at-eol > changes.patch
@gazoombo
gazoombo / .tmux.conf
Created January 27, 2012 18:46
vim keybindings for tmux
# I'm a Vim user, this makes navigation easier
setw -g mode-keys vi # I especially like being able to search with /,? when in copy-mode
unbind-key j
bind-key j select-pane -D # Similar to 'C-w j' to navigate windows in Vim
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
@l4u
l4u / gist:2233073
Created March 29, 2012 03:43
Layer Clipping cocos2d-x
//http://codewars.net/304/layer-clipping-in-cocos2d-x/
void CCClippingLayer::visit()
{
// quick return if not visible
if (!getIsVisible())
{
return;
}
@chinghanho
chinghanho / gist:3346205
Created August 14, 2012 04:18 — forked from lucasfais/gist:1207002
Sublime Text 2: Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T 切換檔案
⌘⌃P 切換專案
⌘R 畫面切換到 method
⌃G 畫面切換到指定行數
⌘KB 關閉 / 開啟側邊欄
⌘⇧P 開啟指令控制面板
@syuhari
syuhari / CardFlip
Created October 13, 2012 21:50
flip card for cocos2d-x
void Card::flipAction() {
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCSprite* card = CCSprite::spriteWithFile("card_face.png");
card->setPosition(ccp(winSize.width/2, winSize.height/2));
this->addChild(card, CARD_FACE_TAG, CARD_FACE_TAG);
card->setVisible(false);
CCSprite* card2 = CCSprite::spriteWithFile("card.png");
card2->setPosition(card->getPosition());
@ufologist
ufologist / douban_reader.js
Created January 17, 2013 12:20
如何导出/下载豆瓣阅读中的电子书
/**
* 分析豆瓣阅读查看电子书的逻辑
*
* 主要用到的JavaScript为
* 1. OzJS(管理模块)
* 2. jQuery(base库)
* 3. Backbone.js(web application框架)
*
* 过程分析
* --------
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@avivkiss
avivkiss / Instructions.md
Last active December 14, 2015 11:09 — forked from danielres/README.markdown
Instructions for using Font Awesome with Octopress.

Edit: Apparently the sass file was removed from the latest versions of Font-Awesome... You can still download the sass file from GitHub here

  1. Download Font Awesome source
  2. Take the file sass/font-awesome.sass and put it in your octopress sass folder
  3. Rename it to _font-awesome.sass
  4. Create a directory 'octopress/source/font' and put the 4 font files there (ttf, svg, eot and woff).
  5. In your stylesheet (sass/screen.scss):
  • @import font-awesome
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
@cloudwu
cloudwu / mymod.user.lua
Created October 26, 2015 12:05
user defined loader
local M = {}
function M.test(...)
print(...)
end
return M