Skip to content

Instantly share code, notes, and snippets.

function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready(function () {
let typeformButton = document.getElementsByClassName('typeform-share button')[0];
@PatrickKennedy
PatrickKennedy / base.html
Created January 12, 2018 01:07
Example jinja style base template
<!DOCTYPE html>
<html>
<head>
{% block meta_tags %}{% endblock %}
<title>
{% block title %}Hello, World{% endblock %}
</title>
{% block stylesheets %}{% endblock %}
{% block javascript_head %}{% endblock %}
{% block extra_head %}{% endblock %}
@PatrickKennedy
PatrickKennedy / docker-guide.md
Last active July 18, 2017 21:06
A quick reference to Docker

The Basics

There are a ton of great resources for Docker, so with that in mind this document will aim to serve as a collection of the best resources, and a practical guide to using Docker.

For any OS specific resources this introduction will focus on Docker for Windows as it's the recommended way of using Docker on Windows, but much of the information here and across the Docker docs is applicable across all platforms.

What is Docker?

Docker is a standard and set of tools that facilitates a Build Once, Run Anywhere methodology of interacting with applications.

const events = require('events');
const purgeCache = require('./util/purgeCache')
const path = require('path');
console.log("Test Space Running");
class BasePlugin {
/**
* @param {String} name - The name of the plugin, must match module name
Python:
# both eat() and clean_up() only run if breakfast_food == "bacon"
if breakfast_food == "bacon":
eat()
clean_up()
# clean_up() always runs in this instance
if breakfast_food == "bacon":
eat()
clean_up()
### Keybase proof
I hereby claim:
* I am PatrickKennedy on github.
* I am dysiode (https://keybase.io/dysiode) on keybase.
* I have a public key whose fingerprint is 6D2D 4E9D FDEA 43E8 DDFA F97C 9A42 BB4E EEC2 78C0
To claim this, I am signing this object:
var sci = ko.views.manager.currentView.scimoz;
// If there's no block our cursor moves so we need to remember where it starts.
var curLine = sci.lineFromPosition(sci.currentPos);
ko.commands.doCommand("cmd_blockSelect");
if (sci.selText == sci.text) {
// We have just a single line selected
sci.gotoLine(curLine);
sci.vCHome();
sci.lineEndExtend();
var line = sci.selText;
#!/usr/bin/env python
#
def check(*tests):
print combine_results([report_result(test) for test in tests])
def report_result(test, globals={}, locals={}):
result = eval(test, globals, locals)
print "%s ... %s" % ("pass" if result else "FAIL", test)
return result
#!/usr/bin/env python
#
# PyGab - Python Jabber Framework
# Copyright (c) 2008, Patrick Kennedy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#