Skip to content

Instantly share code, notes, and snippets.

View yukihr's full-sized avatar
🏠
Working from home

yukihiro hara yukihr

🏠
Working from home
View GitHub Profile
@yukihr
yukihr / gist:5560729
Created May 11, 2013 17:32
Install gnu global with exuberant-ctags parser extension.
$ brew install global --with-exuberant-ctags
$ brew link --overwrite ctags #remove ctags not exuberant
;; 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
@yukihr
yukihr / emacs.rb
Created August 17, 2012 16:33 — forked from sharl/emacs.rb
Yet Another Emacs 24.2 Homebrew Formula (fullscreen+IME inline)
require 'formula'
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftpmirror.gnu.org/emacs/emacs-24.2.tar.bz2'
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.bz2'
sha1 '38e8fbc9573b70a123358b155cf55c274b5a56cf'
if ARGV.include? "--use-git-head"
head 'http://git.sv.gnu.org/r/emacs.git'
@yukihr
yukihr / emacs.rb
Created August 15, 2012 13:37 — forked from rfkm/emacs.rb
Emacs24.1 Formula with inline-patch(+fix)
require 'formula'
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.1.tar.gz'
md5 '97b78dece2b4fd617dfab26b7db2d4bc'
depends_on "autoconf" => :build
if ARGV.include? "--use-git-head"
@yukihr
yukihr / gist:2701180
Created May 15, 2012 11:55
Emacs evil visual line move with j,k
(define-key 'evil-motion-state-map "j" evil-next-visual-line)
(define-key 'evil-motion-state-map "k" evil-previous-visual-line)
@yukihr
yukihr / walk.coffee
Created May 3, 2012 13:48
Walk JSON
walk = (obj, fn, map = 'root') -> #fn(map, leaf)
if obj instanceof Array
for o in obj
walk o, fn, map + "[#{_i}]"
else if typeof obj is 'object'
for key of obj
walk obj[key], fn, map + ".#{key}"
else
fn map, obj
@yukihr
yukihr / init.el
Created March 2, 2012 09:00
Set path correctly even when Emacs has opened from desktop entry.
;; When opened from Desktep entry, PATH won't be set to shell's value.
(let ((path-str
(replace-regexp-in-string
"\n+$" "" (shell-command-to-string "echo $PATH"))))
(setenv "PATH" path-str)
(setq exec-path (nconc (split-string path-str ":") exec-path)))
@yukihr
yukihr / gist:1950055
Created March 1, 2012 14:10
同期的にシェルコマンドを実行して出力を返す elisp 関数
(defun exec-shell-command-sync (command &rest args)
(let (ret
(process
(apply 'start-process-shell-command "exec" nil command args)))
(set-process-filter
process
'(lambda (process output)
(setq ret (cons output ret))
))
(while (not (equalp (process-status process) 'exit))
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(https://www.google.co.jp/reader),
url-prefix(https://www.google.com/reader) {
#gb:not(:hover),
#gb:not(:hover) > * {
max-height: 5px !important;
}
@yukihr
yukihr / gist:1327332
Created October 31, 2011 11:47
Easy userAgent Access
var UA = (function(ua) {
var browsers = {
// Capture: Major#, #2, #3, #4, alphaBeta, alphaBeta#
ie: /InternetExplorer/
, fx: /firefox\/(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:\.(\d+))?(?:(a|b)(\d*))?/i
, cr: /Chrome/
, sf: /Safari/
, op: /Opera/
}, key, ret, obj = {};