Let Google cache and resize your images.
Resized and Cached:
Original:
| #!/bin/bash | |
| #Force file syncronization and lock writes | |
| mongo admin --eval "printjson(db.fsyncLock())" | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| MONGO_HOST="prod.example.com" | |
| MONGO_PORT="27017" | |
| MONGO_DATABASE="dbname" | |
| <?php | |
| /** | |
| * Lazy Database connection class - API version | |
| * | |
| * The database is not actually opened until we execute a query | |
| * | |
| * @author David Knape | |
| */ | |
| class DBConnection |
| <?php | |
| $currency_symbols = array( | |
| 'AED' => 'د.إ', // ? | |
| 'AFN' => 'Af', | |
| 'ALL' => 'Lek', | |
| 'AMD' => '', | |
| 'ANG' => 'ƒ', | |
| 'AOA' => 'Kz', // ? | |
| 'ARS' => '$', | |
| 'AUD' => '$', |
| server { | |
| listen *:80; | |
| server_name www.example.com; | |
| rewrite ^(.*) http://example.com $1 permanent; | |
| } | |
| server { | |
| listen *:80; | |
| server_name example.com; |
| <?php | |
| /** | |
| * @param $baseUrl - non protected part of the URL including hostname, e.g. http://example.com | |
| * @param $path - protected path to the file, e.g. /downloads/myfile.zip | |
| * @param $secret - the shared secret with the nginx server. Keep this info secure!!! | |
| * @param $ttl - the number of seconds until this link expires | |
| * @param $userIp - ip of the user allowed to download | |
| * @return string | |
| */ |
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| #! /bin/bash | |
| # https://gist.github.com/fwolf/5856230 | |
| #ps aux --width 80 | sort -nrk +6 | head -n 15 | |
| # bsdtime is shorter than cputime, hh:mm:ss vs MMM:SS | |
| ps -eo 'user,pid,%cpu,%mem,rss,vsz,stime,bsdtime,s,cmd' --sort '-rss,-vsz' --width 80 | head -n 16 | |
| echo | |
| <?php | |
| // @source: http://www.paulund.co.uk/resize-image-class-php | |
| /** | |
| * Resize image class will allow you to resize an image | |
| * | |
| * Can resize to exact size | |
| * Max width size while keep aspect ratio | |
| * Max height size while keep aspect ratio | |
| * Automatic while keep aspect ratio |
Let Google cache and resize your images.
Resized and Cached:
Original:
| #!/bin/bash | |
| echo "*** SVG 2 ICNS ***" | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: svg2icns filename.svg" | |
| exit 100 | |
| fi | |
| filename="$1" | |
| name=${filename%.*} | |
| ext=${filename##*.} | |
| echo "processing: $name" |