Skip to content

Instantly share code, notes, and snippets.

@rtitle
rtitle / gist:c2022672a6f0007b73517717682a08b9
Created August 15, 2023 12:33
bash shell strips dots
➜ cat local.env
VALID_HOSTS.2=bvdp-saturn-dev.appspot.com
VALID_HOSTS.1=*
VALID_HOSTS.0=localhost:3000
# Old base image
➜ docker run --env-file ./local.env -it us.gcr.io/broad-dsp-gcr-public/base/jre@sha256:c56f81d4ca01792b492f4b25d087f99df0adab50708dc53f2d7f022de687ba56 /bin/bash -c 'printenv | grep VALID'
VALID_HOSTS.2=bvdp-saturn-dev.appspot.com
VALID_HOSTS.1=*
VALID_HOSTS.0=localhost:3000
@rtitle
rtitle / REPLesent.txt
Last active October 5, 2017 20:15
Monad Transformer Talk
| \gMonad Transformers!
Rob Title
2017-10-05
---
| \gA Toy Example
--
\*First, the object model
@rtitle
rtitle / leo_ssl_hacking.md
Last active November 13, 2017 18:53
Leo SSL hacking

Notes on trying to get Leo -> Apache -> Jupyter working on localhost with 2-way SSL authentication. For this test:

  • Jupyter is listening on port 8000 over HTTP
  • Apache is listening on port 443 over HTTPS
  • Leo is listening on port 8080 over HTTP

Start Jupyter server

cd /path/to/leonardo
./jupyter-docker/run-jupyter-local.sh start
@rtitle
rtitle / deadlock_tech_talk.md
Last active July 10, 2017 15:42
Deadlock tech talk notes

Open the REPL and import some stuff:

Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.

scala> import scala.concurrent._, duration._, ExecutionContext.Implicits.global
import scala.concurrent._
import duration._
import ExecutionContext.Implicits.global
@rtitle
rtitle / future_timeout.scala
Last active May 19, 2017 00:31
Future with timeout
scala> :paste
// Entering paste mode (ctrl-D to finish)
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
import akka.actor._
import akka.pattern.after
implicit class FutureWithTimeout[A](f: Future[A]) {
@rtitle
rtitle / hf.md
Last active April 13, 2017 14:29
Handling Fees

Get all AODs without a handling fee:

# on CIC DB:

$ cat aods.sql
copy (
select distinct ip.uid from core.inventory_pools ip, core.inventory_pools_inventory_sources ipis, core.inventory_sources iss
where ip.id = ipis.inventory_pool_id and ipis.inventory_source_id = iss.id and iss.type = 'DealInventory' and lower(iss.name) like 'always on%'
except
select distinct ip.uid from core.inventory_pools ip, core.rate_instances_domains rid, core.rate_instances ri 
@rtitle
rtitle / PG_google.md
Created April 5, 2017 19:13
PG native example

Bid Request

id: "X\345@\363\000\001\346<\n\206\017\n\236\017\306\265"
ip: "\320v\342"
user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
url: "http://dx1am.blogspot.com/p/blog-page.html"
detected_language: "en"
detected_vertical {
  id: 814
  weight: 0.5226902
@rtitle
rtitle / rts_master_test_durations.txt
Last active October 19, 2016 01:36
RTS unit test durations in seconds
# from master build https://jenkins.devaws.dataxu.net/job/realtime-system_build/10054/
# Build #10054 dataxu/master (ad10084d) (Oct 18, 2016 10:30:29 AM)
seconds test
1857 dataxu.rt.services.caching.memcached.DxNodeLocatorTest
1215 dataxu.rt.services.context.aerospike.AerospikeContextServiceTest
358 dataxu.rt.services.budget.BudgetBankTest
317 dataxu.rt.adfilter.lucene.FlightCreativePickerLuceneTest
292 dataxu.rt.api.v2.user.trace.UserTraceServiceTest
267 dataxu.rt.services.users.profiles.AerospikeUserProfileServiceTest
@rtitle
rtitle / retargeting_simplification.md
Last active July 21, 2016 13:22
Retargeting simplification results
@Param({"0", "1", "10", "100", "1000"})
int numIncludedAudiences;
		
@Param({"0", "1", "10", "100", "1000"})
int numExcludedAudiences;
		
@Param({"1", "5", "10"})
int segmentsPerAudience;