Skip to content

Instantly share code, notes, and snippets.

View Grogs's full-sized avatar

Greg Dorrell Grogs

View GitHub Profile
@Grogs
Grogs / issue-540-merchant-sources.md
Created July 29, 2026 23:21
BeerDB #540 merchant source investigation

Merchant source investigation for #540

Investigated 2026-07-22 with one or two small, read-only requests per merchant. These are live storefront contracts, not documented public APIs, so fixtures must isolate tests from later schema or catalogue changes.

Recommendation

Use Vocation first and Polly’s second.

  • Vocation is the safest Shopify pilot: the storefront JSON has an explicit Beer product type, useful tags, availability, images, and single-can versus case variants. It exercises the dominant source shape without making initial filtering depend entirely on title parsing.
  • Polly’s is the safest representative non-Shopify pilot: WooCommerce Store API responses expose canonical permalinks, purchasability, stock, minor-unit prices, categories, and images. Response headers provide exact total/page counts.
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % Test
@Grogs
Grogs / RateLimiter.scala
Created December 6, 2017 00:01
Token bucket rate limiter for Scala Futures
package me.gregd.cineworld.util
import java.util.concurrent.ConcurrentLinkedQueue
import monix.execution.Scheduler.Implicits.global
import monix.execution.atomic.AtomicInt
import scala.concurrent.{Future, Promise}
import scala.concurrent.duration._
/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=55573:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/
@Grogs
Grogs / FileCache.scala
Last active June 4, 2022 22:58
File backed implementation of ScalaCache Cache
import java.nio.ByteBuffer
import java.nio.channels.{AsynchronousFileChannel, CompletionHandler, FileLock}
import java.nio.file.StandardOpenOption.{CREATE, READ, WRITE}
import java.nio.file._
import java.util.concurrent.{Executors, TimeUnit}
import scala.compat.java8.FunctionConverters.asJavaConsumer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future, Promise}
document.querySelectorAll("#saved-passwords-list > .deletable-item > div").forEach(function(p) {
var url = p.querySelector(".url").title
var login = p.querySelector(".name").title
var password = p.querySelector(".password > input").value
console.log(url+"|"+login+"|"+password)
})

Keybase proof

I hereby claim:

  • I am grogs on github.
  • I am grogs (https://keybase.io/grogs) on keybase.
  • I have a public key ASD3ayP7kXNObEWH6f3U8xDBSKzpGlgVI-VAORw0nXemwAo

To claim this, I am signing this object: