Skip to content

Instantly share code, notes, and snippets.

View xiaolai's full-sized avatar
🎯
Focusing

xiaolai xiaolai

🎯
Focusing
View GitHub Profile
@xiaolai
xiaolai / sublime_user_settings.js
Created September 24, 2012 16:20
Example user settings for sublime text 2
{
"color_scheme": "Packages/User/textmate-solarized/Solarized (Dark).tmTheme",
// "color_scheme": "Packages/User/textmate-solarized/Solarized (Light).tmTheme",
// "color_scheme": "Packages/User/TextMate-Tomorrow-Theme/Tomorrow-Night-Eighties.tmTheme",
// "color_scheme": "Packages/User/TextMate-Tomorrow-Theme/Tomorrow-Night-Bright.tmTheme",
// "color_scheme": "Packages/User/TextMate-Tomorrow-Theme/Tomorrow-Night.tmTheme",
"font_size": 12,
"font_face": "menlo",
// "font_face": "monaco",
// "font_face": "Inconsolata",
@xiaolai
xiaolai / gist:3783233
Created September 25, 2012 17:16
disable dashboard of os x
defaults write com.apple.dashboard mcx-disabled -boolean YES
kill all dock
@xiaolai
xiaolai / nokogiri libxml homebrew lion
Created September 30, 2012 12:37 — forked from devpuppy/nokogiri libxml homebrew lion
How to fix: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
@xiaolai
xiaolai / gist:3817378
Created October 2, 2012 08:35
add utf-8 support to rspec.rb file
# encoding: UTF-8
require 'spec_helper'
@xiaolai
xiaolai / smser.rb
Created October 2, 2012 15:51 — forked from mimosz/smser.rb
短信宝
# -*- encoding: utf-8 -*-
require 'digest/md5'
require 'nestful'
class Smsbao
attr_accessor :login, :passwd
def initialize(login, passwd)
@login = login
@passwd = Digest::MD5.hexdigest(passwd)
@xiaolai
xiaolai / rspec-syntax-cheat-sheet.rb
Created October 2, 2012 19:02 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@xiaolai
xiaolai / gist:3827574
Created October 3, 2012 15:29
gitconfig file
#===========================================
# Author: Francis Varga
# eMail: fv@varga-multimedia.com
# Blog: flexbuddha.posterous.com
#===========================================
#
# This is my .gitconfig file
#
# Did you have question ask me ;)...
[user]
@xiaolai
xiaolai / default.custom.yaml
Created October 21, 2012 13:02 — forked from lotem/default.custom.yaml
在Rime輸入方案選單中添加五筆、雙拼、粵拼、注音,保留你需要的
# default.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
schema_list:
- schema: luna_pinyin # 朙月拼音
- schema: terra_pinyin # 地球拼音 dì qiú pīn yīn
@xiaolai
xiaolai / mac_fuck_gfw.sh
Created October 24, 2012 02:48 — forked from happypeter/mac_fuck_gfw.sh
FUCK GWF apple script
#!/user/bin/env bash
on_die() {
echo
echo byebye proxy
echo
networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy
# the name can be "wifi" or "Ethernet 1", just see what is listed in "network preference"
}
@xiaolai
xiaolai / gist:15104f431bb8f2a7af20c5ce22a28ef9
Created May 29, 2016 16:54
open iTerm here in Folder
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: