Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Huck jasonhuck

View GitHub Profile
@jasonhuck
jasonhuck / examples.lasso
Created Jul 18, 2016
Lasso 8.x wrapper for Mailchimp API v3
View examples.lasso
[//lasso
library('mailchimp.lasso');
// create a new mailchimp instance
// NOTE: -verifypeer worked fine for me on Linux, but not Windows
var('mc') = mailchimp( -key='{YOUR_MAILCHIMP_API_KEY}', -version=3.0, -verifypeer=false);
// get all campaigns
$mc->get('/campaigns');
@jasonhuck
jasonhuck / encode_json.lasso
Created Jan 22, 2016
Optimized JSON encoder for Lasso 8.x
View encode_json.lasso
[//lasso
define_tag(
'json',
-namespace='_page_encode_',
-req='value',
-opt='options',
-description='Updated version of [encode_json] with speed improvements by James Harvard.',
-encodenone
);
local(
@jasonhuck
jasonhuck / image.lasso
Last active Feb 24, 2021
Replacement [image] Type for Lasso 8.x
View image.lasso
[//lasso
/*
[Image] type for Lasso 8.x
This is a drop-in replacement for the native [Image] type in Lasso 8.x. This version requires
[OS_Process] and calls the ImageMagick command line utilities rather than relying on the
low-level libraries. Doing so eliminates the need to install an older version of ImageMagick and
its dependencies on the server for compatibility. It is recommended that the ImageMagick module
be removed from LassoModules when using this replacement to avoid startup errors.
@jasonhuck
jasonhuck / Lasso PayPal Express Checkout
Created Nov 5, 2010
An example of how to use the PayPal NVP API in Lasso to perform an Express Checkout transaction.
View Lasso PayPal Express Checkout
--- Include this at the top of every page, e.g., [library('config.inc')]. ---
[//lasso
// include required tags
// (these could also be loaded via LassoStartup)
library('tags/dictionary.inc'); // http://tagswap.net/dictionary
library('tags/paypal_nvpapi.inc');
// create a new paypal object to work with
var('pp') = paypal_nvpapi(
-pwd='your-api-password',