Skip to content

Instantly share code, notes, and snippets.

@loehx
Last active April 28, 2019 07:15
Show Gist options
  • Save loehx/192c1d1f157a296b3b8409995b80f290 to your computer and use it in GitHub Desktop.
Save loehx/192c1d1f157a296b3b8409995b80f290 to your computer and use it in GitHub Desktop.
import Me from 'myself';
function LearnCoding() {
var motivation = 0;
while (Me.interested) {
if (motivation <= 0) {
motivation += Me.learnSomethingNew();
}
var success = Me.code();
if (success) {
motivation++;
Me.body.releaseDopamine();
}
else {
motivation--;
Me.body.releaseCortisol();
}
if (motivation < 0) {
// TODO: Find a way to stay on track and not give up
Me.interested = false;
return;
}
Me.doStuff();
Me.sleep(); // internally calls: Me.body.brain.adapt();
}
}
export default LearnCoding;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment