Skip to content

Instantly share code, notes, and snippets.

@bryanbanda
bryanbanda / gist:be79121ecca85501f09ee266f6d68f22
Created March 8, 2019 12:09 — forked from oddnoc/gist:3280068
Handy git config settings
# Some of these settings came from http://cheat.errtheblog.com/s/git
[alias]
br = branch
brav = branch -avv
brv = branch -vv
ci = commit
co = checkout
contributors = shortlog -se
df = diff

This is explaining stuff relevant to AOC 2021 day 6

How is a matrix used to count fish?

First lets do fibonacci numbers because it's smaller (2x2 matrix instead of 9x9) and it's familiar ground.

So you can implement fibs like this:

def fib(n):
@bryanbanda
bryanbanda / compinit.zsh
Created September 24, 2022 18:27 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@bryanbanda
bryanbanda / index.html
Created March 4, 2024 20:06 — forked from oaluna/index.html
Stripe Website Gradient Animation
<html>
<head>
<title>Stripe Gradient</title>
</head>
<body>
<canvas id="gradient-canvas" data-js-darken-top data-transition-in>
<!--
Remove data-js-darken-top to keep the same brightness in the upper part of the canvas
-->
</canvas>
@bryanbanda
bryanbanda / ColorExt.swift
Created March 16, 2024 09:01 — forked from m1guelpf/ColorExt.swift
Source for the Underlay demo
import SwiftUI
extension Color {
static var background: Color {
return Color(uiColor: .systemBackground)
}
static var secondaryBackground: Color {
return Color(uiColor: .secondarySystemBackground)
}