Skip to content

Instantly share code, notes, and snippets.

klenwell klenwell

Block or report user

Report or block klenwell

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
@klenwell
klenwell / websphere.yml
Last active Dec 19, 2018
Ansible Playbook to Install WebSphere MQ on Debian Server
View websphere.yml
#
# This playbook assumes the WebSphere MQ file provided by IBM has already been
# downloaded to a specific directory (target.wd) on the server.
#
# ${target.wd} is a variable representing the working directory on the target
# server the MQ client will be installed.
#
# Note: Although this playbook is designed to be able to be run independently,
# it is in fact part of a longer playbook and therefore may have some other
# unexpected dependencies not reflected here.
View .rubocop.yml
# Based off: https://gist.github.com/jhass/a5ae80d87f18e53e7b56
AllCops:
Exclude:
- 'bin/**/*'
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- 'Guardfile'
- !ruby/regexp /old_and_unused\.rb$/
TargetRubyVersion: 2.5
@klenwell
klenwell / Flask-App-Engine-Integration-Test.md
Last active Feb 17, 2017
A simple integration test for Flask on the Google App Engine platform.
View Flask-App-Engine-Integration-Test.md

This test example is based on the Google App Engine docs and Flask docs.

To run test:

python tests/test.py ~/google-cloud-sdk/platform/google_appengine/

~/google-cloud-sdk/platform/google_appengine/ is the path to the App Engine SDK.

@klenwell
klenwell / redirect.php
Created Jan 4, 2017
WikkaWiki action to redirect a page.
View redirect.php
<?php
/**
* Redirect the user to another, existing, wiki page.
*
* Save to actions/redirect/redirect.php
*
* ACL for the page have precedence, therefore the user will not be redirected
* if he is not allowed to see the page. The redirect only occurs if the method is 'show'.
* Append 'redirect=no' as a param to the page URL to be not redirected.
*
@klenwell
klenwell / url_detector.py
Created Mar 10, 2016
Python script testing regular expressions to detect URLs in strings.
View url_detector.py
# -*- coding: utf-8 -*-
"""
URL Detection
I'm looking for a roughly accurate URL counter for spam detection in user-submitted content.
REFERENCES
http://daringfireball.net/2010/07/improved_regex_for_matching_urls
"""
import re
@klenwell
klenwell / dict_object.py
Created May 26, 2013
Converts Python dict to object so that d['some_key'] can be accessed at d.some_key
View dict_object.py
# -*- coding: utf-8 -*-
"""
DictObject
Converts dict to object
"""
from collections import defaultdict
class DictObject(defaultdict):
def __getattr__(self, key):
return self[key]
@klenwell
klenwell / action.class.php
Last active Dec 17, 2015
Wikkawiki Action Class: An abstract class that can be extended to create cleaner wikkawiki actions. For more information, see http://klenwell.com/is/WikkaBaseActionClass.
View action.class.php
<?php
/**
* Wikka Action Class
*
* An abstract class that can be extended for wikka action classes.
*
*
* @package Action
* @author Tom Atwell <klenwell@gmail.com>
* @copyright Copyright 2010, Tom Atwell <klenwell@gmail.com>
@klenwell
klenwell / stateful_model.py
Last active Dec 17, 2015
Stateful Model (2 files): stateful_model.py: a subclass of Google App Engine db.Model class that functions as a state machine. test_stateful_model.py: unit test for StatefulModel.
View stateful_model.py
# -*- coding: utf-8 -*-
"""
Google App Engine Stateful Model
Subclass App Engine db.Model class so that it may function as a flexible
state machine.
REFERENCES
http://blog.notdot.net/2010/04/Pre--and-post--put-hooks-for-Datastore-models
"""
@klenwell
klenwell / migrateDeprecatedLinks.php
Created Nov 20, 2015
WikkaWiki script to migrate links from deprecated whitespace-delimiter to new pipe-delimiter format.
View migrateDeprecatedLinks.php
@klenwell
klenwell / djia.py
Created Jun 25, 2015
Simple Scraper for Dow Jones Industrial Average
View djia.py
#
# Simple Scraper for Dow Jones Industrial Average
# With Python 3
#
# INSTALLATION (with pyenv)
# pyenv local 3.4.1
# pip install requests
# pip install beautifulsoup4
# pip install https://github.com/syabro/soupselect/archive/master.zip
#
You can’t perform that action at this time.