Skip to content

Instantly share code, notes, and snippets.

@n5i
n5i / gist:e1df1ca5b928dd98ffda6f0dd6f3585c
Created January 31, 2017 02:20
jasmine protractor logger
var log4js = require('log4js');
var logger = log4js.getLogger();
logger.debug(msg);
@n5i
n5i / gist:596f33d7cf5d3e9571137e0c3eee0cd5
Created February 9, 2017 01:30
Run selenium standalone with firefox profile
java -Dwebdriver.firefox.profile=selenium -jar lenium-server-standalone-3.0.1.jarport 4444
@n5i
n5i / gist:e811900eceb56cf991150e2e1385bbb1
Created February 9, 2017 14:16
Create firefox profile for selenium
cd /your/profile
zip -r profile *
base64 profile.zip > profile.zip.b64
@n5i
n5i / gist:d6ac82c85b53291cfce77c186a871d60
Created February 10, 2017 00:13
Run headless selenium in background
nohup xvfb-run --server-args="-screen 0, 1280x1024x8" java -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /dev/null 2>&1 &
@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");
@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
{
"columns":[
"Name",
"Subreports"
],
"data":[
{
"row":[
"Grandparent",
[
@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
@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)
// 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,