Skip to content

Instantly share code, notes, and snippets.

View elliotlarson's full-sized avatar

Elliot Larson elliotlarson

View GitHub Profile
@elliotlarson
elliotlarson / attachment_spans_ff2_only.json
Created December 17, 2025 00:11
API V4 Attachment Spans: ff2 (regression test)
{
"parameters": {
"asce": "7-16",
"zipCode": "91320",
"windSpeed": 94,
"groundSnowLoad": 1,
"windExposure": "B",
"sds": 1.25,
"siteElevation": 699,
"panelLengthMm": 1130,
@elliotlarson
elliotlarson / attachment_spans_corruslide.json
Created December 17, 2025 00:11
API V4 Attachment Spans: corruslide with corrugatedRoofGauge
{
"parameters": {
"asce": "7-16",
"zipCode": "91320",
"windSpeed": 94,
"groundSnowLoad": 1,
"windExposure": "B",
"sds": 1.25,
"siteElevation": 699,
"panelLengthMm": 1130,
@elliotlarson
elliotlarson / attachment_spans_simple_grip_d.json
Created December 17, 2025 00:11
API V4 Attachment Spans: simple_grip_d with deckThickness
{
"parameters": {
"asce": "7-16",
"zipCode": "91320",
"windSpeed": 94,
"groundSnowLoad": 1,
"windExposure": "B",
"sds": 1.25,
"siteElevation": 699,
"panelLengthMm": 1130,
@elliotlarson
elliotlarson / attachment_spans_qm_hug_d.json
Created December 17, 2025 00:11
API V4 Attachment Spans: qm_hug_d with deckThickness
{
"parameters": {
"asce": "7-16",
"zipCode": "91320",
"windSpeed": 94,
"groundSnowLoad": 1,
"windExposure": "B",
"sds": 1.25,
"siteElevation": 699,
"panelLengthMm": 1130,
@elliotlarson
elliotlarson / asce_716_complete.json
Created November 26, 2025 00:18
API V4 Conditional Requirements - Test Payloads
{
"project": {
"name": "ASCE 7-16 Test - Complete with Roof Shape",
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US",
"asce": "7-16",
"riskCategory": "II",
require 'test_helper'
class FoosControllerTest < ActionDispatch::IntegrationTest
setup do
@foo = foos(:one)
end
test "should get index" do
get foos_url
assert_response :success
import uuid from "uuid/v4";
import { combineReducers } from "redux";
export const types = {
CREATE: "CHARACTERS_CREATE",
UPDATE: "CHARACTERS_UPDATE",
DELETE: "CHARACTERS_DELETE"
};
const byId = (state = {}, action) => {
import { combineReducers } from "redux";
const byId = (state = {}, action) => {
switch (action.type) {
case types.CREATE:
case types.UPDATE:
// Note: create and update are the same now so we can let the case for
// create fall through to the case for update
const characterData = action.payload;
return { ...state, [id]: characterData };
// `src/store/characters.js`
import uuid from "uuid/v4";
export const types = {
CREATE: "CHARACTERS_CREATE",
UPDATE: "CHARACTERS_UPDATE",
DELETE: "CHARACTERS_DELETE"
};
import omit from "lodash/omit";
const newCharacters = omit(characters, deleteId);