Skip to main content

Phil DeJarnett

Member since Jul 18, 2013

Recent Blog Comments By Phil DeJarnett

  • Using The CSS Function calc() Inside The LESS CSS Preprocessor

    Posted on May 14, 2021 at 7:50 AM

    @Ben, We have a similar situation, with an older AngularJS application (upgraded to 1.8 😅) and a custom-built Gulp 3.9 build system. I've modernized the codebase as best I can, but once you hit so many thousands of lines of code, it becomes a bit overwhelming to upgrade even simple librar... read more »

  • Using The CSS Function calc() Inside The LESS CSS Preprocessor

    Posted on May 14, 2021 at 6:15 AM

    I don't know if this helps, but this is a limitation of the older Less precompiler. We upgraded to 13.3.x , and this version no longer processes math operators inside calc() (among some other places), which greatly improves the utility of calc() . I think the only real work we did was:... read more »

  • Common Mistakes That Engineers Make During The Designer-Developer Hand-Off

    Posted on Dec 14, 2019 at 11:47 AM

    This may not fit in exactly with your article, but as a smaller company, a mistake we have made repeatedly (and still do) is assuming a feature or change is small enough it doesn't need a full design phase. When a single person is responsible for the entire feature (including the design), it... read more »

  • Remote Work Increases Intimacy And Amplifies A Shared Sense Of Humanity

    Posted on Oct 17, 2019 at 9:06 AM

    This is a great article, Ben. I agree whole-heartedly. The bit about seeing into other people's homes is very true to my experience. On my team, we tend to split between audio-only and video chat, and the form of discussion and output on audio-only has such a different feeling. It's more imp... read more »

  • Open-Source, Secure, Client-Side, Network-Free, JSON Linting

    Posted on Jul 2, 2018 at 1:31 PM

    If you want something a bit more full-featured, I use the "JSON Lite" browser extension . This lets you drag-and-drop any JSON file directly into the browser, and get easy-to-read views with a theme, formatting, and collapseable subtrees. If you are just using clipboard data, it mig... read more »

  • Method Binding Is An Implicit Part Of Your API Contract (Whether You Like It Or Not)

    Posted on Apr 21, 2017 at 2:10 PM

    I think the design of the API can subtly influence the intended use. For example, if I'm calling a method on a global object, or one that was simply available without directly being involved in creating it, it feels "safer" to use naked method calls. For example, if you can call `window.F... read more »

  • Isolating The ngModel Two-Way Data Binding Life-Cycle In AngularJS

    Posted on Oct 22, 2015 at 10:53 AM

    I do something very similar. I have a service I can create off any data, which generally is used the same way. Keeping the data separate allows for some advanced functionality, too: - I use the original data and the form-data object to test to see if there are any changes (so we can perform notif... read more »

  • AngularJS In Firefox: TypeError: Missing Argument 1 When Calling Function b.get()

    Posted on Jun 25, 2015 at 11:14 AM

    Oh, yeah, a very similar one of those bit me a week or so ago. I really can't believe they want to introduce an Object.prototype method called "watch" into JS. It's just going to cause issues, since it's such a common word or variable.... read more »

  • Monkey-Patching The $q Service With .fcall() In AngularJS

    Posted on Jan 30, 2015 at 10:37 AM

    For this kind of monkey-patching, you can use a decorator: https://docs.angularjs.org/api/auto/service/ $provide#decorator Something like this is a reusable module you can drop into your projects: appModule.config(['$provide', function($provide) { $provide.decorator('$q', ['$delegate', functi... read more »

  • Accidentally Defining A Directive Twice In AngularJS

    Posted on Jan 6, 2015 at 8:21 PM

    Oh, and I should have mentioned, dependencies are mostly wired in closest to where they are used, so there's a `foo.routes` which has all the top-level routes, then `foo.routes.people` might depend on `foo.routes.people.person`, etc.... read more »

  • Accidentally Defining A Directive Twice In AngularJS

    Posted on Jan 6, 2015 at 8:13 PM

    @Ben So, I was thinking about it more: having one module per file _won't_ fix the issue above, because you are allowed to completely overwrite a module in Angular (useful for testing, kinda bad in code, though). So it would actually have continued to hide your duplicate file (but you would not hav... read more »

  • Accidentally Defining A Directive Twice In AngularJS

    Posted on Dec 24, 2014 at 10:21 PM

    Something I've taken up is the idea that every file must have a module definition, and every module should be used in only one file. Basically this means a unique module per file. (This excludes a shared templates module.) This has several benefits: 1. The error above would have been spotted eve... read more »

  • The User Experience (UX) And Cognitive Dissonance Of Forms

    Posted on Apr 3, 2014 at 10:54 AM

    Something that ties the two elements together-the form and the story-is that every piece of information you require should be backed by the story. This helps immensely with two seemingly opposing issues: 1. The user doesn't want to provide any more information than necessary to get the job done. ... read more »

  • User-Friendly Sort Of Alpha-Numeric Data In JavaScript

    Posted on Jul 18, 2013 at 9:42 PM

    @Ben, Hope you don't mind, I took your idea and ran with it. I created a reusable module, and added date parsing into it, too. The source code is much better commented than the jsFiddle was. I wrote up a blog about it here: http://blog.overzealous.com/post/55829457993/natural-sorting-within-an... read more »

  • User-Friendly Sort Of Alpha-Numeric Data In JavaScript

    Posted on Jul 18, 2013 at 2:40 PM

    More thoughts: I think this might be really useful as a global function that can be applied to orderBy as desired, so here's what I came up with: jsFiddle: http://jsfiddle.net/TyHQj/ The function natural() is added to the $rootScope - obviously this may or may not work for everyone, but ... read more »

  • User-Friendly Sort Of Alpha-Numeric Data In JavaScript

    Posted on Jul 18, 2013 at 11:35 AM

    Oops, I meant | orderBy:normalize and I forgot the return keyword in my function. Derp.... read more »

  • User-Friendly Sort Of Alpha-Numeric Data In JavaScript

    Posted on Jul 18, 2013 at 11:30 AM

    That's a great trick. I think it might be more MVC-ish to use orderBy:normalize and add $scope.normalize = function(item) { normalizeMixedDataValue(item.name); }; thereby putting the sorting into the view.... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel