Skip to content

Instantly share code, notes, and snippets.

Steve Piercy stevepiercy

Block or report user

Report or block stevepiercy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View range_dates.js
/**
* Source:
* https://github.com/DataTables/Plugins/blob/master/filtering/row-based/range_dates.js
*
* Filter a column on a specific date range. Note that you will likely need
* to change the id's on the inputs and the columns in which the start and
* end date exist.
*
* @name Date range filter
* @summary Filter the table based on two dates in different columns
View access_token.py
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
self.claims = claims or []
@stevepiercy
stevepiercy / flash_message_queue.macro.jinja2
Created Sep 27, 2018
Examine all flash message queues, pop them, and display their messages with the correct Twitter Bootstrap alert
View flash_message_queue.macro.jinja2
{% macro render_flash(key, cls) %}
{% if request.session.peek_flash(key) %}
{% for msg in request.session.pop_flash(key) %}
<div class="alert alert-{{ cls }} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
{{ msg }}
</div>
{% endfor %}
{% endif %}
{% endmacro %}
@stevepiercy
stevepiercy / .env
Created Aug 30, 2018 — forked from mmerickel/.env
Load secrets from .env files
View .env
DEBUG=yes
AUTH_SECRET=seekrit
AUTH_EXPIRES=3600
HTTPS_ONLY=no
WEB_CONCURRENCY=4
TRUSTED_PROXY=127.0.0.1
BIND_HOST=127.0.0.1
@stevepiercy
stevepiercy / pyeugene-notes.txt
Created May 20, 2018
PyEugene - Setting up a Python development environment - 2018-05-21
View pyeugene-notes.txt
Slides
------
https://docs.google.com/presentation/d/1WS_nFfSn5MDf-Ic5ePLuCh_H7vdTaQTR0UyzFCgO8EY/edit?usp=sharing
Commands
--------
export ENV=${PWD}/env
echo $ENV
python3 -m venv $ENV
tree -C -L 3 env
View keybase.md

Keybase proof

I hereby claim:

  • I am stevepiercy on github.
  • I am stevepiercy (https://keybase.io/stevepiercy) on keybase.
  • I have a public key ASCv-Ovhh4WeStRPLAQ-c1arPPldiFooUprksXWE9E-wZQo

To claim this, I am signing this object:

View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sortable Demo</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
</head>
<body>
<!-- Simple List -->
@stevepiercy
stevepiercy / blowfish-demo.lasso
Created Jan 23, 2017
A failed attempt to demonstrate the knop_seed and blowfish_encrypt bug
View blowfish-demo.lasso
<?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 Aug 2, 2016 — forked from jasonhuck/examples.lasso
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');
@stevepiercy
stevepiercy / pyvenvex.py
Last active Nov 7, 2017 — forked from vsajip/pyvenvex.py
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 pyvenvex.py -h"fo…
View pyvenvex.py
#
# 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
You can’t perform that action at this time.