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
-- Consulta sobre el valor un miembro de primer nivel (para el caso, turnos que son sobreturnos) | |
select * | |
from appointments | |
where details ->> 'isOverturn' = 'true'; | |
-- Consulta sobre el valor de un miembro de un nivel aninado (para el caso, los turnos con atención particular) | |
select * | |
from appointments | |
where details -> 'extra' ->> 'attentionBy' = 'particular' |
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 util | |
import com.redis._ | |
import java.util.concurrent.Executors | |
import scala.concurrent.{Future, ExecutionContext} | |
trait Cache { | |
def get(key: String): Future[Option[String]] | |
def set(key: String, value: String, seconds: Long): Future[Boolean] | |
def ping(): Future[Boolean] |
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
object CookiesStore { | |
private var sessionDataBySessionId = Map[Long, CookieUserInfo]() | |
def asJson(): JsValue = { // taken and adapted from: https://stackoverflow.com/a/27286808/903998 | |
import play.api.libs.json.Json.JsValueWrapper | |
/*implicit val mapReads: Reads[Map[Long, CookieUserInfo]] = new Reads[Map[Long, CookieUserInfo]] { | |
def reads(jv: JsValue): JsResult[Map[Long, CookieUserInfo]] = | |
JsSuccess(jv.as[Map[Long, CookieUserInfo]].map{case (k, v) => |
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
//Esto no funciona.... | |
// wait ms milliseconds | |
function wait(ms) { | |
return new Promise(r => setTimeout(r, ms)); | |
} | |
function f() { |
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 main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
"github.com/lib/pq" | |
) |
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
-- Consulta sobre el valor un miembro de primer nivel (para el caso, turnos que son sobreturnos) | |
select * | |
from appointments | |
where details ->> 'isOverturn' = 'true'; | |
-- Consulta sobre el valor de un miembro de un nivel aninado (para el caso, los turnos con atención particular) | |
select * | |
from appointments | |
where details -> 'extra' ->> 'attentionBy' = 'particular' |
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 java.util.concurrent.BlockingQueue; | |
public class Consumer implements Runnable { | |
private final BlockingQueue<Long> queue; | |
private volatile boolean finish; | |
public Consumer(BlockingQueue<Long> queue) { | |
this.queue = queue; |
NewerOlder