Skip to content

Instantly share code, notes, and snippets.

View aghyad's full-sized avatar
🤖
Never give up

Aghyad Saleh aghyad

🤖
Never give up
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aghyad
aghyad / .tmux.conf
Last active August 29, 2015 13:58 — forked from emachnic/.tmux.conf
.tmux.conf from emachnic
set -g prefix C-a # Make C-a the prefix instead of default
bind C-a send-prefix # Send to application
unbind C-b # Unbind C-b
set -sg escape-time 1 # Remove delay for keystrokes
setw -g mode-keys vi # Use vi mode
### Mouse mode ###
setw -g mode-mouse on # Toggle mouse mode globally
set -g mouse-select-pane on # Select pane using mouse
@aghyad
aghyad / .tmux.conf
Created March 26, 2014 15:05
my .tmux.conf file
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
@aghyad
aghyad / .vimrc
Created March 26, 2014 15:04
.vimrc
" .vimrc
" load up pathogen and all bundles
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
set shiftwidth=2
set expandtab " use spaces, not tab characters
@aghyad
aghyad / chef_solo_bootstrap_ubuntu.sh
Last active January 3, 2016 07:09 — forked from ryanb/chef_solo_bootstrap.sh
chef_solo_bootstrap.sh for Ubuntu <forked from RyanB's Ubuntu>
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@aghyad
aghyad / chef_solo_bootstrap_centos.sh
Last active January 3, 2016 07:09 — forked from ryanb/chef_solo_bootstrap.sh
chef_solo_bootstrap.sh for Centos 6.5 <forked from RyanB's Ubuntu>
#!/usr/bin/env bash
sudo yum -y update && sudo yum -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev libyaml wget rubygems
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
sudo make
sudo make install
gem install chef ruby-shadow --no-ri --no-rdoc
@aghyad
aghyad / testing_rake_tasks.txt
Created December 20, 2013 17:32
My take on testing rake tasks
So you like to write some complicated tests plugged into your rake tasks. Or may be you think you're doing a crime not doing so. I understand. Nothing is wrong with that. But it's more like buying a helicopter so you can travel two blocks in Manhattan.
I'll explain:
1 - Rake tasks are not meant to be a complicated piece of your website. Instead, rake tasks are meant to be "thin" and only to invoke other modules in your system. Those modules do the heavy work. Those modules are what really matters. So, test the meaningful code and not the code that invokes it. Well, if you are still feeling unconfident about the invoking processes ... then:
2 - Trust rails and trust the whole framework. Don't bother testing whether this rake task is going to print something minor. It will work. Otherwise, you have a bigger issue that missing tests in the framework.
In summary: Focus your energy more on testing the functionality that this rake task is written to invoke, which is a class or a method some where else in your
@aghyad
aghyad / .vimrc-aghyad
Created December 19, 2013 22:54
My .vimrc content
" .vimrc
" load up pathogen and all bundles
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
set shiftwidth=2
set expandtab " use spaces, not tab characters
@aghyad
aghyad / haml_crash_course.txt
Last active December 28, 2016 08:54
Crash course in HAML
- is used where you would normally use <%
= is used where you would normally use <%=
% A percentage sign is HTML tags. Like: %h1 , %ul , %li
# A hash is the name of an id of a div tag. For example, #comment is for id="comment"
. A period is for the name of a class of a div tag. For example, .comment is for the class="comment"
@aghyad
aghyad / install_ruby2_without_rbenv_rvm.sh
Created December 4, 2013 20:59
Install ruby 2.0 without rbenv/rvm
Install ruby 2.0 without rbenv/rvm:
$ apt-get -y update
$ apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
$ cd /tmp
$ wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz ### <<< check for a newer version of ruby before executing this