This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fix local permissions to enable ftp/upload operations. | |
| # APACHEUSER = user defined in `/private/etc/apache2/httpd.conf` | |
| sudo chown -R APACHEUSER wp-content | |
| sudo chmod -R g+w wp-content | |
| sudo chown -R APACHEUSER wp-admin | |
| sudo chmod -R g+w wp-admin | |
| sudo apachectl restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # tested on macOS 10.13.4 | |
| # file system created time | |
| ## make sure developer tools are installed with `xcode-select --install` | |
| ## time format: MM/DD/YYYY HH:MM:SS | |
| SetFile -d "12/01/2002 00:00:00" *.jpg | |
| # file system modified date | |
| ## (sometimes recognized by Google Photos as date taken) | |
| ## time format: [CC]YYMMDDhhmm[ss] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add another . for 4-letter file extensions | |
| ls -1 | sed -e 's/\....\*$//' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 301 Redirects for .htaccess | |
| # Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| # Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| # Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Caching | |
| # http://davidwalsh.name/html5-boilerplate-htaccess | |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| ExpiresDefault "access plus 1 month" | |
| # CSS | |
| ExpiresByType text/css "access plus 1 year" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Format a date like YYYY-MM-DD. | |
| * | |
| * @param {string} template | |
| * @param {Date=} [date] | |
| * @return {string} | |
| * @license MIT | |
| */ | |
| function formatDate(template, date) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import fileinput | |
| import re | |
| ## | |
| # Extract email addresses from file or `stdin` | |
| # | |
| # Prints out a standard list of email address substrings contained in `fileinput` | |
| # Call on a file or pipe to `stdin` | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # write date created to date modified | |
| ## `GetFileInfo -d $file` gives us 01/28/2007 22:56:00 | |
| # we need "YYYYMMDDhhmm" for `touch -mt` to set modification time | |
| set tally 0 | |
| for file in (find ./ -maxdepth 1) | |
| set dateString "" # final result goes here | |
| set cuts "7-10" "1-2" "4-5" "12-13" "15-16" # string indices to extract | |
| for cut in $cuts | |
| set dateString $dateString(GetFileInfo -d $file | cut -c $cut) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import fileinput | |
| import re | |
| ## | |
| # Extract URLs from file or `stdin` | |
| # | |
| # Prints out a standard list of url address substrings contained in `fileinput` | |
| # Call on a file or pipe to `stdin` | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.onload = function(){ | |
| c = document.getElementById("myCanvas"); | |
| cc = c.getContext("2d"); | |
| setInterval(update, 1000/30); | |
| }; | |
| var c = document.getElementById("myCanvas"); | |
| var cacX1 = 960; | |
| var dy = document.getElementById("myCanvas").height - 60; | |
| var speed = -1; | |
| var drop = -7; |