Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| var writeData = function (filename, data, callback) { | |
| var writeOutData = function () { | |
| var fw = new FileWriter(); | |
| fw.oncomplete = callback; | |
| fw.onerror = function () { | |
| alert("Failed to save update"); | |
| } | |
| fw.writeAsText("myDir/" + filename, data); | |
| } | |
| /** | |
| * Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers | |
| * @author ShirtlessKirk. Copyright (c) 2012. | |
| * @license WTFPL (http://www.wtfpl.net/txt/copying) | |
| */ | |
| var luhnChk = (function (arr) { | |
| return function (ccNum) { | |
| var | |
| len = ccNum.length, | |
| bit = 1, |
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| <!DOCTYPE html> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <meta name="robots" content="noodp, noydir" /> | |
| <link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> | |
| <link rel="canonical" href="http://mysite.com/" /> | |
| <link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" /> |
| [prefix] is needed to push the new users/usermeta values outside of the range already populated in the database, usually for a site with an ID of 40 using 40,000 will work pretty well (unless some of your sites have a lot of users). | |
| UPDATE wp_users | |
| SET ID = ID + [prefix] | |
| // Add two columns to the end of the wp_users table, spam and deleted. Both are TINYINT(2). | |
| UPDATE wp_usermeta | |
| SET user_id = user_id + [prefix] | |
| <?php | |
| add_filter('rocket_htaccess_mod_expires', 'wp_rocket_remove_html_expire_dreampress'); | |
| /** | |
| * Remove expiration on HTML to prevent issue with Varnish cache | |
| * | |
| * @param string $rules htaccess rules. | |
| * @return Updated htaccess rules | |
| */ | |
| function wp_rocket_remove_html_expire_dreampress( $rules ) { |