Skip to content

Instantly share code, notes, and snippets.

View schuster-rainer's full-sized avatar

Rainer Schuster schuster-rainer

View GitHub Profile
@schuster-rainer
schuster-rainer / docker-dns
Created October 9, 2018 07:44
dns for resolving docker hostnames
#!/bin/bash
# https://stackoverflow.com/questions/37242217/access-docker-container-from-host-using-containers-name
docker run --hostname dns.mageddo --name dns-proxy-server -p 5380:5380 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/resolv.conf:/etc/resolv.conf \
defreitas/dns-proxy-server
@schuster-rainer
schuster-rainer / Dockerfile
Created September 13, 2018 14:39
CentOS based rails docker setup
FROM drecom/centos-ruby:2.2.3
MAINTAINER Rainer Schuster <schuster-rainer@web.de>
ENV TZ Europe/Berlin
ENV LANG en_US.UTF-8
ENV APP_USER myapp
ENV APP_GROUP web
ENV HOME_DIR /home/${APP_USER}
@schuster-rainer
schuster-rainer / minimal_vst2x_host.cpp
Created July 25, 2018 12:08 — forked from t-mat/minimal_vst2x_host.cpp
WIN32 : Minimal VST 2.x host in C++11.
// Win32 : Minimal VST 2.x Synth host in C++11.
//
// This is a simplified version of the following project by hotwatermorning :
// A sample VST Host Application for C++ Advent Calendar 2013 5th day.
// https://github.com/hotwatermorning/VstHostDemo
//
// Usage :
// 1. Compile & Run this program.
// 2. Select your VST Synth DLL.
// 3. Press QWERTY, ZXCV, etc.
@schuster-rainer
schuster-rainer / libgit2.ipynb
Created February 13, 2018 08:45
using git as database from python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schuster-rainer
schuster-rainer / example.js
Created August 23, 2017 16:27
redux-form-immutable validator with JSON API
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Field, reduxForm } from 'redux-form/immutable';
import muiThemeable from 'material-ui/styles/muiThemeable';
import './form';
import validatejs from 'validate.js';
const ExampleForm = ({onSubmit, ...props}) => (
<form onSubmit={onSubmit}>
@schuster-rainer
schuster-rainer / sample.py
Created January 28, 2016 11:03
Execute PIPED command in behave acceptance test
from behave import *
from os.path import join
from subprocess import Popen
import os
@when(u'the requirements are generated for documentation')
def step_impl(context):
cmd = " ".join(["my_fictional_command",
"input1",
context.requirements_filename,
@schuster-rainer
schuster-rainer / sample.feature
Last active January 28, 2016 10:57
Execute command from behave acceptance test
Feature: Tracing
Scenario Outline: Generating a two column CSV
When I execute: my_fictional_command input1.xml input2.xml --header=COL1;COL2
Then the generated csv with <COL1> should map to <COL2>
Examples: COL1 maps to COL2
| REQ_ID| RELATED_ID |
| COL1| COL2 |
| A | 1 |
@schuster-rainer
schuster-rainer / jinja_magic.py
Created November 13, 2015 13:53
IPython jinja cell magic
from IPython import display
from IPython.core.magic import register_cell_magic, Magics, magics_class, cell_magic
import jinja2
@magics_class
class JinjaMagics(Magics):
'''Magics class containing the jinja2 magic and state'''
def __init__(self, shell):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schuster-rainer
schuster-rainer / hello_debug_ipdb.clj
Created October 30, 2012 22:08
debuggin with ipdb in clojure-py
(ns hello-debug)
(require '[ipdb :as pdb])
(pdb/set_trace)
(def greet "hello world!")
(println greet)