Skip to content

Instantly share code, notes, and snippets.

View Maikpwwq's full-sized avatar
💭
Searching for a good job!

Michael Arias Fajardo Maikpwwq

💭
Searching for a good job!
View GitHub Profile
@gaearon
gaearon / minification.md
Last active June 8, 2024 08:15
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@Erushenko
Erushenko / sumUpDiagonals.js
Created December 10, 2016 10:35
Get the sum diagonals in the matrix on javascript
var matrixExample = [
[ 1, 2, 3, 4 ],
[ 4, 5, 6, 5 ],
[ 7, 8, 9, 7 ],
[ 7, 8, 9, 7 ]
];
function sumUpDiagonals(matrix) {
var sumDiagonals = {main: 0, second: 0},
matrixLength = matrix.length;