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 / 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

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)

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 / Designing Event-Driven Systems links.md
Created January 26, 2022 04:56 — forked from giampaolotrapasso/Designing Event-Driven Systems links.md
List of links from Designing Event-Driven Systems by Ben Stopford
@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 / APIs in Laravel Using TDD.md
Created August 25, 2021 04:57 — forked from Pen-y-Fan/APIs in Laravel Using TDD.md
Notes from Youtube series APIs in Laravel Using TDD