Skip to content

Instantly share code, notes, and snippets.

View Fykec's full-sized avatar

yinjiaji Fykec

View GitHub Profile
@Fykec
Fykec / emacs-xcode-document-viewer.diff
Created November 14, 2012 02:25 — forked from guehara/emacs-xcode-document-viewer.diff
emacs-xcode-document-viewer patch for Xcode 4.5
--- xcode-document-viewer.el.orig 2012-10-12 11:25:14.000000000 +0900
+++ xcode-document-viewer.el 2012-10-12 11:19:19.000000000 +0900
@@ -48,7 +48,7 @@
(defcustom xcdoc:document-path nil
"please set docset full path like:
-\"/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone3_1.iPhoneLibrary.docset\"")
+\"/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiPhone6.0.iPhoneLibrary.docset\"")
(defcustom xcdoc:open-w3m-other-buffer nil
;; auto-complete-mode
(setq ac-modes (append ac-modes '(objc-mode)))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor")) ;; Set your own Path to auto-complete-clang.el
(setq ac-clang-flags (list "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200" "-x" "objective-c" "-std=gnu99" "-isysroot" xcode:sdk "-I." "-F.." "-fblocks"))
(require 'auto-complete-clang)
;; (setq ac-clang-prefix-header "stdafx.pch")
;; (setq ac-clang-flags '("-w" "-ferror-limit" "1"))
;(setq clang-completion-flags (list "-Wall" "-Wextra" "-fsyntax-only" "-ObjC" "-std=c99" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk" "-I." "-F.." "-D__IPHONE_OS_VERSION_MIN_REQUIRED=30200"))
(add-hook 'objc-mode-hook
(lambda () (setq ac-sources (append '(ac-source-clang
@Fykec
Fykec / gist:5028782
Created February 25, 2013 09:44 — forked from pokeb/gist:150447
//
// MyController.h
//
// Created by Ben Copsey on 20/07/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GHUnit/GHUnit.h>
@class ASINetworkQueue;
@Fykec
Fykec / tw.gitconfig
Created August 28, 2013 11:44
TextWrangler as git mergetool
[diff]
tool = "twdiff"
[difftool]
prompt = false
[difftool "twdiff"]
cmd = /usr/local/bin/twdiff --wait --resume "$LOCAL" "$REMOTE"
[merge]
tool = "twdiff"
[mergetool]
@Fykec
Fykec / symbolicate_crash.sh
Last active December 24, 2015 03:39 — forked from xperienced/symbolicate_crash.sh
Update symbolicatecrash dir for XCode 5
#!/bin/sh
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
SYMBOLICATECRASH=`find /Applications/Xcode.app -name symbolicatecrash -type f`
${SYMBOLICATECRASH} -v "$1"
@Fykec
Fykec / simple.init.el
Created November 25, 2013 03:10
simple emacs config for mac
;; Yinjiaji's Emacs config in Mac OS X
;; Email: yinjiaji110@gmail.com
;;
;;Unicad
;;(load "~/.emacs.d/unicad.elc")
;;(require 'unicad)
;;ido-mode
(require 'ido)
@Fykec
Fykec / my.gitconfig
Created November 25, 2013 04:11
my gitconfig file
[user]
name = JiaJi Yin
email = yinjiaji110@gmail.com
[core]
quotepath = false
editor = "emacs -nw -q --load \"~/simple.emacs.d/init.el\""
texteditor = "emacs -nw -q --load \"~/simple.emacs.d/init.el\""
autocrlf = input
pager = tig
[diff]
@Fykec
Fykec / dic.py
Created November 25, 2013 04:27
一个小字典脚本,利用了mac程序本身的字典库
#!/usr/bin/python
import sys
from DictionaryServices import *
def main():
try:
searchword = sys.argv[1].decode('utf-8')
except IndexError:
errmsg = 'You did not enter any terms to look up in the Dictionary.'
@Fykec
Fykec / topTen.sh
Last active December 29, 2015 07:39 — forked from jamescarr/gist:5843247
Top 10 shell commands you currently use
LC_ALL='C' history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
@Fykec
Fykec / gist:8035507
Created December 19, 2013 07:13 — forked from carlj/gist:3782351
+ (UIImage*)imageNamedForDevice:(NSString*)name {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
if (([UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale) >= 1136.0f)
{
//Check if is there a path extension or not
if (name.pathExtension.length) {
name = [name stringByReplacingOccurrencesOfString: [NSString stringWithFormat:@".%@", name.pathExtension]
withString: [NSString stringWithFormat:@"-568h@2x.%@", name.pathExtension ] ];