Skip to content

Instantly share code, notes, and snippets.

View choffmeister's full-sized avatar

Christian Hoffmeister choffmeister

View GitHub Profile
package io.airfocus.workspaceservice.managers
import akka.Done
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Sink, Source}
import com.typesafe.scalalogging.LazyLogging
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}

Roles

role description
admin
editor
contributor

New scopes

@choffmeister
choffmeister / video-to-gif.py
Last active November 27, 2018 12:09
Python script to convert a video into a GIF
#!/usr/bin/python
# python -c "$(curl -fsSL https://gist.githubusercontent.com/choffmeister/d0caa672d389a05952a44528158ecfd6/raw/video-to-gif.py)" --width=720 --fps=1 video.mov
import argparse
import os
import re
import subprocess
from datetime import datetime
parser = argparse.ArgumentParser(description='video to gif')
@choffmeister
choffmeister / README.md
Last active April 29, 2018 16:52
i18next-json-loader

i18next-json-loader

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
 test: /\.i18next\.json$/,
import React from "react";
import PropTypes from "prop-types";
// => /a
const userFlowA = [
{ key: "date", Component: SelectFlightDate },
{ key: "insurance", Component: SelectInsurances }
];
// => /b
#!/usr/bin/python
import subprocess
import os
import re
import sys
import itertools
semver_regex = '^(?:v)?(\d+)\.(\d+)\.(\d+)(\-(.*))?$'
import akka.actor.ActorSystem
import akka.cluster.seed.ZookeeperClusterSeed
trait MyAkkaSeedComponent {
def actorSystem: ActorSystem
val extension = ZookeeperClusterSeed(actorSystem)
extension.join()
}
package demo
import spray.json._
import scala.language.implicitConversions
class RootJsonFormatWithDefault[T](inner: RootJsonFormat[T]) {
def withDefault[V](key: String, defaultValue: => V)(implicit writer: JsonWriter[V]): RootJsonFormat[T] = new RootJsonFormat[T] {
override def read(json: JsValue) = {
if (json.asJsObject.fields.contains(key)) inner.read(json)
@choffmeister
choffmeister / SSLPoke.java
Created May 11, 2016 07:48 — forked from 4ndrej/SSLPoke.java
Test of java SSL / keystore / cert setup. Check the commet #1 for howto.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@choffmeister
choffmeister / git-info-loader.js
Created April 11, 2016 07:58
git-info-loader.js
/* eslint-env node */
'use strict'
const Bluebird = require('bluebird')
const childProcess = require('child_process')
function gitCommand (args) {
return new Promise((resolve, reject) => {
childProcess.execFile('git', args, (err, stdout, stderr) => {
if (!err) {