See the new site: https://postgresisenough.dev
ViteJS is a modern JavaScript build tool that can be used to build modern JavaScript frameworks including ReactJS and VueJS to name only two. In this tutorial you will explore how to use ViteJS with AlpineJS. This will prepare you for using ViteJS with ReactJS or other modern web framework.
Modern JavaScript built tools like ViteJS, ParcelJS & react-create-app (built with webpack) embrace ES Modules. Meaning that external dependencies are installed via npm and imported. So no more script, style or link tags. HTML, CSS & JavaScript are bundled into compact bundle.
Let's start exploring ViteJS by creating a new application. Using this command:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <title>hello!!</title> | |
| <canvas | |
| name=canvas | |
| width=300 height=300 style="border: solid 2px red"> | |
| </canvas> | |
| <script> | |
| canvas = document.body.children[0] | |
| context = canvas.getContext('2d') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @url https://major.io/2007/07/05/bintar-argument-list-too-long/ | |
| If you find yourself stuck with over 30,000 files in a directory (text files in this example), packing them into a tar file can be tricky. You can get around it with this: | |
| find . -name '*.txt' -print >/tmp/test.manifest | |
| tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest | |
| find . -name '*.txt' | xargs rm -v |
$ uname -r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Nginx - new server block | |
| # Based on this post: http://clubmate.fi/how-to-make-an-nginx-server-block-manually-or-with-a-shell-script/ | |
| # Functions | |
| ok() { echo -e '\e[32m'$1'\e[m'; } # Green | |
| die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; } | |
| # Variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Vagrant.configure("2") do |config| | |
| config.vm.box = "trusty" | |
| config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | |
| config.vm.hostname = "devstack" | |
| # forward ssh keys from main host - handy for gerrit and github | |
| config.ssh.forward_agent = true |
As configured in my dotfiles.
start new:
tmux
start new with session name: