I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
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
| /** | |
| * Process and render search results. | |
| * | |
| * !! NOTE | |
| * _config.php includes: | |
| * | |
| * FulltextSearchable::enable(); | |
| * Object::add_extension('ExtendedPage', "FulltextSearchable('HeadlineText')"); | |
| * Object::add_extension('NewsStory', "FulltextSearchable('Name,Content')"); | |
| * !! |
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
| #!/bin/sh | |
| # Use git to push to deploy (aka git push to prod) | |
| # Use 'git push remote master' to push to deploy | |
| # This script only deploys on pushes to master. | |
| # | |
| # HOWTO: | |
| # On your server to deploy, create a bare git directory | |
| # (somewhere like /var/git/<gitProject>) | |
| # Your depoly directory (like /var/www) should be somewhere other than your git repo. |
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
| <script> | |
| /* | |
| Squarespace Age Gate. | |
| - Create a "Cover Page" under Pages > Not Linked. | |
| - Click the gear icon, go to Advanced tab in the popup, paste this code. | |
| - This sets the cookie and handles the redirect back to the requested content. | |
| - On the age gate page, you have to create a button that has "#legal" as the link or href. It is what turns off the age gate. | |
| - Elsewhere on the site, you can test for the cookie (legal), and if not set, rediret to the age gate Cover Page (example at the bottom). | |
| */ |
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
| /* | |
| Snippet is nuts and bolts for creating/moving to an isolated tempdb drive. | |
| After you run this, SQL Server must be restarted for it to take effect | |
| */ | |
| DECLARE @DriveSizeGB INT = 40 | |
| ,@FileCount INT = 9 | |
| ,@InstanceCount TINYINT = 1 | |
| ,@VolumeBuffer DECIMAL(8, 2) = .8 /* Set to amount of volume TempDB can fill. */ | |
| ,@RowID INT | |
| ,@FileSize VARCHAR(10) |
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
| #!/bin/sh | |
| # install tools | |
| apt update -y && apt install nano wget curl libguestfs-tools -y | |
| # remove old image | |
| rm -rfv current/noble-server-cloudimg-amd64.img | |
| # remove old template container - WILL DESTROY COMPLETELY | |
| qm destroy 9000 --destroy-unreferenced-disks 1 --purge 1 | |
| # download new image | |
| wget https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img | |
| # add agent to image |
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
| <?php | |
| use App\Livewire\Actions\Logout; | |
| use Livewire\Volt\Component; | |
| new class extends Component | |
| { | |
| public string $password = ''; | |
| public function deleteUser(Logout $logout): void |
Just some tips I gathered over time. All in one easily reachable place so I can share it wherever I want.
Please note that unless you see a shebang (#!/...) these code blocks are usually meant to be copy & pasted directly into the shell. Some of the steps will not work if you run part of them in a script and copy paste other ones as they rely on variables set before.
The { and } surrounding some scripts are meant to avoid poisoning your bash history with individual commands, etc. You can ignore them if you manually copy paste the individual commands.
I chose to write things "in the open" that way so there's still some control and things don't become a black box.