Add the possibility to save options to the current context.
Save the different files in the proper folders:
DJANGO_PROJECT
APP_NAME
templates
APP_NAME
index.html
templatetags
using UnityEngine; | |
using System.Collections; | |
public class GetUserFromWeb : MonoBehaviour | |
{ | |
// Set those up in the inspector if you want to simulate the GetFromWeb behaviour in within the Editor. | |
public string debugUser; | |
public string debugToken; | |
# From https://github.com/ngerakines/commitment/issues/69#issuecomment-91053061 | |
git config --global alias.yolo '!git add -A && git commit -m "$(curl -s whatthecommit.com/index.txt)"' |
Add the possibility to save options to the current context.
Save the different files in the proper folders:
DJANGO_PROJECT
APP_NAME
templates
APP_NAME
index.html
templatetags
From Wagtail 1.7 (maybe?) options will be passed to the widget when instantiated. See https://github.com/torchbox/wagtail/commit/5732e215b0774c22d8e9bf210aa1491353595406
Given the following config:
WAGTAILADMIN_RICH_TEXT_EDITORS = {
'default': {
'WIDGET': 'wagtail.wagtailadmin.rich_text.HalloRichTextArea'
},
from django import forms | |
class MyForm(forms.Form): | |
def clean(self): | |
is_something = cleaned_data.get('is_something') | |
if is_something: | |
validate_required_field(self, cleaned_data, 'name_of_dynamically_required_field') |
Unfortunately because models returned by apps.get_model
in migrations aren't the actual class, methods like Page.add
aren't available and we have to do it manually. The most sensitive part being the handling of the path.
As an aside, deleting pages in migration will not update the numchild
of the parent page. Unfortunately, the fixtree
command doesn't play nice within a migration so it will need to be ran separately (or the parent page should manually be updated).
Notes: When not within a migration, a page path could be created with parent_page.get_last_child()._inc_path()
or Page._get_children_path_interval(parent_page.path)[1]
.
Verifying my Blockstack ID is secured with the address 1Be7X31o6UPoKExkwfavisnbUqrycAtQPM https://explorer.blockstack.org/address/1Be7X31o6UPoKExkwfavisnbUqrycAtQPM |
// For https://www.reddit.com/r/formula1/comments/r39q00/formula1com_cookies_are_out_of_control/hm9hqma/?context=8&depth=9 | |
// 1. Navigate to https://www.formula1.com/ | |
// 2. Select "No, Manage Settings" | |
// 3. Run the following in the developer console | |
document.querySelectorAll("[class^='categories_']").forEach((el) => { | |
const sectionTitle = el.querySelector(".categoryTitle").textContent | |
const companiesCount = el.querySelectorAll("tbody > tr").length / 2 // 2 lines per company | |
console.log(`${sectionTitle}: ${companiesCount} companies`) | |
}) |
import re | |
import unicodedata | |
# Case insensitivity | |
sorted(["Hola", "hello"]) | |
# => ['Hola', 'hello'] | |
sorted( | |
["Hola", "hello"], |
Steps taken to merge this (for posterity, and also because I'll have to do it all over again for wagtail-localize which is in the same Transifex project).
BRANCH_NAME="7111-enforce-translation-string-formatting"
# Merge
git switch main
git pull --ff-only upstream main
git switch "${BRANCH_NAME}"
git reset $(git merge-base main "${BRANCH_NAME}")