This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package brutus.compiler.util; | |
/** | |
* import static Unchecked.unchecked | |
* unchecked(() -> throw new IOException()); | |
*/ | |
public final class Unchecked { | |
@FunctionalInterface | |
public static interface UncheckedFunction { | |
public void apply() throws Throwable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
public final class Madness { | |
public static void main(final String[] args) { | |
final Stack<Integer> stack = new Stack<>(); | |
stack.add(1); | |
stack.add(2); | |
stack.add(3); | |
stack.push(4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./d8 --print_opt_code script.js | |
--- Raw source --- | |
() { | |
var a = 1|0; | |
var b = 0|0; | |
for(var i = 0; i < n; i++) { | |
t = b; | |
b = (a+b)|0; | |
a = t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class Iif[T](val x: T) extends AnyVal { def iif(cond: => Boolean): Option[T] = if(cond) Some(x) else None } | |
"yey" iif true == true getOrElse "ney" //yey | |
"yey" iif true != true getOrElse "ney" //ney | |
val file = "index.html" iif req.uri == "/" getOrElse req.uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hiddenwood.concurrent.*; | |
import hiddenwood.display.*; | |
import hiddenwood.gl.*; | |
import hiddenwood.http.*; | |
class App { | |
private static final String URL = | |
"http://www.random.org/integers/?num=1&min=1&max=100000&col=1&base=10&format=plain&rnd=new"; | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the difference between ceylon and scala | |
// | |
shared | |
class Polar(Float angle, Float radius) { | |
shared | |
Float angle = angle; | |
shared | |
Float radius = radius; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//lift version 2.3-M1 | |
object ErrorSnippet extends DispatchSnippet { | |
val showBug = true | |
def dispatch = { | |
case _ => bug | |
} | |
def bug = { | |
val id = nextFuncName |