Skip to content

Instantly share code, notes, and snippets.

@aero012
aero012 / minification.md
Created July 19, 2023 21:05 — forked from gaearon/minification.md
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:

@aero012
aero012 / index.html
Created December 5, 2021 16:41
Falling Sakura leaves
<!DOCTYPE html>
<!--
All credit goes to http://jsfiddle.net/aKr8D/21/
-->
<html>
<head>
<title>Falling Sakura leaves</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
@-webkit-keyframes fall {
@aero012
aero012 / index.html
Created December 5, 2021 16:41
Falling Sakura leaves
<!DOCTYPE html>
<!--
All credit goes to http://jsfiddle.net/aKr8D/21/
-->
<html>
<head>
<title>Falling Sakura leaves</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
@-webkit-keyframes fall {
@aero012
aero012 / example.html
Created May 19, 2021 15:43 — forked from nu7hatch/example.html
Simple banner rotator with jQuery
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<link href="rotate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="rotate.js"></script>
<script type="text/javascript">
$(window).load(function() {
startRotator("#rotator");
})
</script>