📜 ⬆️ ⬇️

Some interesting and useful things for web developer # 23

Good day, dear habravchane. Recently, I saw some interesting and useful tools / libraries / events that I want to share with Habr.

Basket.js



Basket is a bit like RequireJS, only with its help all connected scripts and styles are cached in localStorage. Tests by Google and Bing demonstrate improved performance when using local storage compared to the usual browser cache. The project initially appeared as an experiment that fully justified the results of these tests.
basket .require({ url: 'missing.js' }) .then(function () { // Success }, function (error) { // There was an error fetching the script console.log(error); }); 



ngrok

Meet ngrok, a simple service that allows you to send a local web service (of any sense: Node.js, ColdFusion, PHP, and so on) on the Internet. It allows you not only to browse your local sites at an affordable URL, but also to test incoming requests as well as repeat them (this can be a decisive factor, if you are testing a service with restrictions, you can ask ngrok to repeat the request without using "Remote service).

Frontender Magazine - "Show yourself with ngrok."
')
Fenix ​​2.0 as an alternative to ngrok, and still have srvdir .


Xdomain


CORS alternative to pure javascript. Xdomain weighs only 25kb (12kb in minifitsirovanny form), does not depend on third-party libraries, does not require any changes on the server, you just need to add proxy.html to the desired domain. Simple XHR access to Amazon and Dropbox file servers.

 //do some vanilla XHR var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://xyz.example.com/secret/file.txt'); xhr.onreadystatechange = function(e) { if(xhr.readyState === 4) alert(xhr.responseText); }; xhr.send(); //or if we are using jQuery... $.get('http://xyz.example.com/secret/file.txt').done(function(data) { console.log("got result: ", data); }); 


jsPDF



A great tool for generating .PDF on a client using javascript. Delight new features, from now on, many of the necessary documents can be easily and easily generated.

Dense.js



The most elegant solution to the problem of responsive images for high-resolution displays, I would even say the most cunning. The bottom line is that the script when determining the Retina makes blur all the pictures and everything looks as if it should be. In my opinion it is very usable:
 <script src="jquery.min.js"></script> <script src="dense.min.js"></script> <script> $('img').dense(); </script> 


The Elements of HTML - for those who honor semantics


Chroma.js


Functional library for working with color. “Chrome” for color is like “The moment for the date. The track record for performing relevant tasks is endless.

Allows you to manipulate colors:
 chroma('#D4F880').darken().hex(); // #9BC04B 


Scale colors:
 scale = chroma.scale(['white', 'red']); scale(0.5).hex(); // #FF7F7F 


Manage modes:
 chroma.scale(['white', 'red']).mode('lab'); 


And a lot of the rest.

Western thoughts or what would translate to Habré:




Says and shows Habr:




Finally:




Previous selection (Release 22)

I apologize for any typos. If you notice a problem - please write in a personal.

Thank you all for your attention.

Source: https://habr.com/ru/post/230405/


All Articles