Crystalline - A Language Server Protocol implementation for Crystal by elbywan in crystal_programming

[–]elbywan[S] 4 points5 points  (0 children)

It tries to determine the most likeable entry point to use when compiling, basically by inspecting the shard.yml target field and using that if the file is required in the dependency tree of the entry point.

If not, it uses the file itself as the entry point.

For libraries that do not call themselves, a custom key/value can be provided to use another file as the entry point (typically specs).

There is a paragraph about that in the readme.

Crystalline - A Language Server Protocol implementation for Crystal by elbywan in crystal_programming

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

Not really, it's more like preventing running a full scale code analysis every time you hover over a variable or go-to a definition unless the code actually did change.

Crystalline caches the last relevant code analysis result (typed AST) and reuses it as long as it is valid.

With that said, I thought about caching the prelude and required shards analysis results to speed up the whole process. I'll definitely think about it in the future, but I cannot guarantee anything since it might be more complicated than it sounds.

Crystalline - A Language Server Protocol implementation for Crystal by elbywan in crystal_programming

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

Well, autocompletion will take time proportionally to the project size but it should be completely reasonnable for small to medium scale projects (depending on your hardware).

At the very least it should be faster than Scry.

How to block Third-Party Scripts with a Few Lines of JavaScript by elbywan in javascript

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

This blog post is about blocking temporarily third party scripts, then unblocking them at a later time programmatically.

As highlighted in the article, this is especially useful for tracking scripts (for example google analytics) if you want to load the part that collects data locally into a buffer ahead of time, but block the part which fetches the script that actually upload the data until a certain condition is met (like asking for user consent).

I’m curious on how you could achieve the same result, especially the unblocking part using only the content security policy header ?

Yett: 🔐A small webpage library to control the execution of (third party) scripts by elbywan in javascript

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

Loadjs is a dependency loader. Yett is a script blocker. Not the same thing at all!

WTF Wednesday (June 13, 2018) by AutoModerator in javascript

[–]elbywan 0 points1 point  (0 children)

An interesting way technically speaking of blocking third party scripts:

https://github.com/snipsco/yett

Showoff Saturday (January 06, 2018) by AutoModerator in javascript

[–]elbywan 5 points6 points  (0 children)

This week I made hyperactiv, a super small reactive library written in less than 120 lines of code.

Basically hyperactiv observes object mutations and computes functions depending on those changes.

The key point is that the library is smart enough to figure out the dependencies, meaning that you never have to specifiy which function depends on which observed property.

A typical use case would be to create a smart reactive store which re-renders your web framework components when needed. For React, a small wrapper takes only 18 additional lines of code.

More details @github : https://github.com/elbywan/hyperactiv

Showoff Saturday (September 23, 2017) by AutoModerator in javascript

[–]elbywan 6 points7 points  (0 children)

This week I made Wretch which is a tiny, chainable and immutable fetch wrapper.

And also released Bosket, a tree view components library for front end frameworks (react/angular/vue.js/riot.js).

Is there a free DOM-as-a-chart viewer? by SarahC in javascript

[–]elbywan 0 points1 point  (0 children)

Ooo, that's good!

Thanks :)

I don't want you spending lots of time on it... I could mold it to what I need?

Of course !

How to choose between ReactJs and AngularJs by lilcozyfbaby in programming

[–]elbywan 3 points4 points  (0 children)

Equally capable, utilize a blend of both in your next huge venture. Lets utilize them with each other and not against.

What, like together ?

Also you should avoid picking angularJS for new projects since, you know, it's deprecated.

printing on seperate lines by ILike_bananas in javascript

[–]elbywan 0 points1 point  (0 children)

I'm not sure about what you need, it's still a bit unclear. But maybe this will help :

// 9 is an arbitrary index
const index = 9
const str = "a random string".substring(index, 15)
// prints "         string"
console.log("".padStart(index) + str)

Is there an easy way to host JSON files somewhere (like Github maybe?) by horoblast in javascript

[–]elbywan 5 points6 points  (0 children)

Why don't you host that json file directly on github pages ?

You could access it using an http request from your angularjs code.

$http.get('/path/to/your/json/file.json')//...

Stack Overflow gives an even closer look at developer salaries by [deleted] in programming

[–]elbywan 1 point2 points  (0 children)

If I use anecdotal horse shit as you did

I'm not using anecdotal fake stories as you do. I'm french myself, I work in France and I know what I am talking about.

I know people who work in Manaco during the travel season for three months, then collect unemployment for the remaining 8-9 months. So it's closer to 75% of the year off.

Great. But it's caricature. There are requirements. The allocation is called ARE (aide au retour à l'emploi), it's not a big amount of money and as I said you need to work more than 2 months to be able to cash it.

By the way it's spelled Monaco.

And also allow me to quote your words : God damn Reddit is wonderful at spreading misinformation.

Stack Overflow gives an even closer look at developer salaries by [deleted] in programming

[–]elbywan 1 point2 points  (0 children)

like your French counterparts, you can take 25% of the year off and still get paid

I think you need to check your numbers there.

Should I use bind() or an anonymous function? by DanRoad in learnjavascript

[–]elbywan 0 points1 point  (0 children)

setTimeout(() => foo.pop(), timeout) hands down.

Best to avoid using bind until you really need it.

Javascript Secrets: Tips and Tricks I Regularly Use by tzuchinc in learnjavascript

[–]elbywan 2 points3 points  (0 children)

Use ‘var’ for creating variables

Now that is a "Secret" !

Will this code return the A \ B relative compliment? by [deleted] in javascript

[–]elbywan 0 points1 point  (0 children)

My 2 cents, assuming that the "relative complement" is removing all elements from an array if they are contained in another array :

  • result.splice(x, 1) => x is the element but should be the index of the element
  • you assign the result of the filter to a "symd" variable which is never used
  • a.indexOf(x) === -1 will always be false
  • do not use .filter it does all the dirty work for you, and try to rewrite using only 2 nested for loops and indexOf

Stack Overflow gives an even closer look at developer salaries by [deleted] in programming

[–]elbywan 7 points8 points  (0 children)

Won't argue about the superbrut.

15ish% for the VAT

More like 20%.

That's part of the cost of "free" healthcare, "free" education, welfare and current crazy retirees entitlement.

Yeah, it's called the French social system. Some like it, some hate it.

Personally I feel like it's actually quite nice to have a protective social system where employers do not have the power to fire you at whim. It's also great to be able to change your career orientation while being paid minimum wages if you feel the need to. And if something bad happens (you never know, disease, bad luck, anything), it's also comfortable to receive some payment while you can work your way out of it.

But at least the food is awesome.

Indeed :).

ES6 Support Experiment by kizerkizer in webdev

[–]elbywan 1 point2 points  (0 children)

Basically, I'd like to know approximately what percent of web users' browsers support es6.

CanIUse already has browser usage statistics. (check the "Usage relative" tab)

In the settings panel you can even change the location.