Skip to content

Instantly share code, notes, and snippets.

Creating Rails Project

Initialization

# List available rubies, to choose which ruby to use
$ rvm list rubies

# To install new ruby use, for example version '2.4.1'
$ rvm install 2.4.1
@IslamAzab
IslamAzab / rtl support in gnome terminal.md
Last active August 17, 2022 20:52
How to enable Arabic support in GNOME terminal?
sudo apt-get install libfribidi0 libfribidi-dev

Download the appropriate package from here

vim /usr/share/applications/gnome-terminal.desktop

add this

Terminal=true

Exec=/usr/bin/bicon.bin

@IslamAzab
IslamAzab / http_server_auth.py
Created July 29, 2022 14:41 — forked from mauler/http_server_auth.py
Python3 http.server supporting basic HTTP Auth (username/password)
# Extended python -m http.serve with --username and --password parameters for
# basic auth, based on https://gist.github.com/fxsjy/5465353
from functools import partial
from http.server import SimpleHTTPRequestHandler, test
import base64
import os
class AuthHTTPRequestHandler(SimpleHTTPRequestHandler):
@IslamAzab
IslamAzab / test_schema_update_table.md
Last active July 31, 2019 19:38
when updating BigQuery table, schema changes are always shown

1- Create a new google_bigquery_table

Terraform will perform the following actions:

  # google_bigquery_dataset.test_us_bigquery_dataset will be created
  + resource "google_bigquery_dataset" "test_us_bigquery_dataset" {
      + creation_time      = (known after apply)
      + dataset_id         = "test_schema_update_dataset"
      + etag               = (known after apply)
@IslamAzab
IslamAzab / Key bindings..sublime-keymap
Last active March 19, 2017 09:57
Sublime Shortcuts
preferences -> key bindings user
[
{ "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+pageup"], "command": "next_view_in_stack" },
{
"draw_white_space": "all",
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
group :development do
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'better_errors'
gem 'binding_of_caller'
gem 'pry-byebug'
gem 'rack-mini-profiler'
gem 'thin'
gem 'marginalia'
gem 'pry-rails'
[user]
name =
email =
[color]
ui = true
[merge]
log = true
tool = meld
[alias]
st = status -s -uno
# remove all merged branches except "develop" branch
git branch -r --merged | grep -v master | grep -v '^ develop$' | sed 's/origin\///' | xargs -n 1 git push --delete origin
# to remove them
git branch -r --merged | grep -v master | grep -v '^ development$' | sed -e 's/origin\///' | xargs -n 1 git branch --delete
# track all remote branches locally
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
@IslamAzab
IslamAzab / imagemagick-install-steps.bash
Last active December 9, 2015 15:54 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
sudo apt-get install libperl-dev gcc libjpeg-dev libbz2-dev libtiff4-dev libwmf-dev libz-dev libpng12-dev libx11-dev libxt-dev libxext-dev libxml2-dev libfreetype6-dev liblcms1-dev libexif-dev perl libjasper-dev libltdl3-dev graphviz pkg-config
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz
cd ImageMagick-6.9.2-8/
./configure --prefix=/opt/imagemagick-6.9
make
make install