Skip to content

Instantly share code, notes, and snippets.

open Pom;
type middleware('context, 'result) =
(Express.Request.t, Express.Response.t, 'context) =>
pomWithError('result, Express.complete);
type handler('context) =
(Express.Request.t, Express.Response.t, 'context) => pom(Express.complete);
let _onError500 =
@christippett
christippett / build.sh
Last active September 11, 2023 05:53
Trigger Cloud Builds in a mono-repo
#!/bin/sh -e
IGNORE_FILES=$(ls -p | grep -v /)
TRACKING_BUCKET="$COMMIT_STATE_BUCKET/$REPO_NAME/$BRANCH_NAME"
detect_changed_folders() {
gsutil cp gs://$TRACKING_BUCKET/LAST_COMMIT . &> /dev/null || true
last_commit_sha=`cat LAST_COMMIT 2> /dev/null || git rev-list --max-parents=0 HEAD`
echo "Detecting changes from last build: $last_commit_sha"
folders=`git diff --name-only "$last_commit_sha" | sort -u | awk 'BEGIN {FS="/"} {print $1}' | uniq`
export changed_components=$folders
async function validatePassword(password: string): string[] {
let errors = []
// 1. Don't regex for things you can trivially express in code
// -----------------------------------------------------------
// For example, we could have written this as `/^.{0,7}$/` but that's not
// nearly as clear as checking the length of the string.
if (password.length < 8) {
errors.push("Password must be at least 8 characters long")
@dillonchanis
dillonchanis / example.css
Created September 20, 2020 14:44
Tailwind Utility for using gradients with text
@layer utilities {
.text-gradient {
background-clip: text;
-webkit-text-fill-color: transparent;
}
}
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to