Skip to content

Instantly share code, notes, and snippets.

View daneden's full-sized avatar

Daniel Eden daneden

View GitHub Profile

Grid Breakpoint API Dilemma

We want a responsive grid API that allows for an arbitrary number of breakpoints to be defined, but there's an issue with how the breakpoint extremities are treated. Given the following API:

<Grid breakpoints={[300, 600, 900]}>
  <Column width={[1, 1/2, 1/4]} />
</Grid>
backend:
name: github
repo: daneden/daneden.me
publish_mode: editorial_workflow
collections:
- name: blog
label: "Blog"
folder: "src/blog"
@daneden
daneden / Component.js
Last active August 5, 2018 01:06
styled-components will generate duplicative style declarations when props change the value for a rule. This is fine for e.g. the example below, where the ruleset is already small, but what if we have a dozen or more common styles for the two variants?
const Component = styled.div`
display: inline-block;
color: ${props => props.red ? 'red' : 'green'};
`
export default Component
@daneden
daneden / recipe.md
Created March 26, 2018 17:45
salmon salad

layout: recipe title: Seared Salmon with Spinach and Walnut Salad hero: /uploads/2016/05/salmon.jpg

intro: This salad is a fantastically easy worknight dinner inspired by a dish from Réveille Coffee. Toasting the walnuts is completely optional, but if you can spare the couple extra minutes, it enhances their flavor and helps round out the dish.

Camera recommendations 2017H2

So I use a Sony a6000 with a variety of lenses, but my selected camera and equipment has taken a lot of time and money to establish. I really love the camera, and can recommend a few lenses in a variety of price ranges that go well with it. Sony has also released two new models of this camera—the a6300 and a6500—which are the same in terms of size but with slight upgrades in features (though at it’s price, the a6000 is probably still the best investment)

I’m obviously biased toward Sony, having invested a fair bit on lenses, but an entry-level camera in Sony’s mirrorless family is also Wirecutter’s top suggestion: http://thewirecutter.com/reviews/best-mirrorless-camera-for-beginners/

In general, Wirecutter’s recommendations are typically top-notch, so you can explore their full reviews in this category and decide for yourself: http://thewirecutter.com/leaderboard/cameras/

You’ll likely find that the majority of good sources will be recommending ‘mirrorless’ cameras: these s

@daneden
daneden / bread.md
Last active October 21, 2017 09:04

Hearth Loaf

This bread takes about two days to make. The recipe seems long, but it’s just detailed. The steps are also very catered to my own schedule, so you should play around with the steps, making use of your refrigerator, to see what works for you.

Also, this recipe is basically a direct copy of a recipe in Josey Baker’s excellent book on making bread, and I implore you to buy it and read it.

Stuff you’ll need

  • Store-bought yeast (I use dry active)
  • Whole wheat flour

Common fears before joining Facebook that I've since resolved:

“FB has so many designers—I don't want to be just another cog in the wheel!”
While true, there's absolutely no reason a designer can't have meaningful impact. We have a ton of designers because we have a lot of meaningful and exciting projects going on at any given time. There's a lot more than meets the eye.
“What about the commute?”
From SF, sure, it can be a toil; 1.5hrs is a long one-way drive, but I've found teams are super flexible when you own your schedule, leave and arrive at the office when it's convenient for you, and spend your time on the shuttle how you like: working, reading, napping, or hanging out with friends you make on the ride.
“How do I grow at a place as big as FB?”
This is Facebook's key differentiator: I haven't got much firsthand experience, but I feel as though, and have heard from coworkers, that Facebook puts more emphasis on career development than any
@daneden
daneden / spec.json
Created August 7, 2017 22:39
Vega Lite Playground
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {
"cell": {
"width": 700,
"height": 300
},
"mark": {
"color": "#066CD2",
"font": "Arial"
@daneden
daneden / .block
Last active August 3, 2017 23:11 — forked from mbostock/.block
Circle Packing
license: gpl-3.0
height: 960
border: no
// chaikin takes an array of points Pn and calculates points QRn
// [PVector] -> [PVector]
ArrayList<PVector> chaikin(ArrayList<PVector> P) {
ArrayList<PVector> CP = new ArrayList<PVector>();
for(int i = 0; i < P.size() - 1; i++) {
PVector p = P.get(i);
PVector p2 = P.get(i + 1);
float qx = lerp(p.x, p2.x, .25); // lerp() == linear interpolation between 2 values at point T where 0 <= T <= 1