Skip to content

Commit

Permalink
Fixed some rST problems and added a new section on Celery deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszzielinski committed May 26, 2014
1 parent 48cbe4b commit f907973
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Welcome to "My notes"!
=====================================
======================

You can find a hosted version of this compilation at http://my-notes.readthedocs.org/
6 changes: 3 additions & 3 deletions books.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
========================
Online books
========================
============
Online books
============

* `TCP/IP Guide <http://www.tcpipguide.com/free/t_toc.htm>`_
22 changes: 11 additions & 11 deletions browsers-js.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
========================
Browsers, HTML5 & JavaScript
========================
============================
Browsers, HTML5 & JavaScript
============================

The hashbang hell
=====================
=================

* http://danwebb.net/2011/5/28/it-is-about-the-hashbangs
* http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs
* http://webmasters.stackexchange.com/questions/32472/pros-cons-of-hash-navigation-from-seo-perspective

HTML5
==========
=====

I've spent some time looking for the best explanations of different aspects of HTML5.
Here are my findings.

General
-----------
-------

* http://mathiasbynens.be/notes/html5-levels
* http://html5doctor.com/avoiding-common-html5-mistakes/
Expand All @@ -36,7 +36,7 @@ Outlining


Headings
---------
--------

* In general it seems that <header> tag is optional it's only meant to wrap a single <h1> tag.
<h1> tag sort of implies <header> around it.
Expand All @@ -56,7 +56,7 @@ Headings


Browsers' bfcache
==========
=================

* Firefox has so called `bfcache ("Back-Forward Cache") <https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching>`_
that keeps the state of the whole page, including JavaScript context, and restores it when user presses the Back
Expand All @@ -77,7 +77,7 @@ JavaScript


Single page apps / mobile apps
====================================
==============================

jQuery Mobile
-------------
Expand All @@ -93,7 +93,7 @@ KnockoutJS


CORS (Cross-Origin Resource Sharing)
-------------------------------------
------------------------------------
* http://enable-cors.org/
* https://developer.mozilla.org/en-US/docs/HTTP_access_control
* http://www.html5rocks.com/en/tutorials/cors/
Expand All @@ -106,5 +106,5 @@ http://toastdriven.com/blog/2012/sep/04/djangocon-2012-slides-api-design-tips/


Websockets
=================
==========
* http://lucumr.pocoo.org/2012/9/24/websockets-101/
4 changes: 2 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.1'
version = '0.3.2'
# The full version, including alpha/beta/rc tags.
release = '0.3.1'
release = '0.3.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
11 changes: 11 additions & 0 deletions deployment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
==========
Deployment
==========

Celery
=================

* http://www.slideshare.net/mahendram/advanced-task-management-with-celery
* https://stackoverflow.com/questions/6551133/issues-with-celery-daemon
* https://github.com/celery/celery/tree/master/extra/supervisord -> https://github.com/celery/celery/blob/master/extra/supervisord/celeryd.conf
* `Celery processes won't die on restart <https://github.com/celery/django-celery/issues/267>`_
16 changes: 8 additions & 8 deletions django-1.3.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========================
Django 1.3, 1.4 tips&tricks
========================
===========================
Django 1.3, 1.4 tips&tricks
===========================

settings.py
===========
Expand Down Expand Up @@ -177,7 +177,7 @@ The catch here is that ``form.is_valid()`` returns ``False`` for unbound forms.


Rarely-known (and/or undocumented) Django features
===================================================
==================================================

* When converting *models.py* into a Python package, make sure that models there have ``app_label`` set in their Meta::

Expand Down Expand Up @@ -214,7 +214,7 @@ Rarely-known (and/or undocumented) Django features


REST, HTTP and Django
======================
=====================


URLs, application structure
Expand Down Expand Up @@ -348,7 +348,7 @@ Django and HTTP caching for static assets


HTTP caching for Django views
--------------------------------
-----------------------------

* There's probably no single setup suitable for all your views (pages)
* So let me just give you a few links:
Expand Down Expand Up @@ -377,7 +377,7 @@ Useful links


Other HTTP performance tips
----------------------------
---------------------------

* Read `Yahoo guidelines <http://developer.yahoo.com/performance/>`_
* Read `Google guidelines <http://code.google.com/intl/pl-PL/speed/articles/>`_
Expand Down Expand Up @@ -411,7 +411,7 @@ Non-HTTP caching and Django


Avoid Apache :)
===================
===============
* Apache is a mature and stable piece of software...
* ...but it's also a complex one. It's not that hard to leave a security hole or misconfigure it:

Expand Down
6 changes: 3 additions & 3 deletions django-1.4-gotchas.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========================
Django 1.4 gotchas
========================
==================
Django 1.4 gotchas
==================

* Password hasing makes unit tests `very slow <http://www.reddit.com/r/django/comments/seq59/are_other_people_experiencing_test_slowdown_in_14/>`_.
The solution is to switch back to MD5 hashing during when running tests::
Expand Down
3 changes: 2 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.
Welcome to "My notes"!
=====================================
======================

This is a compilation of things that I stumbled upon or learned during `my work <http://pyconsultant.eu>`_.
I decided to make it public to give something back to the Open Source community which equipped me with most
Expand All @@ -25,6 +25,7 @@ Contents:

django-1.3
django-1.4-gotchas
deployment
browsers-js
python-2-rarities
python-2-types
Expand Down
10 changes: 5 additions & 5 deletions misc.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========================
Miscellaneous tips&tricks
========================
=========================
Miscellaneous tips&tricks
=========================

Postfix
=======
Expand All @@ -18,14 +18,14 @@ Postfix


git
======
===
* In the precommit hook one can add ``ack-grep "pdb\.set_trace\(\)"``
to find all remaining pdb calls. `You can also do much more there <http://tech.yipit.com/2011/11/16/183772396/>`_.
* `Why You Need a Git Pre-Commit Hook and Why Most Are Wrong <http://tech.yipit.com/2011/11/16/183772396/>`_


Virtualbox (+ Ubuntu)
=======================
=====================

* Port mapping in the NAT mode `<http://superuser.com/questions/424083/virtualbox-host-ssh-to-guest>`_.
Then: ``ssh -p 2222 user@localhost``.
Expand Down
14 changes: 7 additions & 7 deletions python-2-rarities.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
========================
===================
Python 2.x rarities
========================
===================


Slicing, extended slicing, *Ellipsis* - ``a[i:j:step], a[i:j, k:l], a[..., i:j]``
=====================================================================================
=================================================================================

More:
`[1] <http://docs.python.org/release/2.7/library/functions.html#slice>`_,
Expand All @@ -30,7 +30,7 @@ to indicate that the comparison is not implemented with respect to the other typ


iter(obj, sentinel)
==============
===================

`The iter(callable, until_value) function repeatedly calls callable and yields its result until until_value is
returned <http://stackoverflow.com/questions/101268/hidden-features-of-python/102202#102202>`_.
Expand All @@ -39,13 +39,13 @@ Example: ``for line in iter(f.read(), '\n'): ...``


Rot13 source encoding
==============
=====================

http://stackoverflow.com/questions/101268/hidden-features-of-python/1024693#1024693


`Negative \*round()\* <http://stackoverflow.com/questions/101268/hidden-features-of-python/373949#373949>`_
==============
===========================================================================================================

Negative precision affects digits in front of the decimal point::

Expand All @@ -55,7 +55,7 @@ Negative precision affects digits in front of the decimal point::
'1234.57'

Reversing a string or a list (well, a sequence)
==================================
===============================================

It's is as simple as making a copy of it with negative increment: ``sequence[::-1]`` - which is equivalent to
``sequence[-1::-1]`` (see: `Extended slices <http://docs.python.org/release/2.3.5/whatsnew/section-slices.html>`_).
Expand Down
14 changes: 7 additions & 7 deletions python-2-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ General information


Built-in types
===================
==============

For most built-in types the following relationships occur::

Expand Down Expand Up @@ -45,7 +45,7 @@ while ``object`` is instance of ``type``::


Prerequisites for the subsequent sections
===================
=========================================


`"For new-style classes, implicit invocations of special methods are only guaranteed to work correctly if defined on
Expand All @@ -65,7 +65,7 @@ The latter ``__call__`` method is injected into the created ``C`` instance.


Object creation a.k.a. class instantiation
===================
==========================================

To create an object of class C one use: ``c = C(...)``.

Expand All @@ -88,7 +88,7 @@ Subsequently, ``self.__init__()`` takes the class instance object and initialize


Special case of object creation: class declaration a.k.a. metaclass instantiation
===================
=================================================================================

The following declaration::

Expand All @@ -105,7 +105,7 @@ and this is resolved like a standard object creation described in the previous s


A more complex example of "class + metaclass + instantiation" hell
===================
==================================================================

This::

Expand All @@ -128,7 +128,7 @@ gives in the interactive shell::


Another - even more complex - example of "class + metaclass + instantiation" hell
===================
=================================================================================

This::

Expand Down Expand Up @@ -156,7 +156,7 @@ gives in the interactive shell::


Further reading
===================
===============

* http://python.org/doc/newstyle/
* http://docs.python.org/reference/datamodel.html, especially http://docs.python.org/reference/datamodel.html#customizing-class-creation
Expand Down
18 changes: 9 additions & 9 deletions security.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
========================
Security
========================
========
Security
========

Web security
================
============

Password storage
--------------------
----------------
* http://blog.mozilla.org/webdev/2012/06/08/lets-talk-about-password-storage/
* http://codahale.com/how-to-safely-store-a-password/
* http://en.wikipedia.org/wiki/Password_strength
* https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure

Guidelines
--------------------
----------
* https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines
* http://lanyrd.com/2012/djangocon-europe/srprk/
* http://stackoverflow.com/questions/2794016/what-should-every-programmer-know-about-security
Expand All @@ -22,7 +22,7 @@ Guidelines
* http://www.html5rocks.com/en/tutorials/security/content-security-policy/

Attack types
--------------------
------------
* https://www.owasp.org/index.php/Category:Attack
* http://en.wikipedia.org/wiki/Timing_attack
* http://codahale.com/a-lesson-in-timing-attacks/
Expand All @@ -31,13 +31,13 @@ Attack types


HMAC
--------------------
----
* http://en.wikipedia.org/wiki/HMAC
* http://docs.python.org/library/hmac.html


Android security
=====================
================
* App fundamentals: http://developer.android.com/guide/components/fundamentals.html
* Permissions: http://developer.android.com/guide/topics/security/permissions.html
* Device encryption: http://source.android.com/tech/encryption/android_crypto_implementation.html
Expand Down
Loading

0 comments on commit f907973

Please sign in to comment.