Skip to content

Instantly share code, notes, and snippets.

@newhouse
newhouse / mediumUsersFollowedByCount.js
Last active January 6, 2024 00:43
Medium API: get number of followers for User
/**
* Example of how to get the number of followers for a Medium.com User.
*
*
* Related links:
* https://github.com/Medium/medium-api-docs/issues/30#issuecomment-227911763
* https://github.com/Medium/medium-api-docs/issues/73
*/
// LODASH
@newhouse
newhouse / app.js
Created January 12, 2018 03:31
Objection.js: insert-validating-as-if-insertGraph
'use strict';
const assert = require('assert');
const _ = require('lodash');
const objection = require('objection');
const Model = objection.Model;
const knex = require('knex')({
debug: false,
client: 'pg',
@newhouse
newhouse / app.js
Created December 13, 2017 23:40
Objection.js: inconsistent typing of 'date-time' Model props
'use strict';
const _ = require('lodash');
const objection = require('objection');
const Model = objection.Model;
const knex = require('knex')({
debug: false,
client: 'pg',
connection: 'INSERT CONNECTION STRING HERE',
@newhouse
newhouse / app.js
Created April 28, 2017 21:37
Objection.js $formatDatabaseJson bug hunt
'use strict';
const _ = require('lodash');
const objection = require('objection');
const Model = objection.Model;
const knex = require('knex')({
debug: false,
client: 'pg',
connection: 'INSERT CONNECTION STRING HERE',