Skip to content

Instantly share code, notes, and snippets.

@scutdavy
scutdavy / gist:3706103
Created September 12, 2012 11:39
nook中文css
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: normal;
font-style: normal;
src: url(res:///system/fonts/DroidSansFallback.ttf);
}
@font-face {
font-family: "DroidFont", serif, sans-serif;
font-weight: bold;
font-style: normal;
@scutdavy
scutdavy / gist:5219589
Created March 22, 2013 07:32
git config
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/tags/*:refs/tags/*
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
@scutdavy
scutdavy / .tmux.conf
Created July 8, 2013 23:34
tmux config.
0 ¬
1 # Reload the .tmux.conf file with Ctrl-r¬
2 bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"""¬
3 ¬
4 # start window index of 1 instead of 0¬
5 set-option -g base-index 1¬
6 ¬
7 # # Start panes at 1 instead of 0. tmux 1.6 only¬
8 setw -g pane-base-index 1¬
9 ¬
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
require '~/Applications/Zephyros.app/Contents/Resources/libs/zephyros.rb'
hyper = ["cmd", "alt", "ctrl", "shift"]
#hyper = ["cmd", "alt", "ctrl"]
$window_grid_width = 4
API.bind('d', hyper) { `open -a Dictionary` }
@scutdavy
scutdavy / crawler.js
Created November 11, 2013 16:35
赶集网二手房数据定向爬虫
var needle = require("needle");
var cheerio = require('cheerio');
var assert = require('assert');
var async = require('async');
var fs = require('fs');
var itemWith = function($){
item = new Object;
var $house = $.find('.house');
@scutdavy
scutdavy / shell.c
Created December 5, 2013 04:35
unix shell简单实现,支持参数,管道,重定向
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <errno.h>
#define TRUE 1