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
// disable :hover on touch devices | |
// based on https://gist.github.com/4404503 | |
// via https://twitter.com/javan/status/284873379062890496 | |
// + https://twitter.com/pennig/status/285790598642946048 | |
// re http://retrogamecrunch.com/tmp/hover | |
// NOTE: we should use .no-touch class on CSS | |
// instead of relying on this JS code | |
function removeHoverCSSRule() { | |
if ('createTouch' in document) { | |
try { |
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 | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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 | |
$countries = array(); | |
$countries[] = array("code"=>"AF","name"=>"Afghanistan","d_code"=>"+93"); | |
$countries[] = array("code"=>"AL","name"=>"Albania","d_code"=>"+355"); | |
$countries[] = array("code"=>"DZ","name"=>"Algeria","d_code"=>"+213"); | |
$countries[] = array("code"=>"AS","name"=>"American Samoa","d_code"=>"+1"); | |
$countries[] = array("code"=>"AD","name"=>"Andorra","d_code"=>"+376"); | |
$countries[] = array("code"=>"AO","name"=>"Angola","d_code"=>"+244"); | |
$countries[] = array("code"=>"AI","name"=>"Anguilla","d_code"=>"+1"); | |
$countries[] = array("code"=>"AG","name"=>"Antigua","d_code"=>"+1"); |
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 | |
/** | |
* The following is the proper way to handle complex translation strings. | |
* By Justin Tadlock | |
* @see https://wpchat.com/t/do-you-use-format-placeholders-s-and-d-in-translatable-strings/1138/11 | |
*/ | |
$number = get_donation_count(); | |
$string = sprintf( | |
// translators: %s is the number of donations. |
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
add_action( 'admin_bar_menu', 'remove_wp_logo', 999 ); | |
function remove_wp_logo( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'wp-logo' ); | |
} |
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
# Create a repository archive | |
# Format: git archive {branchname} --format={compression} --output={filename} | |
git archive master --format=tar --output=kuma.tar | |
git archive some-feature-branch --format=tar --output=kuma.tar | |
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
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) ); |
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
[mergetool] | |
prompt = false | |
keepBackup = false | |
keepTemporaries = false | |
[merge] | |
tool = winmerge | |
[mergetool "winmerge"] | |
name = WinMerge |
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
<!doctype html> | |
<html> | |
<body> | |
<header role="banner"> | |
<a href="/" rel="home">My company</a> | |
<nav role="navigation"> | |
<a href="/about">About</a> | |
<a href="/contact">Contact</a> | |
</nav> | |
</header> |