<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkUERn44eyp7ImA9WhRaGE4.&quot;"><id>tag:blogger.com,1999:blog-12432169</id><updated>2012-02-21T23:30:07.033+08:00</updated><category term="van.static" /><category term="hack" /><category term="google analytics" /><category term="emacs" /><category term="django" /><category term="python" /><category term="pyramid" /><title>canb.net</title><subtitle type="html">A European geek living in Singapore.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.canb.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.canb.net/" /><author><name>Vehbi Sinan Tunalioglu</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-7W9O-T8TnQA/AAAAAAAAAAI/AAAAAAAAAiI/PlIFJeEZ-m0/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/canburak" /><feedburner:info uri="canburak" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkUERn4yfSp7ImA9WhRaGE4.&quot;"><id>tag:blogger.com,1999:blog-12432169.post-2375193174236340921</id><published>2012-02-22T20:07:00.000+08:00</published><updated>2012-02-21T23:30:07.095+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-21T23:30:07.095+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="emacs" /><title>Emacs buffer coding system and fixing the new line characters</title><content type="html">&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
I had an old blog post which I've demoted as draft because it is in Turkish. I am rewriting it in English.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-SfKHycXZhUc/T0Dgl07t3iI/AAAAAAAANUY/GD1_na8q31M/s1600/Selection_023.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="109" src="http://4.bp.blogspot.com/-SfKHycXZhUc/T0Dgl07t3iI/AAAAAAAANUY/GD1_na8q31M/s200/Selection_023.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
If emacs doesn't recognize the encoding of your file, you can give is some tips to recognize it. For example, see the shot on the left; I have a file encoded as "iso-8859-9" but emacs is unable to display it properly .&lt;br /&gt;
&lt;br /&gt;
The solution is not hard. You do a&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;C-x RET c iso-8859-9&lt;/span&gt;, followed by &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;C-x C-f&lt;/span&gt;, and you now have a properly encoded buffer. To save this file in utf-8, you do a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;C-x RET c utf-8 C-x C-w&lt;/span&gt;. If you have a problem with line coding, append a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;-dos&lt;/span&gt;, &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;-unix&lt;/span&gt; or &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;-mac&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; while reading or writing the file.&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12432169-2375193174236340921?l=www.canb.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/canburak/~4/DVIcRZ3ItQU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.canb.net/feeds/2375193174236340921/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.canb.net/2009/02/emektar-iconv-yerine-emacs.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/2375193174236340921?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/2375193174236340921?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/canburak/~3/DVIcRZ3ItQU/emektar-iconv-yerine-emacs.html" title="Emacs buffer coding system and fixing the new line characters" /><author><name>Can Burak Cilingir</name><uri>https://profiles.google.com/102256701535606126082</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-1RFljqTMiXg/AAAAAAAAAAI/AAAAAAAANOM/Ma0SYUwfMlw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-SfKHycXZhUc/T0Dgl07t3iI/AAAAAAAANUY/GD1_na8q31M/s72-c/Selection_023.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.canb.net/2009/02/emektar-iconv-yerine-emacs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EFQHo_cSp7ImA9WhRaFkg.&quot;"><id>tag:blogger.com,1999:blog-12432169.post-5404176597159245247</id><published>2012-02-18T03:23:00.000+08:00</published><updated>2012-02-19T21:53:31.449+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-19T21:53:31.449+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hack" /><title>Story of an analog POS</title><content type="html">&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-h63lrj5ASGM/Tz6ntsQr3kI/AAAAAAAANO8/sYsLlWT8f0w/s1600/Verifone_Vx_510_credit_card_terminal.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="178" src="http://1.bp.blogspot.com/-h63lrj5ASGM/Tz6ntsQr3kI/AAAAAAAANO8/sYsLlWT8f0w/s200/Verifone_Vx_510_credit_card_terminal.jpg" width="200" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;VeriFone Vx 510&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;I like to read Paul Venezia's blog from time to time. He talks about things like &lt;a href="http://www.infoworld.com/d/data-center/why-arent-we-finally-rid-of-patch-cables-186249?page=0,1"&gt;...dealing with 112 MRJ21 cables...&lt;/a&gt; or &lt;a href="http://www.infoworld.com/d/data-center/what-it-should-know-about-ac-power-177345?page=0,1"&gt;...C19-to-L6-20 cable that will deliver 208v 20-amp...&lt;/a&gt;. Recently he wrote &lt;a href="http://www.infoworld.com/d/data-center/it-guy-wanted-must-have-own-tools-185628"&gt;IT guy wanted; must have own tools&lt;/a&gt; which I remembered today when dealing with the problem I'll talk about below.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;Some of my work involves &lt;a href="http://www.brandsfever.com/"&gt;Brandsfever&lt;/a&gt;, which is a private shopping club in Singapore. Tomorrow we'll have an offline sales event and I was unable to resist the idea of playing with a new toy, &lt;a href="http://www.verifone.com/countertop/vx510.aspx"&gt;VeriFone Vx 510&lt;/a&gt;. When I had the device, I was ready to plug it to my laptop via one of my cisco console cables. Remembering how lucky guy I am, things didn't go smooth and we realized that the device needs to operate on a good old analog phone line. I was expecting at least a SIM card or may be some Wi-Fi but I am still thankful that we don't have to use a credit card imprint device.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;It didn't took long to realize that we are using &lt;a href="http://www.elastix.org/"&gt;Elastix&lt;/a&gt; and we do not have any analog lines. Thankfully Melvin found a &lt;a href="http://en.wikipedia.org/wiki/Linksys_PAP2"&gt;Linksys PAP2&lt;/a&gt; buried in the IT drawer and configured it which provides us an analog line. After spending some time with the device we were able to charge my card 0.01$. We were ready for the event... A phone call disturbed my dream. We won't have a line in the event's place. I love problems to stack up. Thankfully I have my &lt;a href="https://plus.google.com/107124435011904335651/posts/DWi23MNk7jd"&gt;GPL'd portable wireless router&lt;/a&gt; which makes me the type of IT guy Venezia want. After spending some time configuring Elastix and the Linksys device to work together over 3g, I've succeded to charge my credit card without a real phone line.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;Hopefully, if you come to visit out event at &lt;a href="https://www.facebook.com/events/351464508221741/"&gt;111 Somerset&lt;/a&gt;&amp;nbsp;tomorrow, your card will be charged over a POS device which connects to the bank over a 3g connection with the help of a USB dongle connected to a wireless router, a Linksys PAP2 device and an Elastix server located in our office. It makes me feel like a&amp;nbsp;&lt;a href="http://www.catb.org/~esr/faqs/hacker-howto.html"&gt;hacker&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;Please SingTel, don't let us down! And thanks to&amp;nbsp;&lt;/span&gt;Venezia for the inspiration to write this post.&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;i&gt;Update: After a couple of charges over this system, luckily we were able to use a real phone line and switched back to the real analog for our charges. Now, I want to connect this to a computer.&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12432169-5404176597159245247?l=www.canb.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/canburak/~4/sVqKdvkc_CI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.canb.net/feeds/5404176597159245247/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.canb.net/2012/02/story-of-analog-pos.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/5404176597159245247?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/5404176597159245247?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/canburak/~3/sVqKdvkc_CI/story-of-analog-pos.html" title="Story of an analog POS" /><author><name>Can Burak Cilingir</name><uri>https://profiles.google.com/102256701535606126082</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-1RFljqTMiXg/AAAAAAAAAAI/AAAAAAAANOM/Ma0SYUwfMlw/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-h63lrj5ASGM/Tz6ntsQr3kI/AAAAAAAANO8/sYsLlWT8f0w/s72-c/Verifone_Vx_510_credit_card_terminal.jpg" height="72" width="72" /><thr:total>0</thr:total><georss:featurename>20 Sin Ming Ln, Singapore 573968</georss:featurename><georss:point>1.358098 103.833351</georss:point><georss:box>1.3561135 103.8308835 1.3600825 103.83581849999999</georss:box><feedburner:origLink>http://www.canb.net/2012/02/story-of-analog-pos.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UERXY9fCp7ImA9WhRVFko.&quot;"><id>tag:blogger.com,1999:blog-12432169.post-5894787632231591393</id><published>2012-01-16T10:00:00.000+08:00</published><updated>2012-01-16T10:00:04.864+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-16T10:00:04.864+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google analytics" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Push data to Google Analytics with Python</title><content type="html">I'll share with you how to push data to Google Analytics with a simple Python example. You can collect/plot/analyze some interesting data:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;If you have a programmable door lock in the office, you can track employees' office hours.&lt;/li&gt;
&lt;li&gt;Track the commits of your team. Tag with branch/hash etc.&lt;/li&gt;
&lt;li&gt;Track your own computer usage&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Google Analytics is mostly used with a JavaScript snippet on the client side but if you browse the documentation, you'll see that they also provide&amp;nbsp;&lt;a href="http://code.google.com/apis/analytics/docs/mobile/overview.html"&gt;mobile tracking&lt;/a&gt;&amp;nbsp;features which help you to collect data without a web browser or even if the client doesn't support JavaScript.&lt;br /&gt;
&lt;br /&gt;
Basically, mobile client displays an image which is served by a server-side script hosted by you and the script pushes the visit data to Google via GET request. The parameters of this method is listed on the&amp;nbsp;&lt;a href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html#gifParameters"&gt;Troubleshooting the Tracking Code&lt;/a&gt;&amp;nbsp;section of the documentation.&lt;br /&gt;
&lt;br /&gt;
After looking at this list, &lt;a href="http://code.google.com/apis/analytics/docs/mobile/download.html#Download_the_Google_Analytics_server_side_package"&gt;PHP/Perl codes provided by Google&lt;/a&gt;&amp;nbsp;with&amp;nbsp;some trial and error I've found the minimum parameters to push data.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;utmwv&lt;/b&gt;, tracking code version.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;The latest version at the time of this writing is&amp;nbsp;5.2.2d.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;b&gt;utmn&lt;/b&gt;, unique ID generated for each GIF request to prevent caching of the GIF image.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Example value in the documentation is 10 digits so stick to maximum of 10 digits.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;b&gt;utmp&lt;/b&gt;, requested path of the current page.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;utmac&lt;/b&gt;, account string (property id).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;utmcc&lt;/b&gt;, &amp;nbsp;cookie values.&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;__utma&lt;/b&gt;&amp;nbsp;is required. These 2 posts&amp;nbsp;&lt;a href="http://www.analytics-ninja.com/blog.html"&gt;discusses&lt;/a&gt; &lt;a href="http://www.randycullom.com/chatterbox/archives/2008/10/google_analytic.html"&gt;this cookie&lt;/a&gt; in detail.&lt;/li&gt;
&lt;li&gt;"1" can be used for each part except unique visitor id.&lt;/li&gt;
&lt;li&gt;For the visitor id, you can generate something unique for each visitor which doesn't change between visits. The safe assumption for the length of the id 10 because google Analytics itself uses around 10 digits.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div&gt;
After this data is generated, simply request &lt;a href="http://www.google-analytics.com/__utm.gif"&gt;http://www.google-analytics.com/__utm.gif&lt;/a&gt;&amp;nbsp;with these parameters in the query string.&lt;br /&gt;
&lt;br /&gt;
Here is the proof of concept Python code:&lt;br /&gt;
&lt;script src="https://gist.github.com/1593381.js?file=ga.py"&gt;
&lt;/script&gt;
&lt;br /&gt;
If you read this post from any non-js environment, you can visit&amp;nbsp;&lt;a href="https://gist.github.com/1593381"&gt;the gist for this code&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I've provided you the bare minimum. Now you can add more variables and track whatever you need. Don't forget to share your hack in the comments.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12432169-5894787632231591393?l=www.canb.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/canburak/~4/i7AsH-_9CRI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.canb.net/feeds/5894787632231591393/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.canb.net/2012/01/push-data-to-google-analytics-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/5894787632231591393?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/5894787632231591393?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/canburak/~3/i7AsH-_9CRI/push-data-to-google-analytics-with.html" title="Push data to Google Analytics with Python" /><author><name>Can Burak Cilingir</name><uri>https://profiles.google.com/102256701535606126082</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-1RFljqTMiXg/AAAAAAAAAAI/AAAAAAAANOM/Ma0SYUwfMlw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><georss:featurename>Singapore</georss:featurename><georss:point>1.352083 103.819836</georss:point><georss:box>1.098096 103.503979 1.6060699999999999 104.13569299999999</georss:box><feedburner:origLink>http://www.canb.net/2012/01/push-data-to-google-analytics-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08NQHo8eCp7ImA9WhRVEko.&quot;"><id>tag:blogger.com,1999:blog-12432169.post-2804356628424164189</id><published>2012-01-11T17:53:00.000+08:00</published><updated>2012-01-11T17:58:11.470+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T17:58:11.470+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pyramid" /><category scheme="http://www.blogger.com/atom/ns#" term="van.static" /><title>How to serve static files with Pyramid</title><content type="html">&lt;p&gt;If you want to host your &lt;a href="http://www.pylonsproject.org/"&gt;Pyramid&lt;/a&gt; static files in s3 or compile everything to a local folder, just like &lt;a href="https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic"&gt;Django's collectstatic&lt;/a&gt;, &lt;a href="https://github.com/jinty/van.static"&gt;van.static&lt;/a&gt; is to the rescue.&lt;/p&gt;

