Skip to content

Instantly share code, notes, and snippets.

View hchouhan's full-sized avatar
💡
Thinking

Harish Chouhan hchouhan

💡
Thinking
View GitHub Profile
@hchouhan
hchouhan / mamp.md
Created October 26, 2015 21:25 — forked from jfloff/mamp.md
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@hchouhan
hchouhan / wp.css
Created February 17, 2016 10:34 — forked from ahmadawais/wp.css
WP: Default WordPress CSS Classes & IDs
/**
* Default Body Class Styles
*/
.rtl {}
.home {}
.blog {}
.archive {}
.date {}
.search {}
<?php
/*
Plugin Name: DBI Connection Fix
Author: Delicious Brains
Author URI: http://deliciousbrains.com
*/
function dbi_connection( $transports, $args, $url ) {
if ( false !== strpos( $url, 'deliciousbrains.com' ) ) {
// Use streams as cURL results in connection refused
return array( 'streams', 'curl' );
// Mark virtual orders as complete instead of processing
function rp4wp_virtual_order_payment_complete_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( 'processing' == $order_status && ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) {
$virtual_order = false;
if ( count( $order->get_items() ) > 0 ) {
@hchouhan
hchouhan / install-phpcs-with-homebrew.md
Created January 21, 2022 03:58 — forked from pbrocks/install-phpcs-with-homebrew.md
Install phpcs with Homebrew

Install phpcs with Homebrew

To set up php linting, you’ll want to install this PHP CodeSniffer repo and configure with this WordPress Coding Standards repo: . There are a number of ways to do this, whether direct download, Composer, Homebrew, Pear, etc. The following is what works for me on MacOS using Homebrew:

In a terminal window on your Mac, start by updating your Homebrew.

brew doctor

Then install the Code Sniffer: