Skip to content

Instantly share code, notes, and snippets.

View 140am's full-sized avatar

Manuel Kreutz 140am

View GitHub Profile
@140am
140am / Dockerfile
Created September 24, 2019 02:06
emacs in docker
FROM ubuntu:16.04
MAINTAINER Manuel Kreutz <[email protected]>
RUN apt-get update && \
apt-get install -y curl git software-properties-common build-essential && \
apt-get clean
# install emacs 26 from ppa
RUN add-apt-repository ppa:kelleyk/emacs && \

Keybase proof

I hereby claim:

  • I am 140am on github.
  • I am 140am (https://keybase.io/140am) on keybase.
  • I have a public key ASCE_z-ykwDLn4q2e9zGPQYTWu1QxRqRFIHfidc29km9zwo

To claim this, I am signing this object:

@140am
140am / test_amqp.py
Last active August 12, 2016 22:28
Example of a helper to listen & debug the OpenStack MQ event bus
import logging
import json
import dateutil.parser
import pika
FORMAT = '%(asctime)-15s %(levelname)s: %(message)s'
logging.basicConfig(
format = FORMAT,
level = logging.DEBUG
)
@140am
140am / ipc_test.py
Last active March 3, 2025 00:59
Simple Python / ØMQ IPC (Inter Process Communication) performance benchmark
""" Simple IPC benchmark test
Test throughput of 512 KB messages sent between two python processes using:
- multiprocessing pipe
- zeroMQ PUSH/PULL
- zeroMQ DEALER/DEALER
Result:
@140am
140am / pytumblr_example.py
Created January 23, 2014 06:24
Example of using the Python Tumblr API v2 Client
""" Tumblr API Example - Python CLI
"""
import oauth2
import urlparse
import pytumblr
REQUEST_TOKEN_URL = 'http://www.tumblr.com/oauth/request_token'
AUTHORIZATION_URL = 'http://www.tumblr.com/oauth/authorize'
ACCESS_TOKEN_URL = 'http://www.tumblr.com/oauth/access_token'
@140am
140am / butler_service.py
Last active August 12, 2016 22:35
Example of using "butler" Python library to communicate between multiple processes (local or distributed)
""" Example of how to get started with the `butler` library for RPC calls
Defines 3 example classes we want to expose for RPC use (ServiceA, ServiceB, ServiceC)
which all have a 'test' method.
Start a Router and register all the Service classes (`services_objects`)
python butler_service.py --service
Start only a Router process:
@140am
140am / README.md
Created November 14, 2012 23:44
first butler framework example (v0.2)

Installation

virtualenv env; source env/bin/activate
easy_install butler

Use Examples

Save the attached .py files (router.py / worker.py / client.py)

  1. Start Router python router.py
@140am
140am / gist:2249117
Created March 30, 2012 07:55
backbone.js - dynamically set a model attributes based on From selection
class exports.AddTaskTemplateView extends Backbone.View
events:
"change input": "fieldChanged"
"change select": "fieldChanged"
'click #btn-submit' : 'submitInput'
render: (context = {}) ->
$(@el).html require('./templates/user_create') context
this
@140am
140am / core.js
Created November 30, 2011 23:16
SC 1.x routing / statechart example
TestApp = SC.Application.create(
/**
Invoked when route change has been detected
*/
routeDidChange: function(params) {
if (!params.target) return NO;
params = SC.clone(params);
@140am
140am / observer.py
Created June 18, 2011 08:35
python observer pattern example
import pdb
import time
import threading
class Event(object):
pass
class Observable(object):
def __init__(self):
self.callbacks = []