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
<div id ="two"> | |
<p>I speak</p> | |
<div class="box"> | |
<ul> | |
<li class="item-1">English</li> | |
<li class="item-2">Maltese</li> | |
<li class="item-3">Danish</li> | |
<li class="item-4">Italian</li> | |
<li class="item-5">English</li> | |
</ul> |
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></head> | |
<body> | |
<script src="http://connect.soundcloud.com/sdk-2.0.0.js"></script> | |
<script> | |
// initialize client with app credentials | |
SC.initialize({ | |
client_id: 'YOUR_CLIENT_ID', | |
}); |
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
class List | |
attr_reader :head, :tail | |
def self.from_ar ar | |
if h = ar.shift | |
self.new h, self.from_ar(ar) | |
end | |
end | |
def initialize head, tail = nil |
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
get("/a/:id", operation(getA)) { | |
val id = params("id") | |
val idType = params.getOrElse("id_type", "a_id") | |
new AsyncResult { | |
val is: Future[_] = resolveId(id, idType) flatMap { aid => | |
val frm = future { s /*}oing something more in the real code */ }map { s => | |
responseMetaData(s.id) | |
} | |
frm flatMap { rm => |
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
oa@:~/oa$ curl -XGET 'http://api.openaura.com/v1/classic/artists/47?id_type=oa%3Aartist_id&api_key=YOUR_API_KEY' | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 3439 0 3439 0 0 15900 0 --:--:-- --:--:-- --:--:-- 28188 | |
{ | |
"request_info": { | |
"oa_anchor_id": "528fde50e4b084ba1571c831", | |
"request_id": "809FF3B14C169677C6E08D333E0114E8DFA0559B", | |
"timestamp": "2014-03-11T19:58:22.355Z" | |
}, |
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
before() { | |
contentType = "image/gif" | |
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate") | |
response.setHeader("Pragma", "no-cache") | |
response.setHeader("Expires", "0") | |
} | |
get("/request_code/:id.gif") { | |
val id = params("id") |
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
(! 613)-> curl -XGET 'http://api.openaura.com/search/artists?q=taylor&limit=5&api_key=YOUR_API_KEY' | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 523 0 523 0 0 1131 0 --:--:-- --:--:-- --:--:-- 1330 | |
[ { oa_artist_id: '47', | |
name: 'Taylor Swift', | |
musicbrainz_id: '20244d07-534f-4eff-b4d4-930878889970' }, | |
{ oa_artist_id: '13791', | |
name: 'Gillian Taylor', | |
musicbrainz_id: '6cfddc45-bf8b-46a5-b471-297b25b55fa9' }, |
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
(! 612)-> curl -XGET 'http://api.openaura.com/search/artists?q=taylor&api_key=YOUR_KEY' | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 10738 0 10738 0 0 61448 0 --:--:-- --:--:-- --:--:-- 81348 | |
[ { oa_artist_id: '47', | |
name: 'Taylor Swift', | |
musicbrainz_id: '20244d07-534f-4eff-b4d4-930878889970' }, | |
{ oa_artist_id: '13791', | |
name: 'Gillian Taylor', | |
musicbrainz_id: '6cfddc45-bf8b-46a5-b471-297b25b55fa9' }, |
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 net.openaura.util | |
import com.twitter.util.{Future => FinagleFuture} | |
import scala.concurrent.{Promise, ExecutionContext, Future} | |
object FinagleImplicits { | |
implicit def finagleFuture2AkkaFuture[A](future: FinagleFuture[A])(implicit executor: ExecutionContext): Future[_] = { | |
val promise = Promise[A] | |
future onSuccess { result => | |
promise.success(result) |
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
get("/thing/:id", operation(getThingAuraById)) { | |
val id = params("id") | |
val Some(limit) = ParamValidator.asInteger(params.getOrElse("limit", "100")) | |
val Some(offset) = ParamValidator.asInteger(params.getOrElse("offset", "0")) | |
ParamValidator.asInteger(id) match { | |
case Some(id) => { | |
new AsyncResult { val is = | |
// this returns a Finagle Future - I want an implicit in scope here to do the | |
// conversion | |
auraClient.auraByThingId(id, limit = limit, offset = offset) map { aura => |
NewerOlder