- Create a Droplet on e.g. DigitalOcean.
- Make sure it has at least 1 vCPU and 1 GB of memory.
- Mine has: 1 vCPU, 1 GB, 35 GB NVMe SSD, Premium Intel CPU, Ubuntu 24.04 LTS for $8/month on Digital Ocean
- Choose SSH KEY AUTHENTICATION and create a new SSH key.
- Remember the server's IPv4 address.
- Sign up for a Container Registry e.g. on Digital Ocean for $5/mo (the 500MB free plan won't cut it)
- Remember your username on the registry
- Create an API Token at https://cloud.digitalocean.com/account/api/tokens for pushing images to the registry.
- It needs to have these scopes:
registry (4): delete, update, read, create
- It needs to have these scopes:
- Install Kamal with
gem install kamal
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Add React in One Minute</title> | |
| </head> | |
| <body> | |
| <h2>Add React in One Minute</h2> | |
| <p>This page demonstrates using React with no build tooling.</p> |
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/bash | |
| # James Shubin, 2018 | |
| # run `make` in the first directory (or its parent recursively) that it works in | |
| # https://purpleidea.com/blog/2018/03/10/running-make-from-anywhere/ | |
| MF='Makefile' # looks for this file, could look for others, but that's silly | |
| CWD=$(pwd) # starting here | |
| while true; do | |
| if [ -e "$MF" ]; then |
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
| """Node model and Node admin interaction.""" | |
| from django import forms | |
| from django.conf.urls import url | |
| from django.contrib.admin.utils import quote, unquote | |
| from django.core.exceptions import PermissionDenied | |
| from django.core.validators import MinLengthValidator, RegexValidator | |
| from django.db import models | |
| from django.shortcuts import get_object_or_404 | |
| from django.template.loader import render_to_string |
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
| // stuff/templates/wagtailadmin/edit_handlers/inline_panel.js | |
| (function() { | |
| var opts = { | |
| formsetPrefix: "id_{{ self.formset.prefix }}", | |
| emptyChildFormPrefix: "{{ self.empty_child.form.prefix }}", | |
| canOrder: {% if can_order %}true{% else %}false{% endif %}, | |
| maxForms: {{ self.formset.max_num }} | |
| }; | |
| var panel = InlinePanel(opts); |
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
| /* | |
| This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
| It will generate several classes such as: | |
| .m-r-10 which gives margin-right 10 pixels. | |
| .m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
| .m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
| .p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
| .p-l-40 gives PADDING to the LEFT of 40 pixels |
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
| (function() { | |
| /* Define a variável que dá swipe no lightbox */ | |
| var magnificPopup = $.magnificPopup.instance; | |
| /* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
| $("a.image-lightbox").click(function(e) { | |
| /* Espera carregar o lightbox */ | |
| setTimeout(function() { | |
| /* Swipe para a esquerda - Próximo */ |
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
| INITIALISATION | |
| ============== | |
| load wp-config.php | |
| set up default constants | |
| load wp-content/advanced-cache.php if it exists | |
| load wp-content/db.php if it exists | |
| connect to mysql, select db | |
| load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
| load wp-content/sunrise.php if it exists (multisite only) |
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
| /* Override inline dom styles from modal.js */ | |
| #modalContent { | |
| position: fixed !important; | |
| top: 12% !important; | |
| bottom: 12% !important; | |
| right: 4% !important; | |
| left: 4% !important; | |
| } | |
| /* Limit max width to 1000px */ | |
| div.ctools-modal-content { |
NewerOlder