&lt;p&gt;Before going further, ensure that all of your statics are resolved from the request object and any references from CSSs use relative paths. A Mako example would be: &lt;code&gt;${request.static_url("app:static/image.png")}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Install van.static to your virtual environment with &lt;code&gt;pip install van.static&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Setup van.static in your app's entry point:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;from van.static import cdn
static_resources = (('static', 'app:static'),)
cdn.config_static(config,
                  static_resources,
                  static_cdn=settings.get("static_cdn"))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you want to collect all static files together:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;python -m van.static.cdn --target=file:///srv/static/myapp/ --resource="app:static"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;van.static has 2 modes:
&lt;dl&gt;
&lt;dt&gt;Development mode&lt;/dt&gt;&lt;dd&gt;If you do not provide it a static_cdn parameter, it serves everything via Pyramid's static view.&lt;/dd&gt;
&lt;dt&gt;Production mode&lt;/dt&gt;&lt;dd&gt;If you provide the parameter, it simply generates unique urls for each version of your application, prefixing the given URL.&lt;/dd&gt;&lt;/p&gt;
&lt;/dl&gt;

&lt;p&gt;The software is not even a month old but already can compress files with YUI compressor and seems to be pretty usable.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12432169-2804356628424164189?l=www.canb.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/canburak/~4/Rn93vwUkbEk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.canb.net/feeds/2804356628424164189/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.canb.net/2012/01/how-to-serve-static-files-with-pyramid.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/2804356628424164189?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/2804356628424164189?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/canburak/~3/Rn93vwUkbEk/how-to-serve-static-files-with-pyramid.html" title="How to serve static files with Pyramid" /><author><name>Can Burak Cilingir</name><uri>https://profiles.google.com/102256701535606126082</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-1RFljqTMiXg/AAAAAAAAAAI/AAAAAAAANOM/Ma0SYUwfMlw/s512-c/photo.jpg" /></author><thr:total>0</thr:total><georss:featurename>Singapore</georss:featurename><georss:point>1.352083 103.819836</georss:point><georss:box>1.098096 103.503979 1.6060699999999999 104.13569299999999</georss:box><feedburner:origLink>http://www.canb.net/2012/01/how-to-serve-static-files-with-pyramid.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMMQHY9fip7ImA9WhRVE00.&quot;"><id>tag:blogger.com,1999:blog-12432169.post-8010640932368927289</id><published>2010-01-06T07:51:00.000+08:00</published><updated>2012-01-12T00:48:01.866+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-12T00:48:01.866+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="django" /><title>Automatically decorating all views of a django project</title><content type="html">Now the real thing, a middleware for &lt;a href="http://www.djangoproject.com/"&gt;Django&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This middleware auto-decorates each view function in a view module (views.py, or views/) with the decorators defined in settings.py.&lt;br /&gt;
&lt;br /&gt;
An example setting is:&lt;br /&gt;
&lt;script src="https://gist.github.com/1578349.js?file=settings.py"&gt;
&lt;/script&gt;
&lt;br /&gt;
Think this middleware as a firewall.&amp;nbsp; Whether you decorated your view functions or not, this ensures that your content is protected by using the decorators.&lt;br /&gt;
&lt;br /&gt;
Note that this middleware needs to be at the end of the middlewares list because it always return an HttpResponse by calling the view function; which means no other middleware after this is executed.&lt;br /&gt;
&lt;br /&gt;
Here is the function:&lt;br /&gt;
&lt;script src="https://gist.github.com/1578349.js?file=middleware.py"&gt;
&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12432169-8010640932368927289?l=www.canb.net' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/canburak/~4/z-jUi_bUGYM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.canb.net/feeds/8010640932368927289/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.canb.net/2010/01/automatically-decorating-all-views-of.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/8010640932368927289?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12432169/posts/default/8010640932368927289?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/canburak/~3/z-jUi_bUGYM/automatically-decorating-all-views-of.html" title="Automatically decorating all views of a django project" /><author><name>Can Burak Cilingir</name><uri>https://profiles.google.com/102256701535606126082</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-1RFljqTMiXg/AAAAAAAAAAI/AAAAAAAANOM/Ma0SYUwfMlw/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.canb.net/2010/01/automatically-decorating-all-views-of.html</feedburner:origLink></entry></feed>

