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
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() {
@carpeliam
carpeliam / projectmonitor.raptorize.js
Last active April 1, 2019 16:23
Run a raptor across the screen whenever your build is triggered.
(function() {
$.browser = {mozilla: false, webkit: false};
$('<script>').attr('src', 'https://cdn.jsdelivr.net/gh/davesierra/raptorize@master/jquery.raptorize.1.0.js').appendTo('body');
setInterval(function() {
if ($('.pipeline-graph .started').length) {
$(window).raptorize({enterOn: 'timer', delayTime: 0});
}
}, 15000);
}());