Skip to content

Instantly share code, notes, and snippets.

View BruJu's full-sized avatar
🐓

Julian Bruyat BruJu

🐓
View GitHub Profile
@BruJu
BruJu / printPropertyMapper.js
Created April 19, 2021 13:42
PropertyMapper::printPropertyMapper
// https://github.com/BruJu/PREC/blob/master/prec3/vocabulary-reader.js
// Developed for debug purpose
function PropertyMapper::printPropertyMapper() {
console.error("PropertyMapper {");
console.error(` iri:`);
console.error(this.iri);
console.error(" description node:");
console.error(this.descriptionNode);
console.error(" src:");
@BruJu
BruJu / Unblanknode.js
Created April 15, 2021 10:27
Unblanknode
const N3 = require('n3');
/**
* Return the description of the `term`.
*
* The description is:
* - the term itself if it is not a blank node
* - if it is a blank node, a list of every [predicate, object] for which
* there exists a (term, predicate, object) quad in the default graph of the
* store
@BruJu
BruJu / test.js
Created April 8, 2021 15:22
One day i'll learn how to write an issue
const assert = require('assert');
const N3 = require('n3');
const namespace = require('@rdfjs/namespace');
const ex = namespace("http://example.org/", N3.DataFactory);
const rdf = namespace("http://rdf.org/", N3.DataFactory);
describe('N3 Parser', function() {
it('should parse nested nested quad', function() {
let q = (new N3.Parser()).parse("<< << <sss> <ssp> <sso> >> <sp> <so> >> <p> <o> .")[0];
@BruJu
BruJu / julian.ttl
Last active April 1, 2021 14:21
julian.ttl
<http://bruy.at/julian> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
@BruJu
BruJu / manual_enum_dispatch.rs
Last active January 19, 2021 09:30
manual_enum_dispatch.rs
/*
The problematic:
I want enum dispatch for a trait.
I could used
https://docs.rs/enum_dispatch/0.3.5/enum_dispatch/
@BruJu
BruJu / simple.cpp
Created December 28, 2020 11:18
AOC 2015 17
#include "../advent_of_code.hpp"
#include "../util/regex_helper.hpp"
#include <map>
// https://adventofcode.com/2015/day/17
namespace {
size_t to(const std::vector<int> & containers, const std::vector<int> & leftovers, int target, size_t i = 0) {
// Solution
@BruJu
BruJu / notes_latex.md
Last active June 30, 2021 12:52
Notes latex / papiers
  • Most of the time, \tt / \texttt instead of verb!!
  • Create macro for common tools \Javascript
  • Section, Table and Figure with a majuscule, (stop forgetting about this)
  • an rdf because "an airdieff"
  • "semantic" → adjectif, "semantics" → nom (même au singulier)
@BruJu
BruJu / a_Wasm_Tree_cpp.md
Last active December 16, 2020 04:22
WasmTreeFrontEnd ... in C++ Experiments
// https://play.rust-lang.org/
#[derive(Debug)]
struct A {
x: u32
}
fn main() {
let x = A { x: 7 };
@BruJu
BruJu / Graphy And Match.md
Last active December 16, 2020 17:16
Graphy and match

Context : I had trouble to compare Graphy and WasmTree behaviour on match calls, so I tried to understand how Graphy works.

Graphy semmed like it used some cache or lazy matching, so I did some tests

const graphy_factory = require('@graphy/core.data.factory')

const dataset = require('@graphy/memory.dataset.fast')();