Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
package main | |
import ( | |
"./binding" | |
"fmt" | |
) | |
func main() { | |
binding.PrintHello() | |
binding.Seed(1) | |
fmt.Println(binding.Random()) |
#!/bin/bash -e | |
# Make sure you have installed ImageMagick | |
# http://cactuslab.com/imagemagick/ | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
for f in *; do | |
if [[ $f == *@3x* ]]; | |
then |
To further clarify what really goes on during an AD&D game, read the following example. This is typical of the sort of action that occurs during a playing session. Shortly before this example begins, three player characters fought a skirmish with a wererat (a creature similar to a werewolf but which becomes an enormous rat instead of a wolf). The wererat was wounded and fled down a tunnel. The characters are in pursuit. The group includes two fighters and a cleric.
Fighter 1 is the group's leader.
#r @"packages\Streams.0.2.5\lib\Streams.Core.dll" | |
open System | |
open System.IO | |
open System.Collections.Generic | |
open Nessos.Streams | |
// make Visual Studio use the script directory | |
Directory.SetCurrentDirectory(__SOURCE_DIRECTORY__) |
var server = "http://yourserveraddress:8065/"; //Your server and IP address | |
var apiKey = "API-XXXXXXXXXXXXXXXXXXXXXXXXX"; // Get this from your 'profile' page in the Octopus web portal | |
var endpoint = new OctopusServerEndpoint(server, apiKey); | |
var repository = new OctopusRepository(endpoint); | |
var projectId = "projects-225"; //your project id | |
//This pulls out the info you need, the same call that's made on the Create Release page in the UI | |
var template = repository.Client.Get<Octopus.Client.Model.ReleaseTemplateResource>("/api/deploymentprocesses/deploymentprocess-" + projectId + "/template"); |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev