Skip to content

Instantly share code, notes, and snippets.

View madorb's full-sized avatar

Ben Madore madorb

View GitHub Profile
@madorb
madorb / .screenrc
Created October 17, 2012 20:06
My screen config #slalomdev
defscrollback 30000
termcapinfo xterm ti@:te@
#overwrite default escape sequence of Ctrl-a to be Ctrl-o (Ctrl a is nice to keep as it brings you to start of line)
escape ^Oo
# Don't display the copyright page
startup_message off
# tab-completion flash in heading bar
// @flow
import { Pageable, IndexablePage, paginate } from '@panderalabs/koa-pageable';
import type { Context } from 'koa';
import Koa from 'koa';
import Router from 'koa-router'
const app = new Koa();
const router = new Router();
app
.use(router.routes())
// @flow
import { IndexablePage, Pageable, Sort, } from '@panderalabs/koa-pageable';
import type { QueryBuilder } from 'objection';
function getData(pageable: Pageable): IndexablePage<number, Person> {
const pageNumber = pageable.page;
const pageSize = pageable.size;
const sort: Sort = pageable.sort;
const queryBuilder: QueryBuilder = Person.query().where('age', '>=', 21).page(pageNumber, pageSize);
{
"number": 1,
"size": 2,
"sort": [
{
"direction": "asc",
"property": "firstname"
},
{
"direction": "lastname",
{
"number": 1,
"size": 2,
"sort": [
{
"direction": "asc",
"property": "firstname"
},
{
"direction": "lastname",