Skip to content

Instantly share code, notes, and snippets.

from pyramid.decorator import reify
from .principals import Principals as P
class AccessToken:
def __init__(self, type, user=None, claims=None):
self.type = type
self.user = user = claims or []
stevepiercy / .env
Created Aug 30, 2018 — forked from mmerickel/.env
Load secrets from .env files
View .env
stevepiercy / examples.lasso
Created Aug 2, 2016 — forked from jasonhuck/examples.lasso
Lasso 8.x wrapper for Mailchimp API v3
View examples.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
stevepiercy /
Last active Nov 7, 2017 — forked from vsajip/
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python -h"fo…
# Copyright (C) 2013 Vinay Sajip. New BSD License.
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
View oauth_lib.lasso
define oauth_consumer_key => 'key'
define oauth_consumer_secret => 'secret'
define oauth_request_token => 'requestkey'
define oauth_request_secret => 'requestsecret'
define oauth_access_token => 'accesskey'
define oauth_access_secret => 'accesssecret'
define oauth_realm => ''
define oauth_request_endpoint => {return ''}
define oauth_access_endpoint => ''
View jc_session.lasso
Lasso 9 type to handle cookie based sessions
Requires that Ke Carltons DS is installed
Before first use create the needed table and set the proper values for
View wrp.lasso
Quick way to grap a web_request param
2014-10-08 JC Added to Gist
2014-10-08 JC Added separate methods for queryparams and postparams
2014-08-24 JC Rewrite of the wrp method once again. This time with code suggested by Brad Lindsay in a lassotalk thread. Introduces the param -all
2014-08-22 JC Complete rewrite to produce leaner and more reliable code. Arrays are now returned as staticarrays
View patch_email_send.lasso
// [Email_Send2]
// This tag is a drop-in replacement for [Email_Send]. It uses [Email_Compose] on the back-end in order
// to create the message to be sent.
* Replaces subject line that is encoded word by word with a subject line that is encoded as a whole.
View Lasso_icalendar.lasso
2014-10-08 JC Added to Gist
Method to ensure that the given string complies to the icalendar requirements that no row inside an icalendar object is longer than 75 octets (bytes)
stevepiercy / readme.txt
Created Nov 20, 2011 — forked from paulherron/readme.txt
jQuery script to populate a specified input with a suggested slug. For example, if I write 'My Title' in a title field, it can populate the slug field with a suggestion of 'my_title'.
View readme.txt
Video demo at
By default it uses a title field ending in [title] or [name] as the source field, and a field ending in [slug] as the destination. This matches the naming conventions for a framework like CakePHP, i.e. <?php echo $form->input('title'); ?> outputs an input with a name of data[Model][title].
You can override the default source and destination fields by setting document.slugField and document.titleField in JavaScript beforehand:
document.titleField = "input[name$='[heading]']";
document.slugField = "input[name$='[url_safe_heading]']";