Skip to content

Instantly share code, notes, and snippets.

View ulope's full-sized avatar

Ulrich Petri ulope

View GitHub Profile
@ulope
ulope / docker-compose.yml
Created October 27, 2017 08:12
prometheus backfill test
version: "2.1"
services:
prom:
image: prom/prometheus
volumes:
- ./prom.yml:/etc/prometheus/prometheus.yml
ports:
- 9090:9090
source:
def notify_rc(title, message, color='#c0c0c0'):
requests.post(
RC_WEBHOOK_URL,
json={
"attachments": [
{
"title": title,
"text": message,
"color": color
}
@ulope
ulope / .block
Last active August 21, 2017 15:31 — forked from mbostock/.block
Force-Directed Graph
license: gpl-3.0
height: 1200
@ulope
ulope / README.md
Last active July 10, 2021 05:21
iOS fullscreen camera preview without UI

iOS Fullscreen UI-less camera preview

I recently had a need for an app that displayed a fullscreen camera preview on an iPhone without any UI whatsoever. This is the result of 30 minutes of cobbling together various SO answers, blog posts etc.

All you need to do to use this is:

  • Create a new "Single view" poject
  • Add a new UIView to the ViewController in the Storyboard
  • Connect the outlet previewView to the UIView
@ulope
ulope / README.rst
Last active January 3, 2017 17:11
Reenable Jupyter notebook Python virtualenv integration

Reenable Jupyter notebook Python virtualenv integration

To reenable virtualenv integration in newer jupyter notebook versions paste the code below at the top of your ~/.ipython/profile_default/ipython_config.py

Kurzzusammenfassung des "Poll" Workshops auf dem 2. Ethereum Mainz meetup

Verwendete Tools:

Offener Poll

  1. Wir haben zunächst poll_v1.sol implementiert, per Browser Solidity compiliert und mittels MetaMask auf der Blockchain erzeugt. Für den votelimit Parameter haben wir in unserem Test 10 gewählt.
@ulope
ulope / .sh
Created July 18, 2016 15:07
Install Python 3.6.0a3 via pythonz
# Assumes homebrew and pythonz[1] are installed.
brew install openssl
LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" \
pythonz install \
-t cpython \
--url=https://www.python.org/ftp/python/3.6.0/Python-3.6.0a3.tgz \
3.6.0a3
@ulope
ulope / .travis.yml
Last active June 20, 2016 17:45
ethereum tox & travis config
language: python
python: 3.5
sudo: required
dist: trusty
before_install:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo apt-get install -y solc
env:
matrix:
@ulope
ulope / entrypoint.py
Created February 4, 2016 14:26
Dynamically generate a setuptools / pkg_resources entry point
class FakeModuleFinderLoader(object):
def find_module(self, fullname, path=None):
if fullname == "fake_module":
return self
def load_module(self, fullname):
mod = sys.modules.setdefault(fullname, imp.new_module(fullname))
mod.__file__ = "<fake_module>"
mod.__loader__ = self
mod.__package__ = fullname.rpartition('.')[0]
@ulope
ulope / settle_file.py
Last active January 7, 2016 22:25
Poll a file for changes until a defined timeout has occured.
#!/usr/bin/env python
# Requires the `click` library.
# Install with: `pip install click`
import hashlib
import time
import click
import sys