Skip to content

Instantly share code, notes, and snippets.

View LouisBurke's full-sized avatar

Louis Burke LouisBurke

View GitHub Profile
@justinsoliz
justinsoliz / lambda_kinesis_handler.js
Last active December 3, 2021 10:19
Terraform with lambda and kinesis
// applications/kinesis_streamer/lib/handler.js
import AWS from 'aws-sdk';
const kinesis = new AWS.Kinesis();
export function receiveEvent(event, context, callback) {
console.log('demoHandler');
console.log(`Event: ${JSON.stringify(event, null, 2)}`);
console.log(`Context: ${JSON.stringify(context, null, 2)}`);
const base64Data = event.Records[0].kinesis.data;
@redacted
redacted / Dangerous lazy object
Created January 29, 2015 11:31
Lazily initialise python object through horrible __getattr__ hacks
class State:
def __init__(self):
pass
def import_position(self):
self.position = {x: x * x for x in range(10)}
def __getattr__(self, s):
try:
return self.__getattribute__(s)