Skip to content

Instantly share code, notes, and snippets.

View implicit.ax
// Got implicit conversion working the compiler!
// You implement it like this:
enum maybe<T> = none | some(T);
// `T?` is just sugar for `maybe<T>`
impl<T> T? {
// the colon prefix means function is static
fn :from(x: T) -> T? {
View bst.ax
fn print<T>(x: T) {
// backticks inject Golang code directly. This isn't
// type-checked or processed by Axler. Any Axler variable
// must be marshalled via `<%=` and `%>`
`fmt.Printf("%v\n", <%= x %> )`
}
enum maybe<T> = none | some(T);
// `T?` is syntax sugar for `maybe<T>`. Just a convenient way
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.
You can’t perform that action at this time.