If it actually works, I’d passionately take on a full-time job where I march around on the streets, wave my arms and chant “please read these books!” all day long, because the world would definitely become a better place if more people read those books, and this is the most natural and efficient approach I could come up with.
RequireJS Timeout
This is a weird case. Random files get clogged with localhost. Restarting the server got it right.
CSS Selector: Nth-Child, First-Child
Say we have html structure like this:
<div id="parent"> <h1></h1> <p></p> <p></p> </div>
What would this selector have selected?
#parent{ p:first-child{} }
Notes: How To Get Up Early
- If there’s something it is not about, it’s resolution and willpower.
- If there’s something it is about, it’s tweaking the environment until finding the one that works.
- The environment shapes people within much more than people realise.
- There’s no one-size-fit-all cookie-cutter solution. It’s different for everyone and it takes imagination, creativity and willingness to try and fail dozens of times.
Angular Directive: angular-checkbox-set
Links: Github Repo / Live Demo
Angular directive, with recursive support for multiple layers of checkboxes.
Factories, Services, Providers?
For me the revelation came when I realised that they all work the same way: by running something once, storing the value they get, and then cough up that same stored value when referenced through Dependency Injection.
Understanding $watch
Could you tell the difference between these four?
$scope.$watch('foo', fn)
$scope.$watch(function() {return $scope.foo}, fn)
$scope.$watch(obj.prop, fn)
$scope.$watch(function() {return obj.prop}, fn)
Angular Directive: Click Elsewhere?
Benefit of this solution:
- You only need one bind to
$(document)
. Other firing of events would depend on the$emit
of scope events. - You could use both expressions
click-elsewhere="show=false"
, andclick-elsewhere="fn()"
, thanks to$parse
.
A Road Map: What A Blog Does
I was thinking about it: what purpose should a blog serve?