Skip to content

Instantly share code, notes, and snippets.

@ev3rywh3re
ev3rywh3re / php-code-inspection.md
Created March 22, 2020 14:41 — forked from hassanjamal/php-code-inspection.md
How to install PHP code inspection tools using homebrew-php and how to integrate with JetBrain's IntelliJ or PhpStorm

#Inspection Tools with homebrew-php#

##Prerequisites##

  • Homebrew is installed

##Step 1: Installing homebrew-php##

  1. brew tap homebrew/dupes
  2. brew tap josegonzalez/homebrew-php
  3. brew install PHP53 (or other version of your choice)
@ev3rywh3re
ev3rywh3re / mediavine-wp-engineer-preliminary-questions.md
Last active January 23, 2020 11:52 — forked from sethta/mediavine-wp-engineer-preliminary-questions.md
Mediavine WordPress Engineer Preliminary Questions

Instructions

  • Fork this gist.
  • Modify the code samples to complete the first 2 tasks.
  • Answer the remaining 2 questions.
  • Reply back to the email you were sent with the link to your completed gist by 5:00 pm EST on Wednesday, January 22.

  1. Given an API route for retrieving a specific record, do the following:
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@ev3rywh3re
ev3rywh3re / gist:9214179
Created February 25, 2014 17:52
OSX Mavericks force manually edited preferences update
/**
I still live in SVN land and move my svnX application preferecnes between workstations. OSX Mavericks 10.9.x makes this complicated since it uses a blind broken & bitter old man as a preference daemon. Sometimes you can get it drunk and this works.
*/
defaults read ~/this-is-my-new-pref-file.whatever
defaults read com.runnaway-app-and-old-daemon-hater (maybe)
# Rsync command to mirror, delete, with excludes over ssh on a weird port
rsync -avz --delete --exclude *backups --exclude ERROR_LOG* -e 'ssh -p 2222' [email protected]:/from-location/ [email protected]:~/tolocation/
@ev3rywh3re
ev3rywh3re / gist:5975886
Created July 11, 2013 14:22
OSX add user to wheel group using AD
sudo /usr/bin/dscl . -append /groups/wheel GroupMembership <USERNAME>
<?php
/**
* This little class records how long it takes each WordPress action or filter
* takes to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
@ev3rywh3re
ev3rywh3re / ye-olde-html-tag-function.php
Last active December 11, 2015 08:28
Ye Olde PHP HTML Tag Function
/**
* FNBX HTML Tag
*
* Core utility function for the writing and manipulation of HTML tags.
*
* @since 1.0
* @echo string
*/
if ( !function_exists( 'fnbx_html_tag' ) ) {
function fnbx_html_tag( $html = array() ) {
@ev3rywh3re
ev3rywh3re / gist:3875291
Last active October 11, 2015 14:48
OSX Stupid Stuff
-- (all?) So your Ruby Gems hate you because there is no gcc in the right place?
You've upgraded Xcode Right?
You've installed the Command Line Tools under Xcode > Preferences > Downloads right?
Did you lie, cheat, and steal by doing: ln -s /usr/bin/gcc /usr/bin/gcc-4.2? -- Who the hell wants to compile against a version specific compiler anyway?
-- (mavericks) So your git svn is broken, try fixing the perl linking.
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.16/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.16/SVN
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.16/darwin-thread-multi-2level/auto/SVN/ /System/Library/Perl/Extras/5.16/auto/SVN
@ev3rywh3re
ev3rywh3re / gist:2972875
Created June 22, 2012 13:57
SVN Cheat Sheet
// Change the editor to vi
export SVN_EDITOR=vi
// Invoke property editor to do things like ignore .sass-cache directories. You can the ignore options line by line.
svn propedit svn:ignore .