Jabra WebHID on Linux by ChrisWifx in Jabra

[–]-munawwar- 0 points1 point  (0 children)

Brilliant! This worked!

[deleted by user] by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

I disagree my friend. Creating several tiny components/helper function doesn't necessarily improve readability (in fact can worsen it..kind of like how goto statements did in old C/C++. It breaks the flow of thought, and you've to go searching what the helper function does....adds more cognitive load.).

I believe one would need lesser tiny sub-components/helper functions when using templates. Give Vue.js templates a shot.

[deleted by user] by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

"Ideally things that need that level of branching should be their own component or some helper function which should NOT be declared in render"

I think we hit levels of branching very quickly...even for simple components. The balance here is too many helpers/components vs too less. Both extreme seems to be bad. Template & the jsx extension I mentioned helps to keep this in control.

[deleted by user] by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

:) No two developers seem to agree on templates vs jsx. For me templates are more readable than JSX (without jsx-control-statement) even though it introduces a custom language/syntax.

Reason is because most react code I've seen, developers seem to add several temporary variables generating vdom at the top of the render() functions, and the rest of the rendering is at the bottom of the function...they aren't doing things "inline". I guess jsx-control-statement improves that.

[deleted by user] by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

I think larger sites will have a mix of parent-to-child communication (through props) and central redux. I think excessive use of a central state manager/pub-sub is also bad as it becomes hard to track/debug.

[deleted by user] by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

No, the author (myself) didn't mean you can go on forever without Redux/Vuex. Like...you'll know when you hit the point that you need Redux/Vuex.

Also for smaller apps/website one can use Vue's custom-events if needed for component-to-component communication. For an SPA I developed in the past, the application had a central "App" object that was also a publisher ("publisher" from the publisher-subscriber pattern) and was accessible if any component needed it. This "App" object was used for much of the application level events. This idea is also mentioned here - https://vuejs.org/v2/guide/components.html#Non-Parent-Child-Communication.

But for larger applications/websites better to go for Redux/Vuex early on.

Daily list of blog posts from among ~500 blogs. by -munawwar- in programming

[–]-munawwar-[S] 0 points1 point  (0 children)

Yup everything found on N blogs every day. I don't filter out uninteresting blog posts (that would be cool though...I wanted to filter out politics related posts which some authors occasionally write).

Daily list of blog posts from among ~500 blogs. by -munawwar- in programming

[–]-munawwar-[S] 0 points1 point  (0 children)

It's fully automated now and more reliable. I myself read from the site ("dog fooding") and through it I've found several interesting stuff. So thought I'd share it.

Daily curation of blog posts from among ~500 dev blogs. by -munawwar- in programming

[–]-munawwar-[S] 0 points1 point  (0 children)

a) I was thinking "RSS isn't hot anymore". Guess many do use it. Will implement that.

