Skip to content

Instantly share code, notes, and snippets.

View parkan's full-sized avatar

Arkadiy Kukarkin parkan

View GitHub Profile
@parkan
parkan / mchain-resolve.sh
Last active January 25, 2016 18:05
Mediachain Resolver
# request fingerprint lookup from the API
% curl -X POST -H 'Content-Type: application/json' \
-d '{"image_url": "http://www.susanmeiselas.com/images/uploads/MolotovMan-Booklet_520p_70_1.jpg"}' \
https://mediachain-resolver.herokuapp.com/search
{
"matches": [
{
"confidence": 1.0,
"instance_id": "6580df51ed0d44b3a5519c1fc4e69e378df6ffde",
"metadata_id": "QmRBHQVmjKTv6ust1SVjJ4WLQb2p7PJaA1bEespBjb8SwY"
@parkan
parkan / ccr-resolver.md
Last active December 23, 2015 13:07
CCR Resolver

Design

This is the layer of the Canonical Content Registry that allows location of metadata identifiers pointing into the registration store based on perceptual similarity. The DHT is keyed by an appropriate perceptual hash (for example, Fixed Length MH Hash from phash.org for images) hashed again using a Locality Sensitive Hash such as RHH, which allows for efficient similarity search as in Hamming DHT. Keys that collide fully are chained and may be disambiguated as described below.

As in the Hamming DHT, near match keys may be returned, up to a threshold.

The values include a "name" identifier for the registration store and possibly several other perceptual hashes or other derived data (e.g. haar-like features, histogram, etc) for the work that can be used to further disambiguate the query. The client may send up these a

@parkan
parkan / ccr.md
Last active December 30, 2015 23:46 — forked from denisnazarov/ccr.md
Canonical Content Registry

Canonical Content Registry Foundation

Today, there is no reliable way to persist metadata for digital media as it travels across the internet.

Mine is working to build a global content registry on top of the Bitcoin blockchain to serve as an open metadata layer for canonical representations of digital media.

The goal of such a registry is to enable a new decentralized hypermedia protocol that powers the next generation of digital content applications, where creators and consumers to own their media, identity and interactions across the internet, without dependency on industrial or platform gatekeepers.

In March, we published a high level summary of how such such a system could work, titled the Canonical Content Registry. Today, we are taking the first steps to start building it by sharing a proposal for a technical implementation on top of Blockstore. We welcome your feedback and look forward to starting a conversation.

@parkan
parkan / dc-aliases-zsh
Last active August 29, 2015 14:25
docker-compose aliases
b2d-shellinit(){
[ -z "$DOCKER_HOST" ] && $(boot2docker shellinit)
}
alias dc='b2d-shellinit; docker-compose'
alias dcr='b2d-shellinit; docker-compose run'
alias dcr-heroku='b2d-shellinit; docker-compose run `heroku config -a XXX-production | tail +2 | tr -s " " | sed -E "s/^([^ ]+): (.+)/-e \1=\2/" | tr "\\n" " "` api rails c'
alias dcr-heroku-staging='b2d-shellinit; docker-compose run `heroku config -a XXX-staging | tail +2 | tr -s " " | sed -E "s/^([^ ]+): (.+)/-e \1=\2/" | tr "\\n" " "` api rails c'
@parkan
parkan / gist:6a4e74684feb828dddd6
Created July 13, 2015 16:53
onename verification
Verifying I am +arkadiy on my passcard. https://onename.com/arkadiy
@parkan
parkan / gist:0d75c363034db1ade31b
Last active August 29, 2015 14:24
Run a docker rails console container with heroku variables injected into ENV
# this replaces https://github.com/tpope/heroku-surrogate for docker containers (sort of)
docker-compose run `heroku config -a $APPNAME | tail +2 | tr -s " " | sed -E "s/^([^ ]+): (.+)/-e \1=\2/" | tr "\\n" " "` api rails c
@parkan
parkan / force.csv
Last active August 29, 2015 14:18 — forked from d3noob/.block
source target value
Harry Sally 100
Harry Sally 100
Harry Sally 100
Harry Mario 1.3
Sarah Alice 0.2
Eveie Alice 0.5
Peter Alice 1.6
Mario Alice 0.4
James Alice 0.6
@parkan
parkan / gist:e89f9d54533326ff94bd
Created December 5, 2014 17:57
Chromium contributor count
[0ff3a49...//src]% git remote -v (arkadiy@sodium:~/src/)
origin https://chromium.googlesource.com/chromium/src.git (fetch)
origin https://chromium.googlesource.com/chromium/src.git (push)
[0ff3a49...//src]% git shortlog -sn | wc -l (arkadiy@sodium:~/src/)
3385
@parkan
parkan / gist:46e9057b49c4c835a148
Created October 6, 2014 17:30
twisted install failure (scrapy prereq)
[~]% pip install twisted (arkadiy@sodium:~)
Downloading/unpacking twisted
Downloading Twisted-14.0.2.tar.bz2 (4.3MB): 4.3MB downloaded
Running setup.py (path:/private/var/folders/sm/38kkrt9n5z5524hmxqn3h8yh0000gq/T/pip_build_arkadiy/twisted/setup.py) egg_info for package twisted
Downloading/unpacking zope.interface>=3.6.0 (from twisted)
Downloading zope.interface-4.1.1.tar.gz (864kB): 864kB downloaded
Running setup.py (path:/private/var/folders/sm/38kkrt9n5z5524hmxqn3h8yh0000gq/T/pip_build_arkadiy/zope.interface/setup.py) egg_info for package zope.interface
warning: no previously-included files matching '*.dll' found anywhere in distribution
@parkan
parkan / git-grep-blame.rb
Created August 14, 2014 21:33
Blame the output of a git-grep. Edited to work under ruby 2.1.X
#!/usr/local/bin/ruby
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}`
interrupt = false
grep.split("\n").each do |file_with_line|
exit if interrupt
file, line_number, line = file_with_line.split(':', 3)