This file contains hidden or 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 |
This file contains hidden or 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 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) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
function archiveInbox() { | |
var query = 'label:inbox is:read older_than:28d -label:unanswered -label:unread'; | |
var batchSize = 100; | |
while(GmailApp.search(query, 0, 1).length == 1) { | |
GmailApp.moveThreadsToArchive(GmailApp.search(query, 0, batchSize)); | |
} | |
} |
This file contains hidden or 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; |
OlderNewer