Skip to content

Instantly share code, notes, and snippets.

@nagro
nagro / array2table.js
Created April 22, 2018 13:01 — forked from mapsi/array2table.js
Convert JS array to HTML table
// build HTML table data from an array (one or two dimensional)
function generateTable(data) {
var html = '';
if (typeof (data[0]) === 'undefined') {
return null;
}
if (data[0].constructor === String) {
html += '<tr>\r\n';
@nagro
nagro / getcookiebyname.js
Created August 25, 2017 20:46 — forked from meandmax/getcookiebyname.js
get the cookie value by name if a cookie name exists.
/**
* get cookie by name without using a regular expression
*/
var getCookie = function(name) {
var getCookieValues = function(cookie) {
var cookieArray = cookie.split('=');
return cookieArray[1].trim();
};
var getCookieNames = function(cookie) {
@nagro
nagro / gist:3ea80ad50077de86d374032261492dbd
Created August 9, 2017 12:00 — forked from mikejolley/gist:1965933
WooCommerce payment gateway plugin base
<?php
/*
Plugin Name: WooCommerce <enter name> Gateway
Plugin URI: http://woothemes.com/woocommerce
Description: Extends WooCommerce with an <enter name> gateway.
Version: 1.0
Author: WooThemes
Author URI: http://woothemes.com/
Copyright: © 2009-2011 WooThemes.