Skip to content

Instantly share code, notes, and snippets.

View aphagon's full-sized avatar
:octocat:
Working from home

Aphagon aphagon

:octocat:
Working from home
View GitHub Profile
@aphagon
aphagon / functions.php
Created October 13, 2024 07:05
วิธีการเพิ่ม "Blog" slug ไว้ข้างหน้า Posts URL
<?php
/**
* อ่านบทความเพิ่มเติมได้ที่: https://coderblitz.com/blog/add-blog-slug-in-front-posts/
*
* Tip: หลังจากเพิ่มกฎ Rewrite แล้วอย่าลืมไปที่ Settings > Permalinks แล้วกด “Save Changes” เพื่อรีเฟรช Rewrite rules ด้วย
*/
/**
* Filter the post permalink to add 'blog/' slug in front of post slug.

Setting Up WordPress Coding Standards with VSCode

Install WordPress Coding Standards (WPCS)

First, make sure you have Composer installed in your system.

In order to use the WPCS you'll need the PHP_CodeSniffer (PHPCS) and the WPCS rules (sniffs) installed.

You can install PHP_CodeSniffer globally using Composer by running this command:

@aphagon
aphagon / cloudSettings
Last active October 1, 2022 18:29
VSCode Settings
{"lastUpload":"2022-10-01T18:29:55.383Z","extensionVersion":"v3.4.3"}
@aphagon
aphagon / TLMBot.js
Last active April 23, 2021 13:08 — forked from earthchie/TLMBot.js
/******************************\
!!! คำเตือน โปรดระวัง !!!
การใช้บอท มีความเสี่ยงที่จะถูกแบนได้
แนะนำให้สร้างบัญชีใหม่มาบอทโดยเฉพาะ
\******************************/
class TLMBot {
constructor(minWaitTime = 5000, maxWaitTime = 15000) {
this.minWaitTime = minWaitTime;
this.maxWaitTime = maxWaitTime;
@aphagon
aphagon / gutenberg.txt
Last active May 18, 2021 16:03
Wordpress Gutenberg Resources Tutorial
// Tutorial
https://gist.github.com/chrismccoy/de8231206acacfc635c2ff9a5415459c
// React Component
https://dev.to/martinkr/create-a-wordpress-s-gutenberg-block-with-all-react-lifecycle-methods-in-5-minutes-213p
https://melonpan.io/
https://github.com/WordPress/gutenberg-examples
https://github.com/zutigrm/user-info-box-gutenberg-block
https://github.com/UdiAzulay/ua-list-pages
@aphagon
aphagon / nginx.conf
Created January 13, 2021 14:25 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@aphagon
aphagon / eslint_prettier_airbnb.md
Created November 17, 2020 16:36 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node