You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes of 'Understanding Ego Depletion' by Dan Ariely
On stressful days many of us give in to temptation and choose unhealthy options.
Six steps to avoid breaking unders stress
Acknowledge the tension, don't ignore it - we use self control every time we force ourself to make the good, reasonable decision, and that self control, like other human capacities is limited.
Call it what it is: ego depletion - depletion is the psychological sum of these feelings, of all the decisions you made that led to that moment.
Understand ego-depletion - people under greater cognitive strain were less able to overturn their instintive desires.
Some cowbody coding I did couple weeks ago, totally forgot the design decisions and need to start over. :(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your apps starts great and you love working with it up until beta when it becomes a mess and you hate it.
Your app is made up of things and know things about themselves and about others. The latter is dependencies. When the dependencies change, the object will need to change as well.
OO design makes you write code that your future self will love. Stop worrying and learn to love the mess.
Refactoring of Saran's `Endpoint` class based on Sandi Metz's talk/book.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A list of lessons learned from refactoring my open_auth2 library to make it a better OOP citizen.
Recently I've been learning a lot about OOP, especially how to structure code to make it easier to change in the future. The following are some of the ways I refactored my open_auth2 library.
Don't optimize prematurely
I did the mistake of assuming what sugars were required, only to realize I never used them. Source.
Inject dependencies
The Token object accesses Config object for information. Before it was hard coded into Token, so they're highly coupled, so now I pass it as an argument to #initialize. Better yet it defaults to OpenAuth2::Config.new so it's only optional. Source.
zsh function to show specs to code ratio in a rails folder, anything over 0.75 is good.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters