Author: admin

Alexa, Launch Dhamma Talks

Dhamma Talks Logo

I had a few days to play with Amazon Alexa recently and ended up creating a Skill that randomly loads a Dhamma Talk (mp3 audio) by Thanissaro Bhikkhu.

The talks were dynamically pulled from DhammaTalks.org via PHP. I had to install FFMPEG to automatically re-encode them as many were quite old and not encoded in a way that Amazon liked.

It’s a very useful tool for people interested in Thanissaro Bhikkhu. Thanissaro Bhikkhu is probably the west’s greatest contributor of Pali to English translations of the Pali Canon. He is also the author of several highly respected books.

It nice to see how easy it can be to leverage Amazon’s Alexa.

More info here: Dhamma Talks

Mr. Snerfy

The Persistence of Memory

tumblr_ml1g7zuOAn1s99jz9o1_1280[1]

Some times it’s fun to draw or paint and take a break from coding.

The above is a vector illustration of Salvador Dali’s famous painting The Persistence of Memory. I included a character I developed named Mr. Snerfy in Dali’s wonderful painting. I enjoy Mr. Snerfy sooo much, but haven’t quite found him a home yet. I have over 50 pages written about him in a book and many illustrations for a children’s app that’s intended to convey basic Buddhist concepts in a playful way. I haven’t quite got their yet. Some day maybe I’ll finish one or the other.

Here’s another of the illustrations:

tumblr_mlci84PGxi1s99jz9o1_1280[1]

Yes. I do love grapefruit and so does Mr. Snerfy.

He is also and avid meditator. In this animated GIF he attempts to describe Jhanna…

tumblr_n4ta4xEJRD1s99jz9o1_500[1]

There are many other illustrations of Mr. Snerfy at MrSnerfy.com.

Click for more illustrations and Gifs at MrSnerfy.com

ENABLE COMPRESSION

SEO is more competitive than ever and the days of spamming Google are pretty much gone. Search engine companies have done an excellent job of helping users find the most relevant returns for a given query. They simply know what good content is and, for the most part, they know how to filter out the garbage. To rank well, you have to provide truly valuable content.

In addition to providing something useful, you have to provide it a way that respects mobile devices and is FAST.

Taking the time to refine site speed has pretty big payoffs and may be the thing that puts you above your competition. There are many things that can be done (minifying js/css/html, minimize server requests, sprite sheets etc…), and time permitting I’ll go into more detail, but this particular post is about one thing – compression.

Enable Compression

Google’s PageSpeed Insights will let you know if your site is not using compression. As of January 2015, it is likely that you are not.

So how do we enable compression?

I’m a LAMP guy. Linux/Apache/MySQL/PHP. If you are too, chances are mod_deflate is already enabled. I assume you know how to use phpinfo() to determine how your site is configured.

Enabling mod_deflate is only part of what needs to happen. You also need to edit .htaccess.

A quick search on StackOverflow reveals this post: http://stackoverflow.com/questions/12367858/how-can-i-get-apache-gzip-compression-to-work

Of all the suggestions, Oussama’s is the one that worked for me. Simply add this to your .htaccess file:

# Enable GZIP

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
####################
# GZIP COMPRESSION #
####################
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
Header append Vary User-Agent env=!dont-vary

Now use PageSpeed Insights to review your site again. You should see that you’ve made Google happy and your site score improved.