Skip to content

Instantly share code, notes, and snippets.

@felipebn
felipebn / resume.json
Created December 27, 2023 00:51
resume.json
{
"meta": {
"theme": "stackoverflow"
},
"basics": {
"name": "Felipe Brandão Nascimento",
"label": "Full Stack Engineer",
"picture": "",
"email": "felipe.nascimento1@gmail.com",
"phone": "+351 932 370 071",
@felipebn
felipebn / 3rdparty.js
Last active September 27, 2023 01:37
3rdparty.js script loading callback
console.log("3rdparty script START");
// this should be called from consumer page
window.customFunction = function () {
console.log("custom function called!!!!");
};
console.log("3rdparty script END");
@felipebn
felipebn / srcset-debug-util.js
Created December 15, 2021 12:24 — forked from fatso83/srcset-debug-util.js
SrcSet debug utility to print info on the currently loaded image
/**
* Use this to help determine which images are being used
* at which breakpoint. Will print lots of useful information
* on shown resolution, actual resolution, DPR and more
* Usage:
* var elems = document.querySelectorAll('.c-hero-banner__background img')
* responsiveImageDebugOutput(elems);
*
* Author: Carl-Erik Kopseng
* Source: https://gist.github.com/fatso83/55fc446df3f3965ecd66e8307a5dc0e6
@felipebn
felipebn / import_ESCO_csv_en.cql
Created February 25, 2019 13:00 — forked from rvanbruggen/import_ESCO_csv_en.cql
ESCO database in Neo4j
//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);

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:

@felipebn
felipebn / debug.log
Created November 6, 2018 11:20
Neo4j Error - Issue #12058
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 October 23, 2018 09:59
Example query the error occurs.
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 October 22, 2018 18:05
Error when querying neo4j database
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 10:09
Prints HttpServletRequest headers and cookies
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 January 31, 2018 15:02
Sample nightwatch.js assertion in multiple items
module.exports = {
url: 'http://google.com',
elements: {
searchBar: {
selector: 'input[type=text]'
},
btn: {
selector: 'input[type=submit]',
}
},