Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.
 and give it execute permissions (chmod +x). | |
# Then run it with ./pi-cpu-stress.sh | |
# | |
# NOTE: In recent years, I've switched to using s-tui. See: | |
# https://github.com/amanusk/s-tui?tab=readme-ov-file#options | |
# Variables. |
def site_authors(request): | |
return Author.objects.filter(site_id=request.site.id) | |
class Authorships(Orderable, models.Model): | |
author = models.ForeignKey('Author', related_name='author_paper_relationship', on_delete=models.CASCADE) | |
paper = ParentalKey('Page', related_name='paper_author_relationship', on_delete=models.CASCADE) | |
panels = [ | |
SnippetChooserPanel('author', qs_restriction=site_authors, editable=False) | |
] |
@register_snippet | |
class Author(models.Model): | |
first_name = models.CharField(max_length=128) | |
last_name = models.CharField(max_length=128) | |
site = models.ForeignKey('wagtailcore.Site', on_delete=models.CASCADE) | |
panels = [ | |
MultiFieldPanel([ | |
FieldPanel('first_name', classname='col6 first-name'), | |
FieldPanel('last_name', classname='col6 last-name'), |
class MyModel(models.Model): | |
onefield = models.CharField('The field', max_length=100) | |
class MyModelAdmin(admin.ModelAdmin): | |
def has_add_permission(self, request): | |
# if there's already an entry, do not allow adding | |
count = MyModel.objects.all().count() | |
if count == 0: | |
return True | |
return False |