Skip to content

Instantly share code, notes, and snippets.

@jasonsnell
jasonsnell / enphase_average.5m.py
Last active January 20, 2025 08:11
Enphase Envoy Local Data - SwiftBar/xBar Menu Bar Script
#! /usr/bin/env python3
# This script is explained here: <https://sixcolors.com/post/2024/10/putting-my-solar-system-in-my-menu-bar/>
# Adapted from [email protected] <https://github.com/grzegorz914/homebridge-enphase-envoy>
# <xbar.title>Enphase Solar (Averages)</bitbar.title>
# <xbar.version>v1.2</xbar.version>
# <xbar.author>Jason Snell</xbar.author>
# <xbar.author.github>jasonsnell</xbar.author.github>
# <xbar.desc>Display local Enphase solar stats.</xbar.desc>
@gavinmn
gavinmn / KeyboardAttachedView.swift
Created August 20, 2024 02:38
Attach a view to the keyboard with interactive dismissal support
//
// ContentView.Swift
// KeyboardAttachedView
//
// Created by Gavin Nelson on 8/19/24.
//
import SwiftUI
import UIKit
@stephancasas
stephancasas / NSApplication+NSResponderDebug.swift
Created March 18, 2024 20:35
An extension on NSApplication providing a computed property that describes the current responder chain.
//
// NSApplication+NSResponderDebug.swift
//
// Created by Stephan Casas on 3/18/24.
//
import Cocoa;
extension NSApplication {
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active March 18, 2025 21:32
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@kconner
kconner / macOS Internals.md
Last active May 15, 2025 02:32
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@ewhauser
ewhauser / BUILD.bazel
Created April 19, 2022 15:31
Bazel + Gunicorn
gunicorn_binary(
name = "hello",
args = ["hello:app"],
deps = [
"@pypi_flask//:pkg",
],
)
@DvilMuck
DvilMuck / aternosAntiAntiadblock.user.js
Last active May 12, 2025 00:26
Aternos Anti Anti Adblock userscript for Aternos.org
// ==UserScript==
// @name Aternos Anti Anti-adblock
// @namespace r0630hh1edcuum5397kimyc0ucwy2h3psn4c6r1u4j
// @version 0.1.23
// @description Fuck anti-adblock from the free hosting minecraft servers Aternos.org. Parry this you filthy casual!
// @author Angry Developer against excessive ADs
// @source https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a
// @supportURL https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a
// @updateURL https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a/raw/aternosAntiAntiadblock.user.js
// @downloadURL https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a/raw/aternosAntiAntiadblock.user.js
@progrium
progrium / cli.go
Created September 2, 2021 01:13
350 line reimplementation of cobra, simplified and with no dependencies
package cli
import (
"bytes"
"context"
"flag"
"fmt"
"os"
"reflect"
"strings"
@itsthejoker
itsthejoker / dadjoke.py
Created March 13, 2021 21:36
Random dadjoke from fatherhood.gov
#!/usr/bin/env python
# source: 'https://gist.github.com/itsthejoker/33c390748fd8d4184ca81d421b69f9e6'
from urllib import request
import json
import random
resp = request.urlopen("https://fatherhood.gov/jsonapi/node/dad_jokes")
joke = random.choice(json.loads(resp.read()).get('data')).get('attributes')
if joke: