Skip to content

Instantly share code, notes, and snippets.

View usingbuild.md

Using the Build System

The following instructions are given using the command line. Equivalent steps can be carried out in many grahical tools, but are given in the command line format to cover all use cases.

Branching

This process describes the branching of a 1.10 branch, with development continuing on a 1.11 branch. Change the numbers as needed.

First, create a release branch:

View cibuild.md

Full CI integration for Git

Starting Configuration

Servers

  • Bitbucket: We shall use the URL http://BITBUCKET to refer to this server which shall have a project named http://BITBUCKET/projects/PROJECT_KEY/repos/REPOSITORY. This repo will have a folder containing the testing code named jenkins_scripts.
  • Jenkins: We shall use the URL http://JENKINS to refer to this server
View edukit1.py
# edukit1.py - A wrapper around RPi.GPIO setup to make CamJam EduKit 1 look nicer
# Copyright (C) 2017 Matthew Joyce matsjoyce@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
View reply.md

Well, evaluation of decorators does start at the last, but that is during definition time, not execution time. If you have the following code:

def decor_1(func):
    print("Decor 1")
    def wrap_1(*args, **kwargs):
        print("Wrap 1")
        return func(*args, **kwargs)
    return wrap_1
@matsjoyce
matsjoyce / files.py
Created Apr 2, 2015
Result of Override a “private” method in a python module
View files.py
# module.py
def _cmd(command, args):
# do something nasty
print(command, args)
def function_to_be_tested():
# do cool things
_cmd('rm', '-rf /')
return 1
@matsjoyce
matsjoyce / Optimiser.js
Last active Aug 29, 2015
Adjustments to Optimiser
View Optimiser.js
words = read("wordlist").split("\n")
keyboard = {
x: {},
y: ['q w e r t y u i o p', ' a s d f g h j k l', ' z x c v b n m'],
};
for (var i in keyboard.y)
for (var y of keyboard.y[i])
keyboard.x[y] = +i*4;
p = C => (x=keyboard.x[C],{x, y: keyboard.y[x/4].indexOf(C)})
You can’t perform that action at this time.