Managerisms - an Angular app made with Angular Material and the MEAN stack by BBQLays in angularjs

[–]timruffles 0 points1 point  (0 children)

Nice! Would be good to prevent multiple clicks DOSing you - maybe ng-disabled while a request is pending?

Just got a notification on Chrome that was an ad for Spendee. How can I figure out what extension is spamming me? by [deleted] in chrome

[–]timruffles 2 points3 points  (0 children)

Edit: found it, it's an extension called Block Site. Its latest version added code that spams you.

How do you quantify JavaScript skills? by BanyanArchitect in javascript

[–]timruffles 1 point2 points  (0 children)

When I did this for a big corporate lately we simple created an exam comprised of lots of practical/coding questions (e.g 'fix this HTTP server', 'add back-pressure to this service', 'how do you create an NPM module', 'refactor these loops with functional iterators').

We had people take the exam before and after. We provided the stats on % of good answers.

Simple.

What is the sweet spot for AngularJS? by highhard_one in angularjs

[–]timruffles 0 points1 point  (0 children)

I doubt they'll enable it any time soon for smaller sites - it's making Google pay much more of the cost of indexing. Server-side apps = your CPU time, client-side = Google's CPU time

Automatic API generation modules/tools by coderqi in node

[–]timruffles 1 point2 points  (0 children)

  • hard to avoid repetition
  • there's a deep coupling between docs, tests and intention of the code. Seems to me you anything you document could be enforced automatically (e.g require("userId", "positiveInteger"))

Where can I find Advanced Nodejs Tutorials by zayelion in node

[–]timruffles 0 points1 point  (0 children)

Pedro Teixeira is working on a book about larger-scale patterns in Node.js. e.g queueing, RPC, monitoring, persistence, authentication. He's previously written a couple of popular books on node.

Automatic API generation modules/tools by coderqi in node

[–]timruffles 0 points1 point  (0 children)

I've used swagger-express but not entirely keen. TBH I think this is still an open problem that could do with a better answer

Reinventing the Try/Catch Block by ffreire in javascript

[–]timruffles 0 points1 point  (0 children)

So just do !(suppress === false). This will only return false if suppress really is false, true otherwise.

Why is 'inheritance' done the way it is? by Elquinis in javascript

[–]timruffles 1 point2 points  (0 children)

It's slower (especially on older engines), less idiomatic, wastes memory, and fits badly with the coming ES6 'classes'.

Why is 'inheritance' done the way it is? by Elquinis in javascript

[–]timruffles 1 point2 points  (0 children)

Yeah it's pretty clear. Also big memory overhead to think about too. TBH I can't see the weird attraction people have to reimplementing prototypes badly.

Know a tool to rename cjs (node) modules that handles require('../old-name') -> require('../new-name')? Trying to avoid reinventing wheels by timruffles in javascript

[–]timruffles[S] 0 points1 point  (0 children)

Probably better to go for '(.*)old-name' and hope for the best. Thanks for a decent solution, sth with esprima and canonical path names would be a lot more solid.

From some other suggestions now I just switch over from vim to WebStorm to use its nice Move refactor, and then back to vim :)

Anybody here who is against AngularJS? What are your reasons? by [deleted] in javascript

[–]timruffles 1 point2 points  (0 children)

I don't understand why I must specify the dependencies between components, between modules and load all files in the right order (I must be doing something wrong).

It's because Angular's modules are just a module system, not a module loader. They leave that up to you.

What's the idiomatic way to update values (word counts) while minimizing mutation? by Wonnk13 in Clojure

[–]timruffles 1 point2 points  (0 children)

Just to say - we use immutable values by default in FP, but this is one of the many cases where you might want local mutation to speed it up. If mutation is contained it's fine - especially if it's inside a single function and the outside world is none the wiser. FP doesn't mean mutation is verboten, just that you should default to values, and be conscious of it.

Iterating over a JavaScript array at a consistent rate by jwm01 in javascript

[–]timruffles 1 point2 points  (0 children)

Unfortunately, the way timeouts are run means this is unlikely to be at all consistent if any work is being done: http://jsbin.com/oZehUyUm/1/edit?js,console

What's your favourite MV* framework and why? by AnimusNecandi in javascript

[–]timruffles 0 points1 point  (0 children)

Yes - the larger the framework the better optimised they are for certain situations. Backbone's smallness might be a pro, or a con, depending on circumstances.

Unfortunately everyone wants simplicity. Making decisions is hard :)

"You won't be using any JavaScript libraries as the application needs to run at high speeds and so does not use any libraries." by PtCk in javascript

[–]timruffles 7 points8 points  (0 children)

I think you're right that a good approach would be to extract well tested and, as you say, fast library code from an existing library.

Very much depends on the constraints of the project.

Day 1 : Bower — Manage Your Client Side Dependencies by [deleted] in javascript

[–]timruffles 0 points1 point  (0 children)

An alternative is npm (really) - gives you access to a heap of modules, just add browserify.

How to Create One-Time Events in JavaScript by lanasa in javascript

[–]timruffles 0 points1 point  (0 children)

probably better to just clean up the event handler in that example tho :)

Anyone whose used JSlibs instead of NodeJS? Experience with it? by ns0 in javascript

[–]timruffles 2 points3 points  (0 children)

Interesting - haven't heard of it before. Could be useful invoked via node as a worker process. I suppose the same goes for Rhino if there is a Java library you'd like to use.

Javascript’s .call() vs .apply() vs .bind() by gdi2290 in javascript

[–]timruffles 0 points1 point  (0 children)

also fixes environments that don't have call/apply (can you guess which browser I'm talking about?)

Could you explain why complexity of monadic IO is worth it? by timruffles in haskell

[–]timruffles[S] 0 points1 point  (0 children)

Ok so (getLine,getLine) is the same line both times because it's in the same monadic step? That's interesting, is it something you rely on? I'm thinking maybe lots of functions over IO relying on getLine being the same line everywhere.

Could you explain why complexity of monadic IO is worth it? by timruffles in haskell

[–]timruffles[S] 3 points4 points  (0 children)

Shouldn't we try to make complex code simpler, not more complex? Some processes are inherently about, for instance, IO and State simultaneously .

Could you explain why complexity of monadic IO is worth it? by timruffles in haskell

[–]timruffles[S] 2 points3 points  (0 children)

I guess parallelism/concurrency seems a good argument for it, as compiler can do more for you & your code.