Skip to content

Instantly share code, notes, and snippets.

View cutoffthetop's full-sized avatar

Nicolas Drebenstedt cutoffthetop

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cutoffthetop on github.
  • I am cutoffthetop (https://keybase.io/cutoffthetop) on keybase.
  • I have a public key ASB9aXEgZh8jHRdUihyNtGd3hOMP6YqyXCT2cqQblPYycwo

To claim this, I am signing this object:

@cutoffthetop
cutoffthetop / tornado_redis_pubsub_api.py
Created March 26, 2019 11:46
minimal tornado setup with rest and websocket api through redis pubsub
#!/usr/bin/env python3
import json
import signal
import sys
import redis
import tornado.options as opt
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.log import app_log
import tornado.ioloop
import tornado.web
import pprint
class Echo(tornado.web.RequestHandler):
def get(self, *args, **kw):
data = self.request.__dict__.copy()
data.pop('server_connection')
data.pop('connection')
data['headers'] = dict(data['headers'])
@cutoffthetop
cutoffthetop / commit-message-verbs.tsv
Last active November 27, 2015 12:46
What we do all day.
verb count
merge 3459
add 1457
fix 845
update 606
change 547
remove 400
prepare 268
use 257
make 142

Keybase proof

I hereby claim:

  • I am cutoffthetop on github.
  • I am cutoffthetop (https://keybase.io/cutoffthetop) on keybase.
  • I have a public key whose fingerprint is EE8D E8D7 25DD C258 76BC 8735 AF45 F2F9 8FE6 5882

To claim this, I am signing this object:

input {
file {
path => ["/tmp/logstash/*.log"]
start_position => beginning
}
}
output {
hbase {
table_name => "test"
}
@cutoffthetop
cutoffthetop / hbase.rb
Created December 8, 2013 20:15
Custom Logstash output for HBase
# encoding: utf-8
require 'logstash/outputs/base'
require 'logstash/namespace'
class LogStash::Outputs::HBase < LogStash::Outputs::Base
config_name 'hbase'
milestone 2
# The HBase server uri
@cutoffthetop
cutoffthetop / teasers.php
Created July 24, 2013 08:58
Short example on how to create a list of article teasers with the Zeit Online API using PHP.
<?php
$host = "http://api.zeit.de";
$query = "/content?fields=teaser_title,href,teaser_text";
$api_key = "&api_key=PUT_YOUR_API_KEY_HERE";
$response = file_get_contents($host.$query.$api_key);
$result = json_decode($response);
?>
<!DOCTYPE html>
<html>
{"code":200,
"status":"ok",
"user":[
{"birthday":"02-08-1983",
"forename":"Jennifer",
"gender":"f",
"location":"Brighton",
"nickname":"Jenny",
"score":93,
"surname":"Svenson",