Chao Lam

Working on the next small things …

Applying for StartX

leave a comment »

We applied for Stanford’s StartX accelerator program and were fortunate enough to be shortlisted to the interview round. After not having had to be interviewed for over a decade, I was definitely rusty! Here’re a few thoughts more as notes for myself but maybe it’ll be helpful for future applicants as well:

  1. Answer to the intent of the question, don’t necessarily give the literal answer. In our pre-interview, we were prepped that we would be interrupted and possibly barraged with unexpected questions. Sure enough, one of the interviewers suddenly asked our cap table: What is the equity split between you three?
    Given what I knew of StartX, and how it was known for *not* asking for equity from its member companies and the collegial nature of Stanford, I was not expecting such a question and definitely had a deer in headlights moment.
    On reflection, I think I should have asked a clarify question such as “to better answer your question, could I ask why you would like to know our cap table at this stage?” I think that would have 1) allowed me to better answer to what the interviewer was looking for 2) given me more time to think on my feet!
  2. Keep a sense of humor. I think this is where my good friend John is trying to coach me. I want the interview to feel more like a collaboration, that they get so engaged in our project that they would like to be involved and help out. Being relaxed and having a sense of humor just makes the collaboration more fun!
  3. No matter how the interview goes, I think it’s a good idea to sum up the opportunity the way we see it in a succinct manner, perhaps something like: We’re have thousands of paying customers and are profitable, we’ve made good progress in becoming viral and ensuring free distribution. I think together we can figure out how we can scale this project to the next level of our strategy, in Chris Dixon’s words: “Come for the Tool, Stay for the Community”

Written by Pseudonymous

March 4, 2020 at 11:03 pm

Posted in Uncategorized

Tagged with

Integrating your app with Zapier using OAuth2

leave a comment »

If you’re trying to add your own trigger or action for Zapier, and your end point is only accessible via a valid OAuth2 token, be sure to add the Bearer token in the API end point headers!

Here’s what I tripped me for a couple of hours:

I had some API end point. I even tested it as a “test” end point when setting up OAuth v2 authentication and everything worked. But the end point kept returning a 401 Unauthorized code.

I finally figured out I had to manually add the OAuth2 access token http header for each endpoint url:

Written by Pseudonymous

July 22, 2019 at 9:39 pm

Posted in Uncategorized

Twitter Activity Webhook – Inexplicable error

leave a comment »

I had some code relying on Twitter’s Activity Webhook which I hadn’t touched for a while.

Today, when I started playing around with the project again, I got this inexplicable error that took me a while to figure out:
HTTP Error 348: Client application is not permitted to access this user’s webhook subscriptions

After many other rabbit holes, I finally found the solution. It turns out if you have changed your Twitter apps permissions, your accessToken and accessTokenSecret keys will be changed

But that isn’t the half (or quarter of it :). These changed keys won’t help you create a subscription. You now need to go to your “regular” Twitter account “app and settings” and revoke access to this app. Finally, you need to regenerate the apps access token and access token secret.

Phew! Would never figured this out without this helpful link:
https://twittercommunity.com/t/getting-error-code-348-while-trying-to-add-subscription/101796

Once again coding by googling ftw!

Written by Pseudonymous

May 2, 2019 at 5:21 pm

Posted in Uncategorized

Force legacy database using BLOBs to behave as utf-8 strings in rails

leave a comment »

I was working on a legacy mysql database which had a BLOB column “user_name”. I think it used a blog so that it could have emojis as strings (before utf8mb4?)

Anyway, my action mailer emails were failing when they encountered these emoji characters. ActiveRecord does all these magical things behind the scenes, but unfortunately it was magically convert the BLOB to 8-bit ASCII upon which action mailer barfed when it encountered these emoji characters.

Finding the issue was the hard part, the fix was easy:

  def user_name
    self.attributes['user_name'].force_encoding('utf-8')
  end

Written by Pseudonymous

April 23, 2019 at 6:01 pm

Posted in Uncategorized

TLS/SSL on Mac Postgres.app

leave a comment »

This article was helpful but out of date:
http://blog.workherder.com/enable-ssl-in-the-postgres-app-on-mac-os-x/

This is the latest Postgres 11 docs to create self-signed certs:
https://www.postgresql.org/docs/11/ssl-tcp.html

This talks about creating client certs but I’m not sure if it’s needed (at least if client/server are on the same machine):
https://www.howtoforge.com/postgresql-ssl-certificates

Written by Pseudonymous

April 2, 2019 at 11:08 pm

Posted in Uncategorized

Default Active Record tables to utf8mb4 encoding

leave a comment »

I found several articles on how to convert existing rails tables to support 4-byte unicode characters including emojis but didn’t find one talking about how to create a new table.

So, here’s the code I used:

create_table :twitter_users, {options:"DEFAULT CHARSET=utf8mb4"} do |t|
...
t.timestamps
end

Written by Pseudonymous

February 14, 2019 at 10:14 pm

Posted in Uncategorized

Adventures in KenKen

leave a comment »

My Mom enjoys sudoku and I like playing KenKen!

Here’s one I think is worth replaying:

I quickly started out with the basic rules to get this layout:

The only “given” 3 provides a clue to the 45x at the top. The candidates are 1335, given the fixed 3, there can be only 2 possible set of positions for the 45x. A tricked I figured out for 19+ is that it cannot contain digits 1,2 and 3. Thus :

With the double 3s in place, looking at 168x, there are two possible combinations 378 or 467. The double 3s preclude 378, so 467 it is! And with our 21+ eliminating 6 and 7, one of those squares can only be a 4:

Then, looking at the 48x just below 168x, We know there are 4 possible combinations: 344, 624, 618, 328. The first is now eliminated with the 4. 624 and 614 are also eliminated because of the 67 above. So the only combination left is 328:

Now looking at 112x at the bottom. there are 3 combinations: 7144,7224,7128. But the double 2s and 4s are not possible because of the double 24s on the last column (and last two rows). So the only combination 7128. After applying some other clean on the left, we get:

Now here comes a tricky part: The two pairs 15 and 56 circled above, ensures that 19+ cannot have a 5. When 5 is eliminated, 19+ then also cannot have a 6. In fact, the only combination left standing is 478:


Looking at 70x, we know it needs a 2 (in 257), so the 8+ above cannot have a 2, which means it’s 17. Hence (with more cleanup):

becomes:

which collapses and leads to the solution:

Written by Pseudonymous

February 11, 2018 at 5:54 am

Posted in Uncategorized

IFTTT maker (webhook) test with Curl

leave a comment »

IFTTT used to have a test page for developers who wanted to implement the Maker (now called webhook) trigger. Unfortunately they initially hid it and then finally removed it entirely (not sure why). But here’s a command line curl command to simulate the test page:

curl -H “Content-Type: application/json” -X POST -d ‘{“value1″:”xyz”,”value2″:”222″}’ https://maker.ifttt.com/trigger/<$YourEventName>/with/key/<$YourOwnKey&gt;

where <$YourEventName> = your IFTTT app event name

<$YourOwnKey> = user’s IFTTT key

 

Written by Pseudonymous

March 22, 2017 at 10:22 pm

Posted in Uncategorized

Tip: Refund $15 comcast xfinity starter kit

leave a comment »

I recently installed comcast cable internet service. Of course, I chose not to rent their modem for $10/month. Opening the account online was pretty painless, but it insisted on a $15 starter kit. Turns out the starter kit is just cable wire, a splitter and completely useless instructions.

The real instructions can be found at www.xfinity.com/selfinstall

I had to call comcast (via the ever helpful gethuman.com) to get a refund for the starter kit, but it was surprisingly pain-free, hopefully comcast is improving…so it is worth calling Comcast for the $15 refund.

Written by Pseudonymous

January 27, 2017 at 12:54 am

Posted in Uncategorized

leave a comment »

If you’re using the rails jquery autocomplete gem and mongoid, you need to specify the gem *after* the mongoid gem!

i.e. in your Gemfile

gem ‘mongoid’
….
gem ‘rails-jquery-autocomplete’

+++
Apparently, it checks whether mongoid is present before injecting some special mongoid methods!

Written by Pseudonymous

May 27, 2016 at 7:39 pm

Posted in Uncategorized