InfluxData's T.I.C.K. stack is made up from the following components:
| Component | Role |
|---|---|
| Telegraf | Data collector |
| InfluxDB | Stores data |
| Chronograf | Visualizer |
| function! GrepPartial(partial) | |
| if (a:partial) | |
| let pattern = "partial.*" . partial | |
| else | |
| let path = substitute(expand("%:h"), "app/views/", "", "") | |
| let action = substitute(expand("%:t:r:r"), "^_", "", "") | |
| let pattern = "partial.*" . path . "/" . action | |
| endif | |
| if (exists('g:loaded_fugitive')) |
Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"| #include <stdlib.h> | |
| #include <stdbool.h> | |
| typedef enum { | |
| BLUE = -1, | |
| NONE, | |
| RED | |
| } Player; | |
| typedef struct { |
| # State - allow an object to alter its behaviour when its internal state | |
| # changes. The object will appear to change its class. | |
| # Key idea - introduce an abstract class called SomethingState to represent the | |
| # states of the object. Subclasses of the abstract class implement | |
| # state-specific behaviour. | |
| class Person | |
| attr_accessor :state, :name |
| var mongoose = require("mongoose") | |
| , assert = require("assert") | |
| , async = require("async") | |
| , Person | |
| async.series([ | |
| function(callback){ | |
| mongoose.connect("mongodb://localhost/mydb") | |
| mongoose.connection.on("open", callback) | |
| }, |
If you're using golang/dep, and for an unexplained reason running dep ensure errors:
unable to update checked out version: : command failed: [git checkout 019ae5ada31de202164b118aee88ee2d14075c31]: exit status 1
You have to remove the dep from your Gopkg.lock file. This way Gopkg won't look for the missing ref.
And then dep ensure again.
| <script> | |
| angular.directive('tj:focus', function(){ | |
| return function(scope, element){ | |
| element[0].focus(); | |
| }; | |
| }); | |
| </script> | |
| <div> | |
| <input type="text" ng:model="model" tj:focus /> |
| host=$1 | |
| echo "finding host for container: $1" | |
| function ec2-ip () { | |
| aws ec2 describe-instances --filter Name=instance-id,Values=$1 | jq '.Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"' | |
| } | |
| instances=$(aws ecs list-container-instances --cluster api --max-items 100 | jq '.containerInstanceArns | .[]' | tr -d '"') | |
| ids=$(echo $instances | xargs aws ecs describe-container-instances --cluster api --container-instances | jq '.containerInstances | .[] | .ec2InstanceId' | tr -d '""') |
| // error.go | |
| // Copyright 2016 The Upspin Authors. All rights reserved. | |
| // populateStack uses the runtime to populate the Error's stack struct with | |
| // information about the current stack. | |
| func (e *Error) populateStack() { | |
| e.Stack = &Stack{Callers: callers()} | |
| } |