Skip to content

Instantly share code, notes, and snippets.

@guehara
guehara / slackredirect_remove.js
Created Feb 16, 2018
Slack Redirect URL remove for Tampermonkey
View slackredirect_remove.js
// ==UserScript==
// @name Slack Direct Link
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*.slack.com/messages/*
// @grant none
// ==/UserScript==
@guehara
guehara / .zshrc
Last active Mar 13, 2017
.zshrc for macOS
View .zshrc
### zplug
source ~/.zplug/init.zsh
zplug 'zsh-users/zsh-completions'
zplug 'zsh-users/zaw'
zplug 'zsh-users/zsh-syntax-highlighting', defer:2
zplug check || zplug install
### cdr の設定 (zplug load 前に書かないと zaw-cdr がスキップされる)
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook is-at-least
if is-at-least 4.3.10; then
@guehara
guehara / Cask
Created Jan 15, 2015
Cask for Emacs
View Cask
(source gnu)
(source melpa)
(depends-on "auto-complete")
(depends-on "popup")
(depends-on "fuzzy")
(depends-on "auto-java-complete" :git "https://github.com/emacs-java/auto-java-complete.git")
(depends-on "ac-mozc" :git "https://github.com/igjit/ac-mozc.git")
(depends-on "helm")
@guehara
guehara / .tmux.conf
Created Dec 8, 2014
tmux.conf for OSX
View .tmux.conf
# prefix キー変更
set -g prefix C-t
unbind C-b
# キーストロークのディレイを減らす
set -sg escape-time 1
# | でペインを縦に分割する
bind | split-window -h
View build_mozc.py.diff
Index: build_mozc.py
===================================================================
--- build_mozc.py (revision 383)
+++ build_mozc.py (working copy)
@@ -213,6 +213,8 @@
# Include subdirectory of win32 and breakpad for Windows
if options.target_platform == 'Windows':
gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR))
+ elif options.target_platform == 'Mac':
+ gyp_file_names.extend(glob.glob('%s/unix/emacs/*.gyp' % SRC_DIR))
@guehara
guehara / emacs-24.4_build.sh
Last active Aug 29, 2015
Build Emacs 24.4 on Yosemite
View emacs-24.4_build.sh
#!bin/sh
#
# reference from http://masutaka.net/chalow/2014-10-25-1.html
#
cd ~/src/emacs
curl -LO http://ftp.gnu.org/pub/gnu/emacs/emacs-24.4.tar.xz
curl -LO ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-24.4-mac-5.0.tar.gz
tar Jxvf emacs-24.4.tar.xz
tar zxvf emacs-24.4-mac-5.0.tar.gz
@guehara
guehara / emacs-24.3-fix-directory-for-mavericks.diff
Created Dec 9, 2013
emacs 24.3 fix directory for Mavericks
View emacs-24.3-fix-directory-for-mavericks.diff
--- src/emacs.c.orig 2013-12-09 09:18:06.000000000 +0900
+++ src/emacs.c 2013-12-09 09:18:47.000000000 +0900
@@ -1158,6 +1158,11 @@
if (!noninteractive)
{
#ifdef NS_IMPL_COCOA
+ /* Started from GUI? */
+ /* FIXME: Do the right thing if getenv returns NULL, or if
+ chdir fails. */
+ if (! inhibit_window_system && ! isatty (0))
@guehara
guehara / helm-objc-headline.el
Created May 30, 2013
obj-c headline for helm
View helm-objc-headline.el
(defvar helm-c-source-objc-headline
'((name . "Objective-C Headline")
(headline "^[-+@]\\|^#pragma mark")))
(defun objc-headline ()
(interactive)
;; Set to 500 so it is displayed even if all methods are not narrowed down.
(let ((helm-candidate-number-limit 500))
(helm-other-buffer '(helm-c-source-objc-headline) "*ObjC Headline*")))
(global-set-key "\C-xp" 'objc-headline)
View Makefile
# -*- mode: makefile ; coding: utf-8-unix;
__ALL_SRC__ := $(wildcard *.zsh) .zshrc
TARGET :=$(__ALL_SRC__:%=%.zwc)
all: check $(TARGET)
check:
@chmod a-x $(__ALL_SRC__)
%.zwc: %
@guehara
guehara / static_analyze.sh
Created Mar 7, 2013
xcodebuild statis analyzer
View static_analyze.sh
#!/bin/sh
LATEST_VER=`xcodebuild -showsdks |sed -n -e 's/^.*sdk iphonesimulator\([0-9.]\{1,\}[^\n]\)$/\1/p'|sort|sed -n '$p'`
BUILD_CONFIG="Debug"
BUILD_OPTS="clean build"
OUTPUT_DIR="reports"
ANALYZE_OPTS="RUN_CLANG_STATIC_ANALYZER=YES CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR=${OUTPUT_DIR}"
if [ "$1" == ""]; then
exit