Skip to content

Instantly share code, notes, and snippets.

@jpzk
jpzk / qtileconf.py
Created November 9, 2013 10:04
qtile config for blog post
from libqtile.config import Key, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget
import os
mod = "mod1"
modR = "mod5"
keys = [
# Switch between windows in current stack pane
@jpzk
jpzk / app.py
Created December 14, 2015 13:30
Tracking Server in Flask
from flask import Flask
from flask import request
from time import strftime, time
import os
sites = {"1":"trackedsite.com"}
app = Flask(__name__)
@app.route("/t", methods=['GET'])
def track():
Verifying that +jendrik is my blockchain ID. https://onename.com/jendrik
@jpzk
jpzk / gist:8ad2692dc8b89bc4f8783150c152527d
Created November 11, 2016 16:41
Twitter util time control + MockTimer scheduling
import com.twitter.util._
import com.twitter.conversions.time._
val timer = new MockTimer()
def schedule(timer: Timer) = {
timer.schedule(1.second) {
println("statement")
}
}
@jpzk
jpzk / easy-schema-registry.txt
Created November 30, 2018 11:25
Easy way to delete schemas in the schema registry
apt install peco
apt install curl
curl http://localhost:8081/subjects | jq .[] | tr -d "\"" | peco | xargs -I '{}' curl -v -X DELETE http://localhost:8081/subjects/'{}'

Keybase proof

I hereby claim:

  • I am jpzk on github.
  • I am madewithtea (https://keybase.io/madewithtea) on keybase.
  • I have a public key ASDfJ35UsJlF18WijZ5j8R4MOeeTFtXze8wHt8CEU-LjSAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jpzk on github.
  • I am madewithtea (https://keybase.io/madewithtea) on keybase.
  • I have a public key ASDfJ35UsJlF18WijZ5j8R4MOeeTFtXze8wHt8CEU-LjSAo

To claim this, I am signing this object:

import slick.jdbc.PostgresProfile
import slick.jdbc.PostgresProfile.api._
import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
class ExtractorConfig(tag: Tag) extends Table[(String, Long, String)](tag, "configs") {
def name = column[String]("name", O.PrimaryKey)
@jpzk
jpzk / gist:0c74cb3686bbd050641ac873b32621aa
Created July 11, 2019 06:22
transactional producer kafka
package au.com.simplesteph.kafka.kafka0_11.demo
import java.util.Properties
import org.apache.kafka.clients.producer.{KafkaProducer, Producer, ProducerConfig, ProducerRecord}
import org.apache.kafka.common.KafkaException
import org.apache.kafka.common.errors.AuthorizationException
import org.apache.kafka.common.errors.OutOfOrderSequenceException
import org.apache.kafka.common.errors.ProducerFencedException
package com.github.simplesteph.udemy.kafka.streams
import java.lang
import java.util.Properties
import org.apache.kafka.clients.consumer.ConsumerConfig
import org.apache.kafka.common.serialization.Serdes
import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable}
import org.apache.kafka.streams.{KafkaStreams, KeyValue, StreamsConfig}