Skip to content

Instantly share code, notes, and snippets.

@robfitzgerald
robfitzgerald / scale_exterior.rs
Last active February 13, 2025 21:27
A way to scale the exterior of a Polygon or MultiPolygon by some distance
use geo::{
line_string, Centroid, Coord, Distance, GeoFloat, Geometry, KNearestConcaveHull, Length,
LineString, Point, Polygon, Scale,
};
use itertools::Itertools;
use num_traits::FromPrimitive;
/// scales the exterior points of a geometry by some distance.
/// the distance should be in the unit that matches the output of the parameterized Distance
/// trait. for example, using [`geo::Haversine`] expects points in WGS84 lat/lon degrees and
openssl genrsa -out ca.key 2048
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
#:: CZ
#:: Prague
#:: Mrackova
#:: Whatever You Need
#::
#:: domain.cz
#:: email@domain.com
@goliatone
goliatone / README.md
Last active July 1, 2025 14:25 — forked from colophonemes/create_triggers
Postgres TRIGGER to call NOTIFY with a JSON payload

This TRIGGER function calls PosgreSQL's NOTIFY command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.

Create the trigger with notify_trigger.sql.

When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)

The payload returns a JSON object:

@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@patriknw
patriknw / FlowControlSample.scala
Last active May 10, 2018 18:35
Illustrates Actor message flow control with "work pulling pattern". This code is licensed under the Apache 2 license.
package flowcontrol
import scala.concurrent.duration._
import akka.actor.typed.ActorRef
import akka.actor.typed.ActorSystem
import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.Behaviors
/**
@tarlen5
tarlen5 / calculate_mean_ap.py
Last active May 21, 2025 03:38
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@gmr
gmr / rabbitmq-autocluster_k8s_persistent.bash
Created January 10, 2018 20:24 — forked from pmint93/rabbitmq-autocluster_k8s_persistent.bash
Deploy rabbitmq-autocluster on k8s with persistent storage (EBS)
#!/bin/bash
set -eo pipefail
export KUBE_NAMESPACE=test
export REPLICA_COUNT=3
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1beta1
kind: StatefulSet
@saudet
saudet / RedBloodCellDetection.java
Last active March 2, 2024 17:14
Example of object detection with DL4J on images of red blood cells
package org.deeplearning4j.examples.convolution.objectdetection;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.bytedeco.javacv.CanvasFrame;
import org.bytedeco.javacv.OpenCVFrameConverter;
@Pulimet
Pulimet / AdbCommands
Last active October 22, 2025 08:20
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
sealed trait Decidable[+Proof]
final case class Yes[Proof](proof: Proof) extends Decidable[Proof]
final case object No extends Decidable[Nothing]
sealed trait List[+A] {
def nonEmpty: Decidable[this.type <:< ::[A]]
def ::[AA >: A](value: AA): ::[AA] = new ::[AA](value, this)
}
final case object Nil extends List[Nothing] {
def nonEmpty: Decidable[this.type <:< ::[Nothing]] = No