Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@Superbil
Superbil / api_addressbook.org
Last active August 29, 2015 14:00
How to boot up addressbook at local

you will need

  1. Postgresql.app http://postgresapp.com/
  2. homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
  1. node.js
brew install npm
@Superbil
Superbil / run_in_main.m
Created March 28, 2014 04:25
let en is second chose
// ref from: http://stackoverflow.com/questions/20241256/ios-app-default-language-en-is-not-applied
// remove what was previously stored in NSUserDefaults (otherwise the previously selected language will be still the first one in the list and your app won't be localized in the language selected in settings)
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize]; // make the change immediate
// reorder the languages so English is always the default fallback
NSMutableArray *mutableLanguages = [[NSLocale preferredLanguages] mutableCopy];
NSInteger enIndex = NSNotFound;
for (NSString *lang in mutableLanguages) { if ([lang isEqualToString:@"en"]) { enIndex = [mutableLanguages indexOfObject:lang]; break; } }
@try {
@Superbil
Superbil / .clang-format.yaml
Created March 6, 2014 04:16
Custom clang-format
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
@Superbil
Superbil / fix_strings.md
Last active June 9, 2017 07:01 — forked from sprhawk/gist:2779208
Fix *.strings can't diff in git
@Superbil
Superbil / init-local.el
Last active January 4, 2016 02:29
在 Mac OS X 上設定 org-mode 表格可以正確對齊的中文字體設定
;;; 在 Mac OS X 上設定 org-mode 表格可以正確對齊的中文字體設定 - Dev Notes
;;; http://kkdevs.tumblr.com/post/38276076979/mac-os-x-org-mode
(defun set-font (english english-size chinese chinese-size)
(set-face-attribute 'default nil :font
(format "%s:pixelsize=%d" english english-size))
(dolist (charset '(kana han symbol cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil 'font) charset
(font-spec :family chinese :size chinese-size))))
(set-font "Monaco" 13 "STHeiti" 13)
#!/bin/bash
## Mini-Xcode: XCode 5
MIN_VERSION="6.0"
# set default output folder is build
OUTPUT_FOLDER=${PREFIX-build}
# set default compiler
CC=${CC-$(xcrun --find gcc)}
@Superbil
Superbil / requirements.txt
Last active December 27, 2015 19:18
my python site-packages
BeautifulSoup==3.2.1
GitPython==0.3.2.RC1
PIL==1.1.7
Pastebin==1.1.1
PyGithub==1.16.0
Scrapy==0.18.2
SimpleCV==1.3
Twisted==13.1.0
argparse==1.2.1
astroid==1.0.0
@Superbil
Superbil / _stdout.log
Last active December 27, 2015 03:39
uniout debug message
$ pip install uniout
Downloading/unpacking uniout
Downloading uniout-0.3.2.tar.gz
Running setup.py egg_info for package uniout
Traceback (most recent call last):
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/uniout.egg-info
@Superbil
Superbil / fix-font-org-mode.el
Last active August 27, 2022 08:25
fix chinese font on Emacs
;;; base on https://gist.github.com/coldnew/7398835
(defvar emacs-english-font nil
"The font name of English.")
(defvar emacs-cjk-font nil
"The font name for CJK.")
(defvar emacs-font-size-pair nil
"Default font size pair for (english . chinese)")