Skip to content

Instantly share code, notes, and snippets.

View feroult's full-sized avatar
always coding ;)

Fernando Ultremare feroult

always coding ;)
View GitHub Profile
@feroult
feroult / AppengineFirebaseAuth.java
Last active November 22, 2017 18:00
Firebase 3.0 + GAE
public class AppengineFirebaseAuth {
private static final String APP_ID = "YOUR_APP_ID";
public static AppengineFirebaseToken verifyIdToken(String token) {
Map<String, String> publicKeys = GooglePublicKeys.getKeys();
for (String kid : publicKeys.keySet()) {
String publicKey = publicKeys.get(kid);
@feroult
feroult / Person.kt
Last active October 4, 2017 11:46
YAWP Kotlin
@Endpoint(path = "/people")
class Person(@Id
var id: IdRef<Person>? = null,
var name: String? = null,
var age: Int? = null)
fun example() {
var person = Person(name = "John", age = 10)
print("${person.name} has ${person.age} years old")
@feroult
feroult / convert_to_pb.py
Last active March 3, 2024 23:22
Convert OpenSeq2Seq trained model to PB file
import tensorflow as tf
from open_seq2seq.utils.utils import get_base_config, check_logdir, create_model
# Change with your configs here
args_S2T = ["--config_file=/data/training/v5/config-J5x3.py",
"--mode=interactive_infer",
"--logdir=/data/training/v5/models",
"--batch_size_per_gpu=10",
]
@feroult
feroult / gist:b8c88fe38ddea4c2637725cc6ae82a15
Created February 5, 2021 14:56
Id Token Google Cloud Build
- name: gcr.io/cloud-builders/gcloud
entrypoint: "bash"
args:
- "-c"
- |
apt update && apt install jq -y
curl -X POST -H "content-type: application/json" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-d '{"audience": "dexinapp"}' \
"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/___SERVICE_ACCOUNT_EMAIL___:generateIdToken" | jq -r .token > /workspace/token.txt
#!/usr/bin/env python3
"""
Minimal reproduction of PreToolUse hook not being called for non-existent file paths.
This script demonstrates that PreToolUse hooks are NOT invoked when Claude calls
the Read tool with a file path that doesn't exist, contradicting the documentation
which states hooks execute "before processing the tool call".
"""
import asyncio
import logging