Skip to content

Instantly share code, notes, and snippets.

Scala Number Conversion Chart

From → To Expression
val a = ListBuffer(1, 2, 3)
val b = a.toIterable.asInstanceOf[List[Int]]
// List(1, 2, 3)
a.append(4, 5, 6)
b
// List(1, 2, 3, 4, 5, 6)
# Read more at http://www.pindi.us/blog/migrating-cross-domain-cookies-django
from django.conf import settings
from importlib import import_module
class UpdateSessionCookieMiddleware(object):
"""
Migrates session data from an old (hardcoded) session cookie name and domain to the name and
domain currently defined in the Django settings.