Skip to content

Instantly share code, notes, and snippets.

View joa's full-sized avatar

Joa Ebert joa

View GitHub Profile
@joa
joa / whitespace.html
Created April 3, 2012 16:19
Having fun with HTML whitespace behaviour
<!DOCTYPE html>
<html>
<head>
<style>
b { font-weight: normal; background-color: #f0f; }
i { font-style: normal; background-color: #ff0; }
pre { background-color: #0ff; }
.arrg { white-space: pre; background-color: #f00; }
body { background: #333; }
</style>
@joa
joa / hiddenwood_javac_madness.java
Created February 24, 2012 18:54
What is the output?
public final class Main {
public static void main(final String[] args) {
while(true) {
try {
System.out.println("1");
continue;
} finally {
System.out.println("2");
break;
}
@joa
joa / ceylon-vs-scala
Created November 18, 2011 14:17
The difference between Ceylon and Scala
// the difference between ceylon and scala
//
shared
class Polar(Float angle, Float radius) {
shared
Float angle = angle;
shared
Float radius = radius;
@joa
joa / webAudioApiTest.js
Created August 30, 2011 09:22
Web Audio API Playback
// #1 Launch Chrome
// #1.1 If you are on the Beta channel you are fine
// #1.2 If you are not on the Beta channel enable Web Audio API in about:flags
// #2 Ctrl+Shift+C or Apple+Shift+J
// #3 Open Console
// #4 Paste
var bufferSize = 2048
var ctx = new webkitAudioContext()
var js = ctx.createJavaScriptNode(bufferSize, 0, 1)
var phase = 0.0
@joa
joa / go.scala
Created June 1, 2011 11:12
Go Channels in Scala
package go
import java.util.concurrent.{
BlockingQueue => JBlockingQueue,
ArrayBlockingQueue => JArrayBlockingQueue
}
object Channel {
def empty[A]: Channel[A] = new BlockingChannel()
def make[A]: Channel[A] = make(1)
//lift version 2.3-M1
object ErrorSnippet extends DispatchSnippet {
val showBug = true
def dispatch = {
case _ => bug
}
def bug = {
val id = nextFuncName