Skip to content

Instantly share code, notes, and snippets.

🎳
Bowling

Travis Reeder treeder

🎳
Bowling
Block or report user

Report or block treeder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cloudbuild.yaml
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/hello:$SHORT_SHA', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/hello:$SHORT_SHA', 'gcr.io/$PROJECT_ID/hello:latest']
- name: 'gcr.io/cloud-builders/docker'
args: ['tag', 'gcr.io/$PROJECT_ID/hello:$SHORT_SHA', 'gcr.io/$PROJECT_ID/hello:$BRANCH_NAME']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/hello:$SHORT_SHA']
- name: 'gcr.io/cloud-builders/docker'
View simpletoken.sol
// Slightly modified from ETH website
pragma solidity ^0.4.24;
contract MyToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
uint256 public totalSupply;
/* Initializes contract with initial supply tokens to the creator of the contract */
View greeter.sol
pragma solidity ^0.4.21;
contract Mortal {
/* Define variable owner of the type address */
address owner;
/* This function is executed at initialization and sets the owner of the contract */
constructor() public { owner = msg.sender; }
/* Function to recover the funds on the contract */
View token.sol
pragma solidity ^0.4.20;
contract MyToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(
uint256 initialSupply
) public {
View test.json
{
"tests": [
{
"input": {
"body": {
"name": "Johnny"
}
},
"output": {
"body": {
@treeder
treeder / Dockerfile
Last active Aug 30, 2018
triple stage docker builds
View Dockerfile
# 1) BUILD API
FROM golang:alpine AS build-go
RUN apk --no-cache add git bzr mercurial
ENV D=/go/src/github.com/USERNAME/REPONAME
# deps - using the closest thing to an official dependency tool: https://github.com/golang/dep
RUN go get -u github.com/golang/dep/...
ADD ./api/Gopkg.* $D/api/
RUN cd $D/api && dep ensure -v --vendor-only
# build
ADD ./api $D/api
View Dockerfile
# build stage
FROM golang:alpine AS build-env
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
CMD ./goapp
View main.go
package main
import (
"io"
"log"
"net/http"
"os"
)
func hello(w http.ResponseWriter, r *http.Request) {
@treeder
treeder / Dockerfile
Last active Aug 12, 2019
multi-stage build
View Dockerfile
# build stage
FROM golang:alpine AS build-env
RUN apk --no-cache add build-base git bzr mercurial gcc
ADD . /src
RUN cd /src && go build -o goapp
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
You can’t perform that action at this time.