Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Rick Olson http://techno-weenie.net

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

measure map tags for typo

See my associated blog post.

   1  
   2  # /app/views/articles/_article.rhtml
   3  <script type="text/javascript"><!--
   4  if(!mmposts){var mmposts=[];}mmposts[mmposts.length]="<%= article.id %>";
   5  //--></script>
   6  <!-- mmp mmid:<%= article.id %> mmdate:<%= article.created_at.to_s(:db) %> mmurl:<%=h article_url(article, true) %> mmtitle:<%=h article.title %> -->
   7  
   8  # /app/views/articles/_comment.rhtml
   9  <script type="text/javascript"><!--
  10  if(!mmcomments){var mmcomments=[];}mmcomments[mmcomments.length]="<%= comment.id %>";
  11  //--></script>
  12  <!-- mmc mmid:<%= comment.id %> mmdate:<%= comment.created_at.to_s(:db) %> mmauthor:<%=h comment.author %> -->
  13  
  14  # /app/views/articles/read.rhtml
  15  # This is the same as the _article.rhtml snippet, but using the @article instance var instead of the article local var
  16  <script type="text/javascript"><!--
  17  if(!mmposts){var mmposts=[];}mmposts[mmposts.length]="<%= @article.id %>";
  18  //--></script>
  19  <!-- mmp mmid:<%= @article.id %> mmdate:<%= @article.created_at.to_s(:db) %> mmurl:<%=h article_url(@article, true) %> mmtitle:<%=h @article.title %> -->
  20  </div>


There's also a javascript include to add to the bottom of your typo theme, but there's no customization required...

redirecting wordpress xml links to typo in lighttpd

Update: go for the simplest regex possible...

   1  $HTTP["host"] =~ "awesomerailsapp.com" {
   2    server.error-handler-404 = "/dispatch.fcgi"
   3    server.document-root = "/awesomerailsapp/public/"
   4    url.redirect = (
   5      "^/feed/atom" => "http://awesomerailsapp.com/xml/atom/feed.xml",
   6      "^/feed" => "http://awesomerailsapp.com/xml/rss/feed.xml",
   7      "^/wp-rss2\.php" => "http://awesomerailsapp.com/xml/rss/feed.xml",
   8      "^/wp-atom\.php" => "http://awesomerailsapp.com/xml/atom/feed.xml",
   9      # my wp article format to typo's
  10      "^/(\d{4})/(\d{2})/(\d{2})/([\w-_]+)" => "/articles/$1/$2/$3/$4"
  11    )
  12  
  13    # bring on the rest of the config
  14  }
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS