I hereby claim:
- I am brugnara on github.
- I am brugnara (https://keybase.io/brugnara) on keybase.
- I have a public key ASCoJBlnKDqzCqhNkSlpPVBbQvuRel9O-oKGyYRC7MnoFQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| type SnapshotArray struct { | |
| hash map[int]map[int]int | |
| snap int | |
| } | |
| func Constructor(length int) SnapshotArray { | |
| array := SnapshotArray{ | |
| map[int]map[int]int{}, | |
| 0, |
| /** | |
| * Definition for a binary tree node. | |
| * type TreeNode struct { | |
| * Val int | |
| * Left *TreeNode | |
| * Right *TreeNode | |
| * } | |
| */ | |
| func lcaDeepestLeaves(root *TreeNode) *TreeNode { | |
| levels := map[int][]*TreeNode{} |
| /** | |
| * Definition for a binary tree node. | |
| * type TreeNode struct { | |
| * Val int | |
| * Left *TreeNode | |
| * Right *TreeNode | |
| * } | |
| */ | |
| func loopBST(root *TreeNode) bool { | |
| if root == nil { |
| /** | |
| * Definition for a binary tree node. | |
| * type TreeNode struct { | |
| * Val int | |
| * Left *TreeNode | |
| * Right *TreeNode | |
| * } | |
| */ | |
| func printBST(root *TreeNode) { | |
| chn := make(chan int) |
| func totalNQueens(n int) int { | |
| if n == 1 { | |
| return 1 | |
| } | |
| board := make([][]bool, n) | |
| for i:=0;i<n;i++ { | |
| board[i] = make([]bool, n) | |
| } |
| var request = require('request'); | |
| var path = require('path'); | |
| var fs = require('fs'); | |
| var filename = process.argv[2]; | |
| var target = 'http://localhost:3000/upload/' + path.basename(filename); | |
| var rs = fs.createReadStream(filename); | |
| var ws = request.post(target); |
This gist is an implementation of http://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.html on top of Docker Machine and Docker Swarm.
| var i = 0; | |
| setInterval(function() { | |
| if (i++ % 2) { | |
| console.log('I\'m the child!'); | |
| } else { | |
| console.error('I\'m the child!'); | |
| } | |
| }, 1500); |