Skip to content

Instantly share code, notes, and snippets.

View robert-claypool's full-sized avatar
💥
Breaking Things

Robert Claypool robert-claypool

💥
Breaking Things
View GitHub Profile
@robert-claypool
robert-claypool / CORS.md
Created February 19, 2019 22:28
Understanding CORS

"Whenever I start thinking about CORS, my intuition about which site hosts the headers is incorrect, just as you described in your question. For me, it helps to think about the purpose of the same origin policy.

The purpose of the same origin policy is to protect you from malicious JavaScript on siteA.com accessing private information you've chosen to share only with siteB.com. Without the same origin policy, JavaScript written by the authors of siteA.com could make your browser make requests to siteB.com, using your authentication cookies for siteB.com. In this way, siteA.com could steal the secret information you share with siteB.com.

Sometimes you need to work cross domain, which is where CORS comes in. CORS relaxes the same origin policy for domainA.com, using the Access-Control-Allow-Origin header to list other domains (domainB.com) that are trusted

@robert-claypool
robert-claypool / blockstack.txt
Created June 18, 2019 19:20
Blockstack Verification
Verifying that "robert_claypool.id" is my Blockstack ID. https://explorer.blockstack.org/name/robert_claypool.id
{
"name": "Blob Fail Workflow",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
240,
@robert-claypool
robert-claypool / create_network_dataset.py
Last active December 13, 2024 04:30
Setup My Geodatabase Network Dataset (ArcPy)
import arcpy
import os
def create_network_dataset(gdb_path):
"""
Creates a network dataset in a file geodatabase based on an XML workspace document schema.
Args:
gdb_path (str): Path to the file geodatabase.
"""
Below is a single, merged blueprint that folds in the strongest parts of both engineers' proposals and the prior plan. It is written in the Graphile‑Starter style you are already using.
---
## Checklist
* Separate adherence from the scorecard model; reuse patients/providers/organizations/data\_imports.
* Model categories, statuses, opportunities, action types, and reason codes as lookup tables with text PKs and smart tags.
* Add a global pharmacies reference; keep adherence facts org‑scoped for RLS.
* Store PDC as integer basis‑points (0..10000). Expose percents via computed columns or views.