access control allow origin localhost 3000

To access stuff locally do something like:

1
2
3

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome  --disable-web-security

to turn off the Chrome security stuff and get the request out.

August 09, 2011

Ruby debugger rc file

Make a file called .rdebugrc in your home directory and put in “set autoeval on” or whatever.

July 20, 2011

Hack the planet

I’m hiring (again). Check out our post here: http://jobs.github.com/positions/e2b047aa-a8ea-11e0-8abc-b94f79186448 and here: http://jobs.37signals.com/jobs/9264 or just message me directly at github.com/mischa. I’d love to talk to you!

Also, you may have noticed that this blog has become readers only. I’m in the middle of building another company / moving to Boston and have been focusing on that. My plan is to start writing regularly again in 2012, but focused more on product design rather than Ruby, since that’s what I’ve been doing for the past few years.

-Mischa

July 08, 2011

Websql vs indexeddb

Here are the useful resources on indexeddb as of now:

A useful video tutorial with code

A video w/ some rationale

A guy in germany is writing a wrapper

However, indexeddb doesn’t provide a way to do fulltext search, which means that it’s not useful in many situations. It looks like google is pushing for it to do fulltext search, but that won’t happen for a while it seems. When it does, it will seemingly be pretty useful.

In the meantime, there is websql which implements sqlite.

April 24, 2011

left outer joins in rails/arel and left outer joins with where

Consider the following two queries:

1
2
3
4
5

SELECT cats.id, cats.name FROM movies 
LEFT OUTER JOIN people ON(cats.id=people.cat_id AND people.name='John')
LIMIT 10;

1
2
3
4
5
6
7


SELECT cats.id, cats.name FROM movies 
LEFT OUTER JOIN people ON(cats.id=people.cat_id)
Where people.name='John'
LIMIT 10;

The first query returns filters the joined table, but NOT the final results. The second query filters the final results. So, the first query will return 10 rows of cats, whether or not there are any people named john, and the second row will only return cats if there are people named john.

Also—in rails a left outer join is relation.incude, while a normal join is relation.joins.

April 20, 2011

pg_bulkload notes

https://github.com/kkaefer/homebrew/raw/5aa0ac393519abdec14a42628d58d64573237346/Library/Formula/pg_bulkload.rb

/Library/Formulas/pg_bulkload.rb

brew install pg_bulkload

grab file setup

psql -f `pg_config --sharedir`/contrib/pg_bulkload.sql database_name

http://pgbulkload.projects.postgresql.org/sample_csv.ctl

pg_bulkload lib/tasks/importers/import.ctl -d dbname

didn’t work, switching to COPY

copy movies(header, order) from '/file .csv' DELIMITERS ',' CSV ;

April 16, 2011

Communicate in real time with the people around you

I constantly hear about apps or feature requests that will allow me to do something or let me do something. This often seems kind of idiotic for two reasons.

Feature requests

It always bugged me to see something like “Please allow people to export their ribblets to csv” as a feature request. From a developer perspective, it makes it seem like the person thinks that there is some switch that you can hit on some server and suddenly the feature will exist. Obviously this isn’t the case. The language here should be something more like “People should be able to export their ribblets so that they can create paste, which will get us more customers” or something.

Product

Products that “let” or “allow” people to do something are often pretty ill-conceived. Chances are, people can already do whatever the product is supposedly allowing them to do. For example “My todo app allows you to keep track of your todo list” or “My time tracking app lets you track your hours.” Neither of those tasks are very hard. Congrats on making an app this is somewhat harder to use than paper and pencil.

That kind of wording suggests to me that whoever is writing those apps hasn’t thought very hard. For anything that your app allows people to do, ask yourself:

Are people already doing this?

If so, how?

If not, why not?

How are they already doing it?

Why is your way better?

If they aren’t doing it, why will your way convince people to start doing it?

March 25, 2011

Reduce choices and friction

I invited a friend to Quora the other day, and she joined and e-mailed me:

“yep! it also automatically had me following all of my FB friends and all of my interests. facebook is getting a little weird these days :/”

So, immediately after signing up, Quora already had her following stuff she was interested in (b/c I had listed it for her), and it already had her following her friends.

Furthermore, the reason that I had invited her was b/c Quora randomly has that “Invite your friends thing” and rather than, as most sites do, making me type in friends names, quora just lets me click “Invite”

The process involves so little friction and choice.

March 16, 2011