Skip to content

Instantly share code, notes, and snippets.

View bonty's full-sized avatar

bonty bonty

  • TimeTree, Inc.
View GitHub Profile
@bonty
bonty / emacs.rb
Created September 23, 2012 12:25
Homebrew emacs24.2 formula
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'
option "cocoa", "Build a Cocoa version of emacs"
option "srgb", "Enable sRGB colors in the Cocoa version of emacs"
@bonty
bonty / private.xml
Created September 23, 2012 12:45
KeyRemap4MacBook my private.xml
<?xml version="1.0"?>
<root>
<list>
<item>
<name>My Emacs Mode</name>
<list>
<item>
<name>Control+D to Forward Delete</name>
<identifier>option.myemacsmode_controlD</identifier>
<not>EMACS, TERMINAL, VIRTUALMACHINE, REMOTEDESKTOPCONNECTION, X11, ECLIPSE, FIREFOX</not>
@bonty
bonty / ruby_rails_install.sh
Last active December 20, 2015 12:19
ruby-2.0.0-195 and rails 4.0 install script
#!/bin/sh
# ruby install
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install rbenv openssl readline ruby-build
brew link readline openssl --force
brew install curl-ca-bundle
cp /usr/local/Cellar/curl-ca-bundle/1.87/share/ca-bundle.crt /usr/local/etc/openssl/cert.pem
@bonty
bonty / disable_xcode_indexing.sh
Created August 6, 2013 11:11
XCode4のIndexingが重いのでdisableにする
defaults write com.apple.dt.XCode IDEIndexDisable 1
@bonty
bonty / show_hidden_files_finder.sh
Created August 6, 2013 11:12
Finderで隠しファイル・隠しフォルダを表示する
defaults write com.apple.finder AppleShowAllFiles -boolean true
@bonty
bonty / DisableNSLogOnReleaseBuild.h
Created August 6, 2013 11:13
ReleaseビルドでNSLog()を無効にする
#ifdef NS_BLOCK_ASSERTIONS
#ifndef NSLog
// NSLogを無効にする
#define NSLog( m, args... )
#endif
#else
#ifndef NSLog
@bonty
bonty / GetNSDictionaryInNSArray.mm
Created August 6, 2013 11:14
NSArrayの中から指定した要素のNSDictionaryを取得する
// name = 'hoge' の index を取得
NSUInteger idx = [[array valueForKey:@"name"] indexOfObject:@"hoge"];
NSDictionary *dic = [array objectAtIndex:idx];
@bonty
bonty / UIViewController+MyCategory.h
Last active December 20, 2015 16:48
Categoryで擬似インスタンス変数を設定する
#import <UIKit/UIKit.h>
@interface UIViewController (MyCategory)
@property (nonatomic, strong) NSNumber *myProperty;
@end
@bonty
bonty / LoadLocalHTML.m
Last active December 20, 2015 17:48
ローカルのhtmlファイルをUIWebViewでロードする
// in Resources Directory
NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"];
// in Documents Directory
NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:req];
@bonty
bonty / hack.sh
Created May 6, 2014 09:24 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#