Skip to content

Instantly share code, notes, and snippets.

View nataren's full-sized avatar

César López-Natarén nataren

View GitHub Profile
@patrickbrandt
patrickbrandt / python_aws_lambda_config.md
Last active November 6, 2022 10:14
A simple approach to multi-environment configurations for AWS Lambda functions

AWS recently released Versioning and Aliases for Lambda Functions. I'm going to outline how I've taken advantage of this to provide environmentally-aware Lambda function configurations in Python.

AWS Lambda doesn't currently support environment variables, so 12-factor-style configuration isn't an option. I'll be using seprate config files for each environment.

Pregame

We're making two assumptions for this article:

  • I've already created an AWS Lambda function with the following aliases:
    • Dev
    • Test
    • Staging
    • Production
@chrisdone
chrisdone / AnIntro.md
Last active March 24, 2024 21:13
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

@bjorg
bjorg / JDoc
Last active August 29, 2015 14:08
Concept for a JDoc implementation that is fluent and well-typed.
// ----------
// Definition
// ----------
class JDoc {
//--- Types ---
class ArrayBuilder<TOuter> {
//--- Methods ---
@sdether
sdether / gist:9532422
Created March 13, 2014 17:01
Easy immutable object derivation
public class Immutable {
public class Person {
public readonly string Firstname;
public readonly string Lastname;
public Person(string firstname, string lastname) {
Firstname = firstname;
Lastname = lastname;
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@MrBretticus
MrBretticus / gist:1923936
Created February 27, 2012 13:56
What I learnt, or my notes, from "In The Brain of Greg Young: CQRS and Event Sourcing - the Business Perspective"
Notes based on Greg Young's business perspective presentation
http://skillsmatter.com/podcast/agile-testing/greg-young-cqrs-event-sourcing-the-business-perspective
With a standard structural model we make assumptions of what the business may or may not want in the future. How can we presume to know what to track and what to discard.
CQRS/ES benefits:
* Captures behaviour explicitly, events carry the intent of users.
* We can derive any possible model about data that may be required.
* Allows domain experts and users to look at today in any way they may want to.
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';