Skip to content

Instantly share code, notes, and snippets.

@Ivan-Feofanov
Ivan-Feofanov / getMethods.js
Last active July 25, 2023 19:24
Get list of association methods of model in Sequelize
const model = %yourSequelizeModel%
for (let assoc of Object.keys(model.associations)) {
for (let accessor of Object.keys(model.associations[assoc].accessors)) {
console.log(model.name + '.' + model.associations[assoc].accessors[accessor]+'()');
}
}
@coolaj86
coolaj86 / json-to-yaml-litmus-test.md
Last active March 14, 2022 04:32
"Can you write code?" litmus test.

The Developer Litmus Test

I used to think that fizzbuzz was a stupid way to test if someone is a developer.

Screen Shot 2022-01-24 at 3 06 33 AM

Now I think that it's a good litmus test.

However, I think I've found a better one...

Can you convert a Value Object (i.e. JSON) to YAML?

My Expectation

My expectation is that a mid-senior level developer should be able to accomplish this task in under 4 hours:

  • write a basic solution in 30-60 minutes
  • debug / test / fine-tune for another 60-90 minutes
  • document, package, and publish within the remaining time

I could see it reasonable even if a developer takes 2 days to solve this for the first time - possibly because they needed to take a break but didn't, such as feeling pressure and getting brain freeze, taking an initial wrong approach, over-thinking the problem, and then just keeping beating the dead horse, etc - especially if they've never had to work independently before.