Skip to content

Instantly share code, notes, and snippets.

View Azzawie's full-sized avatar
keep it simple, stupid

Mustafa Azzawie Azzawie

keep it simple, stupid
View GitHub Profile
Azzawie / sidekiq.service
Created March 23, 2019 07:03 — forked from mkhuda/sidekiq.service
Sidekiq service auto start for Ubuntu 16.04 using Systemd
View sidekiq.service
# Sidekiq auto start using systemd unit file for Ubuntu 16.04
# Put this in /lib/systemd/system (Ubuntu).
# Run:
# 1. systemctl enable sidekiq (to enable sidekiq service)
# 2. systemctl {start,stop,restart} sidekiq (to start sidekiq service)
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
Azzawie / .bash_aliases
Created February 12, 2020 19:46 — forked from MyklClason/.bash_aliases
List of useful terminal bash aliases for Ruby On Rails, Cloud9, Git and more. What are bash aliases: What does && and ; do?
View .bash_aliases
# About Aliases:
alias ls='ls --color=auto -F'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias less="less -R "
Azzawie /
Created March 27, 2020 08:01 — forked from mrk-han/
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER


For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

Azzawie / auth.dart
Created April 2, 2020 04:28 — forked from nikhilmufc7/auth.dart
Firebase Flutter Platform Exception Codes and example
View auth.dart
// Error Codes for SignUp
ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled.
ERROR_WEAK_PASSWORD - If the password is not strong enough.
ERROR_INVALID_EMAIL` - If the email address is malformed.
ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account.
ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed.
// sending password reset email
ERROR_INVALID_EMAIL` - If the [email] address is malformed.
Azzawie / db_backup.rb
Created June 27, 2020 04:15 — forked from ahmadhasankhan/db_backup.rb
MySQL DB backup script in Ruby CMD
View db_backup.rb
#1===========First code================
#!/usr/bin/env ruby
databases = {
:local_db => {
:database => 'my_db',
:username => 'root',
:password => 'admin',
:host => 'localhost'
Azzawie / mysql.rake
Created June 27, 2020 04:19 — forked from dfl/mysql.rake
rails rake tasks for dumping and reloading mysql databases
View mysql.rake
# mysql db backup and restore for rails
# by David Lowenfels <> 4/2011
require 'yaml'
namespace :db do
def backup_prep
@directory = File.join(RAILS_ROOT, 'db', 'backup')
@db = YAML::load( File.join(RAILS_ROOT, 'config', 'database.yml') ) )[ RAILS_ENV ]
@db_params = "-u #{@db['username']} #{@db['database']}"
Azzawie /
Last active October 5, 2020 01:59
  1. Select which branch to deploy to
      alias deploy='deploy_webport_to_qa'
      function deploy_webport_to_qa {
        if [ "$BRANCH" = "" ]; then
          BRANCH=$(git branch --show-current)
          echo "No branch specified."
          echo "Using currently checked out: $BRANCH"

echo "Press enter to continue or ctl-c to quit"

Azzawie / QRCODE.MD
Last active October 6, 2020 14:19
  • How to generate a QR code with ruby script
require 'rqrcode'

# qrcode ="mailto:<>?query")
qrcode ="")

png = qrcode.as_png(
  bit_depth: 1,
 border_modules: 4,
Azzawie / rails http status codes
Created September 2, 2021 18:32 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View rails http status codes
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
Azzawie /
Created April 20, 2022 23:24 — forked from frane/
Traversing arrays and objects in CoffeeScript
# Traversing arrays and objects in CoffeeScript
# The array and object we use for testing
arr = [1, 2, 3, 4, 5]
obj = {a: 1, b: 2, c: 3, d: 4, e: 5}
# 'in' has a different meaning in CoffeeScript than in JavaScript
# CS: element in array -> JS: array.indexOf(element) >= 0
console.log '5 in arr: ' + (5 in arr)