Skip to content

Instantly share code, notes, and snippets.

View jneves's full-sized avatar

João Miguel Neves jneves

View GitHub Profile

Snack shack

Hello, the competitive world of software engineering has gotten to me and I have decided to enter the world of fast food!

I am making quick snacks but I would like a program to help organise people's orders and what I should be doing.

Version 1 - Sandwiches

I can make a sandwich in one minute and then I need 30 seconds to serve the sandwich and take money from the customer.

Keybase proof

I hereby claim:

  • I am jneves on github.
  • I am jneves (https://keybase.io/jneves) on keybase.
  • I have a public key ASAb9RlAEoV6hbXDgJvyFZ6TVqrqD_CDYTNzejTPaQVa4Ao

To claim this, I am signing this object:

Requirements for package management:

  • I want to have 3 sets of packages: development, test and production.
  • The production set must be a subset of the test set, which must be a subset of the development set.
  • At least initially development and test can be the exact same set.
  • Production set must be as small as possible (target is lambda functions).
  • Production set must not have any dependencies that are only needed for development or tests, so it reduces the attack surface.
  • While the production set must not have development/test dependencies, these dependencies might have an impact (if a test package is only compatible with a specific version of a package that's the only version that is testable, so that should be the one in production).

I'm looking for tools that either do this or could be part of a process that does this.

"""Usage: in your zappa_settings.json file, add the following (assuming this is handler.py and is next to zappa_setttings.json):
"lambda_handler": "handler.lambda_handler"
"""
from zappa.handler import LambdaHandler
import epsagon
epsagon.init(
token='my-secret-token',
@jneves
jneves / joinedload-correlate.py
Created September 26, 2018 15:35
SQLAlchemy issue with joinedload and correlate_except on a column_property
from sqlalchemy import create_engine, select, and_, func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Boolean, Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, column_property, relationship, joinedload, deferred, undefer, load_only
engine = create_engine('sqlite:///:memory:', echo=True)
Session = sessionmaker(bind=engine)
session = Session()
Base = declarative_base()
@jneves
jneves / zappa-prs-2018.md
Last active December 17, 2018 08:45
zappa PRs review

Documentation and string/format minor updates

Miserlou/Zappa#1268 - Add documentation to the README for Cognito triggers - the code change packed in (seemingly by mistake) needs to be removed or explained though

Validated by multiple people

Needs merge

Miserlou/Zappa#757 - Pr/package excludes venv

@jneves
jneves / ecs-validate-deploy.py
Last active March 28, 2018 10:04
Usage: ./ecs-validate-deploy.py <region> <cluster>
#! /usr/bin/env python
import boto3
import logging
import sys
log = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)

Keybase proof

I hereby claim:

  • I am jneves on github.
  • I am jneves (https://keybase.io/jneves) on keybase.
  • I have a public key ASBuIfflXp94ziuaZZvNHN2vN6u9BmN5Xtt1skGCg8SAJQo

To claim this, I am signing this object:

class User(DeclarativeBase):
__tablename__ = 'sys_user'
user_id = Column(Integer, autoincrement=True, primary_key=True)
email = Column(Unicode(100))
name = Column(Unicode(100))
class UserLog(DeclarativeBase):
__tablename__ = 'sys_user_log'
@jneves
jneves / minecraft-in-education-resources.md
Created July 5, 2015 17:38
Resources for Minecraft use in Education