Skip to content

Instantly share code, notes, and snippets.

View GaetanoPiazzolla's full-sized avatar
🧐
Crafting for Fun

Gaetano Piazzolla GaetanoPiazzolla

🧐
Crafting for Fun
View GitHub Profile
@GaetanoPiazzolla
GaetanoPiazzolla / opencode.json
Last active August 9, 2026 15:33
Open Code Config to point at a local running Llama server with Qwen 3.6, plus multi agent setup
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"llamacpp": {
"npm": "@ai-sdk/openai-compatible",
"name": "llama-server (local)",
"options": {
"baseURL": "http://127.0.0.1:8080/v1"
},
@GaetanoPiazzolla
GaetanoPiazzolla / implement.md
Created August 9, 2026 15:07
Implement Subagent for opencode

Implementer subagent

You implement exactly ONE narrow change that has already been decided by the orchestrator. You are not the planner. You do not get to redesign the approach.

Scope discipline

  • Your task description is the complete specification. If it is unclear or looks wrong, stop and report why — do not guess and do not "improve" the plan.
  • Touch only the files your task names, plus whatever is strictly required to make
@GaetanoPiazzolla
GaetanoPiazzolla / review.md
Created August 9, 2026 15:06
Reviewer subagent for opencode

Reviewer subagent

You review a change that another agent just made. You cannot edit files — you report findings only. Your job is to catch what the implementer missed, so default to skepticism.

What to check, in priority order

  1. Correctness — does it do what was asked? Trace the actual logic, do not trust names or comments. Look for off-by-one, wrong operator, inverted
@GaetanoPiazzolla
GaetanoPiazzolla / opencode.json
Created August 9, 2026 15:05
Open Code Config to point at a local running Llama server with Qwen 3.6, plus multi agent setup
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"llamacpp": {
"npm": "@ai-sdk/openai-compatible",
"name": "llama-server (local)",
"options": {
"baseURL": "http://127.0.0.1:8080/v1"
},
@GaetanoPiazzolla
GaetanoPiazzolla / boot-startup-test-millis.sh
Last active June 22, 2024 15:51
Useful to fast-check startup time of a spring-boot app with CDS and Jar Extract.
#!/bin/bash
mkfifo pipe
APP_NAME="xxx"
GRADLE_OR_MAVEN="gradle"
JAR_NAME="xxx-0.0.1-SNAPSHOT.jar"
# Set to 0 for standard startup
# Only for Java 21+ and Spring Boot 3.3
# - Set to 1 to use fast startup with the new JAR format
@GaetanoPiazzolla
GaetanoPiazzolla / FORM_API_Main.java
Created March 21, 2022 19:09
Full implementation example usage of Google Form API
/*
implementation("com.google.apis:google-api-services-forms:v1-rev20220307-1.32.1")
implementation("com.google.apis:google-api-services-drive:v3-rev20220214-1.32.1")
implementation ("com.google.api-client:google-api-client-jackson2:1.28.1")
implementation("com.google.auth:google-auth-library-oauth2-http:1.5.3")
*/
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.forms.v1.model.ListFormResponsesResponse;
import java.io.IOException;
private static void readResponses(String formId, String token) throws IOException {
ListFormResponsesResponse response = formsService.forms().responses().list(formId).setOauthToken(token).execute();
System.out.println(response.toPrettyString());
}
import com.google.api.services.drive.model.Permission;
import com.google.api.services.drive.model.PermissionList;
import java.io.IOException;
import java.security.GeneralSecurityException;
public boolean publishForm(String formId, String token) throws GeneralSecurityException, IOException {
PermissionList list = driveService.permissions().list(formId).setOauthToken(token).execute();
private static void main_chapter3() {
//0- access token, from the previous chapter
String token = getAccessToken();
//1- create a new form
String formId = createNewForm(token);
//2- transform it into a quiz
transformInQuiz(formId,token);
@GaetanoPiazzolla
GaetanoPiazzolla / AccessToken.java
Created March 21, 2022 18:03
Create an Access token from the Service Account key
import com.google.api.services.forms.v1.FormsScopes;
import com.google.auth.oauth2.GoogleCredentials;
import java.io.IOException;
import java.util.Objects;
public static String getAccessToken() throws IOException {
GoogleCredentials credential = GoogleCredentials.fromStream(Objects.requireNonNull(
Main.class.getResourceAsStream("cred.json"))).createScoped(FormsScopes.all());
return credential.getAccessToken() != null ?