Skip to content

Instantly share code, notes, and snippets.

View madsmtm's full-sized avatar

Mads Marquart madsmtm

  • Copenhagen, Denmark
  • 05:51 (UTC +02:00)
View GitHub Profile
@madsmtm
madsmtm / eve-sqlalchemy-enums.py
Last active October 25, 2018 14:43
Minimal example of Eve-SQLAlchemy enumerators not working when using enumerated classes
import enum
from eve import Eve
from sqlalchemy import Column, Integer, Enum
from sqlalchemy.ext.declarative import declarative_base
from eve_sqlalchemy import SQL
from eve_sqlalchemy.config import DomainConfig, ResourceConfig
from eve_sqlalchemy.validation import ValidatorSQL
@madsmtm
madsmtm / Vagrantfile
Last active June 27, 2018 08:28
Conditional Vagrant Provisioner
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# When you type 'up' the first time, it's always updated
config.vm.provision 'update', type: 'shell', inline: "apt-get update;apt-get -yq upgrade"
# When you provision the machine, you're asked whether you want to update it
if ARGV.include?('up') or ARGV.include?('reload') or ARGV.include?('resume') and ARGV.include?('--provision') or ARGV.include?('provision')