Skip to content

Instantly share code, notes, and snippets.

View zhiephie's full-sized avatar
:octocat:
Focusing

Yudi Purwanto zhiephie

:octocat:
Focusing
View GitHub Profile
@zhiephie
zhiephie / in.js
Last active August 16, 2023 05:08
Performance Increase using Dynamic SQL Generation
// Expand your date range to an array
const dates = [
'2023-08-01',
'2023-08-02',
'2023-08-03',
'2023-08-04'
]
// Define the static part of your query
let query = `SELECT hotelRoomId, MIN(price)
@zhiephie
zhiephie / AutoLogout.vue
Last active July 24, 2023 13:48
Vue Auto Logout for Laravel
<template>
<div v-if="warningZone">Are you still with us?</div>
</template>
<script>
export default {
name: 'AutoLogout',
data: function () {
return {
@zhiephie
zhiephie / laravel.md
Last active December 4, 2022 23:05
Laravel Cheat Sheet & Best Practices
@zhiephie
zhiephie / mysql_backup.sh
Created July 26, 2019 08:10 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am

Learning Plan for Design Patterns and Principles of Good Design

These learning resources primarily focus on programming using Good Design Principles and Design Patterns

  • There is an emphasis on learning using PHP, although most patterns are universal to every object orientated language.
@zhiephie
zhiephie / semantic-commit-messages.md
Created November 9, 2021 09:53 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@zhiephie
zhiephie / php-pools.md
Created September 5, 2022 16:14 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@zhiephie
zhiephie / apiCall.js
Last active August 25, 2022 06:55
Api Call using fecth
export function apiCall(route, body = {}, method = 'POST') {
const request = new Promise((resolve, reject) => {
const headers = new Headers({
'Content-Type': 'application/json',
});
const requestDetails = {
method,
mode: 'cors',
headers,
@zhiephie
zhiephie / mysql-docker.sh
Created August 1, 2022 02:56 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@zhiephie
zhiephie / Test Driven Laravel.md
Created February 15, 2022 11:03 — forked from Pen-y-Fan/Test Driven Laravel.md
Test Driven Laravel