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
$('#dl-container-id').on('click', 'dt.class-name', function() { | |
$(this).next().toggle(); | |
}); |
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
/* Minifies HTML and removes comments (except IE tags and comments within script tags) | |
* | |
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag | |
* | |
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q | |
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html | |
*/ | |
class WP_HTML_Compression | |
{ | |
// Settings |
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 | |
/** | |
* Get Terms used by Post Type | |
* Fetches only terms actually used by posts of a specified post type | |
* | |
* @param string $taxonomy the taxonomy to look for terms | |
* @param string $post_type the post type to match the taxonomy terms found | |
* | |
* @return array the query result (an array of taxonomy terms as objects) |
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 | |
/** | |
* Limit WordPress media uploader maximum upload file size | |
* Uploading very large images is pointless as they will hardly ever be used at full size. | |
* Crunching larger files takes more memory; larger files take more space too. | |
* | |
* @param mixed $file the uploaded file item to filter | |
* | |
* @return array $file the filtered file item with response |
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 | |
/** | |
* Sets a 'wp_debug' cookie for logged in WordPress administrators | |
* In conjunction with a properly configured wp-config.php, it can enable WP_DEBUG mode conditionally. | |
* | |
* @link http://wordpress.stackexchange.com/questions/69549/define-wp-debug-conditionally-for-admins-only-log-errors-append-query-arg-f | |
*/ | |
function set_admin_debug_cookie( $user_login, $user ) { |
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 | |
// enter your database name | |
$database_name = 'name'; | |
// enter your database user name | |
$database_username = 'user'; | |
// enter your database user password | |
$database_password = 'password'; | |
$connection = mysql_connect( 'localhost', $database_username, $database_password ); |
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
echo options thinkpad_acpi dbg_bluetoothemul=1 bluetooth_state=1 | sudo tee -a /etc/modprobe.d/thinkpad_acpi.conf |
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
# See: http://stackoverflow.com/questions/1071857/how-do-i-svn-add-all-unversioned-files-to-svn | |
svn add --force * --auto-props --parents --depth infinity -q |
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 | |
/** | |
* Problem: | |
* Given a string similar to '[key][subkey][otherkey]' | |
* we want to make a multidimensional array $array['key']['subkey']['otherkey'] | |
* | |
* Original question on Stackoverflow: | |
* @link http://stackoverflow.com/questions/31103719/php-make-a-multidimensional-associative-array-from-key-names-in-a-string-separat/31104168 | |
* There are alternative solutions posted. | |
*/ |
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
#!/bin/bash | |
# Log in into the box | |
vagrant ssh | |
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first | |
sudo service vboxadd-service stop | |
# Now you can set any date and time | |
sudo date -s "2020-10-01 10:25:00" |
OlderNewer