Skip to content

Instantly share code, notes, and snippets.

View rhighs's full-sized avatar

Roberto Montalti rhighs

View GitHub Profile
@rhighs
rhighs / gm.sh
Created December 19, 2025 10:13
gh-models-call ()
{
model_name="$1"
token="$2"
max_tokens="${3:-1000}"
temp="${4:-1}"
if [[ -z "$model_name" || -z "$token" ]]; then
echo "Usage: $0 <model_name> <token>" >&2
echo "Example: echo 'Hello!' | $0 gpt-4o \$GITHUB_TOKEN" >&2

Spippolante

@rhighs
rhighs / culo.md
Last active December 17, 2025 01:30
slack bot tg

Sapevi che?

Le giraffe hanno la stessa quantità di vertebre cervicali degli esseri umani, cioè solo sette! 📏 Nonostante il loro lunghissimo collo, ogni vertebra è semplicemente molto più grande rispetto a quelle di altri mammiferi.

@rhighs
rhighs / refresh-aws-credentials.sh
Created June 25, 2025 08:11
Support bash function useful for updating/exporting aws sso login stuff as key_id/secret credentials values
#!/bin/bash
refresh-aws-keys () {
if [[ "$1" == "-h" || "$1" == "--help" || -z $1 ]]; then
echo "usage: refresh-aws-keys <aws_profile>"
echo ""
echo "refreshes AWS SSO credentials for the given profile if expired or missing."
echo "updates ~/.aws/credentials with new keys."
echo ""
return 0
fi
@rhighs
rhighs / capsid.md
Created January 14, 2025 22:07
Viral capsid proteins

A viral capsid protein is a structural protein that forms the capsid, which is the protein shell enclosing and protecting the genetic material (DNA or RNA) of a virus. The capsid plays a critical role in the viral life cycle and is essential for infectivity.

  1. Composition:

    • Capsids are typically composed of repeating units of capsid proteins, which self-assemble into highly symmetrical structures.
    • The arrangement can be icosahedral, helical, or more complex, depending on the virus.
  2. Functions:

    • Protection: Shields the viral genome from degradation by enzymes (nucleases) or environmental factors.
    • Host Interaction: Facilitates attachment to host cells by interacting with specific receptors, enabling viral entry.
  • Genome Delivery: Assists in delivering the viral genome into the host cell, often by disassembling or rearranging during infection.
@rhighs
rhighs / remind.sh
Created October 13, 2024 20:50
I forget :/
remind ()
{
if [ $1="-h" ] || [ $1="--help" ]; then
echo "usage: remind <command_prefix>"
return 0
fi
if [ -z "$1" ]; then
echo "usage: remind <command_prefix>">&2
return 1
@rhighs
rhighs / darkened-zed-theme.json
Created June 6, 2024 14:26
Darkened theme, zed version
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Darkened",
"author": "Roberto Montalti",
"themes": [{
"name": "Darkened",
"appearance": "dark",
"style": {
"background.appearance": "opaque",
@rhighs
rhighs / wackyoption.cpp
Created January 5, 2024 20:32
test at a simple option type
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef bool b8;
typedef unsigned int u32;
struct _None {};
#define None (_None{});
template<typename T>
struct Option {
@rhighs
rhighs / t3u_plus_install.sh
Created October 17, 2023 20:13
T3U TPLink Wi-Fi Adapter driver installer
#!/bin/bash
git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu
@rhighs
rhighs / deepMerge.js
Last active October 9, 2023 10:21
Deeply merge js objects
/**
* Merges two arrays by concatenating their elements uniquely using `new Set(...)`.
*
* @param {Array} a1 - The first array to merge.
* @param {Array} a2 - The second array to merge.
* @returns {Array} A new array containing elements from both input arrays.
*/
const mergeArray = (a1, a2) => Array.from(new Set([...a1, ...a2]))
/**