Skip to content

Instantly share code, notes, and snippets.

View carpeliam's full-sized avatar
👋
say hi!

Liam Morley carpeliam

👋
say hi!
View GitHub Profile
@carpeliam
carpeliam / nested_multiselect.go
Last active May 18, 2025 17:32
Example of a nested multi-select on top of bubbletea and huh
// Example of a nested multi-select on top of bubbletea and huh.
//
// *Current behavior*:
// - given a two-level set of nested objects,
// - allow for any parent or child to be selected
// - selecting a parent also selects all its children
// - deselecting a parent also deselects all its children
// - parents with no children are hidden from view
// - upon making a final selection and pressing Enter, the children are returned
//
import { Writable } from 'stream';
class InMemoryStream extends Writable {
private chunks: Uint8Array[] = [];
private contentPromise: Promise<string>;
constructor() {
super();
this.contentPromise = new Promise((resolve, reject) => {
this.once('finish', () => { resolve(Buffer.concat(this.chunks).toString('utf8')); });
this.once('error', err => { reject(err); });
[core]
editor = /usr/local/bin/vim
hooksPath = /Users/pivotal/workspace/git-hooks-core
[transfer]
fsckobjects = true
[alias]
gst = git
st = status
di = diff
co = checkout
const RPSApp = require("../src/RPSApp")
const {NgModule} = require("@angular/core")
const {BrowserModule} = require("@angular/platform-browser")
const {FormsModule} = require("@angular/forms")
const {platformBrowserDynamic} = require("@angular/platform-browser-dynamic")
const { UseCaseFactory } = require("rps")
require('reflect-metadata')
const jsdom = require("jsdom")
@carpeliam
carpeliam / concourse_bg_funz.js
Last active July 6, 2019 22:20
maybe you want to tie your concourse background to your build status to raise awareness of the current status, GUYS THIS IS IMPORTANT
const pipelineContainer = document.getElementById('pipeline-container');
const PipelineState = {
BUILDING: 'BUILDING',
FAILED: 'FAILED',
PASSING: 'PASSING',
};
const PipelineImages = {
BUILDING: 'https://ketstatic.cdn.ket.org/wp_transfer/images/BOBL/BOBL__000708.3555962.848x480.jpg',
function wrapPromiseInTimeout(promise) {
const possibleError = new Error();
return new Promise((resolve, reject) => {
const timeoutID = setTimeout(() => reject(possibleError), 1000);
promise.then(resolve).catch(reject).finally(() => clearTimeout(timeoutID));
});
}
@carpeliam
carpeliam / bug.md
Created February 9, 2017 18:33
Tracker Templates

🐛 🐒 🍍

Current Behaviour

Expected Behaviour

Steps to reproduce it

#!/usr/bin/env bash
./gradlew bootRun > /dev/null 2>&1 &
GRADLE_PID=$!
printf 'starting server'
until $(curl --output /dev/null --silent --head http://localhost:8080); do
printf '.'
sleep 3
@carpeliam
carpeliam / manifest.yml
Last active October 10, 2016 04:47
simple little slackbot, along with CF manifest and node package
---
applications:
- name: your-app-here
command: node slack.js
# no-route: true
health-check-type: none
domain: cfapps.io
env:
SLACK_API_TOKEN: your-token-here
import React from 'react';
import { connect } from 'react-redux';
function fetchIfNecessary(fetchWithProps, hasRequiredProp) {
function mapDispatchToProps(dispatch, props) {
return { fetch: () => dispatch(fetchWithProps(props)) };
}
return (Component) => {
class Fetcher extends React.Component {
componentDidMount() {