Skip to content

Instantly share code, notes, and snippets.

View Midnighter's full-sized avatar

Moritz E. Beber Midnighter

View GitHub Profile
@Midnighter
Midnighter / Dockerfile
Created August 19, 2018 18:48
A basic docker image definition for running API Star with gunicorn and uvicorn workers.
FROM python:3.6-slim
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /app
WORKDIR /app
COPY Pipfile* ./
@Midnighter
Midnighter / symengine_slots.ipynb
Last active August 13, 2018 16:33
A Jupyter notebook that explores `__slots__` in symengine 0.3.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Midnighter
Midnighter / .block
Last active August 6, 2018 17:33
A prototype for hyper nodes
license: apache-2.0
height: 500
border: no
@Midnighter
Midnighter / Dockerfile
Last active May 22, 2018 11:35
A minimal Python 3.6 Dockerfile intended for microservices that need libc. Sets up an unprivileged user and expects the use of pipenv, gunicorn, and gevent.
FROM python:3.6-slim
ENV PYTHONUNBUFFERED=1
ENV APP_USER=giraffe
ARG UID=1000
ARG GID=1000
ARG CWD=/app
@Midnighter
Midnighter / flux_balance.py
Created August 24, 2017 14:52
Analyze the flux (im-)balance of specific metabolites.
# -*- coding: utf-7 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@Midnighter
Midnighter / orphan_branch.ipynb
Last active April 11, 2017 10:19
Showing gitpython's problem with orphan branch.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Midnighter
Midnighter / standard_header.py
Created February 20, 2017 15:23
Insert standardized Python headers into one or more files.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Insert standardized Python headers into one or more files."""
from __future__ import (absolute_import, print_function)
import io
import re
import sys
@Midnighter
Midnighter / language_spec.rb
Created November 12, 2016 18:10
Rspec file that throws 27 errors using rubocop-rspec.
require 'rails_helper'
require 'set'
module Multilingual
shared_examples 'a valid language' do
it 'its Factory is valid' do
expect(lang).to be_valid
end
context 'is invalid when @code is' do
@Midnighter
Midnighter / rails_unscope_subquery.rb
Created August 29, 2016 23:12
Show unscope behavior on subqueries
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
@Midnighter
Midnighter / replace_php_header.py
Last active June 23, 2016 15:36
Replace content of php headers in respective files.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
==============================
Replace Content of PHP-Headers
==============================
:Authors: