Skip to content

Instantly share code, notes, and snippets.

View joehillen's full-sized avatar
🦡

Joe Hillenbrand joehillen

🦡
View GitHub Profile
@joehillen
joehillen / gist:b8494ad2e06e65b8b57a7d2a0864e3d1
Created July 19, 2023 16:48
Rust 1.71.0 ICE when building deno
[deno 1.35.1] cargo:rerun-if-changed=/home/joe/src/deno/runtime/js/99_main.js
Running `CARGO=/home/joe/.rustup/toolchains/1.71.0-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=deno CARGO_CRATE_NAME=deno CARGO_MANIFEST_DIR=/home/joe/src/deno/cli CARGO_PKG_AUTHORS='the Deno authors' CARGO_PKG_DESCRIPTION='Provides the deno executable' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=deno CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/denoland/deno' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=1.35.1 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=35 CARGO_PKG_VERSION_PATCH=1 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 GIT_COMMIT_HASH=5919f31891f464fb8975084795550d7e731c12de GIT_COMMIT_HASH_SHORT=5919f31 LD_LIBRARY_PATH='/home/joe/src/deno/target/debug/deps:/home/joe/.rustup/toolchains/1.71.0-x86_64-unknown-linux-gnu/lib:/home/joe/.rustup/toolchains/1.71.0-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/joe/src/deno/target/debug/build/deno-d5280f
@joehillen
joehillen / build.sh
Last active December 23, 2022 22:02
Build bash scripts with `source` files into a single script.
#!/usr/bin/env bash
#
# https://gist.github.com/joehillen/30f08738c1c3c0ca3e4c754ad33ad2ff
#
# This script inlines 'source' files.
#
# For long scripts, it is nice to be able to break them into multiple files
# to make them easier to work with but still release as a single script.
#
# Inspired by https://stackoverflow.com/a/37533160/334632 with the following enhancements:
@joehillen
joehillen / server.hs
Last active June 1, 2022 17:56
A re-implementation of Simon Marlow's Async Haskell Chat Server using Conduits
{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase #-}
import Conduit
import Data.Conduit
import Data.Conduit.Network
import qualified Data.ByteString.Char8 as BS
import Data.Conduit.TMChan
import Text.Printf (printf)
import Control.Concurrent.STM
import qualified Data.Map as Map
@joehillen
joehillen / semver.sh
Created June 9, 2021 20:56
Amend git commits with semversioner changes
#!/bin/bash -ex
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ $BRANCH == patch* || $BRANCH == bugfix* ]]; then
VER_TYPE=patch
elif [[ $BRANCH == feature* || $BRANCH == minor* ]]; then
VER_TYPE=minor
elif [[ $BRANCH == major* ]]; then
VER_TYPE=major
else
@joehillen
joehillen / deno.ts
Created May 1, 2020 21:31
Trying out Deno
#!/usr/bin/env -S deno --allow-run
type AbsDir = string;
type AbsFile = string;
type AbsPath = AbsFile | AbsDir;
type RelFile = string;
type RelDir = string;
type Path = RelFile | AbsFile | RelDir | AbsDir;
async function ls(dir: AbsDir): Promise<RelFile[]> {
@joehillen
joehillen / keybase.md
Created November 17, 2016 21:50
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/bin/bash
function run {
# how we want to extract the variables from the commit message.
format_name="--format=%cn"
format_when="--format=%cr"
format_summary="--format=%s"
format_body="--format=%b"
@joehillen
joehillen / spellchecker_trie.py
Created July 11, 2013 08:08
A slightly better spellchecker using a Trie.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Written by Joe Hillenbrand <joehillen@gmail.com> 2012
All rights reserved!
"""
import sys
@joehillen
joehillen / bad_spellcheckers.py
Created July 11, 2013 07:40
A crappy spellchecker implementation I wrote for a job interview. I didn't get the job =P
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Written by Joe Hillenbrand <joehillen@gmail.com> 2012
All rights reserved!
"""
import string
import Control.Concurrent (forkIO, killThread,
threadDelay, newEmptyMVar,
tryTakeMVar, putMVar)
import Control.Monad (void, forever)
import Control.Concurrent.STM (atomically)
import Control.Monad.Trans (MonadIO(..))
import Control.Monad.Trans.Resource (MonadResource, allocate)
import Data.Conduit (GInfConduit, awaitE)
throttle :: (MonadResource m) => Int -> GInfConduit a m a