This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # BEGIN mod headers | |
| <IfModule mod_headers.c> | |
| Header set Connection keep-alive | |
| </IfModule> | |
| # END mod headers | |
| # BEGIN compress text, html, javascript, css, xml: | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE text/plain |
| def chop(target, ordered_array) | |
| # Wrap ordered array with an array if it has not been wrapped | |
| ordered_array = [ordered_array, 0] if !ordered_array[0].is_a?(Array) | |
| sub_array = ordered_array[0] | |
| total_sliced_from_left = ordered_array[1] | |
| # no matches found | |
| return -1 if sub_array.empty? || sub_array.size == 1 && sub_array[0] != target | |
| middle = sub_array.size / 2 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # If this were for purposes of cleaning out | |
| # offensive words it would be easier to just use gsub | |
| # but in this case we want to preserve things like "bigger" | |
| # when searching for "big" | |
| # also the challenge was using an array as the second argument | |
| # where this takes an unlimited number of params. Each param passed | |
| # after the first is a string we want to obfuscate | |
| # Alternative solution below that allows the words param to be |
| <?php | |
| /** | |
| * Automatically minifies style.css and writes output to style.min.css | |
| * | |
| * @author Justin Tallant | |
| * @param boolean $minification_is_on when true ends execution of the function | |
| * @return void | |
| * @link http://justintallant.com/switching-between-minified-and-non-minified-css-and-js-files-in-wordpress/ | |
| */ |
| # compress text, html, javascript, css, xml: | |
| AddOutputFilterByType DEFLATE text/plain | |
| AddOutputFilterByType DEFLATE text/html | |
| AddOutputFilterByType DEFLATE text/xml | |
| AddOutputFilterByType DEFLATE text/css | |
| AddOutputFilterByType DEFLATE application/xml | |
| AddOutputFilterByType DEFLATE application/xhtml+xml | |
| AddOutputFilterByType DEFLATE application/rss+xml | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/x-javascript |
python -V make sure that is a capital V
If you are less than 2.6 then you need to install a newer version of Python but don't worry it's easy.
First off you need to recognize yum’s dependency on Python 2.4. Simply replacing this will break your passing semblance of a package manager. We will be using this later so not breaking is the preferred path. Python versions can live in relative harmony together. Download the Python source and untar it to some directory. I use /opt or ~/source for all of my non-native additions. You can choose whatever you want.
| <?php | |
| $jt_use_minified_files = true; | |
| add_filter( 'stylesheet_uri', 'child_stylesheet_uri', 10, 2 ); | |
| function child_stylesheet_uri($stylesheet_uri, $stylesheet_dir_uri) { | |
| global $jt_use_minified_files; | |
| if ( true == $jt_use_minified_files ) { |
| <html> | |
| <head> | |
| <title>Checkbox</title> | |
| <style> | |
| input[type=checkbox] { | |
| display:none; | |
| } | |
| #car + label, |