Design With Intent
2010-09-15
2010-09-15
2010-09-14
Quelques références pour Sass, extension ruby de génération de css, qui permete l'utilisation de variables, règles imbriquées, mixins, imports en ligne, génération de png base-64, etc. :
Sass et sa documentation ;
Compass : mixins, includes et « framework » pour sass ;
Lemonade : bientôt intégré à Sass, un générateur de sprites.
2010-09-07
After nearly five years in which Vollkorn became famous in the web and world it gets two crispy sisters : Italic and Bold-Italic.
— Friedrich Althausen, Typographer and Type Designer, Weimar, Germany
2010-08-23
Le layout de l'application est similaire à celui décrit par Zachary Voase ici: http://blog.zacharyvoase.com/2010/03/05/django-uwsgi-nginx/#configuration
Tout est question de chemin…
``` export PROJECT_NAME="myproject" export VIRTUAL_ENV="myprojectenv"
```
Créer un répertoire locale à la racine du projet
``` workon $VIRTUAL_ENV cdvirtualenv cd $PROJECT_NAME mkdir locale
```
Créer un répertoire par localisation dans locale
cd locale
mkdir fr en
Configurer le LOCALE_PATHS dans les settings de Django
```
LOCALE_PATHS = (
SITE_ROOT / 'locale'
)
```
Lancer le makemessages
```
DJANGO_SETTINGS_MODULE="$PROJECT_NAME.settings.development" PYTHONPATH=".." django-admin.py makemessages --settings=$PROJECT_NAME.settings.development -s -a $ import sys, warnings, os, fnmatch, glob, shutil, codecs, md5 $ processing language fr
DJANGO_SETTINGS_MODULE="$PROJECT_NAME.settings.development" PYTHONPATH=".." django-admin.py makemessages --settings=$PROJECT_NAME.settings.development -s -a -d djangojs -e.html,.js
```
Compiler les messages traduits
DJANGOSETTINGSMODULE="$PROJECTNAME.settings.development" PYTHONPATH=".." django-admin.py compilemessages --settings=$PROJECTNAME.settings.development
2010-08-23
2010-08-23
to enable that, set
LOCALE_PATHin your settings pointing to directory containing locales, e.g.
import os SITE_ROOT = os.path.dirname(os.path.abspath(__file__)) LOCALE_PATHS = ( os.path.join(SITE_ROOT, 'locale') )
2010-08-20
2010-08-04
À nettoyer, modifier, améliorer… Emprunté au snippet MediaWikiMarkup
Usage :
{{ object.html_text|createToc }}
Code :
```
from django.template import Library import re from django.template.defaultfilters import slugify, striptags
register = Library()
_headerPat = re.compile(ur"<Hh(.?)>(.?)", re.UNICODE) _tagPat = re.compile(ur"<.*?>", re.UNICODE)
def createToc(text, extractToc=None, noToc=None):
# Get all headlines for numbering them and adding funky stuff like [edit]
# links - this is for later, but we need the number of headlines right now
matches = _headerPat.findall(text)
numMatches = len(matches)
# if there are fewer than 4 headlines in the article, do not show TOC
# unless it's been explicitly enabled.
enoughToc = (numMatches >= 3)
# headline counter
headlineCount = 0
# Ugh .. the TOC should have neat indentation levels which can be
# passed to the skin functions. These are determined here
toc = []
head = {}
sublevelCount = {}
levelCount = {}
toclevel = 0
level = 0
prevlevel = 0
toclevel = 0
prevtoclevel = 0
refers = {}
refcount = {}
wgMaxTocLevel = 5
for match in matches:
headline = match[2]
if toclevel:
prevlevel = level
prevtoclevel = toclevel
level = matches[headlineCount][0]
if enoughToc:
if level > prevlevel:
toclevel += 1
sublevelCount[toclevel] = 0
if toclevel < wgMaxTocLevel:
toc.append(u'\n<ul class="toc">')
elif level < prevlevel and toclevel > 1:
# Decrease TOC level, find level to jump to
if toclevel == 2 and level < levelCount[1]:
toclevel = 1
else:
for i in range(toclevel, 0, -1):
if levelCount[i] == level:
# Found last matching level
toclevel = i
break
elif levelCount[i] < level:
toclevel = i + 1
break
if toclevel < wgMaxTocLevel:
toc.append(u"</li>\n")
toc.append(u"</ul>\n</li>\n" * max(prevtoclevel - toclevel, 0))
else:
if toclevel < wgMaxTocLevel:
toc.append(u"</li>\n")
levelCount[toclevel] = level
# count number of headlines for each level
sublevelCount[toclevel] += 1
# The canonized header is a version of the header text safe to use for links
canonized_headline = slugify(headline)
# strip out HTML
tocline = striptags(headline)
# Save headline for section edit hint before it's escaped
headline_hint = tocline
canonized_headline = slugify(tocline)
refers[headlineCount] = canonized_headline
# count how many in assoc. array so we can track dupes in anchors
if canonized_headline not in refers:
refers[canonized_headline] = 1
else:
refers[canonized_headline] += 1
refcount[headlineCount] = refers[canonized_headline]
# Create the anchor for linking from the TOC to the section
anchor = canonized_headline;
if refcount[headlineCount] > 1:
anchor += u'_' + unicode(refcount[headlineCount])
if enoughToc:
toc.append(u'\n<li class="toclevel-')
toc.append(unicode(toclevel))
toc.append(u'"><a href="#')
toc.append(anchor)
toc.append(u'">')
toc.append(u'<span class="toctext">')
toc.append(tocline)
toc.append(u'</span></a>')
# give headline the correct <h#> tag
if headlineCount not in head:
head[headlineCount] = []
h = head[headlineCount]
h.append(u'<h')
h.append(unicode(level))
h.append(u' id="')
h.append(anchor)
h.append('">')
h.append(matches[headlineCount][1].strip())
h.append(headline.strip())
h.append(u'</h')
h.append(unicode(level))
h.append(u'>')
headlineCount += 1
if enoughToc:
if toclevel < wgMaxTocLevel:
toc.append(u"</li>\n")
toc.append(u"</ul>\n</li>\n" * max(0, toclevel - 1))
#toc.insert(0, u'<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>')
toc.append(u'</ul>\n')
# split up and insert constructed headlines
if extractToc is not None:
full = []
if enoughToc :
full += toc
full = u''.join(full)
return full
else:
blocks = _headerPat.split(text)
i = 0
len_blocks = len(blocks)
full = []
while i < len_blocks:
j = i/4
full.append(blocks[i])
if enoughToc and not i :
if noToc is not None :
full += toc
toc = None
if j in head and head[j]:
full += head[j]
head[j] = None
i += 4
full = u''.join(full)
return full
"""
return text
"""
register.filter(createToc)
```
2010-07-29
2010-07-28
2010-07-27
2010-07-23
2010-07-22
2010-07-21
screen -S starts a new screen instance
screen -ls list running screen instances
screen -r attach to a specific screen instance
^a " list available windows
^a c create a new window and switch to it
^a n switch to the next window
^a p switch to the previous window
^a A rename the current window
^a d detach screen from the current terminal (programs will continue to run)
^a D Power detach and logout
^a ? help; show key bindings
^a k Kill the current window
2010-07-16
2010-07-16
2010-07-15
2010-07-15
The most interesting trend in the development of the Internet is not how it is changing people’s ways of thinking but how it is adapting to the way that people think
2010-07-12
Internet est la rencontre, la convergence, sinon la collision brutale, entre une longue et lente évolution technologique, des protocoles informatiques extrêmement arides et des usages humains
2010-07-08
2010-07-08
The goal of design is to efficiently solve problems. Design is based on the understanding of how user see the world, how they think and behave. And the toolset of the designer is broader than just colors and font-styles, as it also includes user-research, prototyping, usability testing, and more.
— UX Myths
2010-07-07
Floating is quite hard
2010-07-05
2010-07-05
python-tumblr has an issue with posting to a secondary tumblblog. abiomkhar suggested a simple patch : http://code.google.com/p/python-tumblr/issues/detail?id=4. If you read this, it just means that it works perfectly. As I’m posting this from my django admin.
2010-07-05
2010-07-01
2010-06-30
2010-06-23
2010-06-23
2010-06-17
2010-06-15
2010-06-07
2010-06-07
2010-06-06
This is everything we asked for but not what we wanted.
— (via clientsfromhell) (via nautilebleu)
2010-06-04
2010-06-04
2010-06-04
2010-06-04
2010-06-03
2010-06-02