Skip to content

Instantly share code, notes, and snippets.

@IslamAzab
IslamAzab / sublime-3-better_errors.md
Last active September 29, 2015 13:35 — forked from stevenpetryk/sb2-better_errors.md
Using Sublime Text 3 with better_errors on Ubuntu

Using better_errors on Ubuntu with SublimeText 3

After I installed the fantastic better_errors gem, I was disappointed to notice that linking to your text editor doesn't work correctly on Ubuntu (at least, it didn't for me). Here's how I fixed it.

First, create a new desktop entry:

# /usr/share/applications/subl-urlhandler.desktop
@IslamAzab
IslamAzab / net-http-debug.rb
Created October 20, 2015 11:16 — forked from ahoward/net-http-debug.rb
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
@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
@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 / 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):

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