Skip to content

Instantly share code, notes, and snippets.

View kdawgwilk's full-sized avatar
🐘
Technical Co-founder @ AskElephant

Kaden Wilkinson kdawgwilk

🐘
Technical Co-founder @ AskElephant
View GitHub Profile
@kdawgwilk
kdawgwilk / index.ts
Created October 12, 2023 20:51
GraphQL LLM Streaming Examples
import { createServer } from 'node:http'
import { createSchema, createYoga, Repeater } from 'graphql-yoga'
import { useDeferStream } from '@graphql-yoga/plugin-defer-stream'
import OpenAI from 'openai'
const openai = new OpenAI({
// apiKey: 'my api key', // defaults to process.env["OPENAI_API_KEY"]
})
const generateCompletion = (prompt: string): Repeater<string> => {
@kdawgwilk
kdawgwilk / machine.js
Created January 20, 2021 20:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@kdawgwilk
kdawgwilk / keybase.md
Created October 19, 2020 21:36
Keybase Proof

Keybase proof

I hereby claim:

  • I am kdawgwilk on github.
  • I am kdawgwilk (https://keybase.io/kdawgwilk) on keybase.
  • I have a public key ASBEBCeTI6ENqeDBvSJys24fXLiJCBV5e3UQrALUwZjC8wo

To claim this, I am signing this object:

@kdawgwilk
kdawgwilk / SwiftLintRulesExamples.md
Last active November 13, 2018 13:13
SwiftLint Rules Examples

Empty Count (empty_count)

Prefer checking isEmpty over comparing count to zero.

Non-triggering Examples:

Example #1

var count = 0
@kdawgwilk
kdawgwilk / git-dmz-flow.md
Created July 1, 2016 19:01 — forked from djspiewak/git-dmz-flow.md
Git DMZ Flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@kdawgwilk
kdawgwilk / Podfile
Created February 8, 2016 06:22
Cross platform podfile with unit/ui test targets
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
def shared_pods
pod 'Fabric'
pod 'Crashlytics'
end
def shared_testing_pods
@kdawgwilk
kdawgwilk / cs-2420_download_txts.py
Last active December 15, 2015 09:20
CS-2420 Download Sample Student Lists
# Downloads all the sample txts to the directory where this script is ran
import urllib
files = ["InsertNames.txt", "DeleteNames.txt", "RetrieveNames.txt", "InsertNamesMedium.txt", "DeleteNamesMedium.txt",
"RetrieveNamesMedium.txt", "InsertNamesBig.txt", "DeleteNamesBig.txt", "RetrieveNamesBig.txt"]
for filename in files:
url = "http://cit.cs.dixie.edu/cs/2420/ssn/%s" % filename
file_from_url = urllib.URLopener()
file_from_url.retrieve(url, filename)

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store