This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl genrsa -out key.pem 4096 | |
openssl req -new -key key.pem -out csr.pem -subj "/C=US/ST=California/L=San Francisco/O=Local-Company/OU=dev/CN=localhost/[email protected]" | |
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem | |
rm csr.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
build | |
*.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const client = new APIClient(); // whatever. I use https://github.com/Yomguithereal/djax-client | |
const store = new LocalStore(); // whatever. A localStorage abstraction | |
// A tree | |
const tree = new Baobab({ | |
fetchingUsers: false, | |
session: null, | |
data: { | |
users: [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Getting the related nodes and avoiding irrelevant children belonging | |
// to other WEs. | |
MATCH (we:WE {name: "SCPO"})-[:PREFIX]->(:Node)-[rels:PARENT*0..]->(n:Node) | |
WHERE ALL(n IN extract(rel in rels | endNode(rel)) WHERE NOT (n)<-[:PREFIX]-()) | |
RETURN n; | |
// Computing the WEs graph | |
MATCH (we:WE {name: "SCPO"})-[:PREFIX]->(:Node)-[rels:PARENT*0..]->(n:Node) | |
WHERE ALL(n IN extract(rel in rels | endNode(rel)) WHERE NOT (n)<-[:PREFIX]-()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Points to improve: | |
# 1) Distance metrics | |
# 2) Clustering scheme | |
import csv | |
import re | |
from collections import defaultdict | |
# Parameters | |
SOURCE_CSV_PATH = './uniq_artworks.csv' |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"title":"Wikipedia Single Word","authors":[],"bundleVersion":"0.1alpha","consolidated":true,"date":"2017-10-02","defaultNodeColor":"crawling-status","defaultNodeSize":"indegree","defaultEdgeSize":"count","edgeAttributes":[{"id":"count","name":"Count","count":73832,"type":"ranking-size","integer":true,"areaScaling":{"min":10,"max":100,"interpolation":"linear"},"data":{}}],"nodeAttributes":[{"id":"crawling-status","name":"Crawling_status","count":1354,"type":"partition","integer":false,"modalities":[{"value":"FINISHED","count":1353,"color":"#666"},{"value":"UNCRAWLED","count":1,"color":"#AAA"}],"modalitiesIndex":{"FINISHED":{"value":"FINISHED","count":1353,"color":"#666"},"UNCRAWLED":{"value":"UNCRAWLED","count":1,"color":"#AAA"}},"data":{"modalitiesIndex":{"FINISHED":{"nodes":1353,"internalLinks":73803,"internalNDensity":0.12495090204793532,"inboundLinks":0,"inboundNDensity":0,"outboundLinks":29,"outboundNDensity":0.00004909795210748721,"externalLinks":29,"externalNDensity":0.00004909795210748721},"UNCRAWLED" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from collections import Counter | |
from queue import Queue | |
from threading import Condition, Event, Lock, Thread, Timer | |
# TODO: shutdown + end threads | |
# TODO: use thread safe urllib3 | |
# TODO: for ordered case, we can also have an output buffer | |
FOREVER = 365 * 24 * 60 * 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from minet.crowdtangle import crowdtangle_summary | |
for result in crowdtangle_summary(urls, token='TOKEN', start_date='2017-08-01'): | |
print(result.stats) | |
print(result.posts) |