Skip to content

Instantly share code, notes, and snippets.

// lock code around a file handle when multiple processes running and single access
fn main() {
std::thread::spawn(|| {
let lock = with_lock("my_lock".to_string());
loop {
let r = lock(|| {
sleep(Duration::from_millis(100));
"blah"
});
sleep(Duration::from_millis(500));
import java.util.concurrent.locks.ReentrantReadWriteLock
import com.typesafe.scalalogging.LazyLogging
import scala.collection.mutable
import scala.concurrent.duration._
/**
* Trivial cache which is lazily limited to size - when size is exceeded with evict the oldest object
* @param limitSize the limit size option
endpoint status

there are 1161 potential requests in file

❌ POST /recommend?_=1565526947122 BODY: {"sec":8771591,"uid":"-2769713442859793034","data":{"wId":"55571","fId":16583,"maxProducts":24,"rules":[{"id":217054,"type":"include","slots":[],"isContextAware":true}],"ctx":{"type":"PRODUCT","data":["2000352323022"]},"filtering":[]},"v":1} 1c1

/Users/avnerbarr/workspace/docker-dev/offline-scripts/GORMirror: ./.build/x86_64-apple-macosx/debug/GORMirror there are 1161 potential requests in file ✅ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/v2/recommend?_=1565526951847", requestBody: Optional(424 bytes), headers: nil)

❌ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/recommend?_=1565526947636", requestBody: Optional(503 bytes), headers: nil)
sku name price categories group_id image_url in_stock url keywords
a a 1 a a http://a.com true http://blah.com a
@avnerbarr
avnerbarr / Arkit.md
Created June 22, 2019 09:14
ARKit learning

Scene

Drag ARKitSCNView to story builder or make in code

@IBOutlet weak var sceneView: ARSCNView!
  let configuration = ARWorldTrackingConfiguration()

Add a configuration object to the view controller

sku image_url group_id name url in_stock price categories
sku-1 http://sku-1.com/a.png group-sku-1 name-sku-1 http://sku-1.com true 5 sku-1
sku group_id name url price in_stock image_url categories
123 123 test product https://www.linio.com 1 false https://www.linio.com Test
567 567 test product 2 https://www.linio.com 1 true https://www.linio.com Test
This file has been truncated, but you can view the full file.
[
{
"sku": 51528960275,
"brand": "Rebecca-Minkoff",
"categories": "P/17 UM HB",
"condition": "new",
"description": "Keep your style classic and simple with the sophisticated, take-anywhere Fulton Brief. Style #: HU17MSCR02",
"dy_display_price": 325,
"group_id": 12375378259,
"image_url": "https://cdn.shopify.com/s/files/1/1754/9245/products/hu17mscr02_fulton_brief_13_15_blackcement_a_large.jpg?v=1506359518",