Skip to content

Instantly share code, notes, and snippets.

View jasich's full-sized avatar

Jason Sich jasich

View GitHub Profile
@jasich
jasich / gist:a1ea2f6a3d195fc57f01
Created July 22, 2014 19:35
Golang BasicAuth Middleware
package security
import (
"encoding/base64"
"net/http"
"strings"
)
// BasicAuth Middleware with next handler in chain
type BasicAuth struct {
@jasich
jasich / gist:1ad1d22969cd17b79889
Last active August 29, 2015 14:05
Go Chunks of Base64 Image
image := make([]byte, asset.BlobInfo.Size)
reader := blobstore.NewReader(ctx, asset.BlobInfo.BlobKey)
reader.Read(image)
imageAsBase64 := base64.StdEncoding.EncodeToString(image)
megabyte := (500)
totalSize := len(imageAsBase64)
totalChunks := int(math.Ceil(float64(totalSize) / float64(megabyte)))
$/
  docs/
  src/
  tests/
  samples/
  artifacts/
  packages/
  build/
 lib/
@jasich
jasich / scroll.cljs
Created December 11, 2016 02:28
ClojureScript scroll element into view
;; Based on https://github.com/GabrielDelepine/smooth-scroll/blob/main/smooth-scroll.js
(ns example.scroll)
(def speed 500)
(def moving-frequency 15)
(defn cur-doc-top []
(+ (.. js/document -body -scrollTop) (.. js/document -documentElement -scrollTop)))
(defn element-top [elem top]
@jasich
jasich / reload-video-sources.sh
Created March 22, 2017 13:19
Update list of video sources for Slack & Sococo
sudo killall VDCAssistant
Omakase: https://i.imgflip.com/20c9zd.jpg
@jasich
jasich / copy.cljs
Created January 29, 2018 02:18
Browser Copy in CLJS
(defn copy-text-from-elem
[elem-id]
(let [elem (.getElementById js/document elem-id)]
(.select elem)
(try
(if (.execCommand js/document "copy")
"Copied to Clipboard!!"
"Sorry Couldn't Copy")
(catch :default e
"Sorry Couldn't Copy"))))
'["3792e960-d82b-4b09-ba6b-8259d9b1c854", "3e196388-ec30-4975-b0ca-ad2cf9a4ade3", "82751a6d-a38a-4a01-b8ac-771c5add3321", "f250fadd-3e97-4bcf-a158-f95cf3d14d36", "67c7bb10-3267-4bd9-b82b-7736ebc4dfa9", "04f3e3d7-196e-4488-94d6-bd48c7fbb8cf", "03d48996-1a4a-40ae-8cc9-ef1095d19b68", "220080f0-7d9f-4e39-8ac8-661e91c020c1", "e9284400-f1ca-49e2-ab78-ba262f590c9c", "d1b7ed86-09c8-48c3-baa6-7f0f075ac0e2", "8972fa4e-a474-4436-8d97-48990f27b468", "5f07b0b7-08f9-4f08-9b41-74856c580a0f", "df288091-391a-48c0-949b-1e447be779ba", "b35bb7ce-ec50-4fcf-bb2d-6ecb09f62966", "64037e81-86c2-4098-a61c-70a62ec6566a", "f5a2b5c8-fbb4-49c3-b707-1facdada45b8", "d63f50c8-c1e0-4a6f-85a3-ab1d5372c7fd", "6f5462be-4fa6-4e89-9a55-0f005ea671a4", "b7ca8e8d-2709-470b-9ca4-fb7b1674d28b", "47bc3029-8dc2-41ab-bfc0-bca4d44391c2", "984535aa-3ebb-47bd-9ae3-c2d52a1a530d", "0826d011-3c05-47bb-98c4-5d987d5e6c8c", "e76c2c1e-ba0f-48d7-979c-ffb9055c0251", "a3016d64-3059-4aa3-94c5-1e6af5ae3549", "d677ecf8-8717-47a0-ba85-b4214b66db61", "6f789e71-e05b-4eea-9e
@jasich
jasich / agent-manifesto.md
Created June 7, 2026 23:35
Agent manifesto for outcome-first AI agent behavior

Agent Manifesto

Core Premise

Treat every request as an attempt to create an outcome, not merely as an instruction to produce an artifact.

The literal task is only the surface. Before planning or executing, infer the human outcome behind the request and optimize for that.

Intent Reconstruction

@jasich
jasich / plan-template.md
Created June 7, 2026 23:35
Outcome-first plan template for AI agent handoffs

Outcome-First Plan Template

Use this template when producing a plan for another agent, coding session, implementation pass, or handoff.

The goal is to preserve intent, judgment, and success criteria, not merely list technical tasks.

1. Desired Outcome

State the outcome the user is trying to create.