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
dispatch_group_t group = dispatch_group_create();
dispatch_semaphore_t semaphore = dispatch_semaphore_create(10);
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
for (int i = 0; i < 100; i++)
{
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
dispatch_group_async(group, queue, ^{
NSLog(@"%i",i);
sleep(2);
dispatch_semaphore_signal(semaphore);
@Superbil
Superbil / readme.md
Last active December 25, 2015 16:09
covert Excel file to localizable files
@Superbil
Superbil / ido-find-file.el
Created October 17, 2013 17:31
auto use root to open file
(defadvice ido-find-file
(after find-file-sudo activate)
"Find file as root if necessary."
(unless (and buffer-file-name
(file-writable-p buffer-file-name))
(find-alternate-file (concat "/sudo:root@localhost:"
buffer-file-name))))
@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)")
@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 / 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
#!/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 / 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)
@Superbil
Superbil / fix_strings.md
Last active June 9, 2017 07:01 — forked from sprhawk/gist:2779208
Fix *.strings can't diff in git