Skip to content

Instantly share code, notes, and snippets.

View pmundt's full-sized avatar

Paul Mundt pmundt

View GitHub Profile
@pmundt
pmundt / mro-clobber.py
Created October 8, 2019 14:37
Python MRO and Multi-class inheritance type clobbering
from abc import ABC, abstractmethod
from datetime import timedelta
class A1(ABC):
_value = "A1"
def __init__(self):
print("A1 type at init:", type(self._value))
def test_value(self):
@pmundt
pmundt / Dockerfile Dart Native
Created October 4, 2019 15:49
Multi-Stage Dockerfile for native compilation of server-side app using alpine-glibc base
FROM google/dart:2.6-dev AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
ADD lib /app/lib/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
@pmundt
pmundt / Dockerfile Dart AOT
Created October 4, 2019 08:07
Multi-Stage Dockerfile for AOT compilation of server-side app
FROM google/dart AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
ADD lib /app/lib/
RUN pub get --offline
RUN dart2aot /app/bin/server.dart /app/server.aot
@pmundt
pmundt / Dockerfile Dart VM JIT
Created October 4, 2019 08:04
Dockerfile for JIT compilation of server-side app
FROM google/dart
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD . /app
RUN pub get --offline
CMD []