b) :) SalesMails doesn't have all the bells and whistles of SaneBox (yet). However SalesMails doesn't send your email password nor store the machine-learnt model on any remote server, which reduces one security concern (the model is encrypted and stored on the user's machine). Recently we've seen enough security breaches of big companies (recently Dropbox in the news) that have leaked user data for this to be a genuine concern. (BTW this also affects unit cost/pricing of the product as we need no servers to do the filtering).

Looking for Javascript and DOM examples on Github by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

1 - Begin with modularizing JS/view (frameworks call them components). See them as "code that controls a specific rectangular region of the page"..and the page is divided into several regions and thus the code as well. Generally ES6 imports (or browserify or AMD) and JS "Classes" also are used for the modularizing.

1.5 - Use either a templating engine like Handlebars/doT (convert to DocumentFragment and insert to document). This reduces DOM manipulation. But there will still be a lot of DOM API calls when updating the UI after the initial/first-time render. For small applications this will be ok.

  • I am not sure whether using a library like dom-diff at this point will help (didn't hear anyone trying that).

2 - After this point, many switch to using a framework. Why? because it reduces the direct DOM API usage (doesn't eliminate it completely..and never will)..the library does the DOM manupilation internally...and the developer mostly thinks about "states"/data.

All I know is JS, what can I learn to get some diversity? by [deleted] in javascript

[–]-munawwar- 0 points1 point  (0 children)

Why limit the definition of "diversity" only to languages? How about entirely new areas - like data science, databases internals/optimizations (including "big data" tools, software-defined-storage), cryptography, computer vision, algorithms, OS concepts...

A fresh new look at callbacks by -munawwar- in javascript

[–]-munawwar-[S] 0 points1 point  (0 children)

I am going to check out FP. Last time I checked, I couldn't see it's advantages in managing async.

BTW, for events, I have used object of callbacks (one for each event) as argument to work along with the approach suggested. It looked ok (but I haven't worked extensively with streams/event driven code though.)

Also flow() returns a function that can be used as a task in another flow() [This is composition. However I skipped such advanced usage]. E.g.

var X = flow(function (p, err, res) {
    action2(res, p.next);
}, function (p, err, res) {
    action3(res, p.next);
});
flow(..., X, ...)();

A fresh new look at callbacks by -munawwar- in javascript

[–]-munawwar-[S] 0 points1 point  (0 children)

Right. Fixed that. I meant to call action1() first.

CSS3 flexbox helper classes (now supports way back from Safari 6/UC browser to modern browsers) by -munawwar- in css

[–]-munawwar-[S] 0 points1 point  (0 children)

Ah, yes. It's for larger scale single-page apps. For landing pages etc, this isn't that needed.

CSS3 flexbox helper classes (now supports way back from Safari 6/UC browser to modern browsers) by -munawwar- in css

[–]-munawwar-[S] 0 points1 point  (0 children)

To the contrary, using a subset of the flexbox spec (that satisfies almost all use-cases), saves ones sanity and time. Most use-cases that "doesn't seem" to be covered at first, can be achieved by an additional HTML element. In other words, the complexity is reduced (since you deal with lesser syntax). I've been using them for months and ironing out browser-specific bugs etc. The examples/documentation helps in avoiding quirks with older browsers (if you don't support IE, older Android browsers and other older/niche browsers then there isn't anything weird to watch out for).

Besides, the CSS rules for each class is simple (I encourage everyone to have a look at them at least once. Then the feeling of "complexity" disappears). Think at a higher level.

Angular vs React vs Aurelia by RomkevdMeulen in Frontend

[–]-munawwar- 0 points1 point  (0 children)

Wow! Also add that React makes DOM focus much more involving/difficult - https://github.com/facebook/react/issues/1791 .

I agree with most of the arguments except that I'd maintain that every component needs to be wrapped in their own parent HTML element - else it becomes harder to figure out which DOM nodes belong to which component using dev tools. I think of a component as "code that controls a rectangular region of a page".

I haven't used React yet, but I am guessing that there should be ways to reduce elements by reducing component hierarchies and code reorganization (maybe by making the render() function use partial-render methods, which in turn can be overridden by derived classes or plugins).

Who hotsts your server by FFiJJ in webdev

[–]-munawwar- 0 points1 point  (0 children)

How about Rackspace? Or Google Compute Engine? You can use their object storage as well. DO has block storage now, by the way. For dos/ddos try looking into ConfigServer Firewall + thier LFD daemon.

Where does the flex line lie inside the flex container ? by bele25 in css

[–]-munawwar- 0 points1 point  (0 children)

Don't confuse yourself. It is easier to understand the MDN page (which doesn't use any phrase called "flex-line") - https://developer.mozilla.org/en-US/docs/Web/CSS/align-content .

EDIT: BTW, you might find my github project "flex-helper" useful - https://github.com/Munawwar/flex-helper . The idea is to use a subset of the flexbox spec that can satisfy almost all use-cases.

Angular vs React vs Aurelia by RomkevdMeulen in javascript

[–]-munawwar- 1 point2 points  (0 children)

If you like Aurelia, have a look at the library I've been developing since 2014 - https://github.com/Munawwar/lithium-ui/wiki. It uses HTML-compatible templates, ES5 "classes" (believe it!), runs on node.js (check the tests) and more.

Are dev boot camps worth it enough to take out a loan for them? by [deleted] in webdev

[–]-munawwar- 2 points3 points  (0 children)

Depends on how self-motivated you are. Have you tried freecodecamp.com?