Skip to content

Instantly share code, notes, and snippets.

View qa1's full-sized avatar
🎯
Focusing

qa1

🎯
Focusing
View GitHub Profile
#!/bin/bash
goversion=$1
[ -z "$goversion" ] && { echo "Please input go version. for example: 1.18"; exit 1;}
sudo apt-get remove golang-go &&
sudo apt-get remove --auto-remove golang-go &&
sudo rm -rvf /usr/local/go &&
wget https://go.dev/dl/go$goversion.linux-amd64.tar.gz &&
sudo tar -xvf go$goversion.linux-amd64.tar.gz &&
sudo mv go /usr/local
@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

#composer create-project --prefer-dist laravel/laravel blog
composer global require "laravel/installer=~1.1"
# ~/.composer/vendor/bin
laravel new projectName
composer require laravel/ui
php artisan ui vue --auth
php artisan migrate
npm install && npm run dev
> got install cannot find module 'semver' error
# sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo apt-get remove --purge mysql\*
sudo apt install mysql-server mysql-client
sudo mysql
> UNINSTALL COMPONENT "file://component_validate_password";
sudo phpenmod mbstring
sudo apt install php7.4 php7.4-fpm php7.4-mysql php7.4-cgi php7.4-cli php7.4-common
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
sudo mysql
> SELECT user,authentication_string,plugin,host FROM mysql.user;
> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
@qa1
qa1 / fish
Last active July 8, 2021 06:12
sudo apt upgrade &&
apt-get install fish -y &&
sudo add-apt-repository ppa:fish-shell/release-3
sudo apt-get update
sudo apt-get install fish
chsh -s /usr/bin/fish &&
curl -L https://get.oh-my.fish | fish &&
omf install shellder &&
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher &&
fisher install jethrokuan/z &&
git remote remove origin
git remote set-url origin new.git.url/here
composer create-project laravel/laravel example
cd example
composer require tcg/voyager
add to config/app providers : TCG\Voyager\VoyagerServiceProvider::class
edit config/database 'charset' => 'utf8','collation' => 'utf8_unicode_ci'
php artisan migrate
php artisan voyager:install --with-dummy
php artisan serve
go to localhost:8000/admin
git bisect is for finding bug in crowdy commit log.
git bisect start
git bisect good {$CommitHash}
git bisect good #automaticly go to next commit
git bisect bad
#!/bin/bash
# source : https://ops.tips/gists/measuring-http-response-times-curl/
# Set the `errexit` option to make sure that
# if one command fails, all the script execution
# will also fail (see `man bash` for more
# information on the options that you can set).
set -o errexit
@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;