Skip to content

Instantly share code, notes, and snippets.

View omarismail's full-sized avatar

Omar Ismail omarismail

  • HashiCorp
View GitHub Profile
@omarismail
omarismail / business-models.md
Created March 6, 2020 17:19 — forked from ndarville/business-models.md
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
package e2etfcapi
import (
"context"
"testing"
tfe "github.com/hashicorp/go-tfe"
"github.com/hashicorp/go-uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@omarismail
omarismail / tf
Created May 11, 2021 21:59
tf config
terraform {
required_providers {
tfe = {
version = "~> 0.24.0"
}
}
}
provider "tfe" {
hostname = "tfe-zone-4c292d5b.ngrok.io"
@omarismail
omarismail / main.tf
Created October 16, 2021 19:33
cloud backend, name
terraform {
cloud {
hostname = "app.terraform.io"
organization = "omar-test"
workspaces {
name = "app"
}
}
}
@omarismail
omarismail / main.tf
Created October 16, 2021 19:33
cloud backend, tags
terraform {
cloud {
hostname = "app.terraform.io"
organization = "omar-test"
workspaces {
tags = ["app"]
}
}
}
@omarismail
omarismail / main.tf
Created October 16, 2021 19:36
local backend
terraform {
backend "local" {
}
}
output "env" {
value = "${terraform.workspace}"
}
@omarismail
omarismail / main.tf
Created October 16, 2021 19:36
remote backend, prefix
terraform {
backend "remote" {
hostname = "app.staging.terraform.io"
organization = "omar-test"
workspaces {
prefix = "app-"
}
}
}
@omarismail
omarismail / main.tf
Created October 16, 2021 19:36
remote backend, name
terraform {
backend "remote" {
hostname = "app.staging.terraform.io"
organization = "omar-test"
workspaces {
name = "app"
}
}
}
@omarismail
omarismail / main.tf
Created October 16, 2021 19:37
s3 backend
terraform {
backend "s3" {
bucket = "tf-backend-omar"
region = "us-east-1"
acl = "public-read"
}
}
output "env" {
@omarismail
omarismail / go-table-driven-tests-parallel.md
Created November 11, 2021 19:11 — forked from posener/go-table-driven-tests-parallel.md
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()