Skip to content

Instantly share code, notes, and snippets.

View oschrenk's full-sized avatar

Oliver Schrenk oschrenk

View GitHub Profile
@oschrenk
oschrenk / GameOfLife.scala
Last active April 18, 2020 18:26
Game of Life
case class GameOfLife private(width: Int, height: Int, cells: Set[Point]) {
private def neighbors(p: Point): Set[Point] = {
(for {
x <- Math.max(1, p.x - 1).to(Math.min(this.width, p.x + 1))
y <- Math.max(1, p.y - 1).to(Math.min(this.height,p.y + 1))
} yield Point(x, y)).toSet - p
}
Process: Signal [75058]
Path: /Applications/Signal.app/Contents/MacOS/Signal
Identifier: org.whispersystems.signal-desktop
Version: 1.25.0 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Signal [75058]
User ID: 501
Date/Time: 2019-05-31 12:07:59.313 +0200
package com.oschrenk.expando
import akka.Done
import akka.actor.ActorSystem
import akka.dispatch.MessageDispatcher
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.{Cookie, `Set-Cookie`}
import akka.stream.scaladsl.{Flow, Sink, Source}
import akka.stream.{ActorMaterializer, Materializer}
#!/bin/bash
#
# Notify of Homebrew updates via Notification Center on Mac OS X
#
# Author: Chris Streeter http://www.chrisstreeter.com
# Requires: terminal-notifier. Install with:
# brew install terminal-notifier
BREW_EXEC='/usr/local/bin/brew'
TERMINAL_NOTIFIER=`which terminal-notifier`
@oschrenk
oschrenk / keybase.md
Created August 15, 2016 21:14
keybase.io proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@oschrenk
oschrenk / make.log
Created April 8, 2015 16:07
iTerm2 make.log
=== CLEAN TARGET ShortcutRecorder.framework - with embedded ibplugin OF PROJECT ShortcutRecorder WITH CONFIGURATION Release ===
Check dependencies
Clean.Remove clean /Users/oliver/Library/Developer/Xcode/DerivedData/Timer-eczfdxazowouiyacmenywqnnawln/Build/Intermediates/ShortcutRecorder.build/Release/ShortcutRecorder.framework\ -\ with\ embedded\ ibplugin.build
builtin-rm -rf /Users/oliver/Library/Developer/Xcode/DerivedData/Timer-eczfdxazowouiyacmenywqnnawln/Build/Intermediates/ShortcutRecorder.build/Release/ShortcutRecorder.framework\ -\ with\ embedded\ ibplugin.build
Clean.Remove clean /Users/oliver/Library/Developer/Xcode/DerivedData/Timer-eczfdxazowouiyacmenywqnnawln/Build/Products/Release/ShortcutRecorder.framework
builtin-rm -rf /Users/oliver/Library/Developer/Xcode/DerivedData/Timer-eczfdxazowouiyacmenywqnnawln/Build/Products/Release/ShortcutRecorder.framework
@oschrenk
oschrenk / configure-hadoop.sh
Last active December 30, 2015 09:39
Configuring Hadoop on OS X for the first time
#!/bin/sh
function error_handler() {
echo "Error occurred in script at line: ${1}."
echo "Line exited with status: ${2}"
}
trap 'error_handler ${LINENO} $?' ERR
set -o errexit #
@oschrenk
oschrenk / gist:5388170
Created April 15, 2013 13:47
Re: Getting notifications on forks for old commits I'm @ mentioned in
Delivered-To: oliver.schrenk@gmail.com
Received: by 10.58.239.202 with SMTP id vu10csp168751vec;
Mon, 15 Apr 2013 06:40:23 -0700 (PDT)
X-Received: by 10.49.97.163 with SMTP id eb3mr15491731qeb.45.1366033222553;
Mon, 15 Apr 2013 06:40:22 -0700 (PDT)
Return-Path: <noreply@github.com>
Received: from smtp1-ext.rs.github.com (smtp1-ext.rs.github.com. [207.97.227.250])
by mx.google.com with ESMTP id ko8si12369721qeb.19.2013.04.15.06.40.22;
Mon, 15 Apr 2013 06:40:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of noreply@github.com designates 207.97.227.250 as permitted sender) client-ip=207.97.227.250;
@oschrenk
oschrenk / NextHighestLongSameDigits.java
Created February 4, 2013 03:08
Given a number, find the next higher number which has the exact same set of digits as the original number. For example: given 38276 return 38627
package com.acme.numbers;
import java.util.Arrays;
/**
*
* Given a number, find the next higher number which has the exact same set of
* digits as the original number. For example: given 38276 return 38627
*
*
@oschrenk
oschrenk / JsonEqivalenceTest
Created October 11, 2012 08:03
Testing with JUnit/Maven
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import com.google.common.base.CharMatcher;
import com.google.common.base.Charsets;