Skip to content

Instantly share code, notes, and snippets.

View jay7793's full-sized avatar
🏠
Working from home

Jay Jay jay7793

🏠
Working from home
View GitHub Profile
@jay7793
jay7793 / functions.php
Last active April 3, 2021 00:12
Sample WooCommerce API Product Update (พี่เม่น)
<?php
ติดตั้ง Woocommerce php sdk โดยใช้คำสั่งด้านล่างนี้ (ใช้ Command ในการตัดตั้ง)
// composer require automattic/woocommerce
// Setup:
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
function wc_init() {
@jay7793
jay7793 / .eslintrc.js
Created October 10, 2018 09:18
ESLint config normal Vue.js application
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
@jay7793
jay7793 / .eslintrc.js
Created October 10, 2018 06:27
ESLint config normal front-end application
module.exports = {
env: {
node: true,
mocha: true
},
parserOptions: {
ecmaVersion: 8
},
// Standard JavaScript Style Guide
extends: ['standard', 'plugin:prettier/recommended'],
@jay7793
jay7793 / aes.java
Last active August 26, 2018 14:55
Java AES Encryption & Decryption
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.util.Arrays;
import javax.crypto.Cipher;
@jay7793
jay7793 / aes.php
Created August 26, 2018 14:44
Aes encryption PHP 7.0 with OpenSSL
/**
Aes encryption
*/
class AES {
protected $key;
protected $data;
protected $method;
/**
* Available OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING
@jay7793
jay7793 / Instruction.sh
Last active August 4, 2023 08:01
Install Laravel 5.6 With PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
sudo apt-get update
# Install nginx