Have to create placeholder images in Go project?

Overview of the "Sticket" - a Golang library, that generate placehold images with text 
07 August 2017   455
Go

Open source project developed by a team at Google and many contributors from the open source community.

All web developers one way or another have to deal with the layout. The task is to harmoniously arrange the content on the page (text, images, video, etc.), make it flexible, responsive, beautiful and appropriate design idea.

Placeholder images help all web developers to make their products pretty and suitable for any screensize. Let's learn how to generate placeholder images in Go project easily.

Sticker is a Go library, that  generate placeholder images with text.

Installation

Make sure you have a working Go environment.

To install sticker, simply run:

go get github.com/muesli/sticker

To execute it from source:

cd $GOPATH/src/github.com/muesli/sticker
go get -u -v
go build && go test -v

Example

gen, err := sticker.NewImageGenerator(sticker.Options{
    TTFPath:         "/usr/share/fonts/TTF/Roboto-Bold.ttf",
    MarginRatio:     0.2,
    Foreground:      color.RGBA{0x96, 0x96, 0x96, 0xff},
    Background:      color.RGBA{0xcc, 0xcc, 0xcc, 0xff},
    BackgroundImage: img,
})
img, err := gen.NewPlaceholder("Lorem ipsum!", 400, 200)
...
 

Sticker will automatically pick a suitable font size, so the text will always fit neatly inside the image.

If you supply a background image, it will automatically be cropped and scaled (while maintaining its original aspect ratio) to the desired output size.

Learn more and download Sticker from GitHub.

Brigade launched

Event-driven scripting tool for Kubernetes released by Microsoft
31 October 2017   438

Microsoft has unveiled its new Open Source development for the needs of DevOps, a Brigade utility designed to run scripts that are executed on a Kubernetes cluster on an event.

The Brigade utility was created by former employees of Deis, a company that Microsoft bought earlier this year. Deis was working on Kubernetes, Helm and Draft. The purpose of Brigade is to "script simple and complex workflows using JavaScript." The solution allows to associate containers by running them sequentially or in parallel and invoking scripts based on time, events in GitHub (also supported by "DockerHub and other popular web services"), push operations in Docker or other triggers. Readme of the project describes it as "a tool for creating pipelines for Kubernetes".

Brigade architecture
Brigade architecture 

Brigade is written in Go and TypeScript / JavaScript, it functions as a service inside Kubernetes. The job (task) in Brigade is a JavaScript script that is interpreted by the product service, which leads to the creation of the necessary resources in Kubernetes. Next, Brigade expects events and performs the corresponding task trigger. It is assumed that the new solution is well suited for the tasks of continuous integration and delivery of applications (CI / CD), tk. simplifies automated testing, assembly of artifacts and releases, management of software deployment.

Check GitHub for more information.