Skip to content

Instantly share code, notes, and snippets.

@quartzjer
quartzjer / When Mushrooms Speak of Stars.md
Created January 4, 2025 20:33
A short story written by Gemini 2: When Mushrooms Speak of Stars

The forest held its breath, the usual symphony of birdsong silenced, a stillness that sent a shiver crawling up Dr. Sarah Chen's spine. She adjusted the focus on her microscope, her pen scratching across the page, recording the intricate fungal network like a cartographer plotting a hidden world. The soil sample beneath the lens revealed a complex world of hyphae, a miniature ecosystem. As she gathered her equipment, she noticed a small mushroom, its cap shimmering with an iridescent sheen. It was a variety she'd cataloged before, but the way this one refracted the light, its delicate purple gills now starting to droop slightly, felt different, an anomaly in the forest's otherwise predictable palette. The towering redwoods cast long shadows, the filtered sunlight dancing on the moss-covered floor, the air thick with the smell of damp earth, and something else, a subtle, electric hum she could almost feel, a resonance that tickled the edges of her skin. Her hand, almost of its own accord, reached toward the ir

@quartzjer
quartzjer / gemini_rt_websocket.md
Created December 12, 2024 01:25
Gemini 2.0 Realtime WebSocket API Notes & Examples

These are some cleaned up notes that may help fill in gaps in the official docs, full real wire examples are nice ;)

Connection

Connect to the WebSocket endpoint:

wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key=YOUR_API_KEY

Protocol Overview

Creating a richly detailed unicorn in SVG involves using paths, shapes, gradients, and filters to give it a distinctive look. Here's a complete SVG depiction of a unicorn:
```svg
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 500 500"
width="500px"
height="500px"
>
@quartzjer
quartzjer / up.sh
Last active April 8, 2021 18:58
simple shell wrapper to run any command in a loop
#!/bin/sh
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "first arg $1 must be number of seconds to wait between loops" >&2; exit 1
fi
count=0
while [ true ]
@quartzjer
quartzjer / tectonic
Created March 9, 2021 23:13 — forked from r-rmcgibbo/tectonic
system: x86_64-linux | build_time: 7 minutes | https://github.com/NixOS/nixpkgs/pull/115636
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/v38dgprlggn9jx7zqp8gjvjs80kw0www-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/90v63505na41d2i07v7rdyd3rmpkxkyj-tectonic-0.4.1-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
Executing cargoSetupPostPatchHook

Keybase proof

I hereby claim:

  • I am quartzjer on github.
  • I am quartzjer (https://keybase.io/quartzjer) on keybase.
  • I have a public key ASCTHskd5O1mVq1mJUywKNPS1lcMtNmsL63vl8UC8kaElwo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1FqKbcAP3uhk6EBC5Qr6Wu98dfP6Pwp2Dg https://explorer.blockstack.org/address/1FqKbcAP3uhk6EBC5Qr6Wu98dfP6Pwp2Dg
function testGenerateImportExport(cipher){
return crypto.subtle.generateKey(cipher, true, cipher.usage).then(function(keys){
if (keys.type === "secret") //only one secret key (e.g. with HMAC)
cipher.keys = [keys];
else
cipher.keys = [keys.privateKey, keys.publicKey];
var exportProms = [];
for (var i = 0; i < cipher.keys.length; i++){
exportProms.push(crypto.subtle.exportKey("jwk", cipher.keys[i]));
@quartzjer
quartzjer / pins.json
Created September 6, 2014 22:11
pinoccio scoutscript pin.status json
{
"rx0":{"id":"0", "mode":"reserved", "val":"-"},
"tx0":{"id":"1", "mode":"reserved", "val":"-"},
"d2":{"id":"2", "mode":"unset", "val":"-", "pwm":true, "wakeup":0},
"d3":{"id":"3", "mode":"unset", "val":"-", "pwm":true},
"d4":{"id":"4", "mode":"unset", "val":"-", "pwm":true, "wakeup":0},
"d5":{"id":"5", "mode":"unset", "val":"-", "pwm":true, "wakeup":0},
"d6":{"id":"6", "mode":"unset", "val":"-"},
"d7":{"id":"7", "mode":"unset", "val":"-", "wakeup":0},
"d8":{"id":"8", "mode":"unset", "val":"-"},
@quartzjer
quartzjer / w5100_spi.ino
Created August 23, 2014 17:26
minimal spi w5100 ethernet boot test for debugging
/**************************************************************************\
* Pinoccio Library *
* https://github.com/Pinoccio/library-pinoccio *
* Copyright (c) 2014, Pinoccio Inc. All rights reserved. *
* ------------------------------------------------------------------------ *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the MIT License as described in license.txt. *
\**************************************************************************/
#include <SPI.h>
#include <Wire.h>