Skip to content

Instantly share code, notes, and snippets.

View bkono's full-sized avatar

Bryan Konowitz bkono

View GitHub Profile
@bkono
bkono / multitool.go
Last active April 24, 2024 17:53
Simple update to the go-openai completion-with-tools example for Groq and Mixtral
// Beefed up version that includes multiple tools and a verbose flag for printing the dialogue along the way.
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"math"
"math/rand"
@bkono
bkono / router.go
Last active February 28, 2024 22:50
Custom NotFound and Middleware with new golang 1.22 http router
package main
import (
"fmt"
"log/slog"
"net/http"
"slices"
)
type (
@bkono
bkono / SingleTableAppSync.md
Created December 16, 2022 22:29 — forked from dabit3/SingleTableAppSync.md
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
@bkono
bkono / action.js
Created November 21, 2022 04:06
Pipedream action for creating a draft in Typefully. Supports unscheduled and next-free-slot.
import axios from "axios";
export default {
name: "Typefully Create Draft",
description:
"Create a draft in Typefully. Supports unscheduled draft, or adding to next available slot.",
key: "typefully_create_draft",
version: "1.0.0",
type: "action",
props: {
@bkono
bkono / f.fish
Last active May 26, 2022 22:17
Some useful FZF fish funcs
function f -d "Fuzzy-find and open a file in current directory"
set file (fzf --height 40% --info inline --border --reverse --preview 'bat {}')
if test -n "$file"
nvim $file
end
end
@bkono
bkono / ptr.go
Last active January 17, 2024 00:58
A decent use of generics, safe derefence
// Package ptr implements a simple pointer instrumentation.
// As it is based on Go generics, the minimal Go version is 1.18.
// Credit to https://github.com/candiduslynx/ptr/ and https://gist.github.com/bkono/8f832566e6c2875d7cede15e46aa9d58
package ptr
// Deref will deref the pointer if it can, otherwise it will return either a fallback if provided, or a default value for T
func Deref[T any](pointer *T, fallback ...T) T {
if pointer != nil {
return *pointer
}
@bkono
bkono / redirecting-github-pages.md
Created March 11, 2022 18:21 — forked from domenic/redirecting-github-pages.md
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.

The solution

Cello Project
Individual Contributor License Agreement ("Agreement") v1.0
Thank you for your interest in the Cello Project. In order to clarify the intellectual
property license granted with Contributions from any person or entity, Intuit Inc.
(Intuit), the current custodian of the Cello Project, must have a Contributor License
Agreement ("CLA") on file that has been signed by each Contributor, indicating
agreement to the license terms below. This license is for your protection as a
@bkono
bkono / actionlist.vim
Created August 15, 2021 05:08 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real