Skip to content

Instantly share code, notes, and snippets.

View rezuankassim's full-sized avatar
🤡
Sometimes I don't know why it works

Rezuan Kassim rezuankassim

🤡
Sometimes I don't know why it works
View GitHub Profile
# Change to the project directory
cd /var/www/html/analytic
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
sudo git pull
@rezuankassim
rezuankassim / tailwind.config.js
Created September 18, 2020 09:29
tailwind config file heavily inspired by @jackmcdade
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
purge: [
'./storage/frameworks/views/*.php',
'./resources/views/**/*.blade.php'
],
theme: {
extend: {
colors: {
@rezuankassim
rezuankassim / .phpv.sh
Last active September 24, 2020 03:23
script to change php version easily using brew and valet
phpv() {
valet stop
brew unlink php@7.0
brew unlink php@7.2
brew unlink php
brew link --force --overwrite $1
brew services stop php@7.0
brew services stop php@7.2
brew services stop php
brew services start $1
<?php
use PhpCsFixer\Finder;
$finder = Finder::create()
->in([
__DIR__.'/app',
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/resources',
@rezuankassim
rezuankassim / deploy.sh
Last active August 9, 2021 03:59
PawnBroker deploy.sh
# Change to the project directory
cd /var/www/html/pawnbroker
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
sudo git pull
{
"emmet.triggerExpansionOnTab": true,
"editor.formatOnSave": false,
"editor.tabSize": 2,
}
In ERD shown that the table is for storing currencies when then currencies is not available in the database
To minimize the call for the currencies, I have just call `USD_MYR` and `USD_EURO` because and I can get the inverse of
the currency rate by ` 1 / currency_rate `. Therefore I would get the inverse by just using one free API from the
currency API.
When I have check the database do not have the currency that I need, I will call the API and store the rates with the inverse
of the rates into the database. Whenever user click calculate, I will check whether the database got the rates, if not will
call the API.