Skip to content

Instantly share code, notes, and snippets.

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

Sander sajoku

🏠
Working from home
View GitHub Profile
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
@sajoku
sajoku / tmux.md
Last active August 29, 2015 14:24 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

term = "Star Trek"
guessed_term = "**** ****"
puts "Welcome to the Hangman!"
puts "You are going to guess this movie: "
puts "**** ****"
puts ""
puts "Start with guessing letters, you have in total 3 attempts"
puts "At any times you can also guess the full term!"
puts "So let's start!"
@sajoku
sajoku / tmux.conf
Created May 18, 2016 09:10 — forked from atelic/tmux.conf
A vim-friendly tmux config
# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
@sajoku
sajoku / rvm2rbenv.txt
Last active May 23, 2016 17:52 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@sajoku
sajoku / siege_examples.sh
Created November 30, 2016 10:56 — forked from rob-murray/siege_examples.sh
Siege examples
# Basic example
siege -t60s -c20 -d10 'http://robertomurray.co.uk/'
# Basic auth;
$auth = echo -n 'username:password' | openssl base64
siege -t60s -c20 -d10 --header="Authorization:Basic $auth" 'https://staging.a-hostname.co.uk/'
@sajoku
sajoku / YouCompleteMe.md
Created April 15, 2017 18:35 — forked from lemonjp/YouCompleteMe.md
Install YouCompleteMe.vim

YouCompleteMe.vim Installation

Install YouCompleteMe on Ubuntu 16.04

sudo apt install vim-nox

sudo apt-get install build-essential cmake

sudo apt-get install python-dev python3-dev

Keybase proof

I hereby claim:

  • I am sajoku on github.
  • I am sajoku (https://keybase.io/sajoku) on keybase.
  • I have a public key whose fingerprint is 6910 D690 8077 3384 04FD 8507 F3B5 0E4C 16AB 1D45

To claim this, I am signing this object: