Chris Oliver

Joined

291,530 Experience
86 Lessons Completed
296 Questions Solved

Activity

Posted in Analytics with Segment Discussion

Got any specifics you'd like to see?

Posted in Simpleform association with images!

Doh. I looked at your code and didn't have any good answers. Didn't cross my mind that the table might be missing. 😜

You can still create a users controller even if you use Devise so you can make the /users.json endpoint. Devise doesn't define a GET route for /users, just POST and PUT which means you're free to create one or you can make a different route as well.

Sweet, I haven't used zipline myself but that sounds awesome.

Are you primarily working with small file sizes? I would imagine this could get problematic if someone tried to zip a gigabyte or something, but hopefully that's not an issue you have to worry about yet.

  • I think parsing the S3 bucket logs could work but it may be hard for you to tell who did what if you want to track who did what.
  • I have done the redirect version of this before for http://feedforward.io/ and it works pretty well. You link to /whatever/1/download and then record the download and then redirect the user to the actual download url. Works pretty well.
  • Another thing you could do is use a JS tracker like Ahoy or Mixpanel, etc where you track it with an AJAX request when the user clicks the download link. This means you don't have to have anything special going on in your app and you can use third party analytics tools like Mixpanel really easily.

I'd probably go with one of the latter options for simplicity.

Posted in Liking Posts Discussion

Well, you can cache the user signed out version and use that everywhere. That will cover a lot of things if your website gets much traffic from search results. The other thing I'd say is to use an AJAX request or just embed the IDs in the HTML somewhere for the logged in users and just have JS update the cache'd snippet visually to reflect whether the user had voted on it.

This way you can use the same cache for literally everyone and then just tweak it visually based upon the current user with a little JS. That's how I'm handling the watchlist and completed states of videos on GoRails now so I can have a single cache for every episode and then update it visually for logged in users.

Posted in Simpleform association with images!

Hey Martin,

Could you post the full error and a bit of the stacktrace as well? I'm guessing it has something to do with your associations.

I haven't seen the can't write unknown attribute error message recently so I'm not quite sure what it refers to. Googling it leads me to believe maybe your Bucket doesn't have a message_id column or your associations are backwards maybe? https://stackoverflow.com/questions/20295710/activemodelmissingattributeerror-cant-write-unknown-attribute-ad-id-with-f

Posted in Free SSL with Rails and Nginx using Let's Encrypt

You'd want two server blocks like you said and each one would point to different SSL certs if you wanted them both on SSL.

Posted in Turbolinks 5 Forms for Mobile Discussion

I believe if you want to do iOS development at all, you have to use macOS. You can run it on some compatible PCs though: tonymacx86.com

Having spent the last few weeks doing some React Native on the side, it's a pretty rough experience. Lots of compatibility problems and things like navigation libraries have been rewritten like 6 times already. It's still got a long way to go and it's getting better, but it can be pretty frustrating compared to just building native apps with or without Turbolinks adapters. At least when you're building native you can easily use any library or examples online.

Just as a heads up I just published this week's episode on this topic. :)

Archiving servers, deleting apps, and deploying to a custom VPS are now live! Things may still be a little buggy, but it's ready to try.

I'm using easyAutocomplete for the global search on GoRails. It just makes an AJAX request that queries episodes and forum threads and returns a JSON object of two arrays, one for each and those get displayed accordingly. I'll try to do an episode on this soon.

Just wanted to give you a heads up, I've got app deletion almost ready and that will becoming out this week hopefully alongside the custom VPS option that will allow you to make deployments on any VPS, not just DigitalOcean. 👍

You can definitely do all of that with typed store and a json column. Like I showed in the example, it casts both going in and out of the store, so there's no chance you'll have booleans with 5 states.

One better example is probably feature flags that will often come and go. Adding and removing columns for every feature flag is going to be way overkill for something that can easily be handled through a store.

Posted in In-App Messages Between Users Discussion

As far as I know, yes it's still the go-to. Messaging doesn't change that much so I wouldn't expect a whole lot of change for it.

I believe that JSONB is probably the best format for this because it's a binary representation. Should be more efficient for most everything. There's some more information on this stuff here: https://www.citusdata.com/b...

Posted in My first 3 hour project for job application

An interface is the public methods on an object you define so that other code can interact with them.

You can as long as you're using hstore or json column in Postgres, but it's not quite the normal where syntax like you mentioned. You have to use the SQL syntax I showed in the episode for querying JSON columns (note the "->>" part at the end).

Hstore has its own syntax as well that's a bit different and uses "@>" and some other syntax.

Posted in My first 3 hour project for job application

That's exciting Sean! I did this back in 2011 for a job and had the same 3 hour window thing.

For me, I was given 4 or 5 CSV files that I had to parse and then run searches against. It was pricing data, searches, gps locations, and stuff and was quite a hard thing to solve in 3 hours, especially for my first job. I got super close but didn't have time to write any tests and my answers were close but not quite correct from what I could tell. Ultimately I didn't get hired because they were on the fence with my results but I learned a lot from it.

My big takeaways from it were:

  1. The biggest thing is to stay as calm as you can and share your thought process. If you don't, you're going to write a bunch of code that's semi-disorganized and makes it had for them to understand how you were trying to approach the problem. The best way to share your thought process is through well organized code, but take your time to comment / write out your ideas as you go and turn that in as well. You can outline which pieces you'd break down and separate into different parts, which you'd tackle first, and so on. Also note the pieces you see are complex or you think could be solved better and how you might come back later to improve them.
  2. Do your best to write out all your objects and interfaces for them as clearly as you can. What ones will you need? what is each one's job? how will they interact?
  3. The previous questions are a good foundation for thinking about how your objects would be tested as well. Even if you don't get around to writing tests or anything, showing that your objects are designed to be testable will be a great sign.

This is awesome, thanks for sharing that John!