Skip to content

Instantly share code, notes, and snippets.

@pmkay
pmkay / _ide_helper.php
Created January 31, 2017 03:38 — forked from barryvdh/_ide_helper.php
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.1.40 (LTS) on 2016-07-18.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@pmkay
pmkay / Install-php7.md
Created July 30, 2017 17:27 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@pmkay
pmkay / rbenv-howto.md
Created November 9, 2017 20:07 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@pmkay
pmkay / auto-coupon-woo.php
Created November 21, 2017 21:41 — forked from jwebcat/auto-coupon-woo.php
Automatically apply coupon to cart WooCommerce
add_action( 'woocommerce_before_cart', 'apply_matched_coupons' );
function apply_matched_coupons() {
global $woocommerce;
$get1 = 'getonech'; // your coupon code here
$get2 = 'gettwoch'; // your coupon code here
$get3 = 'getthreech'; // your coupon code here
$get4 = 'getfourch'; // your coupon code here
$get5 = 'getfivech'; // your coupon code here
@pmkay
pmkay / woocommerce-custom-thank-you-page-redirect.php
Created April 18, 2018 19:20 — forked from vishalck/woocommerce-custom-thank-you-page-redirect.php
Redirect to Custom Thank You page in WooCommerce
<?php
add_action( 'template_redirect', 'woo_custom_redirect_after_purchase' );
function woo_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && !empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'http://localhost:8888/woocommerce/custom-thank-you/' );
exit;
}
}
@pmkay
pmkay / woocommerce-custom-thank-you-page-redirect.php
Created April 18, 2018 19:20 — forked from vishalck/woocommerce-custom-thank-you-page-redirect.php
Redirect to Custom Thank You page in WooCommerce
<?php
add_action( 'template_redirect', 'woo_custom_redirect_after_purchase' );
function woo_custom_redirect_after_purchase() {
global $wp;
if ( is_checkout() && !empty( $wp->query_vars['order-received'] ) ) {
wp_redirect( 'http://localhost:8888/woocommerce/custom-thank-you/' );
exit;
}
}
@pmkay
pmkay / README.md
Created May 17, 2018 20:24 — forked from Alymosul/README.md
Downgrade PHP 7.2 to 7.1 on Laravel Forge

Install php7.1 related stuff..

apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages \
php7.1-cli php7.1-dev \
php7.1-pgsql php7.1-sqlite3 php7.1-gd \
php7.1-curl php7.1-memcached \
php7.1-imap php7.1-mysql php7.1-mbstring \
php7.1-xml php7.1-zip php7.1-bcmath php7.1-soap \
php7.1-intl php7.1-readline php-xdebug php-pear php7.1-fpm
@pmkay
pmkay / top-brew-packages.txt
Last active June 27, 2024 12:16 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles
@pmkay
pmkay / gist:5bdb43223ecd4de5e134bf4d3c10a515
Created June 25, 2018 23:21 — forked from asugai/gist:8408561d5134cf090f78
enable gzip / compression on an Amazon AMI EC2 instance via .htaccess
# Mixings from:
# https://www.clayharmon.com/words/posts/enabling-gzip-compression-on-ec2
# http://www.samaxes.com/2008/04/htaccess-gzip-and-cache-your-site-for-faster-loading-and-bandwidth-saving/
# http://www.tonmoygoswami.com/2013/05/how-to-enable-gzip-on-amazon-elastic.html
# ------------------------------------------------------------------------------
# | Compression |
# ------------------------------------------------------------------------------
<IfModule mod_deflate.c>
@pmkay
pmkay / Example_of_use.vue
Created July 19, 2018 23:00 — forked from wilcorrea/Example_of_use.vue
Vue component wrapper around parallax-js
<template>
(...)
<parallax-scene :scalar-x="25" :scalar-y="15">
<parallax-layer :depth="0.00">
<img src="~assets/parallax/0_sun.png" style="position: relative; top: -4px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.33">
<img src="~assets/parallax/1_mountains.png" style="position: relative; top: 40px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.67">