Skip to content

Instantly share code, notes, and snippets.

View raimon49's full-sized avatar
🍺
lovecraftbeer

raimon raimon49

🍺
lovecraftbeer
View GitHub Profile
@raimon49
raimon49 / change_repo_to_github.sh
Created July 31, 2016 08:55
vvmコマンドのソースコード取得先をGitに変更
# インストール済みvvmの更新
$ cd ~/.vvm/repos/vvm
$ git pull origin master
# clone済みhgリポジトリを削除
$ cd ~/.vvm/repos
$ rm -rf vimorg
# git tagを指定してVimをビルド
$ vvm install vimorg--v7.4.2133 --with-features=big --enable-multibyte --without-x --disable-gui --enable-luainterp --with-lua-prefix=/usr
@raimon49
raimon49 / AppDelegate.m
Created May 26, 2015 13:02
Ignoring certificate errors with NSURLConnection
@implementation NSURLRequest(OOA)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host {
return YES;
}
@end
@raimon49
raimon49 / install_icdiff_at_home.sh
Created December 14, 2014 09:38
icdiffをGitのサブコマンドとして使えるよう自分のHOMEにインストール
$ curl 'https://raw.githubusercontent.com/jeffkaufman/icdiff/release-1.6.0/icdiff' -s -o ~/local/bin/icdiff
$ curl 'https://raw.githubusercontent.com/jeffkaufman/icdiff/release-1.6.0/git-icdiff' -s -o ~/local/bin/git-icdiff
$ chmod 755 ~/local/bin/icdiff
$ chmod 755 ~/local/bin/git-icdiff
@raimon49
raimon49 / install_jq_at_home.sh
Created December 14, 2014 09:21
jqのLinux 64bitバイナリを自分のHOMEにインストール
$ wget 'http://stedolan.github.io/jq/download/linux64/jq' -O ~/local/bin/jq
$ chmod 755 ~/local/bin/jq
$ jq --help
jq - commandline JSON processor [version 1.4]
Usage: jq [options] <jq filter> [file...]
For a description of the command line options and
how to write jq filters (and why you might want to)
@raimon49
raimon49 / echo_filetypes.vim
Created May 26, 2014 15:04
filetypeの一覧を出力
:echo join(map(split(globpath(&rtp, 'ftplugin/*.vim'), '\n'), 'fnamemodify(v:val, ":t:r")'), "\n")
@raimon49
raimon49 / install_tig_on_ubuntu.sh
Created May 2, 2014 11:40
Ubuntu Server 12.04 LTSにTig 最新版(2.0.1)を入れる
# 日本語用
$ sudo apt-get install libncursesw5-dev
# ソースコード取得
$ git clone https://github.com/jonas/tig.git
$ cd tig
$ git checkout -b my-build-2.0.1 tig-2.0.1
# ビルド, インストール
$ LDLIBS=-lncursesw CFLAGS=-I/usr/include/ncursesw make install prefix=$HOME/local
@raimon49
raimon49 / gist:9719585
Created March 23, 2014 06:40
checkoutしてる側でsubmoduleのリポジトリ変更に追従
# [submodule "module-name"] から対象のリポジトリエントリを削除
$ vim .git/config
# それまでcheckoutしていたリポジトリを削除
$ cd .git/modules
$ rm -rf module-name
# Dマークが付くが、無視して再度submoduleを初期化
$ git submodule update --init
@raimon49
raimon49 / install_guest_additions.sh
Last active August 29, 2015 13:57
Ubuntu Server 12.04 LTSにVirtualBoxのGuest Additionsを入れる
# [デバイス] -> [Guest AdditionsのCDイメージを挿入]
$ sudo mount /dev/dvd /mnt
$ sudo apt-get install xserver-xorg xserver-xorg-core
$ sudo sh /mnt/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.8 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.8 of VirtualBox Guest Additions...
Copying additional installer modules ...
@raimon49
raimon49 / migrate_from_ruby-2.0.0_to_ruby-2.1.1.sh
Created March 5, 2014 07:28
XREAサーバのruby-2.0.0からruby-2.1.1へ移行
# Rubyのインストール
$ wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.bz2
$ bunzip2 ruby-2.1.1.tar.bz2
$ tar xf ruby-2.1.1.tar
$ cd ruby-2.1.1
$ ./configure --prefix=$HOME/ruby-2.1.1 --disable-install-doc --disable-install-rdoc
$ make
$ make install
$ ~/ruby-2.1.1/bin/ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
@raimon49
raimon49 / gist:9031914
Last active August 29, 2015 13:56
Effective Objective-C 2.0メモ
// 読み出しを通常のブロック, 書き込みをバリアブロックとして並列キューで処理
_syncQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
- (NSString *)someString
{
__block NSString *localSomeString;
dispatch__sync(_syncQueue, ^{
localSomeString = _someString;
});
return localSomeString;