Skip to content

Instantly share code, notes, and snippets.

View qa1's full-sized avatar
🎯
Focusing

qa1

🎯
Focusing
View GitHub Profile
@qa1
qa1 / clean_code.md
Created February 10, 2022 05:16 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@qa1
qa1 / laravel-voyager-admin-rtl.css
Created October 10, 2020 08:09 — forked from abdumu/laravel-voyager-admin-rtl.css
A custom css file to convert Laravel voyager admin panel to RTL
@import url(//fonts.googleapis.com/earlyaccess/notokufiarabic.css);
body{
direction: rtl;
font-family: 'Noto Kufi Arabic', sans-serif;
text-align:right;
}
h1, h2, h3, h4, h5, h6{
font-family: 'Noto Kufi Arabic', sans-serif;
@qa1
qa1 / goh-packet-sniff.go
Created September 27, 2020 12:49 — forked from arashrasoulzadeh/goh-packet-sniff.go
Go Packet Sniffer
package main
import (
"fmt"
"log"
"time"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
@qa1
qa1 / php.ini
Created July 11, 2020 06:37 — forked from mbpcoder/php.ini
Xdebug Configuration for php.ini
[xdebug]
zend_extension ="c:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_port=9000
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/xampp/tmp"
@qa1
qa1 / docker.md
Created July 11, 2020 06:36
Docker basic command

tipe: we can have a lot of containers base on an image

run a docker image. it download image if not present in local

sudo docker run hello-world 

list all docker images

sudo docker images
@qa1
qa1 / jalaali_utils.go
Created May 15, 2020 18:47 — forked from meysampg/jalaali_utils.go
Calculate some useful infornation on Jalali Calendar
// algorithms from php version of https://jdf.scr.ir/download/
package cal
import (
"log"
"strconv"
"strings"
"time"
"github.com/jalaali/go-jalaali"
@qa1
qa1 / backup.sh
Created May 5, 2020 11:03 — forked from ssbostan/backup.sh
Create a backup and Delete old backups
#!/bin/bash
tar -zcf /backups/backup-$(date +%Y%m%d).tar.gz --absolute-names /data
rm -f /backups/backup-$(date -d 'now - 7 days' +%Y%m%d).tar.gz
// delete all origin branch that deleted from origin and stay in your local
git fetch -p
// chekout to main brach to prevent delete it from local
git checkout master
// delete all local branch
git branch | xargs git branch -d
// delete all origin branch that don't deleted from origin and stay in your local
git branch | xargs git branch -D
// now you have master branch in local
@qa1
qa1 / install.sh
Last active March 9, 2020 05:36 — forked from insane-dev/install.sh
Lemp stack for Ubuntu 16.04 (PHP7, Nginx, MySql, MongoDB, PhpMyAdmin, Git, Node.js, Bower, Gulp, Docker, Composer(with asset plugin), Dnsmasq)
#!/bin/bash
echo "Please, enter your username, it will be added to 'sudo' and 'docker' groups during the process."
read USERNAME
if [ -z "$USERNAME" ] ; then
echo "Exiting... Done."
exit
else
echo "Adding user to 'sudo' group..."
@qa1
qa1 / persian-braille.json
Created November 14, 2018 09:54 — forked from ebraminio/persian-braille.json
Persian Braille
{
"آ": "⠜",
"ا": "⠁",
"ب": "⠃",
"پ": "⠏",
"ت": "⠞",
"ث": "⠹",
"ج": "⠚",
"ﭺ": "⠉",
"ح": "⠱",