This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
<? | |
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
function hhs_get_sample_options() { |
This file contains 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
/** | |
* Convert existing meta keys to new meta keys. | |
* | |
* @since x.x.x | |
* | |
* @global object $wpdb The current database. | |
* | |
* @param string $existing_key The existing meta key. | |
* @param string $new_key The new meta key. | |
* @param bool $remove_existing Optional. Whether to remove the old meta entries after conversion. |
This file contains 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
<?php | |
/* | |
* example usage: $results = reset_role_WPSE_82378( 'subscriber' ); | |
* per add_role() (WordPress Codex), $results "Returns a WP_Role object | |
* on success, null if that role already exists." | |
* | |
* possible $role values: | |
* 'administrator' | |
* 'editor' | |
* 'author' |
This file contains 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
<?php | |
/** | |
* ----------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/engine/kernel/converter.php` | |
* ----------------------------------------------------------------------------------------- | |
*/ | |
// HTML Minifier | |
function minify_html($input) { |
This file contains 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
# Apache Server Config | MIT License | |
# https://gist.github.com/bhubbard/6082577 | |
# Modified from https://github.com/h5bp/server-configs-apaches | |
# ############################################################################## | |
# # Default WordPress # | |
# ############################################################################## | |
# http://randomtype.ca/blog/the-wordpress-htaccess-file-explained/ | |
# BEGIN WordPress |
This file contains 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
<ifModule mod_headers.c> | |
Header set Connection keep-alive | |
</ifModule> | |
<IfModule mod_mime.c> | |
AddType text/css .css | |
AddType text/x-component .htc | |
AddType application/x-javascript .js | |
AddType application/javascript .js2 | |
AddType text/javascript .js3 | |
AddType text/x-js .js4 |