Skip to content

Instantly share code, notes, and snippets.

View sgammon's full-sized avatar
:shipit:
f*ck it, ship it

Sam Gammon sgammon

:shipit:
f*ck it, ship it
View GitHub Profile
@sgammon
sgammon / central-snapshot.sql
Created April 5, 2024 00:36
Maven Central snapshot from multiple sources
WITH
Snapshots AS (
SELECT TIMESTAMP_TRUNC(MAX(SnapshotAt), DAY) AS Latest
FROM `bigquery-public-data.deps_dev_v1.PackageVersionsLatest`
WHERE system = 'MAVEN'
LIMIT 1
),
ReadyArtifacts AS (
SELECT
There appears to be a string encoded in the binary payload:
https://gist.github.com/q3k/af3d93b6a1f399de28fe194add452d01#file-hashes-txt-L115
Which functions as a killswitch:
https://piaille.fr/@zeno/112185928685603910
Thus, one workaround for affected systems might be to add this to `/etc/environment`:
```
@sgammon
sgammon / settings.gradle.kt
Created July 11, 2023 05:11
Buildless for Gradle: Kotlin DSL
import build.less.plugin.settings.buildless
plugins {
id("build.less") version "1.0.0-beta1"
}
buildless {
// settings go here
}
@sgammon
sgammon / settings.gradle
Created July 11, 2023 05:10
Buildless for Gradle: Groovy
plugins {
id 'build.less' version '1.0.0-beta1'
}
buildless {
// settings go here
}
@sgammon
sgammon / settings.gradle
Created July 11, 2023 05:09
Buildless for Gradle: Installation
plugins {
id 'build.less' version '1.0.0-beta1'
}
buildless {
// settings go here
}
@sgammon
sgammon / gradle.properties
Created January 6, 2023 23:06
Gradle properties for Elide toolchain issue
# set these in your ~/.gradle/gradle.properties to fix gradle toolchain issues with Elide.
# (this is a temporary fix until the GraalVM toolchain plugin is fully built).
# fix for GraalVM toolchain
versions.java.language=19
org.gradle.java.installations.paths=/Library/Java/JavaVirtualMachines/gvm-ce.jdk19/Contents/Home
org.gradle.java.home=/Library/Java/JavaVirtualMachines/gvm-ce.jdk19/Contents/Home
# repositories for Elide
elide.publish.repo.maven = gcs://elide-snapshots/repository/v3
did:3:kjzl6cwe1jw145avw57b0udbnrk7gac9bbx83x7lkhiewr0so2tetaloleew3nh
@sgammon
sgammon / Passbase.kt
Last active March 2, 2022 15:10
Example of Passbase metadata encryption in Kotlin. Private key given by example (not a real key)
package com.passbase.sample
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import java.io.*
import java.nio.charset.StandardCharsets
import java.security.*
import java.security.spec.PKCS8EncodedKeySpec
import java.util.*
@sgammon
sgammon / CryptoLogic.kt
Created December 29, 2021 18:24
Example of Passbase metadata encryption in Kotlin
class CryptoLogic {
companion object {
const val metadataCipher = "RSA/None/PKCS1Padding"
}
fun <R> encryptMetadata(plaintext: String, callback: (String) -> R): R {
return withPublicKey(/* key info... */) { publicKey ->
// initialize the cipher with the resolved public key
val cipher: Cipher = Cipher.getInstance(metadataCipher)
cipher.init(Cipher.ENCRYPT_MODE, publicKey)
@sgammon
sgammon / BUILD.bazel
Created January 4, 2021 19:18
rust-wasm-build-bg-unfurled
exports_files([
"README.md",
"cfe-v1.js",
])
cargo_build_script(
name = "worker_builder",
srcs = ["build.rs"],
rustc_env = {"CARGO_PKG_VERSION": RUST_CARGO_VERSION},