Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevepiercy
stevepiercy / blowfish-demo.lasso
Created January 23, 2017 22:06
A failed attempt to demonstrate the knop_seed and blowfish_encrypt bug
<?lasso
// Demo of blowfish issue
define knop_seedbug => {
local('seed'= string( server_ip) + string( server_name) + response_localpath)
#seed -> removetrailing(response_filepath)
return #seed
}
define knop_blowfishbug => type {
@stevepiercy
stevepiercy / examples.lasso
Created August 2, 2016 06:36 — forked from jasonhuck/examples.lasso
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');
@stevepiercy
stevepiercy / routes.py
Last active February 28, 2016 21:52
refactor check for existing page from view to new_page_factory in authorization step
from pyramid.httpexceptions import (
HTTPNotFound,
HTTPFound,
)
from pyramid.security import (
Allow,
Everyone,
)
from .models import Page
@stevepiercy
stevepiercy / views-default.py
Last active February 28, 2016 20:36
if user requests to add_page that already exists, redirect to edit_page
import cgi
import re
from docutils.core import publish_parts
from pyramid.httpexceptions import HTTPFound
from pyramid.view import view_config
from ..models import Page
# regular expression used to find WikiWords
@stevepiercy
stevepiercy / hello.py
Created January 4, 2014 11:37
Hello Pyramid - A simple single-file web application using the Pyramid framework
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('<h1>Hello World!</h1>')
if __name__ == '__main__':
@stevepiercy
stevepiercy / database.inc
Created June 22, 2012 09:40
fix for clear record locks
if: (self -> 'lockfield') != '';
(self -> 'lockvalue')=(field: (self -> 'lockfield'));
(self -> 'lockvalue_encrypted')=(encrypt_blowfish: (field: (self -> 'lockfield')), -seed=(self -> 'lock_seed'));
/if;
@stevepiercy
stevepiercy / egit_install_guide.md
Created June 19, 2012 10:37
egit_install_guide.md

Still Testing EGit Installation Guide Trash Me!!!!

EGit is a plugin to use git within any Eclipse-based IDE, including Lasso Lab.

@stevepiercy
stevepiercy / git_install_guide.md
Created June 18, 2012 13:28
git_install_guide.md

How to install and set up git with GitHub

For information of how to install and set up git to work with GitHub, please visit the following link.

@stevepiercy
stevepiercy / readme.txt
Created November 20, 2011 03:09 — 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'.
Video demo at http://screencast.com/t/WcjpL2lc.
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:
<script>
document.titleField = "input[name$='[heading]']";
document.slugField = "input[name$='[url_safe_heading]']";
</script>
@stevepiercy
stevepiercy / index.html
Last active September 18, 2015 20:20
bootstrap-datepicker - After cloning https://github.com/eternicode/bootstrap-datepicker place index.html in the directory and load it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Datepicker for Bootstrap</title>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<link id="bs-css" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link id="bsdp-css" href="dist/css/bootstrap-datepicker3.min.css" rel="stylesheet">
</head>
<body>