Skip to content

Instantly share code, notes, and snippets.

Slava Akhmechet coffeemug

Block or report user

Report or block coffeemug

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View age-of-em-review.markdown

Every piece of speculation about the future I've ever encountered broadly pattern-matches into one of four genres: forecasting, prophecy, literary works of fiction, and rants. Age of Em doesn't autocomplete into any of these, and I think both my irritation and fascination with it come from the same source -- the audacity of creating an entirely new genre of futurism.

Here are rough properties of the existing four genres:

  • Forescasting - narrow subject matter, falsifiable details that
View gist:80af67195b206e1eb035ce878f3f411c
### Keybase proof
I hereby claim:
* I am coffeemug on github.
* I am coffeemug (https://keybase.io/coffeemug) on keybase.
* I have a public key whose fingerprint is 61D8 8768 ADF2 C641 6ED5 2E6A 045D F3C7 4618 7048
To claim this, I am signing this object:
View rethinkdb-failure-reasons-according-to-hn.md
- Inexplicable perversity of human nature.
- The clever machinations of MongoDB's marketing people.
- The AGPL license killed it.
- We spent too long development before monetizing.
- Bad performance.
- Numeric types limited to a 64-bit `float`.
- Great product, but didn't/couldn't translate to revenue.
- Bad business model.
- Failure in timezones/timestamp nuances.
View keybase.md

Keybase proof

I hereby claim:

  • I am coffeemug on github.
  • I am coffeemug (https://keybase.io/coffeemug) on keybase.
  • I have a public key whose fingerprint is 5925 55F9 CC4C 2D4E E82E 97AA A33E 7D8E 5279 41E9

To claim this, I am signing this object:

@coffeemug
coffeemug / hn_rethink
Created Oct 7, 2014
Grab top stories into RethinkDB via Hacker News API
View hn_rethink
r.http("https://hacker-news.firebaseio.com/v0/topstories.json").limit(5).map(
r.http(r.add("https://hacker-news.firebaseio.com/v0/item/",
r.row.coerceTo('string'),
".json"))
);
View Migrating to RethinkDB 1.12.md

Migrating to RethinkDB 1.12

There are a number of breaking changes in RethinkDB 1.12 you should be aware of before migrating.

Data migration

First, make sure to go through the regular data migration process, since the 1.12 file format isn't compatible with file formats generated by previous versions of RethinkDB.

Then, replace group_by and grouped_map_reduce commands in your applications with the new group command.

View gist:8034819
r.table('authors').filter(lambda author:
r.table('users')['last_name'].contains(author['last_name'])).
run(conn)
View gist:7942219
David, sorry you ran into these issues. The crash is a known bug, and will be fixed in the 1.12 release (along with the new cache implementation). See https://github.com/rethinkdb/rethinkdb/issues/1389 for more details.
As to the performance you're getting, could you give some additional info so we could track this down?
- Which OS/version are you running?
- Which RethinkDB version are you running? (you can tell by running `rethinkdb --version`)
- Which client driver are you using (and which version)?
- What query do you use to get out 100 documents and how are you measuing latency?
Would really appreciate your feedback so we could fix these issues.
@coffeemug
coffeemug / gist:6444786
Created Sep 5, 2013
RethinkDB vs. Mongo insert test
View gist:6444786
"""Compares rethinkdb with mongo. Copied from http://pastebin.com/3PqdFTjc. Example output:
mongodb: 0.110867023468
rethink: 2.25043606758
"""
import copy
import pymongo
import rethinkdb as r
import time
@coffeemug
coffeemug / gist:6417983
Last active Dec 22, 2015
Importing `git log` data into RethinkDB
View gist:6417983
git log --pretty=format:"%H|%ae|%at|%s" | \
python -c " \
import rethinkdb as r; \
import sys; \
r.connect().repl(); \
r.table_create('commits').run(); \
r.table('commits').insert([dict(map(lambda x, y: [x, y], \
['id', 'email', 'date', 'subject'], \
line.split('|', 3))) \
for line in sys.stdin]) \
You can’t perform that action at this time.