Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
localhost:3000

Ahmad Mirzaei a-m-dev

:electron:
localhost:3000
View GitHub Profile
View monitor.sh
#!/bin/bash
cvt -r 1920 1080
xrandr --newmode "1920x1080R" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
xrandr --addmode VGA-0 1920x1080R
View monitor.sh
#!/bin/bash
cvt -r 1920 1080
xrandr --newmode "1920x1080R" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync
xrandr --addmode VGA-0 1920x1080R
View react eslint configuration
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:react/recommended"
],
"plugins": [
"react"
],
@a-m-dev
a-m-dev / pre-commit
Last active Feb 3, 2020
git pre commit
View 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'
View Docker
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
View css module webpack config
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
// 'css-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
localsConvention: 'camelCaseOnly',
View v3_crawler
import requests
from bs4 import BeautifulSoup
response = requests.get('https://www.varzesh3.com').content
View laravel rest
# 01 create table
php artisan make:migration create_articles_table --create=articles
# 02 create fake data with seeder
php artisan make:seeder ArticlesTableSeeder
View append child react
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';
View laravel ubuntu set up
# 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`