Skip to content

Instantly share code, notes, and snippets.

View williammartin's full-sized avatar

William Martin williammartin

View GitHub Profile
package retry
import (
"context"
"errors"
"fmt"
"math"
"time"
)
@williammartin
williammartin / main.ts
Last active June 19, 2021 13:27
Empty GCP bucket
import * as core from '@actions/core';
import { Storage } from '@google-cloud/storage';
import * as E from 'fp-ts/lib/Either';
import { pipe } from 'fp-ts/lib/function';
import * as IOEither from 'fp-ts/lib/IOEither';
import * as T from 'fp-ts/lib/Task';
import * as TE from 'fp-ts/lib/TaskEither';
import * as t from 'io-ts';
import { failure } from 'io-ts/PathReporter';
// Helpers
// optional
type Some<T> = {
_tag: "some";
value: T;
};
type None = {
_tag: "none";
#[derive(Debug, PartialEq)]
pub enum Material {
Brick,
Concrete,
Wood,
}
#[derive(Debug, PartialEq)]
pub struct Blueprint {
num_floors: usize,
package gildedrose
type Item struct {
Name string
SellIn int
Quality int
}
type Inventory []*Item
package main
import (
"context"
"fmt"
mailslurp "github.com/mailslurp/mailslurp-client-go"
)
func main() {
openapi: "3.0.0"
info:
version: 1.0.1
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
var _ = Describe("ginkgotcha", func() {
It("is irregular", func() {
buffer := BufferWithBytes([]byte("map[string]"))
Expect(buffer).To(Say("map[string]"))
})
})
var _ = Describe("ginkgotcha", func() {
It("leaks a goroutine", func() {
go func() {
defer GinkgoRecover()
time.Sleep(time.Second / 2)
Fail("lol play time is over")
}()
})
It("is gonna have a bad time", func() {
var _ = Describe("ginkgotcha", func() {
var number int
BeforeEach(func() {
number = 10
})
It("is equal to 10", func() {
Expect(number).To(Equal(10))
})