Skip to content

Instantly share code, notes, and snippets.

View DinoChiesa's full-sized avatar

Dino Chiesa DinoChiesa

View GitHub Profile
@DinoChiesa
DinoChiesa / Gemini.md
Last active August 7, 2025 21:46
Dino's Gemini.md file

General

  • Avoid obsequiousness. If I ask a reasonable question, don't praise. Just answer. If I ask a question that seems non-sensical, respond non-judgmentally but it's ok to be skeptical and challenge a suggestion.

  • Be economical in prose responses. "Makes sense" is better than "Oh, good question! you are on the right track by asking that."

  • When I ask a question, if things aren't clear, state that. When you're not

@DinoChiesa
DinoChiesa / README.md
Created August 5, 2025 20:09
Dashboard for Gemini Code Assist metrics

tl;dr

To use this, Just copy and paste the JSON from gca_metrics_dashboard.json into a new Cloud Observability dashboard.

Prerequisites for Code Acceptance Metrics

For the "Code Acceptance Metrics" section of the dashboard to work, you must have the following set up in your Google Cloud project:

  1. Enable Gemini for Google Cloud Logging: Logging must be enabled for your project to collect
@DinoChiesa
DinoChiesa / eval-after-load.el
Created July 23, 2025 21:19
Emacs - Adjust csharp-ts-mode indentation rules
(eval-after-load "csharp-mode"
'(progn
;; Adjustments for indentation.
;; This one is for the open curly for the using statement.
;; (The using _directive_ (for import at top of file) is different.)
(setf (cdr (car csharp-ts-mode--indent-rules))
(cons
'((parent-is "using_statement") parent-bol 0)
(cdr (car csharp-ts-mode--indent-rules))))
@DinoChiesa
DinoChiesa / GEMINI.md
Created July 21, 2025 19:52
Gemini MD to reduce sycophancy

General

  • Avoid obsequiousness. If I ask a reasonable question, don't praise. Just answer. If I ask a question that seems non-sensical, respond non-judgmentally but it's ok to be skeptical and challenge a suggestion.

  • Be economical in prose responses. "Makes sense" is better than "Oh, good question! you are on the right track by asking that."

  • When I ask a question, if things aren't clear, state that. When you're not

@DinoChiesa
DinoChiesa / instructions.md
Created July 4, 2025 03:54
Building nginx with lua support
@DinoChiesa
DinoChiesa / Update-TreeSitter.ps1
Created June 29, 2025 16:07
Update Tree Sitter langs to latest for Windows #ps1
<#
.SYNOPSIS
Downloads, extracts, renames, and symlinks the latest Emacs Tree-sitter grammars for Windows.
.DESCRIPTION
This script performs the following actions:
1. Fetches the latest "Release" from https://github.com/emacs-tree-sitter/tree-sitter-langs/releases.
2. Identifies and downloads the `tree-sitter-grammars-windows-0.XX.YYY.tar.gz` file to the system's TEMP directory.
3. Creates a new directory (e.g., `tree-sitter-v0.XX.YYY`) in the current working directory.
4. Extracts the contents of the downloaded archive into this new directory.
@DinoChiesa
DinoChiesa / testPortalPermissions.sh
Last active May 29, 2025 00:04
test Apigee portalAdmin permissions - via bash
#!/bin/bash
# Ensure TOKEN, PROJECT, and ORGANIZATION_ID are set in your environment
if [[ -z "$TOKEN" || -z "$PROJECT" || -z "$ORGANIZATION_ID" ]]; then
echo "Error: TOKEN, PROJECT, and ORGANIZATION_ID environment variables must be exported."
echo "Example: export TOKEN=\$(gcloud auth print-access-token)"
echo " export PROJECT=\"your-project-id\""
echo " export ORGANIZATION_ID=\"your-org-id\"" # e.g., 123456789012
exit 1
fi
@DinoChiesa
DinoChiesa / my-path-helper.el
Created May 25, 2025 02:09
Emacs lisp helper code for setting the path just right on Windows
;; ====================================================================
;; For tools like apheleia and flycheck, other tools that might invoke shell
;; commands (like csslint, csharpier, etc), We need to set the path
;; properly. The following functions help with that. I had some problems
;; getting it just right, so it now verbosely logs everything.
(defun my/reorder-list (list predicate)
"Reorders LIST so that elements satisfying PREDICATE come first.
Returns a new list with elements reordered according to PREDICATE.
The original list is not modified.
@DinoChiesa
DinoChiesa / deploy-with-shasum.sh
Created May 18, 2025 16:57
Deploy Apigee bundle with sha-256 checksum in the Description
#!/bin/bash
# -*- mode:shell-script; coding:utf-8; -*-
#
# Copyright © 2025 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
@DinoChiesa
DinoChiesa / dired-additions.el
Created May 8, 2025 04:35
Copy or move files or directories from one dired buffer to another
(defun mode-for-buffer (&optional buffer-or-string)
"Returns the major mode associated with a buffer."
(with-current-buffer (or buffer-or-string (current-buffer))
major-mode))
(defun my-dired-copy-or-move-other-window (operation)
"Copy or move the marked files to another directory.
OPERATION is a symbol, either `COPY' or `MOVE' .
This works with files or directories."
(unless (eq major-mode 'dired-mode)