Skip to content

Instantly share code, notes, and snippets.

View b-studios's full-sized avatar

Jonathan Immanuel Brachthäuser b-studios

View GitHub Profile
@b-studios
b-studios / Processing.scala
Created January 22, 2014 13:54
To use processing with scala: You have to download the processing `core.jar` available at http://processing.org/download/?processingand save it to your `lib/` directory. This gist just illustrates the basic setup necessary to run a processing application.
import processing.core.PApplet
class ProcessingTest extends PApplet {
override def setup() {
size(1024, 768)
background(255)
}
override def draw() {
@b-studios
b-studios / SnocList.scala
Created February 28, 2014 23:14
Simple implementation of snoc lists
trait SnocList[+T] {
def <> [S >: T](el: S) = Snoc(this, el)
}
case class Snoc[+T](init: SnocList[T], el: T) extends SnocList[T]
case object Empty extends SnocList[Nothing]
// usage:
// scala> Empty <> 1 <> 2 <> 3 <> 4
// res0: Snoc[Int] = Snoc(Snoc(Snoc(Snoc(Empty,1),2),3),4)
class E[F]
class A
class B
class C
trait TypeMember {
type X
id(value) // This call throws an AbstractMethodError
@b-studios
b-studios / notes.scala
Last active August 29, 2015 14:16
Comparing Object Encodings
/**
* This file contains some notes taken while reading:
*
* Comparing Object Encodings
* Kim B. Bruce, Luca Cardelli and Benjamin C. Pierce
*/
package object encodings {
// Library Stuff
trait Fix[F[_]] {
<html><script>
// Library Stuff
function assert(b) {
if (!b) { throw "Assertion failed!"; }
}
// binds `this` of f to `obj`
function bind(f, obj) {
return function () {
@b-studios
b-studios / source.html
Created June 23, 2015 08:00
GitLab Mail Source
----==_mimepart_550395aeaec5d_1898a98a027821
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html lang=3D'en'>
<head>
<meta content=3D'text/html; charset=3Dutf-8' http-equiv=3D'Content-Type'>=
<title>
# Build this docker container with
# sudo docker build -t webapp .
#
# then run it with
# sudo docker run -d -p 3000:3000 webapp
# In the host-host then localhost:3030 yields the meteor app (for debugging purposes)
FROM ubuntu:15.04
MAINTAINER Jonathan Brachthäuser
(00.000029) Added /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd ext mount mapping
(00.000046) Added /sys/fs/cgroup/cpu,cpuacct:/sys/fs/cgroup/cpu,cpuacct ext mount mapping
(00.000049) Added /sys/fs/cgroup/hugetlb:/sys/fs/cgroup/hugetlb ext mount mapping
(00.000051) Added /sys/fs/cgroup/blkio:/sys/fs/cgroup/blkio ext mount mapping
(00.000054) Added /sys/fs/cgroup/net_cls,net_prio:/sys/fs/cgroup/net_cls,net_prio ext mount mapping
(00.000056) Added /sys/fs/cgroup/memory:/sys/fs/cgroup/memory ext mount mapping
(00.000058) Added /sys/fs/cgroup/freezer:/sys/fs/cgroup/freezer ext mount mapping
(00.000060) Added /sys/fs/cgroup/cpuset:/sys/fs/cgroup/cpuset ext mount mapping
(00.000062) Added /sys/fs/cgroup/devices:/sys/fs/cgroup/devices ext mount mapping
(00.000065) Added /sys/fs/cgroup/perf_event:/sys/fs/cgroup/perf_event ext mount mapping
(00.000084) Added /sys/fs/cgroup/cpuset:/sys/fs/cgroup/cpuset ext mount mapping
(00.000136) Added /sys/fs/cgroup/cpu:/sys/fs/cgroup/cpu ext mount mapping
(00.000143) Added /sys/fs/cgroup/cpuacct:/sys/fs/cgroup/cpuacct ext mount mapping
(00.000149) Added /sys/fs/cgroup/memory:/sys/fs/cgroup/memory ext mount mapping
(00.000155) Added /sys/fs/cgroup/devices:/sys/fs/cgroup/devices ext mount mapping
(00.000172) Added /sys/fs/cgroup/freezer:/sys/fs/cgroup/freezer ext mount mapping
(00.000178) Added /sys/fs/cgroup/blkio:/sys/fs/cgroup/blkio ext mount mapping
(00.000184) Added /sys/fs/cgroup/perf_event:/sys/fs/cgroup/perf_event ext mount mapping
(00.000200) Added /sys/fs/cgroup/hugetlb:/sys/fs/cgroup/hugetlb ext mount mapping
(00.000206) Added /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd ext mount mapping
@b-studios
b-studios / object-encodings.scala
Created June 3, 2016 14:50
Comparing Object Encodings
/**
* This file contains some notes taken while reading:
*
* Comparing Object Encodings
* Kim B. Bruce, Luca Cardelli and Benjamin C. Pierce
*/
package object encodings {
// Library Stuff
trait Fix[F[_]] {