Skip to content

Instantly share code, notes, and snippets.

View PhouvanhKCSV's full-sized avatar
🌴
On vacation

Phouvanh KCSV PhouvanhKCSV

🌴
On vacation
View GitHub Profile
@PhouvanhKCSV
PhouvanhKCSV / webpack.mix.js
Created December 6, 2017 02:10 — forked from reinink/webpack.mix.js
Using Purgecss with Tailwind and Laravel Mix
let cssImport = require('postcss-import')
let cssNext = require('postcss-cssnext')
let glob = require('glob-all')
let mix = require('laravel-mix')
let purgeCss = require('purgecss-webpack-plugin')
let tailwind = require('tailwindcss')
mix.js('resources/assets/js/app.js', 'public/js')
.postCss('resources/assets/css/app.css', 'public/css/app.css', [
cssImport(),
@PhouvanhKCSV
PhouvanhKCSV / .php_cs
Created September 20, 2017 02:06 — forked from isuzuki/.php_cs
Config for PHP-CS-Fixer ver 2 (based on laravel .php_cs https://github.com/laravel/framework/blob/5.4/.php_cs)
<?php
/**
* Config for PHP-CS-Fixer ver2
*/
$rules = [
'@PSR2' => true,
// addtional rules
@PhouvanhKCSV
PhouvanhKCSV / php-oracle.md
Created September 6, 2017 08:48 — forked from odan/php-oracle.md
XAMPP - Oracle Driver Setup (v12)
@PhouvanhKCSV
PhouvanhKCSV / deprecated.md
Created August 15, 2017 04:28 — forked from Rarst/deprecated.md
WordPress coding standards configuration for PhpStorm

Now Native

PhpStorm now bundles WordPress coding style natively, starting from version 8.

  1. Go to Project Settings > Code Style > PHP.
  2. Select Set From... (top right of window) > Predefined Style > WordPress.

No longer need to muck with this import! :)

# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile

MAMP PRO 4 Trial Reset

A simple script that resets latest MAMP PRO 4 trial validity, and keeps your data safe.

How to use

  • Copy the code into a file OR download the script and save it as reset_mamp4.sh
  • Open the Terminal app and write chmod +x then drag and drop the file on the Terminal. You should have something like chmod +x reset_mamp4.sh. Press Enter to run it.
  • Now, run the file itself by dragging and dropping it on the Terminal (something like reset_mamp4.sh) then pressing Enter.
  • Open MAMP PRO and check if you have 14 days left now.

Didn't work?

@PhouvanhKCSV
PhouvanhKCSV / array_multi_unique.php
Created July 21, 2017 07:57 — forked from twysto/array_multi_unique.php
[PHP] array_unique in a multi-dimensional array
<?php
function array_multi_unique($array) {
$tmp_ComparisonArray = $final_Array = Array();
foreach($array as $key => $value) {
if(!in_array($value[0], $tmp_ComparisonArray)) {
$tmp_ComparisonArray[] = $value[0];
@PhouvanhKCSV
PhouvanhKCSV / gist:6496481fd274199a4c809ed2e1a4ac73
Created July 4, 2017 07:03 — forked from WillBrubaker/gist:0e66c7a53cfcfecb16bd
Change WooCommerce Subscriptions "Change Payment Method" text
add_filter( 'woocommerce_change_payment_button_text', 'wooninja_change_payment_button_text' );
function wooninja_change_payment_button_text() {
return 'MY BUTTON TEXT';
}
add_filter( 'woocommerce_my_account_my_subscriptions_actions', 'wooninja_filter_subscriptions_actions', 99 );
function wooninja_filter_subscriptions_actions( $actions ) {
foreach ( $actions as $key => $value ) {
@PhouvanhKCSV
PhouvanhKCSV / switch-subscription-link.php
Created July 4, 2017 06:59 — forked from thenbrent/switch-subscription-link.php
Output a link to switch a subscription for the current user.
function tattoo_submit() {
if (isset($_POST["addtattoo"])) {
$title = "Tattoo : ". $_POST["tatooInput"];
$my_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,