Skip to content

Instantly share code, notes, and snippets.

@michaelcurry
michaelcurry / rfc-template.md
Created September 29, 2016 18:07
RFC Template [Markdown]

RFC Template

Feature Name: (fill me in with a unique identity, myawesomefeature)

Type: (feature, enhancement)

Start Date: (fill me in with today's date, YYYY-MM-DD)

Author: (your names)

Verifying that +kernelcurry is my openname (Bitcoin username). https://onename.com/kernelcurry
@michaelcurry
michaelcurry / gist:90cf637f0f72118d8e8a
Created September 24, 2014 00:14
Change WordPress URL MySQL Query
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);

Keybase proof

I hereby claim:

  • I am michaelcurry on github.
  • I am michaelcurry (https://keybase.io/michaelcurry) on keybase.
  • I have a public key whose fingerprint is E0BC 49E5 0BA7 404D 4DB2 7246 1571 A4CD FC45 0C22

To claim this, I am signing this object:

@michaelcurry
michaelcurry / hello_dolly_oop.php
Last active January 3, 2017 03:28
This is an object-oriented sample Wordpress plugin. Blog Post: http://www.kernelcurry.com/blog/object-oriented-wordpress-plugin
<?php
/**
* @package Hello_Dolly_OOP
* @version 0.1
*/
/*
Plugin Name: Hello Dolly OOP
Plugin URI: http://kernelcurry.com/blog/object-oriented-wordpress-plugin
Description: This plugin is an object oriented version of Matt Mullenweg's Hello Dolly plugin.
Version: 0.1
@michaelcurry
michaelcurry / mirrorAttack.js
Last active December 28, 2015 22:59
Include to mirror a web page. jQuery not required. Happy trolling.
/*!
* Mirror Attack JS
* Twitter: @KernelCurry
* http://www.kernelcurry.com
* @link https://gist.github.com/michaelcurry/7576007
*
* Include to mirror a web page. jQuery not required. Happy trolling.
*
*/
@michaelcurry
michaelcurry / csv to array with key as header
Last active December 18, 2015 22:39
Simple CSV to array function. if Header == NULL then the first row will be the header.
/**
* @link https://gist.github.com/michaelcurry/5855818
*/
function csv_to_array($filename, $delimiter = ',', $header = NULL){
$array = array();
$rows = file($filename);
foreach($rows as $line) {
$tmp = str_getcsv($line, $delimiter);
if( ! $header ) {
$header = $tmp;
@michaelcurry
michaelcurry / jQuery Diagonal Grid Fill
Last active December 11, 2015 23:59
jQuery Diagonal Grid Fill Algorithm used to slide animations and menus. This code is NOT commented right now, but will be edited in the future.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<style>
body{
padding:0;
margin:0;
}
.screen{
width: 600px;