Skip to content

Instantly share code, notes, and snippets.

View karimmtarek's full-sized avatar

Karim Tarek karimmtarek

View GitHub Profile
unbind C-b
set -g prefix C-s
# $Id: h-boetes.conf,v 1.2 2009-10-25 21:45:26 nicm Exp $
#
# From Han Boetes.
set -g default-command zsh
set -g status-right "#(uptime|awk '{print $11}') #(date)"
@karimmtarek
karimmtarek / Install_tmux
Created October 9, 2015 03:28 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@karimmtarek
karimmtarek / vimtutor summary
Last active August 29, 2015 14:22
vimtutor summary
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
# Hauleth's Rails app template
# Sass helpers and nicer views
gem 'autoprefixer-rails'
# Faster HTML escaping
gem 'escape_utils'
# Translations
gem 'r18n-rails'
@karimmtarek
karimmtarek / rails_interview_question.md
Last active August 29, 2015 14:18
Ruby on Rails interview questions

#Ruby on Rails Interview Questions

What is CSRF and how do you prevent it?
What are strong parameters introduced in Rails 4 and what is the reasoning behind the change?
Explain how you test your Rails app. Explain the various test levels available out of the box (controllers/integration/mailers/models).
What is a Rails engine?
What are different ways you could modularize a huge Rails app?
What code would you put in app/controllers/concern?
What does “keep your controllers thin and your models fat” mean?
How would you remove logic from your views?
When would you use a class vs instance variables in RoR ?
@karimmtarek
karimmtarek / ruby_interview_questions.md
Last active August 29, 2015 14:18
Interview_Questions_Ruby

#Ruby Interview Questions

What are blocks for?

Plain old english: Ways of grouping code we want to run. The simplest explanation for a block is that it is a chunk of code between {} or do...end, that can't be stored in a variable and isn't an object. A block is just part of the syntax of a method call. It doesn’t mean anything on a standalone basis and can only appear in argument lists.

What are the difference between p and puts?

The difference is subtle, but p prints the true value of an object, rather than a string-ified version of the object. This will make more sense soon, but for the sake of simplicity, we'll use the p command throughout the exercises, as we'll want to see the true values of our code returned to the output window.

### Install OpenJDK
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Download and Install ElasticSearch
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.1.deb
sudo dpkg -i elasticsearch-1.3.1.deb
ApplicationController.allow_forgery_protection = false
app.post('/whatever_my_user_model_is/sign_in', {"whatever_my_user_model_is"=>{"email"=>"users@email.com", "password"=>"users_password"}})
@karimmtarek
karimmtarek / todowiz curl syntax
Last active August 29, 2015 14:14
todowiz curl syntax
### Get lists
curl -X GET http://todowiz:3000/v1/lists -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"'
### Update lists
curl -X PUT http://todowiz:3000/v1/lists/5 -H 'Authorization: Token token="13da9ded671555ef5aaa"' -d "list[permission]=private"
### get header information
curl -X GET http://todowiz:3000/v1/lists -I
### Create new user