Two weeks I gave a talk at Euruko 2022 on trunk-based development with the full title of From massive pull requests to trunk-based development.
Here is the talk description:
Massive, long-lived pull requests are often such a headache. In this session we go through a move into a trunk-based development source-control workflow which eliminates the need for these “code avalanche” pull requests.
After short introduction of trunk-based development and the fears people have for implementing it, we will go through concrete examples, lifted from a production system, of code, architecture, and workflows to tackle those fears when working on improving the development and deployment happiness of the team working on the application.
After this talk the attendee are emboldened to start their own trunk-based development journey or excited to apply some of the techniques from the talk to their existing development processes and codebases.
I’ve lately used vx visualization components to implement different data visualizations. It provides small pieces you combine and customize to build your own custom visualizations. I’ve found it quite comprehensible and deeply customizable.
vx includes a network graph component for showing graph data which I needed for a project. Unfortunately it doesn’t automatically calculate the positions for the graph nodes, so I decided to use the D3.js force simulation to calculate the X and Y coordinates for the nodes.
React component’s componentDidMount callback sets up d3 forceSimulation which takes care of setting the x and y properties for the passed nodes.
The full code for a simple network graph with automatic layout is below. You can also view how it looks and play around with it in CodeSandbox.
importReactfrom"react";importReactDOMfrom"react-dom";import{Graph}from"@vx/network";import{forceCenter,forceLink,forceManyBody,forceSimulation}from"d3-force";// The node rendered by the graphclassNetworkNodeextendsReact.Component{render(){return<circler={10}fill={"#9280FF"}/>;}}classNetworkextendsReact.Component{constructor(props){super(props);constlinks=props.network.links;constnodes=props.network.nodes;this.state={data:{nodes,links}};}// Update force if the width or height of the graph changescomponentDidUpdate(newProps){if(newProps.width!==this.props.width||newProps.height!==this.props.height){this.force=this.force.force("center",forceCenter(newProps.width/2,newProps.height/2)).restart();}}// Setup D3 forcecomponentDidMount(){this.force=forceSimulation(this.state.data.nodes).force("link",forceLink().id(function(d){returnd.id;}).links(this.state.data.links)).force("charge",forceManyBody().strength(-500)).force("center",forceCenter(this.props.width/2,this.props.height/2));// Force-update the component on each force tickthis.force.on("tick",()=>this.forceUpdate());}render(){if(!this.force){returnnull;}return(<divstyle={{width:"100%",height:"100%"}}><svgwidth={this.props.width}height={this.props.height}><rectwidth={this.props.width}height={this.props.height}fill="#f9fcff"/><Graphgraph={this.state.data}nodeComponent={NetworkNode}/></svg></div>);}}functionApp(){constnodes=[{id:1},{id:2},{id:3},{id:4},{id:5}];constlinks=[{source:1,target:2},{source:1,target:3},{source:1,target:4},{source:2,target:4},{source:3,target:4},{source:4,target:5}];return(<divclassName="App"><Networkwidth={400}height={400}network={{nodes:nodes,links:links}}/></div>);}constrootElement=document.getElementById("root");ReactDOM.render(<App/>,rootElement);
Fetching Github gems using HTTPS instead of git protocol is going to be the new default when Bundler 2.0 is released. Here are the instructions on how to do it locally and on Heroku and Travis CI before Bundler 2.0 is released.
Configure Bundler to use HTTPS for GitHub sources:
Last year I missed the posting of the yearly reading update so this post covers both 2015 and 2016.
I managed to hit my reading goals and they were also good reading years in quality.
In 2015 I read 82 books (24 of them comics) and in 2016 read 65 books (20 of them comics). In 2016 I also started doing lot more re-reading of previously read books or parts of them.
Books with 5 stars
I’m not a literary critic and don’t know which books are good or bad so I give my stars according to my own feeling on how much I got out of the book and how big of an impact I estimate it having on my life.
I enjoyed a bunch of books in 2014 (46 in total). My selection process for picking books to read is rather random but this year I could lift a few themes. I feature my favorite books of the year in this post.
Bird by Bird: Some Instructions on Writing and Life by Anne Lamott
This is a book about writing and writer’s life. Even though I don’t write that much I could find plenty of good advice. Encouraging and inspiring (even though some people might find the honesty off-putting) read that also reminded me of the importance of the shitty first draft.
The Obstacle Is the Way: The Timeless Art of Turning Trials into Triumph by Ryan Holiday
Meditations by Marcus Aurelius
I’ve been interested about Stoicism and read two books related to it. Great advice for the rough times and one-liners to spice up your day. I already bought couple other Stoic books so will read more during 2015.
Foundation and Empire & Second Foundation by Isaac Asimov
On the fiction front I read the second and third installment of the science fiction series Foundation. I enjoy the dry writing style of Asimov. The books are low in action and very dialogue heavy so not for everyone. I love the plots and uncovering the mysteries of psychohistory. I will continue reading the series in 2015.
World War Z by Max Brooks
Another fiction pick is World War Z. It is a fictional collection of stories about lives of people after the Zombie war. The stories encompass various nationalities in different life situations told as dialogues with the interviewer of the book. Stories blend together social, economic, religious, political, and environmental themes and there is a clear critique and commentary on the current state of the world.
After reading the book I returned back to the stories in my head and marvelled on all the view points the book included. Event if you don’t like zombies, I would recommend it. It’s sometimes categorized as horror but I wouldn’t label it as such.
Functional JavaScript: Introducing Functional Programming with Underscore.js by Michal Fogus
I didn’t read that many technical books this year but from the ones I did, this was my favorite. I’ve being dabbling with Clojure and this book linked many of those functional programming ideas to JavaScript.
Waking Up: A Guide to Spirituality Without Religion by Sam Harris
Still the Mind by Alan Watts
On the spirituality front these books were my favorites.
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution by Walter Isaacson
This is the book I have talked about the most this year, so I guess that makes it my favorite. It tells the stories of people and teams that have invented the ideas and built the technologies we rely on in today’s digital world: programming, microprocessor, personal computer, software, internet and so on. It also observes what are the commonalities of the innovators and tries to lift themes from their stories. While reading the book I also read some of the papers written by the early pioneers. Reading papers written in the 60’s and 70’s you see how so many parts of the technology puzzle took decades to go from idea to wide usage.
I also found it interesting that when the first interactive computers were invented, the first user interface designers were psychologists. The teams building these interactive machines thought of it as a man-machine symbiosis so it only made sense to put engineers, the experts of the machine, and psychologists, the experts of the human, to the same team to work on the machines.