Skip to content

Instantly share code, notes, and snippets.

@pomadchin
pomadchin / SchemaAuto.scala
Last active September 27, 2025 00:14
Dynosaur Schema Auto derivation // https://github.com/SystemFw/dynosaur // Scala 2
package io.github.pomadchin.dynosaur.derivation
import dynosaur.Schema
import scala.language.experimental.macros
import scala.reflect.macros.blackbox
object SchemaAuto {
def derive[T]: Schema[T] = macro SchemaMacro.implNoDiscriminator[T]
@pomadchin
pomadchin / SchemaAuto.scala
Last active September 27, 2025 00:13
Dynosaur Schema Auto derivation // https://github.com/SystemFw/dynosaur // Scala 3
package io.github.pomadchin.dynosaur.derivation
import dynosaur.{Prism, Schema}
import dynosaur.Schema.structure.{Alt, Field}
import dynosaur.Schema.AltBuilder
import cats.syntax.apply.*
import cats.syntax.option.*
import cats.syntax.semigroup.*
import cats.free.FreeApplicative
object CforInline:
inline def cfor[A](init: => A)(test: => A => Boolean, next: => A => A)(body: => A => Unit): Unit =
cforInline(init, test, next, body)
inline def cforInline[R](inline init: R, inline test: R => Boolean, inline next: R => R, inline body: R => Unit): Unit =
var index = init
while test(index) do
body(index)
index = next(index)
@pomadchin
pomadchin / Main.scala
Last active August 4, 2024 19:04
GeoTrellis quickstart
package com.pomadchin
import geotrellis.raster.RasterSource
import geotrellis.vector.Extent
object Main {
// https://github.com/locationtech/geotrellis/blob/master/raster/data/one-month-tiles-tiff/test-200506000000_0_1.tiff
// ./bin/hadoop fs -copyFromLocal ~/Downloads/test-200506000000_0_1.tiff /test-200506000000_0_1.tiff
def main(args: Array[String]): Unit =
RasterSource("hdfs://localhost:9000/test-200506000000_0_1.tiff")
@pomadchin
pomadchin / README.md
Created February 13, 2023 23:12 — forked from robertpainsi/README.md
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@pomadchin
pomadchin / example-item-id.json
Last active November 9, 2021 16:00
PySTAC SELF_CONTAINED catalog generation with absolute links in items
{
"type": "Feature",
"stac_version": "1.0.0",
"id": "example-item-id",
"properties": {
"datetime": "2021-11-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
"coordinates": [
@pomadchin
pomadchin / README.md
Last active October 13, 2021 17:59
RF Notebook with STAC and Focal Operations

Instructions to run STAC API Example.ipynb

git clone [email protected]:locationtech/rasterframes.git
cd rasterframes/rasterframes/rf-notebook/src/main/docker

# edit docker-compose.yaml
# image: quay.io/daunnc/rasterframes-notebook:0.9.2-SNAPSHOT
docker compose up
@pomadchin
pomadchin / snippets-importing-libraries.ipynb
Last active October 13, 2021 16:42
RasterFrames STAC and Focal Ops example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function git-tag-rename() {
git tag $2 $1
git tag -d $1
git push origin :refs/tags/$1
git push --tags
}
for tag in $(git tag); do
git-tag-rename "$tag" "v$tag"
done
debug: Using host CA: commonName=StM Root CA
debug: Using host CA: commonName=StM Root CA
debug: Using host CA: commonName=5b7fb0f6-e87d-463a-b1a5-ad7ca22c0540
debug: Using host CA: commonName=17799bf3-1589-4401-9f0f-3dcd835564fb
debug: Using host CA: countryName=US,stateOrProvinceName=New Jersey,localityName=Jersey City,organizationName=The USERTRUST Network,commonName=USERTrust RSA Certification Authority
debug: Using host CA: countryName=US,stateOrProvinceName=New Jersey,localityName=Jersey City,organizationName=The USERTRUST Network,commonName=USERTrust RSA Certification Authority
debug: Using host CA: countryName=US,stateOrProvinceName=MI,localityName=Ann Arbor,organizationName=Internet2,organizationalUnitName=InCommon,commonName=InCommon RSA Server CA
debug: Using host CA: countryName=SE,organizationName=AddTrust AB,organizationalUnitName=AddTrust External TTP Network,commonName=AddTrust External CA Root
debug: Using host CA: countryName=SE,organizationName=AddTrust AB,organizationalUnitName=Add