Skip to content

Instantly share code, notes, and snippets.

View vabruzzo's full-sized avatar

Vincent Abruzzo vabruzzo

View GitHub Profile
@vabruzzo
vabruzzo / react-week-19.md
Last active July 25, 2019 15:48
React Week 'i9

talk descriptions: https://reactweek.nyc/conference

Automating component variation rendering using the Cartesian component

<Button type={primary | submit | error} theme={dark | light} />

= 6 button variations, i.e. the cartesian product of the set of types and the set of themes

The Madness of the Individual

Oh, it comes and goes. When it comes, grab it and focus, but don't focus too much 'cause you'll lose the present. But you still have to focus, filter, all that jazz. And when it goes, so it goes. Sometimes you'll be sad. There is a strange relief with sadness: you know, that feeling you get when you remember that when you die you'll lose one less thing. The peculiar thing that it is.

We have to shift the focus a bit so you'll see with the heart instead of the brain.

I don't really know what it is I'm talking about. Is it? These mediocre semblances and combinations of faint conceptual manifestations of things I may or may not have encountered in whatever it is I think and touch. What if it is some kind of affair. Some kind of hard to distinguish gesture that she made with her lips and her eyes. She invited you in and there was a certain passion written on the wall. But what happened? What happens to love when it sobers up? Oh there is too little time for this kind of introspe

@vabruzzo
vabruzzo / safeRender.md
Last active July 12, 2018 17:08
React safeRender HoC

React safeRender higher-order component

Common errors

attempting to access properties on null or undefined values causes internal server errors, breaks entire site

Solutions

  1. defensive programming
    • idioms like if (!object) return null, object && object.value1 && object.value1.value2, and lodash's get(object, 'value1.value2')
    • consideration: no errors are thrown, need to rely on humans in some cases to notice something wrong with or missing on the front-end
# React `safeRender` higher-order component
## Common error
attempting to access properties on `null` or `undefined` values causes internal server errors, breaks entire site
## Prior solutions
1. defensive programming using idioms like `object && object.value1 && object.value1.value2` and lodash's `prop(object, 'value1.value2')`
2. Ensure data validity and correctness in falcon, etc.
https://taco-spolsky.github.io/?level=watch#trello=awesome|checksum=9357638|Vincent%20Abruzzo=name
#!/usr/local/bin/ruby
# posting to a topic
require('/path/to/discourse_api/gem')
client = DiscourseApi::Client.new("https://push-language.hampshire.edu")
client.api_key = "YOUR_API_KEY"
client.api_username = "slack_archive"
response = client.create_post(