< description

Notes, thoughts, failures. A blog.

< tags | sort -R | ಠ_ಠ
soyuka@soyuka.me ~/soyuka.me/

Angular2 external subscriber in a directive (Output)

You made a great component that leverage reactive forms. The thing is, you want to share this directive, and let users define the Observable that should be used by the custom form component. The naive way to make this work would be to bind that Observable in an @Input, and then use that input in the component. We will see here why it doesn’t feel right and how to implement it as an @Output.

~900 Words

Distance between flexbox items

Ever wanted to set a gutter between your flexbox items? This is, in my opinion the best way to do it. It doesn’t require negative margins or padding hacks, which will lead you to only struggle more. By the way, this method hooks on columns and doesn’t need additional div’s or inner containers.

~700 Words

Fast fix diverged branches

You made a pull-request, but now some other changes got merged and branches have diverged. There’s a small tip I use to keep history while re-applying commits.

~400 Words

Rewrite an older commit with rebase and stash

You just commited some modifications, but there you’ve to edit things that are related to a previous commit, which isn’t the last one. So, instead of simply amending the commit, you need some more work to keep clean commits.

~300 Words

Optimize Web assets with Gulp

Images, css, javascript, fonts, we’re using a lot of things in today’s websites. Every time you add an asset <link>, <script>, @import, the browser will issue a request to fetch it. The number of requests that you’ll send might not matter compared to how heavy your ressources are.