Skip to content

Instantly share code, notes, and snippets.

Avatar
🛸

David Sword davidsword

🛸
View GitHub Profile
View wordpress-get-post-ids-navigation-menu-2.txt
(
[menu_id] => object_id
[menu_id] => object_id
[menu_id] => object_id
..etc
)
View compile-less-css-coda-2.php
<?
require "lessc.inc.php";
$less = new lessc;
$less->compileFile("style.less", "style.css");
?>
<style>code { animation: fadein 2s }
@keyframes fadein { from { opacity:0 } to { opacity:1 } }</style>
<code>Compiled: <?= date('r') ?></code>
View quickly-toggle-hidden-files-mac-os-x-2.bash
alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder"
alias nohidden="defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder"
View add-or-remove-www-in-wordpress-1.htaccess
# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com/$
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
# Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
View more-modern-mobile-menu.html
<header>
<input id="hamburger" type="checkbox" />
<label for="hamburger" id="hamburger-icon"></label>
<nav>
Your navigation here
</nav>
</header>
View more-modern-mobile-menu.css
header input, header label { display: none }
header nav { /* your desktop navigation css */ }
@media screen and (max-width: 960px) {
header label {
display: block;
width: 20px;
height: 20px;
background-image:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgODggODgiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDg4IDg4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPmNpcmNsZSwgZWxsaXBzZSwgbGluZSwgcGF0aCwgcG9seWdvbiwgcG9seWxpbmUsIHJlY3QsIHRleHQgeyBmaWxsOiAjMzAzNzNiICFpbXBvcnRhbnQ7IH08L3N0eWxlPg0KPGc+DQoJ
View opengraph-image-from-featured-inline-or-attached.php
You can’t perform that action at this time.