Skip to content

Instantly share code, notes, and snippets.

View local-storage.js
console.log(window.localStorage);
@mcobzarenco
mcobzarenco / reinfer.openapi-v3.yaml
Last active July 20, 2021 17:15
Re:infer OpenAPI v3.0
View reinfer.openapi-v3.yaml
openapi: 3.0.0
info:
title: Reinfer
description: "\nWelcome to the Re:infer API. We strive to make the API predictable, easy to use\nand painless to integrate. If there is anything you feel we can do to improve\nit or if you encounter any bugs or unexpected behaviour, please email\n[support@reinfer.io](mailto:support@reinfer.io) and we will get back to you as\nsoon as possible.\n\nYou can see all available endpoints in the [API Reference](/api/summary). There\nis also an [API Tutorial](/api/tutorials/basic-tutorial).\n\n## API Endpoint\n\nAll API requests are sent to Re:infer as JSON objects to an endpoint over\nHTTPS.\n\n```txt\nhttps://reinfer.io/api/...\n```\n\n### Development and production environments\n\nIn Re:infer, development and production data and workflows are separated by\nplacing them in separate organisations, each of which is permissioned\nseparately (so that developers can have admin access in the development\norganisations while having stricter access controls in production). Both\ndevel
View gist:5461cb705a77c56f957652e0310e7bee
swagger: '2.0'
info:
title: Re:infer API
description: Re:infer v1 API
contact:
name: Reinfer Ltd.
email: eng@reinfer.io
url: https://reinfer.io
version: 1.0.0
externalDocs:
View gist:502a220eb29d29889b3c
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCtitJ/uiynqT9VxZZfos7c0INrzJEWq306QRenZ3Za5zZfZs50b1P1qgcvQKrrX/3EP1KZ5b1QXOjoPovaIIYoiNuNaBJYYHRK+EcjxDlFt/EsBgEQHxZyEp8J7ss3pfDuwS0QxUOFA7ABDJieS7O5GXfNfEqwZ6w4Ttpjwpg2fMihN9MZ0/3Rk2PSKNxfH5kYrwKY/rauZIjDmC/vDf0qwjDZy6W6M2HnOy5NlcGduQJv+ixdY4yMlY5XTZg6ymoBCOu4daKxmQb+YRl+wy/0/o/kjhyElF+nJXnwgyUniQUFMpPJeNyI9Xq3w7XDpaiJVL3GwXyP36PTCX3t2TXf marius@reinfer.io
@mcobzarenco
mcobzarenco / join_triples.erl
Created August 3, 2015 10:57
MapReduce Riak job for doing a join
View join_triples.erl
emit_left_id(Obj, _, TargetBucket) ->
try
Key = riak_object:key(Obj),
Triple = mochijson2:decode(riak_object:get_value(Obj)),
case proplists:get_all_values(<<"left_id_s">>, element(2, Triple)) of
[Id] -> [{{{<<"maps">>, TargetBucket}, Id},
{{<<"maps">>, TargetBucket}, Id, Key, Triple}}];
_ -> []
end
catch
@mcobzarenco
mcobzarenco / entity.capnp
Created July 14, 2015 12:51
Capnp for a knowledge base
View entity.capnp
struct Entity {
type @0 :EntityType;
union {
id @0 :Text;
blob @1 :Text;
text @1 :List(Text);
}
}
@mcobzarenco
mcobzarenco / wikidata.py
Created July 7, 2015 17:29
Parse wikidata dump in Python
View wikidata.py
#!/usr/bin/env python
from __future__ import print_function, division
import argparse
import json
import sys
from gzip import GzipFile
def concat_claims(claims):
for rel_id, rel_claims in claims.iteritems():
View gist:17eaa35996c13a857ae9
Verifying that +anih is my openname (Bitcoin username). https://onename.com/anih
View Move CTR Bench.cpp
#include <chrono>
#include <iostream>
#include <vector>
using namespace std;
template<typename T>
uint64_t time_it_us(const T& t) {
auto begin = std::chrono::high_resolution_clock::now();
View gist:cc23946abb41b1a182f2
template<typename Scalar>
struct ImmutableParams {
std::vector<Eigen::Map<const DynamicMatrix<Scalar>>> W;
std::vector<Eigen::Map<const DynamicVector<Scalar>>> b;
};
template<typename Scalar>
struct MutableParams {
std::vector<Eigen::Map<DynamicMatrix<Scalar>>> W;
std::vector<Eigen::Map<DynamicVector<Scalar>>> b;