Skip to content

Instantly share code, notes, and snippets.

View Copser's full-sized avatar
:octocat:
Something need doing?

p_pilipovic Copser

:octocat:
Something need doing?
View GitHub Profile
@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@freakboy3742
freakboy3742 / beyond-web-2.0.rst
Last active January 1, 2016 05:51
Beyond Web 2.0 - Django and Python in the modern web ecosystem

Beyond Web 2.0 - Django and Python in the modern web ecosystem

Django is over 10 years old; but the web that it was built for doesn't really exist any more. Yes, we still need to rapidly develop database-backed websites, and we still need those sites to use AJAX, but the modern web is faced with new problems, and new challenges. Many of those challenges involve interacting with devices that aren't desktop machines, and platforms that aren't a traditional browser - places where Python isn't a first-class citizen.

Does this mean we have to abandon Django and Python for other frameworks and languages? Can we keep using Python and Django on the server side and interact with independent client side frameworks? Or can we push Python and Django into these new environments?

In this talk, Dr Russell Keith-Magee will explore the problems, and some potential solutions, to these problems.

Objectives

@mattseymour
mattseymour / django-secret-keygen.py
Last active September 8, 2022 23:47
Django secret key generator
"""
Pseudo-random django secret key generator.
- Does print SECRET key to terminal which can be seen as unsafe.
"""
import string
import random
from __future__ import print_function