Skip to content

Instantly share code, notes, and snippets.

View AndrewM2M's full-sized avatar

Andrew White AndrewM2M

  • Message2Medium
  • Toronto, ON Canada
View GitHub Profile
@AndrewM2M
AndrewM2M / csv-to-json.js
Created January 22, 2019 20:31 — forked from jssuttles/csv-to-json.js
CSV to JSON Conversion in JavaScript
//var csv is the CSV contents with headers
function csvJSON(csv){
var lines=csv.split('\n');
var result = [];
var headers=lines[0].split(',');
lines.splice(0, 1);
lines.forEach(function(line) {
@AndrewM2M
AndrewM2M / custom-template-plugin.php
Created August 28, 2017 22:08 — forked from ashokmhrj/custom-template-plugin.php
Get Template Part From plugin directory
<?php
/**
* The below function will help to load template file from plugin directory of wordpress
* Extracted from : http://wordpress.stackexchange.com/questions/94343/get-template-part-from-plugin
*/
define('PLUGIN_DIR_PATH','Your-plugin-directory-path');
function ccm_get_template_part($slug, $name = null) {
do_action("ccm_get_template_part_{$slug}", $slug, $name);