Skip to content

Instantly share code, notes, and snippets.

@vc27
vc27 / gist:7578c93312a4ae25c6dc
Last active August 29, 2015 14:11
_index_a_document
// http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_quickstart.html#_index_a_document
require_once( 'lib/initiate.php' );
$params = array();
$params['body'] = array('testField' => 'abc');
$params['index'] = 'properties';
$params['type'] = 'property';
$params['id'] = '1234567890';
@vc27
vc27 / Link Repo
Last active April 29, 2016 02:22
Links I want to check out, or want for later use
@vc27
vc27 / Code review.md
Last active November 17, 2015 16:16
Code Review

Intro

Below is the small sum of personal code I have been able to wrangle together in my off time. Unfortunatly 90% of the code I've written is behind the client wall and can only be viewed as a finished product. Many of the classes and functions below are updated sparingly as personal time permits.

Front end v.s. Back end (in bullets)

@vc27
vc27 / problem-activating-on-wordpress-site-in-subdirectory.md
Created September 18, 2015 20:44
example of - problem-activating-on-wordpress-site-in-subdirectory
@vc27
vc27 / hide_all_notices.php
Last active October 2, 2015 12:59
for those projects that have a bazillion plugin notices taking up 2x pagefold
/**
* hide_all_notices
* @since 1.2
**/
add_action( 'admin_head', 'hide_all_notices' );
function hide_all_notices() {
$user = wp_get_current_user();
if ( $user->user_login == 'randyhicks' ) { // get rid of the damn things!!!!
echo "<style>.notice, .error, .update-nag { display:none; }</style>";

OS

  • Version: 10.11
  • MacBook Pro (Retina, 13-inch, Mid 2014)
  • 2.6 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • Intel Iris 1536 MB

Recently

  • Updated to El Cap and CodeKit started to randomly quit
  • Use CleanMyMac to un-install CodeKit and then re-installed and activated registration
@vc27
vc27 / WP_API_Starter_WP
Last active April 13, 2016 18:04
Simple started class for the wp api, requires https://wordpress.org/plugins/rest-api/
<?php
/**
* @package WordPress
* @subpackage ProjectName
* @license GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Description:
**/
####################################################################################################
<?php
function is_palindrome( $word ) {
return $word === strrev( $word ) ? true : false;
}
function print_palindrome($word)
{