Skip to content

Instantly share code, notes, and snippets.

View a-m-dev's full-sized avatar

Ahmad Mirzaei a-m-dev

View GitHub Profile
@a-m-dev
a-m-dev / git-pushing-multiple.rst
Last active February 17, 2019 06:04 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

convert() {
var numerals = {
persian : ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"],
arabic : ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]
};
function fromEnglish(str, lang){
var i, len = str.length, result = "";
for( i = 0; i < len; i++ )
# 01 php -v
if you saw the php version you can skip this step else you need to install it. for installing php you need to run `sudo apt install php`. and after that you need to run `sudo apt install hhvm`. this would take cuple minutes. to varify that you can type this command to check the version of that `php --version`
# 02 installing composer
for installing composer you need to run run this command `sudo apt install composer`. to varify that you can type this command to check the version of that `composer --version`
# 03 navigating to folder directory
type this command to go inside the htdocs directory: `cd /opt/lampp` inside that directory you have `htdocs` folder. navigate inside of that with this command `cd ./htdocs`
and then create a folder with this command: `mkdir tmp`. the `tmp` is the folder name. just after creating the folder you need to navigate inside that folder with this command: `cd tmp`
showResult = (result) => {
let node = document.createElement('DIV');
node.classList.add('custom-alert');
let textnode = document.createTextNode(result);
node.appendChild(textnode);
node.style.overflow = 'scroll';
node.style.position = 'fixed';
node.style.height = '5%';
node.style.width = '100%';
node.style.zIndex = '1000011111111';
# 01 create table
php artisan make:migration create_articles_table --create=articles
# 02 create fake data with seeder
php artisan make:seeder ArticlesTableSeeder
import requests
from bs4 import BeautifulSoup
response = requests.get('https://www.varzesh3.com').content
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
// 'css-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
localsConvention: 'camelCaseOnly',
@a-m-dev
a-m-dev / Docker
Last active November 12, 2019 06:37
docker build -t test_04 -f Dockerfile-CSR .
docker build --network host .
docker run -p 9000:80 --rm test_04
// -d for detached mode ( run in background )
docker run -d -p 9000:80 --rm test_04
@a-m-dev
a-m-dev / pre-commit
Last active February 3, 2020 08:26
git pre commit
#!/bin/bash
# colors
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
LIGHT_RED='\033[1;31m'
LIGHT_GREEN='\033[1;32m'
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:react/recommended"
],
"plugins": [
"react"
],