Skip to content

Instantly share code, notes, and snippets.

@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',
@newhouse
newhouse / mediumUsersFollowedByCount.js
Last active September 10, 2024 15:32
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