Skip to content

Instantly share code, notes, and snippets.

View david-mears-2's full-sized avatar

David Mears david-mears-2

  • London
View GitHub Profile
@david-mears-2
david-mears-2 / gist:e0178645234e4ff29a3e3e640a35a5c3
Created July 29, 2026 13:36
PARAmap backend API endpoints - v2 draft 29th July
# General notes
Survey data and model outputs are versioned and released separately.
# The /prevalences endpoint
## Notes
We need to distinguish two query parameters to do with admin level. The first is about the level at which the prevalences are reported: e.g. the prevalences could be reported for each admin2 region or for each admin1 region. The second is about scoping the request to a region, e.g. only give me prevalences that are within a certain admin0 region (country) - and we probably need to say _what level_ this specified region is at, as we would in SQL like `select * where admin0 = "MLI"`.
@david-mears-2
david-mears-2 / donor_questions_schemas
Created April 3, 2024 19:30
note of what the partners' donor questions schema were before migration
Partner.where(name: ['One For The World', 'One For The World UK', 'One For The World Canada', 'One For The World Australia']).pluck(:name, :donor_questions_schema).to_s
=> "[[\"One For The World Canada\", {\"questions\"=>[{\"name\"=>\"phone_number\", \"type\"=>\"text\", \"title\"=>\"What is your phone number?\", \"options\"=>[], \"required\"=>true}, {\"name\"=>\"GDPR_static_text\", \"type\"=>\"statictext\", \"title\"=>\" One for the World would occasionally like to send you information about our charities, your impact and other initiatives. If you are happy to receive this information, please indicate here:\", \"options\"=>[], \"required\"=>false}, {\"name\"=>\"comms_email\", \"type\"=>\"checkbox\", \"title\"=>\"By Email\", \"options\"=>[], \"required\"=>false}, {\"name\"=>\"comms_phone\", \"type\"=>\"checkbox\", \"title\"=>\"By SMS (By selecting this box, you agree to receive donor engagement texts from One For The World. Message frequency varies. Message and data rates may apply. Reply STOP to unsubscribe a
console.log('Running script hosted at https://gist.github.com/david-mears-2/a96ff2d0f4a93f03b25901fc6747eb96')
// Create the div element with the specified HTML
const modalDiv = document.createElement('div');
modalDiv.id = 'team-modal--modal';
modalDiv.className = 'team-modal--modal';
modalDiv.innerHTML = '<div class="team-modal--content"><p>Content</p><span class="team-modal--close">×</span></div>';
// Find an existing element to append the new element to
// For example, you can append it to the body element
const body = document.body;

Keybase proof

I hereby claim:

  • I am david-mears-dfe on github.
  • I am dmears (https://keybase.io/dmears) on keybase.
  • I have a public key ASAFcpmBa9zkjXmzNkSLfrIjSVgp1sHJqKpl9KEaQ2k-Xgo

To claim this, I am signing this object: