| // meet Stringy - a simple string type with a fluent interface | |
| struct Stringy { | |
| let content: String | |
| init(_ content: String) { | |
| self.content = content | |
| } | |
| func append(appendage: Stringy) -> Stringy { |
| /* | |
| This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a | |
| valid CSS hexadecimal color code (like #000 or #000000), the background color will change to that | |
| color and the font color will be changed to the inverse color for readability. | |
| To use this script in a Google Sheets spreadsheet: | |
| 1. go to Tools » Script Editor; | |
| 2. replace everyting in the text editor with this code; | |
| 3. click File » Save; |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| package main | |
| import ( | |
| "log" | |
| "os" | |
| "github.com/samalba/dockerclient" | |
| ) | |
| func main() { |
| // This code accompanies a blog post: http://chris.eidhof.nl/posts/json-parsing-in-swift.html | |
| // | |
| // As of Beta5, the >>= operator is already defined, so I changed it to >>>= | |
| import Foundation | |
| let parsedJSON : [String:AnyObject] = [ | |
| "stat": "ok", | |
| "blogs": [ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| // Create a new layer which is the width of the device and with a heigh | |
| // of 0.5px. | |
| CALayer *topBorder = [CALayer layer]; | |
| topBorder.frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 0.5f); | |
| // Set the background colour of the new layer to the colour you wish to | |
| // use for the border. | |
| topBorder.backgroundColor = [[UIColor blueColor] CGColor]; | |
| // Add the later to the tab bar's existing layer |