Skip to content

Instantly share code, notes, and snippets.

View phylaxis's full-sized avatar

Adam Christianson phylaxis

View GitHub Profile
@phylaxis
phylaxis / ext.bbm_ckbuttons.php
Created February 26, 2014 20:21
Add CKButton to Wygwam
<?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 / plugin.js
Last active August 29, 2015 13:56
Add CKButton JS code
/**
* 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 / sdgc-tribe-events.php
Last active August 29, 2015 14:00
SDGC Tribe Events Function
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) {
/* @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;
/*********************
COLORS
*********************/
$blue: #0a5785;
$light-blue: #88aabb;
$green: #00A459;
$orange: #cd6500;
$red: #b80024;
@phylaxis
phylaxis / subscibe_payment_details.sql
Created October 12, 2012 22:02
Get Payment Details
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
@phylaxis
phylaxis / print_r_dump.txt
Created November 21, 2012 02:18
print_r($this->EE->_mcp_reference)
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' => &
....
@phylaxis
phylaxis / gist:27ec7c98cb94f8d2caa3
Created February 9, 2016 08:05
Foundation Abide Form
<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 / currency_formatting.js
Created December 18, 2018 23:10
Currency Formatting
var amount = 12345.99;
//prepare number formatter
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
//Format the amount