Mako template for city index
.. code-block:: mako
<%inherit file=“base.mako” />
<div class=“grid=”15”>
There are ${count} cities in ${state[‘name’].title()} to browse:
<% letters = ‘abcdefghijklmnopqrstuvwxyz’%>
% endfor
</ul>
% endif
% endfor
.. code-block:: python
class Bread( object ): ““” Create a list of URL parts or crumbs —————————————- >>> from bread import Bread >>> bread = Bread(“http://www.foxhop.net/samsung/HL-T5087SA/red-LED-failure”) >>> print bread.crumbs >>> print bread.links
"""
def __init__( self, url=None ):
if url: self.url = url # invoke url.setter
else: self._url = url # set _url to none
@property
def url( self ):
return self._url
@url.setter
def url( self, url ):
if url.startswith( 'http://' ): url = url[ 7: ] # remove http:// if exists
if url.startswith( 'https://' ): url = url[ 8: ] # remove https:// if exists
self._url = url.rstrip('/')
self.crumbs = self._url.split('/')
@property
def links( self ):
links = []
count = 0
for crumb in self.crumbs:
string = ""
for c in range( count + 1 ):
string = string + self.crumbs[c] + '/'
count += 1
string = string.rstrip('/')
links.append('<a href="http://' + string + '">' + crumb + '</a>')
return links
EXAMPLE OUTPUT
.. code-block:: python
[‘foxhop.net’, ‘os’, ‘linux’, ‘ubuntu’]
[‘foxhop.net’, ‘os’, ‘linux’, ‘ubuntu’]
.. code-block:: sql
CREATE TABLE game ( id VARCHAR(16) NOT NULL, user1_id VARCHAR(16), user2_id VARCHAR(16), token CHAR(1), turn_id VARCHAR(16), winner_id VARCHAR(16), createdate DATETIME, modifydate DATETIME, board BLOB NOT NULL, PRIMARY KEY (id), FOREIGN KEY(user1_id) REFERENCES user (id), FOREIGN KEY(user2_id) REFERENCES user (id), FOREIGN KEY(turn_id) REFERENCES user (id), FOREIGN KEY(winner_id) REFERENCES user (id) )
CREATE TABLE user ( id VARCHAR(16) NOT NULL, name VARCHAR(32), email VARCHAR(32), PRIMARY KEY (id) )
.. code-block:: sql
CREATE TABLE game ( id VARCHAR(16) NOT NULL, token CHAR(1), turn_id VARCHAR(16), winner_id VARCHAR(16), createdate DATETIME, modifydate DATETIME, board BLOB NOT NULL, PRIMARY KEY (id), FOREIGN KEY(turn_id) REFERENCES user (id), FOREIGN KEY(winner_id) REFERENCES user (id) )
CREATE TABLE user ( id VARCHAR(16) NOT NULL, name VARCHAR(32), email VARCHAR(32), PRIMARY KEY (id) )
CREATE TABLE usergame( id VARCHAR(16) NOT NULL, user_id VARCHAR(16), game_id VARCHAR(16), PRIMARY KEY (id) FOREIGN KEY(user_id) REFERENCES user (id), FOREIGN KEY(game_id) REFERENCES game (id), )
http://www.shanghaiwebhosting.com/web-hosting-tips/a-few-useful-linux-ssh-commands-to-show-and-monitor-server-resources-memory-disk-usage
uptime
df
free or free -m
ps -ef
w
tload
like it ?
.. code-block:: bash
(env)$ pserve development.ini
test
Another test
This is pretty sweet I think, and yes, I like it.
Thanks for that
chooper <http://www.foxhop.net/account/chooper>_! I’m
sure this will come in handy for somebody.