Skip to content

Instantly share code, notes, and snippets.

@greenstevester
greenstevester / how-to-setup-ollama-on-a-macmini.md
Last active June 17, 2026 19:49
April 2026 TLDR setup for Ollama + Gemma 4 12B on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive

April 2026 TLDR setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon) — auto-start, preload, and keep-alive

April 2026 TLDR Setup for Ollama + Gemma 4 on a Mac mini (Apple Silicon)

Prerequisites

  • Mac mini with Apple Silicon (M1/M2/M3/M4/M5)
  • At least 16GB unified memory for Gemma 4 (default 8B)
  • macOS with Homebrew installed
@kofta999
kofta999 / keymap.json
Created April 3, 2025 22:46
Zed config files
[
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work in normal & visual mode
// Git
"space g h d": "editor::ToggleSelectedDiffHunks",
"space g h r": "git::Restore",
// Toggle inlay hints
@ArmandoAssuncao
ArmandoAssuncao / ruby_selenium_with_proxy.rb
Last active November 26, 2023 14:29
Ruby Selenium with Proxy
# Obs: Work only in Firefox 66.x or prior, because the function "driver.switch_to.alert.send_keys" not work in new versions.
# tested in selenium-webdriver (3.142.7), webdrivers (4.6.0) and firefox (66.0.5)
# Download firefox to folder
# config/initializers/selenium.rb
Selenium::WebDriver::Firefox::Binary.path = 'path/to/firefox/66.x'
# -----------------------------------------------------------------------------------------------------
# Code
@berkant
berkant / cloud-init.cfg
Last active September 24, 2025 01:37
Cloud-init config to set up my Ubuntu dev machine.
## template: jinja
#cloud-config
{% if v1.distro_release == 'focal' %}
users:
- name: berkant
shell: /usr/bin/bash
ssh_import_id: gh:berkant
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
@parrotmac
parrotmac / dbus-send-modem-command.sh
Created November 15, 2018 08:14
Send serial command to modem using ModemManager via DBus
#!/bin/sh
# Sends command 'ATI' to modem #3
# Get a list of modems by running `mmcli -L`
# Timeout is (probably) 2 seconds
# Also see https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.Command
dbus-send --system --dest=org.freedesktop.ModemManager1 --print-reply /org/freedesktop/ModemManager1/Modem/3 org.freedesktop.ModemManager1.Modem.Command string:'ATI' uint32:2000
@dideler
dideler / bot.rb
Last active July 5, 2026 02:34
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active October 27, 2025 08:09
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

package main
import (
"fmt"
"log"
"net"
"time"
)
// Dialer .
// junkterm is a quick and dirty serial terminal.
package main
import (
"io"
"log"
"os"
"github.com/pkg/term"
"github.com/spf13/cobra"
package main
import (
"code.google.com/p/go.net/websocket"
)
type connection struct {
// The websocket connection.
ws *websocket.Conn