Skip to content

Instantly share code, notes, and snippets.

View blokhin's full-sized avatar

Evgeny Blokhin blokhin

View GitHub Profile
#!/usr/bin/env node
var https = require('https');
var qs = require('querystring');
var api_key = ""; // your key
var host = "api.mpds.io", port = 443, path = "/v0/download/facet";
var search = {
"elements": "Mn",
"classes": "binary, oxide",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@blokhin
blokhin / MPDS_UO_bondlengths.ipynb
Last active September 28, 2022 23:12
An example of using MPDS with Matminer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?label
WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label }
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dbres: <http://dbpedia.org/resource/>
DESCRIBE dbres:Curie-Weiss_law
SELECT ?dbr WHERE { ?dbr foaf:isPrimaryTopicOf <http://en.wikipedia.org/wiki/Curie–Weiss_law> }
@blokhin
blokhin / NODEJS
Last active April 16, 2020 13:23
node --optimize_for_size --max_old_space_size=920 --gc_interval=100 server.js // 1500 Mb RAM
node --optimize_for_size --max_old_space_size=460 --gc_interval=100 server.js // 512 Mb RAM
// downgrade npm
npm install -g npm@VERSION
# Amazon:
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080
iptables -t nat -A DOCKER -p tcp --dport 8001 -j DNAT --to-destination 172.17.0.19:8000
# Drop existing:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
SELECT * FROM sys_rdf_schema;
ld_dir('/data', '*.ttl', 'http://www.example.com/genealogy.owl#');
delete from DB.DBA.load_list where ll_file='/data//einstein.ttl';
SPARQL SELECT (COUNT(DISTINCT ?x) AS ?count) WHERE { ?x ?y ?z };
sparql clear graph <http://www.example.com/genealogy.owl#>;
sparql load <https://github.com/blokhin/genealogical-trees/raw/master/data/header.ttl> into <http://www.example.com/genealogy.owl#>;
rdfs_rule_set('fhkb', 'http://www.example.com/genealogy.owl#');
SPARQL SELECT ?g count(*) as ?count WHERE { GRAPH ?g {?s ?p ?o } } GROUP BY ?g ORDER BY DESC 2;
@blokhin
blokhin / CASSIEs
Last active January 6, 2025 22:01
CONSISTENCY ONE;
CREATE KEYSPACE james WITH replication = {'class':'SimpleStrategy', 'replication_factor': 1};
describe keyspaces;
describe tables;
use james;
CREATE TABLE james (column1 int PRIMARY KEY, column2 text);
INSERT INTO james (column1, column2) VALUES(42, 'just a test');
SELECT * FROM system_schema.keyspaces;
@blokhin
blokhin / DOCKERs
Last active January 6, 2025 22:01
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
docker start `docker ps -q -l`
docker attach `docker ps -q -l`
docker run -ti -v //c/Users/Evgeny/office:/data kaixhin/theano
docker run -ti -v //c/Users/Evgeny/office:/data b.gcr.io/tensorflow/tensorflow bash
docker run -ti -v //c/Users/Evgeny/office:/data ubuntu:12.04
@blokhin
blokhin / GITs
Last active October 15, 2025 23:04
# common GIT tips
git show HEAD~0:index.html
git log --graph --oneline --date-order --decorate --color --all
git diff --name-status master..somebranch
git diff somebranch master -- myfile
git commit --amend -m "New commit message"
git archive --format zip --output /full/path/to/zipfile.zip master
git archive --format tar --output ~/.tar master
git shortlog -s -n
git checkout otherbranch myfile.txt