Skip to content

Instantly share code, notes, and snippets.

@jasonhuck
jasonhuck / examples.lasso
Created July 18, 2016 18:17
Lasso 8.x wrapper for Mailchimp API v3
[//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 January 22, 2016 13:56
Optimized JSON encoder for Lasso 8.x
[//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 February 24, 2021 13:38
Replacement [image] Type for Lasso 8.x
[//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 November 5, 2010 10:13
An example of how to use the PayPal NVP API in Lasso to perform an Express Checkout transaction.
--- 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',