I hereby claim:
- I am robi42 on github.
- I am robi42 (https://keybase.io/robi42) on keybase.
- I have a public key ASCuBTF2Vf86jtTHHPaGy7KAlORSqX0Zeq-KCCY1F8o5zgo
To claim this, I am signing this object:
{JFrame, JButton} = javax.swing | |
main = -> | |
frame = new JFrame('Hello World!') | |
button = new JButton('Bye bye') | |
button.addActionListener (e) -> | |
system.exit(); return | |
frame.add 'Center', button | |
frame.setSize 300, 300 | |
frame.visible = true |
$ wget --no-check-certificate https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js | |
$ ringo --optlevel -1 | |
>> fs = require('fs') | |
>> coffee = fs.read('./coffee-script.js').replace(/this\.CoffeeScript/, 'exports.CoffeeScript') | |
>> fs.write('./coffee-script.js', coffee) | |
>> var {CoffeeScript} = require('./coffee-script') | |
>> code = CoffeeScript.compile("do -> 'Hello, Ringo world!'", {bare: true}) | |
'(function() { | |
return \'Hello, Ringo world!\'; | |
})();' |
var {Application} = require('stick'); | |
var response = require('ringo/jsgi/response'); | |
var app = exports.app = Application(); | |
app.configure('notfound', 'error', 'params', 'route'); | |
app.get('/', function (req) { | |
return response.json(req.params); | |
}); |
class Respond extends Service[Request, Response] with Logger { | |
def apply(request: Request) = { | |
try { | |
request.method -> Path(request.path) match { | |
case GET -> Root / "todos" => Future.value { | |
val data = Todos.allAsJson | |
debug("data: %s" format data) | |
Responses.json(data, acceptsGzip(request)) | |
} | |
case GET -> Root / "todos" / id => Future.value { |
$ ringo | |
>> list = java.util.Arrays.asList("foo", "bar", "baz") | |
[java.util.Arrays$ArrayList [foo, bar, baz]] | |
>> array = [_ for (_ in Iterator(list))] | |
[ 'foo', 'bar', 'baz' ] |
$ ringo | |
>> list = new ScriptableList(new java.util.HashSet(["foo", "bar", "bar"])) | |
[java.util.ArrayList [foo, bar]] | |
>> list[0] | |
'foo' | |
>> list.pop() | |
'bar' | |
>> map = new ScriptableMap(new java.util.HashMap({foo: 'bar'})) | |
{ foo: 'bar' } | |
>> map.foo |
I hereby claim:
To claim this, I am signing this object: