Skip to content

Instantly share code, notes, and snippets.


Charles Lowell cowboyd

View GitHub Profile
cowboyd /
Created Oct 28, 2020
Do stuff on windows
use neon::prelude::*;
use winapi::shared::minwindef::{TRUE, FALSE};
use winapi::um::winnt::LPSTR;
//use winapi::um::synchapi::{WaitForSingleObject};
//use winapi::um::handleapi::CloseHandle;
use winapi::um::processthreadsapi::*;
use winapi::um::consoleapi::*;
use winapi::um::wincon::*;
use std::process::Command;
cowboyd / signin.test.json
Created Oct 7, 2020
BigTest suite and its raw JSON equivalent
View signin.test.json
"description": "Sign In",
"steps": [
"description": "visiting \"/\""
"description": "click on link \"Sign in\""
cowboyd / checkin.interactors.js
Created Aug 26, 2020
One-off interactors I wrote for ui-courses and ui-checkin FOLIO modules
View checkin.interactors.js
import { createInteractor, App } from '@bigtest/interactor';
export const Input = createInteractor('Input')({
selector: 'input',
defaultLocator: (elem) =>,
locators: {
byAriaLabel: element => element.ariaLabel
actions: {
type: (elem, val) => {
cowboyd / index.ts
Created Aug 4, 2020
Setup Browser Simulation
View index.ts
import { Server } from 'miragejs';
import { createGraphQLHandler } from '@miragejs/graphql';
import { schema as schemaSource } from '@self/graphql';
import { factories } from './factories';
export interface Simulation {
create<T>(modelName: string, data?: Record<string, unknown>): T;
createList<T>(modelName: string, count: number): T[];
cowboyd / schema.graphql
Last active Jul 30, 2020
Try to get factories working with mirage graphql
View schema.graphql
type Company{
id: ID!
name: String!
type Query {
companies: [Company!]!
cowboyd / lsp-start-plain.el
Created Jul 24, 2020
Enhanced version of start plain that includes typescript-mode and json-mode
View lsp-start-plain.el
;;; lsp-start-plain.el --- LSP mode quick starter -*- lexical-binding: t; -*-
;; Copyright (C) 2018 Ivan Yonchovski
;; Author: Zhu Zihao <>
;; Keywords: languages
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
cowboyd / index.feature
Last active Jul 21, 2020
BigTest Cucumber plugin
View index.feature
Feature: Dashboard
Scenario: Viewing the Index
Given I navigate to /
Then I see the logo in the header
cowboyd / operation.ts
Last active Jul 10, 2020
Proposed Effection operations that are non-ambiguous
View operation.ts
// Operation is an un-ambiguous union.
export type Operation<T = unknown> = Promise<T> | OperationIterator<T> | OperationConstructor<T> | AtomicOperation<T>;
// Any generator, any iterator that produces operations can be used.
export type OperationIterator<T> = Iterator<Operation<unknown>, T, any>;
// used anywhere we currently have to use a control function.
// the evaluator never yields control when evaluating this one, so operation
// is guaranteed to be executed in the same tick of the runloop as its caller
interface AtomicOperation<T> {
cowboyd / calculator-intermediate.ts
Created Jun 23, 2020
An intermediate module describing a gherkin feature
View calculator-intermediate.ts
// compile step definitions into some importable file
import { TestImplementation, Context } from '@bigtest/suite';
import stepDefinitions from './step-definitions';
const feature: TestImplementation = {
description: "Feature: Calculator",
steps: [],
cowboyd / run-command.js
Last active Jun 23, 2020
catch exceptions in async computations
View run-command.js
function* runCommand({
log = `running command for ${pkg}`,
}) {
try {
yield function*() {
You can’t perform that action at this time.