Skip to content

Instantly share code, notes, and snippets.

Avatar

Ray Zane rzane

View GitHub Profile
@rzane
rzane / gem.md
Last active May 10, 2020
Actions
View gem.md

Gem

Build

name: Build
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
@rzane
rzane / README.md
Last active Jul 18, 2020
QueryExtensions
View README.md

QueryExtensions

First, you'll need to incorporate the extension:

class ApplicationRecord < ActiveRecord::Base
  extend QueryExtensions
end
@rzane
rzane / fileExchange.ts
Created Aug 1, 2019
URQL file exchange (which doesn't work at all)
View fileExchange.ts
import { print } from "graphql";
import { pipe, map } from "wonka";
import { Exchange, Operation } from "urql";
type FetchExchangeFn = (
operation: Operation,
options: RequestInit
) => RequestInit;
const createFetchExchange = (fn: FetchExchangeFn): Exchange => {
@rzane
rzane / github-to-pivotal.rb
Created May 22, 2019
Migrate GitHub issues to Pivotal Tracker
View github-to-pivotal.rb
require 'github_api'
require 'tracker_api'
GITHUB_USER = 'username or organization'
GITHUB_REPO = 'repo'
GITHUB_LOGIN = 'username'
GITHUB_PASSWORD = '***'
PIVOTAL_TOKEN = '***'
PIVOTAL_PROJECT_ID = 'last segment of the pivotal URL'
@rzane
rzane / Dockerfile
Created Apr 1, 2019
Tiny debug image
View Dockerfile
FROM golang:alpine as build
WORKDIR /usr/src/app
RUN apk --no-cache add upx
COPY ./server.go ./
ENV CGO_ENABLED=0
RUN go build -o server server.go
RUN upx --brute server
# ---
@rzane
rzane / maybe.ts
Created Mar 8, 2019
The simplest possible `maybe` implementation in TypeScript
View maybe.ts
type None = null | undefined;
export class Maybe<T> {
private _value: T | undefined;
public constructor(value: T | None) {
this._value = value === null ? undefined : value;
}
public value(): T | undefined {
@rzane
rzane / tsconfig.json
Created Feb 26, 2019
Typescript config for a client side app
View tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
View baby_squeel-ar-521.log
Run options:
include {:focus=>true}
exclude {:compat=>true}
All examples were filtered out; ignoring {:focus=>true}
Running with ActiveRecord 5.2.1
..........................................................................................................................................................................F..............F......F..F...F....FFF.................F............F....F........F.......FF...FF............
Failures:
@rzane
rzane / openapi.yaml
Created Jan 10, 2019
Reproduce OpenAPI additionalProperties issue
View openapi.yaml
openapi: 3.0.0
info:
title: MyAPI
description: MY API
version: 0.0.0
servers:
- url: http://localhost:8080/api/
paths:
/example:
get:
@rzane
rzane / openapi.yaml
Created Jan 10, 2019
Reproduce OpenAPI anyFromJSON issue
View openapi.yaml
openapi: 3.0.0
info:
title: MyAPI
description: MY API
version: 0.0.0
servers:
- url: http://localhost:8080/api/
paths:
/example:
get: