start new:
tmux
start new with session name:
tmux new -s myname
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
#!/bin/bash | |
# install homebrew's official php tap | |
brew tap josegonzalez/homebrew-php | |
# install homebrew-dupes (required to install zlib, php54's dependency) | |
brew tap homebrew/dupes | |
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug | |
brew install nginx mysql |
MIDDLEWARE_CLASSES = ( | |
'django.middleware.common.CommonMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
'django.middleware.csrf.CsrfViewMiddleware', | |
'utils.AutomaticLoginUserMiddleware', | |
'django.contrib.auth.middleware.AuthenticationMiddleware', | |
'django.contrib.messages.middleware.MessageMiddleware', | |
'django.middleware.transaction.TransactionMiddleware', | |
) |
# Sometimes it's handy to create small anonymous objects instead of explicitly defining a class for it, especially while prototyping. | |
def new(name, data): | |
return type(name, (object,), data) | |
person = new('Person', { 'name': 'Joe', 'age': 30 }) | |
print(person.name) |
""" | |
MIT License | |
Copyright (c) 2017 Michał Bultrowicz | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
# synchronous api | |
# response = sg.client.mail.send.post(request_body=data) | |
# except urllib.error.HTTPError as exc: | |
# async implementation | |
api_endpoint = 'https://api.sendgrid.com/v3/mail/send' | |
headers = {'Authorization': f'Bearer {sendgrid_api_key}', | |
'Content-Type': 'application/json'} |
Given a Parent
class with value
property, Child
can inherit and overload the property while accessing Parent
property getter and setter.
Although we could just reimplement the Child.value
property logic completely without using Parent.value
whatsover, this would violate the DRY principle and, more important, it wouldn't allow for proper multiple inheritance (as show in the example property_inheritance.py
bellow).
Two options:
Child
redefines value
property completely, both getter and setter.