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 akka.actor.Scheduler | |
import com.github.blemale.scaffeine.{Cache, Scaffeine} | |
import play.api.libs.json.OWrites | |
import scala.reflect.runtime.universe._ | |
import scala.concurrent.duration._ | |
import scala.concurrent.{ExecutionContext, Future} | |
class CachingDynamoStore[A : Indexable : OWrites](store: DataStore[A], cache: Cache[String, A])( | |
implicit executionContext: ExecutionContext, |
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
def get_next_page(res) | |
res.headers['link']&. | |
split(',')&. | |
select{|x| x.include? 'next'}&.first&.split(';')&. | |
first&. | |
gsub(/[ ><]/,'') | |
end |
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 TeamPrStatistics | |
attr_accessor :team, :stats | |
class Stat | |
attr_accessor :titles | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
@titles = [] | |
end |
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
# since i'm overriding HTTParty's headers i need to provide the user agent so GitHub won't reject the api call | |
headers = {"User-Agent"=>"Httparty", "Accept"=>"application/vnd.github.mockingbird-preview"} |
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
username 'put your username here' | |
token = 'put your personal token from GitHub here, prefeably via ENV VAR' | |
auth = { username: uname, password: token } | |
url = "https://api.github.com/repos/#{owner}/#{repo_name}/pulls?per_page=1&state=all" | |
res = HTTParty.get(url, basic_auth: auth) | |
body = JSON.parse(res.body) |
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
version: "3" | |
services: | |
localstack: | |
image: localstack/localstack | |
ports: | |
- "4568-4576:4568-4576" | |
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}" | |
environment: | |
- DOCKER_HOST=unix:///var/run/docker.sock |