Skip to content

Instantly share code, notes, and snippets.

View danielnegri's full-sized avatar
Coffee first.

Daniel Negri danielnegri

Coffee first.
View GitHub Profile

INCIDENT DATE - INCIDENT TYPE

Meeting

Waiving meetings

In some cases the IC might determine that a PM meeting for the incident isn't needed. If the IC decides to waive the meeting please replace the Meeting section with a note indicating the meeting has been waived (example: Meeting waived: Paul Mooring)

@danielnegri
danielnegri / fetch_tree.adoc
Created May 7, 2018 16:32 — forked from jexp/fetch_tree.adoc
Fetch a Tree with Neo4j

Fetch a Tree with Neo4j

Today I came across a really interesting StackOverflow question:

Given a forest of trees in a Neo4j REST server, I`m trying to return a single tree given the root vertex. Being each tree quite large, I need a de-duplicated list of all vertices and edges in order to be able to reconstruct the full tree on the client side.

@danielnegri
danielnegri / fetch_tree.adoc
Created May 7, 2018 16:32 — forked from jexp/fetch_tree.adoc
Fetch a Tree with Neo4j

Fetch a Tree with Neo4j

Today I came across a really interesting StackOverflow question:

Given a forest of trees in a Neo4j REST server, I`m trying to return a single tree given the root vertex. Being each tree quite large, I need a de-duplicated list of all vertices and edges in order to be able to reconstruct the full tree on the client side.

def trapBOM(fileBytes []byte) []byte{
trimmedBytes := bytes.Trim(fileBytes, "\xef\xbb\xbf")
return trimmedBytes
}
@danielnegri
danielnegri / howto_nat_traversal.md
Created October 24, 2017 12:59 — forked from mildred/howto_nat_traversal.md
How To TCP NAT Traversal using Node.js and a STUN Server

How To TCP NAT Traversal using Node.js and a STUN Server

With the scarecity of IPv4 addresses, and IPv6 still not available at large, NAT traversal is becoming a necessity. Especially with the generalisation of Carrier-grade NATs that you can find on mobile connections. Even with IPv6 you may suffer NAT66. Imagine your mobile device that gets only a single Ipv6 address, and you want to share it on your computer.

The solution might be in a decentralized protocol for address attribution such

@danielnegri
danielnegri / redux-light-example.js
Created July 13, 2017 20:16 — forked from davidbgk/redux-light-example.js
redux in 14 lines of code
const store = createStore((state = { counter: 0 }, action) => {
switch(action.type) {
case "INCREMENT":
return { counter: state.counter + 1 }
case "DECREMENT":
return { counter: state.counter - 1 }
default:
return state
}
})
@danielnegri
danielnegri / golang_job_queue.md
Created April 20, 2017 15:17 — forked from harlow/golang_job_queue.md
Job queues in Golang
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
@danielnegri
danielnegri / background.js
Created December 2, 2016 15:33 — forked from Rob--W/background.js
Implementation example of writable response bodies for Chromium extensions (API draft).
/**
* Implementation example of writable response bodies.
* Based on the draft of the Streams API (19 March 2014)
* https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm
* Design document for response body reading/writing:
* https://docs.google.com/document/d/1iE6M-YSmPtMOsec7pR-ILWveQie8JQQXTm15JKEcUT8
*/
/* globals chrome, ByteStream, URL, XMLHttpRequest */
'use strict';
@danielnegri
danielnegri / pwdx_for_mac.bash
Created November 15, 2016 20:42 — forked from tobym/pwdx_for_mac.bash
pwdx for mac. Usage: pwx pid
function pwdx {
lsof -a -p $1 -d cwd -n | tail -1 | awk '{print $NF}'
}