Skip to content

Instantly share code, notes, and snippets.

@newhouse
newhouse / app.js
Created Jan 12, 2018
Objection.js: insert-validating-as-if-insertGraph
View app.js
'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 Dec 13, 2017
Objection.js: inconsistent typing of 'date-time' Model props
View app.js
'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 Apr 28, 2017
Objection.js $formatDatabaseJson bug hunt
View app.js
'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 / mediumUsersFollowedByCount.js
Last active Oct 10, 2021
Medium API: get number of followers for User
View mediumUsersFollowedByCount.js
/**
* 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