Skip to content

Instantly share code, notes, and snippets.

View JaredCE's full-sized avatar

Jared Evans JaredCE

  • London, United Kingdom
View GitHub Profile
@JaredCE
JaredCE / Logger.js
Created July 11, 2018 19:07
I've been playing around with AOP in JavaScript to create a Logger that I can attach to classes and output what is going on (mainly instantiation, calling of functions and the results from functions). I've done this by creating a static class (static method in a class) that essentially is a factory that uses a proxy to trap the instantiation of …
class Logger {
static ClassHandler(eventEmitter, obj) {
const InstanceHandler = {
get(target, prop, receiver){
eventEmitter.publish(`${prop} called on ${target.constructor.name}`);
const orig = Reflect.get(target, prop, receiver);
if (typeof orig == "function" &&
prop !== 'Logger') {
return function (...args) {
eventEmitter.publish(`Method ${prop} called with ${JSON.stringify(args)}`);
import multiprocessing
import random
import string
class doThis:
def __init__(self):
print('init')
def get_array(self):
arr = [random.random() for _ in range(100)]
Dear <<MP Name>>
I am writing to you today with a serious question. It's not one that you would like me asking you in real life, it's not one you'd really enjoy anyone asking you and you might even blush if your partner asked you this question. It's a question that our goverment is intent on asking those of us who are over 18.
Do you watch pornography over the internet?
Of course, as your constituent, this is more a rhetoical question. It's not one that I feel needs answering, by you, or anyone else. But I am concerned that this question is going to be asked by our government, and it's not one that we should answer. We have come a long way in our society, that the pleasures and passions of the bedroom have become private and the government does not anymore prosecute or persecute those who have loving consensual relationships with other adult humans.
Whilst the above is obviously excellent, I believe the question about a persons porn viewing habits could lead back to a goverment that seeks to prosec