Skip to content

Instantly share code, notes, and snippets.

@idibidiart
idibidiart / state.js
Last active October 11, 2019 15:42
Cyclic Graph App-State Model
/*
Cyclic Graph App State Model:
1. Fully normalized data, no repetition and no need for synchronization of duplicated entities
2. Easy to serialize since objects don't directly reference other objects.
3. Allows type annotations using natural JS syntax (works with user defined types in e.g. type.js, see BigSet.)
@idibidiart
idibidiart / theory.md
Last active October 7, 2019 16:19
Combining Neural Machine Learning and Logical Analysis for Classification Tasks

Theory of Operation

Training a neural embeddings model on domain-specific data is a way to build an Always Evolving Pattern Dictionary for that domain that associates the different patterns found that data via their cosine similarity in vector space. The patterns can be any sequence of symbols, including whole words, letters, digits, etc.

Some neural embeddings models like Word2Vec work only at the whole-word level (not the letter level) and are context independent in terms of the matched vector, when the trained model is fed a test pattern, i.e. each pattern is represented by just one vector regardless of the associated context in the test pattern. Others like BERT, ELMo and Flair are context dependent, i.e. may have one or more vectors for each pattern and the matched vector depends on the context in the test pattern, and work at the sub-word level. Simple embeddings that work on the word level and are context independent work well in situations where we have patterns such as product names and acronyms

@idibidiart
idibidiart / arch.md
Last active November 27, 2018 09:44
Event Driven Transactional Microservices

arch

What Are Domain Aggregates and Why Do We Need Them?

In this architecture, microservices boundaries map to Domain Aggregates that encapsulate a given transaction within their boundary. Domain Aggregates are the collection of domain objects that must be read and/or updated within the boundary of a single database trasaction (to guarantee the read/write consistency for the involved etities, under concurrency.)

A domain model contains clusters of different data entities and processes that can control a significant area of functionality, such as order fulfilment or inventory. A more fine-grained Domain Driven Design (DDD) unit is the Aggregate, which describes a cluster or group of entities and behaviors that can be treated as a cohesive unit from a transactional perspective.

We usually define an aggregate based on the transactions that we need. A classic example is an order that also contains a list of order items. An order item will usually be

@idibidiart
idibidiart / index.html
Last active April 2, 2018 18:00 — forked from flavioespinoza/depth_chart.html
D3 Market Depth Chart built from Order Book
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>d3 depth chart</title>
<script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
<style>
@idibidiart
idibidiart / README.md
Created March 20, 2018 22:38 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@idibidiart
idibidiart / Readme.md
Created March 19, 2018 16:18 — forked from vicapow/Readme.md
WebGL + d3.layout.force

This demo uses d3.layout.force() to calculate the node positions and then passes those to webGL to render them on the GPU.

@idibidiart
idibidiart / Infrastructure.js
Last active September 10, 2020 00:53 — forked from sebmarkbage/Infrastructure.js
SynchronousAsync.js
const fetch = (url) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(url)
switch(url.match(/\d[aA-zZ]$/)[0]) {
case "1a":
resolve({name: "Seb"})
// or try this instead:
// reject({error: "something went wrong while fetching " + url})
break;
@idibidiart
idibidiart / test.md
Last active September 22, 2017 05:10
@idibidiart
idibidiart / testing.md
Created September 14, 2017 13:20
Last night's testing
  1. Unhandled Promise Rejections

Cause silent failure mode, with unlogged warning, on older version of Node Cause a crash on newer version of Node

I had already told some developers about it. Prakash avoided it in Power Reviews

In FromManufacturer.js

componentDidMount() {

@idibidiart
idibidiart / clipboard-example.html
Created February 22, 2017 17:49 — forked from scottoffen/clipboard-example.html
JavaScript Copy To Clipboard Example
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Copy To Clipboard Example</title>
</head>
<body>
<input id="txtToCopy" type="text">
<button id="btnCopy">Copy!</button>