Skip to content

Instantly share code, notes, and snippets.

View maherelgamil's full-sized avatar
😉

Maher El Gamil maherelgamil

😉
View GitHub Profile
@maherelgamil
maherelgamil / Google-Sheet-Form-Post.md
Created April 14, 2023 05:37 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.

Run example

You should be able to just open index.html in your browser and test locally.

@maherelgamil
maherelgamil / page-separator.css
Last active January 13, 2023 01:03
page separator with only html & css
.page-separator {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
line-height: 1em;
position: relative;
outline: 0;
border: 0;
color: #000;
text-align: center;
height: 1.5em;

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@maherelgamil
maherelgamil / timezones.json
Last active December 29, 2022 22:50
list of timezones as json file
{
"Africa/Abidjan": "(GMT+00:00) Abidjan",
"Africa/Accra": "(GMT+00:00) Accra",
"Africa/Addis_Ababa": "(GMT+03:00) Addis_Ababa",
"Africa/Algiers": "(GMT+01:00) Algiers",
"Africa/Asmara": "(GMT+03:00) Asmara",
"Africa/Bamako": "(GMT+00:00) Bamako",
"Africa/Bangui": "(GMT+01:00) Bangui",
"Africa/Banjul": "(GMT+00:00) Banjul",
"Africa/Bissau": "(GMT+00:00) Bissau",
@maherelgamil
maherelgamil / composer.sh
Created June 8, 2021 05:13
Install composer latest version on Ubuntu 20.04
#!/usr/bin/env bash
set -e
set -x
# Update server
sudo apt update
# Install some needed packages
sudo apt install php-cli unzip
@maherelgamil
maherelgamil / getAllUrlParams.js
Created February 24, 2019 09:45
Getting a URL Parameter with javascript
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
@maherelgamil
maherelgamil / generate-ssh-key.sh
Created February 13, 2019 18:27 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@maherelgamil
maherelgamil / PowerShell Customization.md
Created February 8, 2019 15:00 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

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.

#!/bin/sh
# 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
maherelgamil / Readme.md
Last active September 3, 2018 23:29
[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: