Skip to content

Instantly share code, notes, and snippets.

View cameronblandford's full-sized avatar
🧭
orienting

Cameron Blandford cameronblandford

🧭
orienting
View GitHub Profile
@cameronblandford
cameronblandford / scrapeAllProviders.js
Last active January 23, 2021 18:34
Get All Vaccine Providers in the Continental US
import axios from "axios";
import _ from "lodash";
import fs from "fs";
// HI: long: -178 to -155
// HI: lat: 18 to 29
// PR: long: -67 to -64
// PR: lat: 17 to 19
// AK: long: -180 to -125
// AK: lat: 50 to 70
@cameronblandford
cameronblandford / pagination.md
Last active August 30, 2019 18:03
Pagination Behavior

Spec for Pagination Behavior

Pagination will look like the following for a 24-page results set.

< 1 2 3 4 5 6 ... 24 >

< 1 2 3 4 5 6 ... 24 >

< 1 2 3 4 5 6 ... 24 >

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@cameronblandford
cameronblandford / knexPostgresFullTextSearch.js
Last active November 8, 2023 07:35
Implement full text search using Knex + Objection
// Because we're using an ORM (Objection), it's a pain to add a tsvector when inserting,
// since tsvectors and FTS aren't supported by Objection. Instead, I've added a hook that
// fires on insert which auto-generates the tsvector field for each newly inserted entry.
// This is an example knex migration file for said behavior.
const addUserIndex = `
ALTER TABLE public.user ADD "document" tsvector;
CREATE FUNCTION my_trigger_function()
RETURNS trigger AS $$

Keybase proof

I hereby claim:

  • I am cameronblandford on github.
  • I am heartdefense (https://keybase.io/heartdefense) on keybase.
  • I have a public key ASB1Fk6ogVgOgnXhLlLnsrc6HzMlNaiRAmwkONbP5KOHPAo

To claim this, I am signing this object: