Skip to content

Instantly share code, notes, and snippets.

View majelbstoat's full-sized avatar

Jamie Talbot majelbstoat

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@majelbstoat
majelbstoat / slate-react.d.ts
Created April 1, 2018 00:08
Typescript definitions for Slate
declare module 'slate-react' {
import Slate from 'slate'
import Immutable from 'immutable'
import { ReactNode } from 'react'
type RenderMarkProps = {
mark: { type: string }
children: ReactNode
}
@majelbstoat
majelbstoat / spanner.d.ts
Created June 28, 2018 02:17
Typescript types for @google-cloud/spanner, based on v1.4.0 documentation
// Type definitions for Google Cloud Spanner 1.4
// Project: https://github.com/googleapis/nodejs-spanner
// Definitions by: Jamie Talbot <https://github.com/majelbstoat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
/// <reference types="node"/>
declare module '@google-cloud/spanner' {
export type SpannerDate = object
@majelbstoat
majelbstoat / README.md
Created March 23, 2020 00:17
protoc-gen-grpc-gateway-ts

Example Usage:

$ go build -i -o protoc-gen-grpc-gateway-ts .

$ protoc -I ./lib/proto ./lib/proto/*.proto
--plugin=protoc-gen-grpc_gateway_ts=which protoc-gen-grpc-gateway-ts
--grpc_gateway_ts_out=lib/ts/src

@majelbstoat
majelbstoat / compose.test.ts
Created June 29, 2020 13:49
Slate operation composition
import { Operation } from 'slate'
import { composeOperations } from './compose'
function testComposition(operations: Operation[], expected: Operation[]) {
expect(composeOperations([], operations)).toEqual(expected)
}
const path = [0, 0]
describe('Inserting text', () => {
test('Inserting consecutive text composes them to a single operation', () => {
This code scans a text file and performs some basic manipulations on its contents to unearth amulets,
as defined by Robin Sloan.
Learn more about them at https://text.bargains
USAGE: go run .
Expects a filename called shakespeare.txt in the same directory.
I used a version from the Gutenberg Project, with gratitude: