Skip to content

Instantly share code, notes, and snippets.

View ahoy-jon's full-sized avatar
🐋
Thinking!

Jonathan Winandy ahoy-jon

🐋
Thinking!
View GitHub Profile
@ahoy-jon
ahoy-jon / Tools.scala
Last active August 29, 2015 14:16 — forked from anonymous/Tools.scala
object SerDe {
import java.io._
import java.util._
import javax.xml.bind.DatatypeConverter
def fromString(s:String ):Any = {
val data = DatatypeConverter.parseHexBinary(s)
val ois = new ObjectInputStream(new ByteArrayInputStream(data))
val o = ois.readObject()
ois.close()
@ahoy-jon
ahoy-jon / 0_reuse_code.js
Created April 7, 2014 09:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ahoy-jon
ahoy-jon / Point.scala
Last active December 19, 2015 04:49 — forked from fsarradin/Point.scala
object Point {
trait PointAdder[P1, P2] {
def add(p1: P1, p2: P2): Point3D
}
case class Point2D(x: Int, y: Int)
case class Point3D(x: Int, y: Int, z: Int)
implicit object Point2DAdder extends PointAdder[Point2D, Point2D] {
@ahoy-jon
ahoy-jon / Point.scala
Last active December 19, 2015 04:49 — forked from fsarradin/Point.scala
object Point extends App {
trait Semigroup[T] {
def append(p1: T, p2: T): T
}
case class Point2D(x: Int, y: Int)
case class Point3D(x: Int, y: Int, z: Int)
object Point2D {
@ahoy-jon
ahoy-jon / tron.bot.clj
Last active December 17, 2015 13:39 — forked from cgrand/tron.bot.clj
;the bot is tron.bots.ahoy/turn-based-strat
(ns tron.bots.ahoy
(:require [tron.core :as tron]))