Skip to content

Instantly share code, notes, and snippets.

Rick Harding mitechie

Block or report user

Report or block mitechie

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
@mitechie
mitechie / cmr-demo.txt
Last active Aug 16, 2017
Cross model relations with K8 across regions and monitored on AWS
View cmr-demo.txt
# get the latest juju edge snap
sudo snap refresh --edge juju
juju (edge) 2.3-alpha1+develop-c8d3e6c from 'canonical' refreshed
PATH=/snap/bin:$PATH
# turn on the Cross Model Relation feature flag
export JUJU_DEV_FEATURE_FLAGS=cross-model
juju bootstrap aws/us-west-2 west-noc
juju bootstrap google/europe-west1 eu-west-workloads
View check-juju-version.py
#!/usr/bin/env python
### Loops through your controllers and outputs the model version for each
### model on each controller.
### JAAS NOTE: if you're not actively logged into JAAS the script will fail
### until you auth. Rerun after authenticating and it should work on the
### second go.
import json
from subprocess import check_output
@mitechie
mitechie / juju-db
Created Mar 2, 2017
juju-db connection script
View juju-db
#!/bin/sh
# Usage: juju-db
# Connect to the database holding the state of the current Juju controller.
set -e
while [ $# -ge 1 ]; do
key="$1"
case $key in
View bookie-macosx-setup.md

Bookie: setup a Mac OSX local dev environment

I succesfully managed to setup a local development environment for Bookie in my Mac OSX machine and I'd like to share a few notes. The required changes are just small details and I guess it would be easy to edit the Makefile in order to make it work with Mac OSX, but actually I'm not an expert on it...

System configuration

OS: Mac OSX 10.8.5
Xcode: 4.6.3

Steps

  1. Manually install system libraries
View .gitconfig
###
### QA a pull request branch on remote: juju
###
# Pull info on the specified pull request from the origin remote, not your
# github fork. The pull request is not on your fork.
fetch-pr = "!f() { git fetch $1 refs/pull/$2/head:refs/remotes/pr/$2; }; f"
# git qa-pr juju 6 qa-sticky-headers
@mitechie
mitechie / gist:6132350
Created Aug 1, 2013
This isn't run/tested but a general refactor. What = \ ?
View gist:6132350
from kivy.adapters.dictadapter import DictAdapter
from kivy.uix.gridlayout import GridLayout
from kivy.uix.listview import ListItemButton
from kivy.uix.listview import ListView
from fixtures import fruit_categories
from fixtures import fruit_data
from fruit_detail_view import FruitDetailView as DetailView
View pyramid-routes.py
@view_config(route_name='my-route')
def my_view(request):
# here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict?
if request.view_name = 'my-route2':
# do extra work
config.add_route('my-route', '/path-1/view')
config.add_route('my-route2', '/path-2/view')
@mitechie
mitechie / test_quality.py
Created Aug 23, 2012
@voidspace Code quality checks: unittest test cases that use pep 8 and pyflakes and fail if any errors are found
View test_quality.py
import os
import pep8
from collections import defaultdict
from cStringIO import StringIO
from unittest import TestCase
from mock import patch
from pyflakes.scripts.pyflakes import checkPath
@mitechie
mitechie / jerry_commits.txt
Created Apr 21, 2012
list of commits in jerry's branch that need to be processed into readability_lxml
View jerry_commits.txt
commit cec2d35c55cc8b94f0f6ff582cf700dab377af8a
Author: Jerry Charumilind <git@jcharum.fastmail.net>
Date: Tue Sep 13 10:38:13 2011 -0700
Increment version to 0.07dev
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit b646ea1ceacf66cc9d32baa432c08a3b5e7fc085
View gist:1476757

DataTable design overview

These are my early thoughts on how to structure DataTable in 3.5.0. Feedback is welcome in the comments. Test

Instantiable classes out of the box

new Y.DataTable({...});
new Y.DataTable.Base({...});
You can’t perform that action at this time.