Skip to content

Instantly share code, notes, and snippets.

@n5i
n5i / gist:91b11078a056b08505f9fb8fd0736742
Created October 30, 2018 21:31
Docker ps shows ID and Names only
docker ps --format "table {{.ID}}\t{{.Names}}"
@n5i
n5i / gist:b18a41070b8d1b233427deaccc5b8a0c
Created October 24, 2018 14:02
Atom dotted spell check underline
atom-text-editor::shadow .spell-check-misspelling .region {
border-bottom: 1px dotted #659C6B;
}
find -name \* -print0 | xargs -0 zgrep "82mp5a3o4fk1qsha0f9l"
$ telnet kafka.brandur.org 9092
Trying 10.100.15.15...
Connected to kafka.brandur.org.
Escape character is '^]'.
// Add index
CREATE INDEX ON :Var(value)
// Polulate data
WITH ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t","u","v","w", "z", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] AS R
UNWIND range(0,1000000) AS d
WITH R,
toInteger(rand()*36) AS i1,
toInteger(rand()*36) AS i2,
toInteger(rand()*36) AS i3,
@n5i
n5i / gist:30c30f15deff3bb886a9e23458eb1d0e
Created October 10, 2017 00:01
Neo4j : Generate 1M connected nodes
unwind range(1,1000000) as r
match (n) where id(n) = r
match (m) where id(m) = toInt(rand()*1000000)
create (n)-[:KNOWS]->(m)
@n5i
n5i / gist:a82c4e1c307f6baa25d1ea82337bdab0
Created May 26, 2017 13:43
Update memory limit on docker container which is run.
docker update -m 2G --memory-swap -1 container_id
{
"columns":[
"Name",
"Subreports"
],
"data":[
{
"row":[
"Grandparent",
[
@n5i
n5i / main.go
Created March 28, 2017 17:22
Receiving nested response from Neo4j to Golang.
package main
import(
"github.com/jmcvetta/neoism"
"fmt"
)
func main(){
// Connect to the neo4j database with the address provided
@n5i
n5i / Neo4j_nested_response.java
Created March 28, 2017 17:16
Neo4j plugin call whith nested response.
@Procedure("test.nested")
public Stream<NestedReport> testNested()
{
ArrayList<NestedReport> res = new ArrayList<>();
NestedReport grandParent = new NestedReport("Grandparent");
NestedReport parent = new NestedReport("Parent");
NestedReport child = new NestedReport("Child");
NestedReport grandchild = new NestedReport("Grandchild");