Skip to content

Instantly share code, notes, and snippets.


Maher El Gamil maherelgamil

View GitHub Profile
maherelgamil / getAllUrlParams.js
Created Feb 24, 2019
Getting a URL Parameter with javascript
View getAllUrlParams.js
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] :;
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
maherelgamil /
Created Feb 13, 2019 — forked from grenade/
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "" -f ~/.ssh/mozilla_rsa
maherelgamil / PowerShell
Created Feb 8, 2019 — forked from jchandra74/PowerShell
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization
View PowerShell

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

View git automatic tagging
# This script will be executed after commit in placed in .git/hooks/post-commit
# Semantic Versioning 2.0.0 guideline
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you make incompatible API changes,
# MINOR version when you add functionality in a backwards-compatible manner, and
# PATCH version when you make backwards-compatible bug fixes.
maherelgamil /
Last active Sep 3, 2018
[VPS install bash script for Ubuntu 16.04] #ubuntu #linux #server #vps
# =================== YOUR DATA ========================
maherelgamil /
Last active Sep 3, 2018
[Create nginx server block] #nginx #server #linux #ubuntu

Here’s what it does, in a nutshell:

  • Creates a new directory for the site (/var/www/DOMAIN.COM/public_html)
  • Creates a new directory for log files (/var/www/DOMAIN.COM/logs)
  • Sets correct owner/group.
  • Creates a simple index.html file to show the site is working.
  • Asks for restart.

To use the script type:

maherelgamil / slugify.js
Last active Sep 3, 2018 — forked from Omranic/slugify.js
[Slugify] Converts a string to a "URL-safe" slug. #javascript
View slugify.js
* Converts a string to a "URL-safe" slug.
* Allows for some customization with two optional parameters:
* @param {string} Delimiter used. If not specified, defaults to a dash "-"
* @param {array} Adds to the list of non-alphanumeric characters which
* will be converted to the delimiter. The default list includes:
* ['–', '—', '―', '~', '\\', '/', '|', '+', '\'', '‘', '’', ' ']
if (!String.prototype.slugify) {