Skip to content

Instantly share code, notes, and snippets.

@kocoai
kocoai / gist:4327191
Last active July 11, 2019 12:24
vimrc #vim
"Ressource
"http://ensiwiki.ensimag.fr/index.php/Vimrc_minimal
"http://www.jeoffrey54.com/article126/mon-vimrc-explications#.Uiha4GSsi2x
"http://amix.dk/vim/vimrc.html
"http://stackoverflow.com/questions/164847/what-is-in-your-vimrc
execute pathogen#infect()
"Activer la coloration et l'indentation
syn on
set syntax=on
@kocoai
kocoai / gist:4327991
Last active July 11, 2019 12:25
generate xib strings file #xcode #ios
for FILE in "$@"
do
NAME=$FILE:r
ibtool --generate-strings-file $NAME.strings $NAME.xib
done
@kocoai
kocoai / gist:4336123
Last active July 11, 2019 12:25
#xcode gitignore #git
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#########################
@kocoai
kocoai / gist:4347234
Last active July 11, 2019 11:59
#xcode #searchreplace localized string
Search
(NSLocalizedString\(@"([^"]*)",)(@"([^"]*)")
Replace
\1nil
@kocoai
kocoai / gist:9a30968090aee6be71d8
Last active July 11, 2019 12:25
install zsh for mac #shell
#http://stackoverflow.com/questions/12032583/what-is-the-definitive-way-to-install-upgrade-set-the-default-version-of-zsh
#Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
brew doctor
#Install Zsh
brew install zsh
#Zshrc
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
@kocoai
kocoai / gist:002b2b54c06f0b94e4dc
Last active July 11, 2019 12:00
install rvm #shell #rvm
#Install RVM
\curl -L https://get.rvm.io | bash -s stable --ruby
#Intall Ruby
rvm list known
rvm install 2.0.0
rvm --default use 2.0.0
#Other way
rvm get stable --auto-dotfiles
@kocoai
kocoai / gist:f92948b840841b4077ae
Last active July 11, 2019 12:00
change files, folders permission #shell
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@kocoai
kocoai / gist:ed1020c03aa93fca0e29
Last active July 11, 2019 12:27
tcpblock log #security
tail -f -n 10 /var/log/system.log | grep --line-buffered tcpblock
@kocoai
kocoai / gist:0b37c8cd1e4d3664d81f
Last active July 11, 2019 12:01
copy paste in #shell
cat path/to/file | pbcopy
pbpaste > path/to/file
@kocoai
kocoai / gist:1984e8870c62e531ba63
Last active July 11, 2019 11:57
keyboard avoid #ios
- (void)registerForKeyboardNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWasShown:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillBeHidden:)
name:UIKeyboardWillHideNotification