Skip to content

Instantly share code, notes, and snippets.

View mohamm6d's full-sized avatar
🤗

Mohammad Hadizadeh mohamm6d

🤗
View GitHub Profile
@mohamm6d
mohamm6d / countries_code.json
Created February 3, 2020 13:36
JSON: Countries list with ISO two-letter codes
[{"Code": "AF", "Name": "Afghanistan"},{"Code": "AX", "Name": "\u00c5land Islands"},{"Code": "AL", "Name": "Albania"},{"Code": "DZ", "Name": "Algeria"},{"Code": "AS", "Name": "American Samoa"},{"Code": "AD", "Name": "Andorra"},{"Code": "AO", "Name": "Angola"},{"Code": "AI", "Name": "Anguilla"},{"Code": "AQ", "Name": "Antarctica"},{"Code": "AG", "Name": "Antigua and Barbuda"},{"Code": "AR", "Name": "Argentina"},{"Code": "AM", "Name": "Armenia"},{"Code": "AW", "Name": "Aruba"},{"Code": "AU", "Name": "Australia"},{"Code": "AT", "Name": "Austria"},{"Code": "AZ", "Name": "Azerbaijan"},{"Code": "BS", "Name": "Bahamas"},{"Code": "BH", "Name": "Bahrain"},{"Code": "BD", "Name": "Bangladesh"},{"Code": "BB", "Name": "Barbados"},{"Code": "BY", "Name": "Belarus"},{"Code": "BE", "Name": "Belgium"},{"Code": "BZ", "Name": "Belize"},{"Code": "BJ", "Name": "Benin"},{"Code": "BM", "Name": "Bermuda"},{"Code": "BT", "Name": "Bhutan"},{"Code": "BO", "Name": "Bolivia, Plurinational State of"},{"Code": "BQ", "Name": "Bonaire, Sint E
@mohamm6d
mohamm6d / laravel-storage-error
Last active March 20, 2020 08:19
Installing Laravel Commands
cp .env.example .env
php artisan key:generate
php artisan migrate
sudo chmod -R 777 storage
sudo chmod -R 777 bootstrap/cache
@mohamm6d
mohamm6d / post-receive
Created March 20, 2020 08:20
Sample of post-receive for Git repository
#!/bin/sh
echo "Starting deploying ..."
git --work-tree=/var/www/example.com/public_html --git-dir=git-server/example-com.git checkout -f
echo "Starting composer ... please wait"
composer install --working-dir=/var/www/example.com/public_html
echo "Composer done"
@mohamm6d
mohamm6d / linux-essential-commands
Last active March 20, 2020 08:23
Linux Essential Commands
#This is for when multiple packages are installed
sudo nano /etc/apt/sources.list
#Short open tag ubuntu
nano /etc/php.ini
#Install PHP extensions
sudo apt-get install php-mbstring php7.3-mbstring php-gettext libapache2-mod-php7.3
#!/bin/sh
#######################################
# Bash script to install an AMP stack and PHPMyAdmin plus tweaks. For Debian based systems.
# Written by @AamnahAkram from http://aamnah.com
# In case of any errors (e.g. MySQL) just re-run the script. Nothing will be re-installed except for the packages with errors.
#######################################
#COLORS
@mohamm6d
mohamm6d / uninstall Mysql Ubuntu
Created April 10, 2020 06:30
How to uninstall and re-install MySQL Ubuntu
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
sudo apt-get install mysql-server
@mohamm6d
mohamm6d / bash
Last active April 24, 2020 18:06
MYSQL Reset password ubuntu 20
sudo systemctl restart mysql
use mysql;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'username'@'localhost';
flush privileges;
@mohamm6d
mohamm6d / phpmyadmin_count_warning
Created April 28, 2020 09:08
Problem with phpMyAdmin and PHP. Warning in ./libraries/sql.lib.php#613 count()
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
#Press CTRL + W and search for (count($analyzed_sql_results['select_expr'] == 1)
#Replace it with ((count($analyzed_sql_results['select_expr']) == 1) and save the file
@mohamm6d
mohamm6d / shopify-tag-creator.php
Created August 19, 2020 11:24
This gist make tags for Shopify store based on variants
<?
require_once dirname(__FILE__) . '/vendor/autoload.php';
class ShopifySdk
{
public function __construct()
{
$this->username = '';
$this->password = '';
@mohamm6d
mohamm6d / campaign.html
Created April 11, 2021 15:41
Campaign container with cookie-based password
<!--- Starting april 2021 campaign container -->
<div id="campaign-container">
<img src="http://s.mmgo.io/t/CAm7" alt="motionmailapp.com" />
<div class="form-container">
Enter password for early-access to this campaign
<input type="password" placeholder="Enter password here" name="" id="campaign_password">
<button id="campaign_button">Let me in</button>
</div>
</div>
<style>