Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| <?php | |
| /** | |
| * Name: Attachments Metabox Uploader | |
| * Author: Jared Williams - http://new2wp.com | |
| * Description: This is for adding a custom metabox to post types which enables you to add/remove | |
| * post attachments that you can upload and enter the meta information for right on the edit page. | |
| * Version: 0.1.0 | |
| * | |
| * Notes: In order to add this to a post type you need to find the word 'product' and replace it with * whatever the post type is you want to use it on. | |
| */ |
| // Takes a credit card string value and returns true on valid number | |
| function valid_credit_card(value) { | |
| // Accept only digits, dashes or spaces | |
| if (/[^0-9-\s]+/.test(value)) return false; | |
| // The Luhn Algorithm. It's so pretty. | |
| let nCheck = 0, bEven = false; | |
| value = value.replace(/\D/g, ""); | |
| for (var n = value.length - 1; n >= 0; n--) { |
| // encode(decode) html text into html entity | |
| var decodeHtmlEntity = function(str) { | |
| return str.replace(/&#(\d+);/g, function(match, dec) { | |
| return String.fromCharCode(dec); | |
| }); | |
| }; | |
| var encodeHtmlEntity = function(str) { | |
| var buf = []; | |
| for (var i=str.length-1;i>=0;i--) { |
| /* arrows */ | |
| .arrow-right {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAJUlEQVR42mNgAILy8vL/DLgASBKnApgkVgXIkhgKiNKJ005s4gDLbCZBiSxfygAAAABJRU5ErkJggg==") no-repeat scroll 0 0 transparent} | |
| .arrow-bottom {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAG0lEQVR42mNgwAfKy8v/48I4FeA0AacVDFQBAP9wJkE/KhUMAAAAAElFTkSuQmCC") no-repeat scroll 0 0 transparent} |
| String.prototype.extract = function(prefix, suffix) { | |
| s = this; | |
| var i = s.indexOf(prefix); | |
| if (i >= 0) { | |
| s = s.substring(i + prefix.length); | |
| } | |
| else { | |
| return ''; | |
| } | |
| if (suffix) { |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545
| // Set up "namespace." | |
| var APP = APP || {}; | |
| // `Shared settings. | |
| //---------------------------------------------------------------------------------------------------- | |
| APP.config = APP.config || {}; | |
| // How long to keep cache, in minutes. | |
| APP.config.cache_duration = APP.config.cache_duration || 15; |
| function getData() { | |
| var deferred = $.Deferred(); | |
| $.ajax({ | |
| 'url': 'http://google.com', | |
| 'success': function(data) { | |
| deferred.resolve('yay'); | |
| }, | |
| 'error': function(error) { | |
| deferred.reject('boo'); |
To remove a submodule you need to: