Omar Albeik
  • Blog
  • Snippets
  • Portfolio
  • About
  1. Home
  2. Snippets

Subscript with default argumentsSwift

Swift 5.2 added subscript with default arguments, it gets quite powerful for custom subscripts, but also default ones like in this example

Screenshot from UIViewSwift

Generate a screenshot from a UIView

Get a random element from arrayTypescript

Get a random element from array - O(1)

Read and write JSONPython

Read and write JSON

Print to the same linePython

Print to console using the same line (useful for progress logging)

Create dynamic pages in NextJSNextJS

Create dynamic pages that fetch their content from an API in NextJS

Use Docker networks to share the same localhostDocker

Use Docker networks to share the same localhost between containers.

Pre-populate fields in Django adminDjango

Pre-populate fields' text based on the content of another field in Django admin

Autocomplete fields in Django AdminDjango

Show autocomplete search dropdown for ManyToManyField fields in Django admin.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Blog
  • Portfolio
  • Snippets
  • RESTful API
  • About

This is a fully dockerized open-source project that uses Django and NextJS to build. Grab your copy from Github

  • github
  • twitter
  • linkedin
  • stackoverflow
Copyright © 2020 Omar Albeik. All rights reserved.