Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Christianson phylaxis

View GitHub Profile
View currency_formatting.js
var amount = 12345.99;
//prepare number formatter
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
//Format the amount
View gist:27ec7c98cb94f8d2caa3
<form id="signupform" action="http://somesite.com/wp-login.php?action=register" method="post" data-abide="" novalidate="novalidate">
<div class="row form-row">
<div class="medium-6 columns">
<p class="error">
<label for="email">Email <strong>*</strong>
<input type="text" name="email" id="email" required="" pattern="email">
</label>
<small class="error">A valid email address is required.</small>
</p>
</div>
@phylaxis
phylaxis / sdgc-tribe-events.php
Last active Aug 29, 2015
SDGC Tribe Events Function
View sdgc-tribe-events.php
function sdgc_get_events($start=null,$end=null) {
global $post;
$current_date = isset($start) ? date('j M Y', $start) : date('j M Y', strtotime('-1 day'));
$end_date = isset($end) ? date('j M Y', $end) : date('j M Y', strtotime('+6 day'));
$get_posts = tribe_get_events(array('start_date'=>$current_date,'end_date'=>$end_date, 'eventDisplay'=>'upcoming', 'posts_per_page'=>5 ) );
printf('<table class="sdgc-events">');
printf('<tbody>');
foreach($get_posts as $post) {
@phylaxis
phylaxis / plugin.js
Last active Aug 29, 2015
Add CKButton JS code
View plugin.js
/**
* Basic sample plugin inserting current date and time into CKEditor editing area.
*
* Created out of the CKEditor Plugin SDK:
* http://docs.ckeditor.com/#!/guide/plugin_sdk_intro
*/
// Register the plugin within the editor.
CKEDITOR.plugins.add( 'tmo-addpage', {
@phylaxis
phylaxis / ext.bbm_ckbuttons.php
Created Feb 26, 2014
Add CKButton to Wygwam
View ext.bbm_ckbuttons.php
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Bbm_ckbuttons_ext
{
var $name = 'BBM CKButtons';
var $version = '1.0';
var $description = 'Adds custom TMO buttons to Wygwam CKEditor';
var $docs_url = 'http://backbeatmedia.com/';
var $settings_exist = 'n';
@phylaxis
phylaxis / print_r_dump.txt
Created Nov 21, 2012
print_r($this->EE->_mcp_reference)
View print_r_dump.txt
object(Tmo_payments_mcp)[424]
public 'version' => string '2.0.0' (length=5)
private '_base_url' => string 'artsys?S=24bc4a880ab8ce6a4dd458d7f893dc8ebc181c09&amp;D=cp&amp;C=addons_modules&amp;M=show_module_cp&amp;module=tmo_payments' (length=124)
private '_form_base' => string 'C=addons_modules&amp;M=show_module_cp&amp;module=tmo_payments' (length=61)
private 'EE' => &
....
View subscibe_payment_details.sql
SELECT subscriptions.subscription_id,
client_gateways.alias,
(CASE client_gateways.alias WHEN 'Authorize.net' THEN 'Credit Card'
WHEN 'PayPal Express Checkout' THEN 'Pay Pal'
ELSE '' END) as 'payment_type',
subscriptions.card_last_four,
subscriptions.amount,
IF (client_gateways.alias = 'Authorize.net' AND subscriptions.card_last_four != '',true,false) AS 'card_on_file'
FROM subscriptions
INNER JOIN customers ON subscriptions.customer_id = customers.customer_id
View gist:3643044
/*********************
COLORS
*********************/
$blue: #0a5785;
$light-blue: #88aabb;
$green: #00A459;
$orange: #cd6500;
$red: #b80024;
View gist:3626112
/* @include box-shadow(5px, 5px, 10px, #000); */
@mixin box-shadow($shadow-1,
$shadow-2: false, $shadow-3: false,
$shadow-4: false, $shadow-5: false,
$shadow-6: false, $shadow-7: false,
$shadow-8: false, $shadow-9: false) {
$full: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9);
-webkit-box-shadow: $full;
-moz-box-shadow: $full;
You can’t perform that action at this time.