Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am felipebn on github.
  • I am felipebn (https://keybase.io/felipebn) on keybase.
  • I have a public key ASBow54OaWWVc4rmkX9ML-yqeCeCkyMO_fYFm7c8ZJIYago

To claim this, I am signing this object:

View import_ESCO_csv_en.cql
//Import ESCO using CSV files
create index ON :Occupation(ISCOGroup);
create index ON :Occupation(altLabels);
create index ON :Skill(altLabels);
create index ON :ISCOGroup(code);
create index ON :Skill(conceptUri);
create index ON :ISCOGroup(conceptUri);
create index ON :Occupation(conceptUri);
create index ON :Occupation(preferredLabel);
create index ON :Skill(preferredLabel);
@felipebn
felipebn / debug.log
Created Nov 6, 2018
Neo4j Error - Issue #12058
View debug.log
2018-11-06 11:17:38.336 [http-nio-8080-exec-2] T:DEFAULT_TENANT INFO o.n.o.d.bolt.request.BoltRequest - Request: MATCH subJobFamilyPath=(subJobFamily:SubJobFamily)-[toDescriptions:GJC_CATEGORY_TO_DESCRIPTION]->(subDescription:DescriptionElement)-[subToPayload]->(subPayload:JobCatalogLocalizedPayload) WHERE subJobFamily.uuid IN {subJobFamilyIds} AND subToPayload.language IN {languages} AND ALL( rel IN [toDescriptions, subToPayload] WHERE rel.min - {revision} <= 0 AND rel.max - {revision} > 0 )OPTIONAL MATCH subFamToDetail=(subJobFamily)-[toDetails:GJC_CATEGORY_TO_DETAIL]->(detail:JobCategoryDetail)-[detailToDefinition:GJC_DETAIL_TO_DEFINITION]->(detailDefinition:JobCategoryDetailDefinition)-[detailDefinitionToPayload:GJC_DETAIL_DEFINITION]->(detailDefinitionPayload:JobCatalogLocalizedPayload) WHERE detailDefinitionToPayload.language IN (COALESCE({languages},[]) + detailDefinition.defaultLanguage) AND ALL( rel IN [t
@felipebn
felipebn / failingquery.cypher
Created Oct 23, 2018
Example query the error occurs.
View failingquery.cypher
MATCH jobPath = (job:Job)<-[toJob:GJC_SUBFAMILY_TO_JOB]-(subJobFamily:SubJobFamily)<-[toSubFamily:GJC_JF_TO_SJF]-(jobFamily:JobFamily)<-[toFamily:GJC_CATALOG_TO_FAMILY]-(jobCatalog:JobCatalog) WHERE job.uuid IN ["cac77ef5-1b47-4d1d-996a-d448a8a859b7"] AND ALL( rel IN [toJob, toSubFamily, toFamily] WHERE rel.min - 2 <= 0 AND rel.max - 2 > 0 ) AND (["8f277b6a-44c4-4e72-9aeb-9d0b1ee18a5c"] IS NOT NULL AND jobCatalog.uuid IN ["8f277b6a-44c4-4e72-9aeb-9d0b1ee18a5c"])
OPTIONAL MATCH jobTypePath = (job)-[jobToType:GJC_JOB_TO_TYPE]->(jobType:JobType)-[jobTypeToPayload:GJC_DETAIL_DEFINITION]->(jobTypePayload:JobCatalogLocalizedPayload) WHERE ALL( rel IN [jobToType] WHERE rel.min - 2 <= 0 AND rel.max - 2 > 0 )
OPTIONAL MATCH reportsToPath = (job)-[reportsTo:GJC_JOB_REPORTS_TO]->(jobToReport:Job)<-[jobToReportToCatalog:GJC_SUBFAMILY_TO_JOB|GJC_JF_TO_SJF|GJC_CATALOG_TO_FAMILY*1..3]-(jobCatalog)
@felipebn
felipebn / neo4j-debug.log
Created Oct 22, 2018
Error when querying neo4j database
View neo4j-debug.log
2018-10-22 16:46:51.845+0000 ERROR [o.n.b.v.r.ErrorReporter] Client triggered an unexpected error [Neo.DatabaseError.General.UnknownError]: (n,RefSlot(4,true,Any)) (of class scala.Tuple2), reference 6154f67f-8230-4a70-a5bd-a03b09894612. (n,RefSlot(4,true,Any)) (of class scala.Tuple2)
scala.MatchError: (n,RefSlot(4,true,Any)) (of class scala.Tuple2)
at org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext$$anonfun$mergeWith$1.apply(SlottedExecutionContext.scala:214)
at org.neo4j.cypher.internal.runtime.slotted.SlottedExecutionContext$$anonfun$mergeWith$1.apply(SlottedExecutionContext.scala:214)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
at scala.collection.mutable.HashMap.foreach(HashMa
@felipebn
felipebn / HttpServletRequestPrintout.java
Created May 13, 2018
Prints HttpServletRequest headers and cookies
View HttpServletRequestPrintout.java
private String printRequestDebug(HttpServletRequest request) {
final String divider = "---------------------------------------------------------------------------------------\n";
StringBuilder sb = new StringBuilder();
sb.append(divider);
Enumeration<String> headers = request.getHeaderNames();
while (headers.hasMoreElements()) {
String headerName = headers.nextElement();
sb.append(String.format("Header[%s]: '%s'\n", headerName, enumerationAsList(request.getHeaders(headerName))));
}
sb.append(divider);
@felipebn
felipebn / google.js
Created Jan 31, 2018
Sample nightwatch.js assertion in multiple items
View google.js
module.exports = {
url: 'http://google.com',
elements: {
searchBar: {
selector: 'input[type=text]'
},
btn: {
selector: 'input[type=submit]',
}
},
@felipebn
felipebn / docker-compose.yml
Created Jan 11, 2018
Docker compose file to exemplify how to place a automatic reverse proxy in front of containers (WINDOWS)
View docker-compose.yml
version: '3.4'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
environment:
#192.168.65.2 is (usually) the docker host, discovered by checking which networks were reachable from a container
@felipebn
felipebn / docker_logs_from_keycloak_contianer.sh
Created Nov 17, 2017
Powershel - How to get docker ps output first column OR How to get docker contianer ID from docker ps
View docker_logs_from_keycloak_contianer.sh
# Example for a container with '/keycloak' in the name
docker logs -f $(docker ps | Select-String /keycloak | % { $_.ToString().Split(" ") | select -first 1})