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
sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rfv /Volumes/[disk]/Backups.backupdb/[path] |
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
// expand {{PATTERNS}} | |
// You can do this serverside. I just did it this way for demonstration purposes. | |
(function () { | |
"use strict"; | |
var shares = document.querySelectorAll("ul.share > li > a"); | |
var keywords = document.querySelector('meta[name=keywords]').getAttribute("content"); | |
var description = document.querySelector('meta[name=description]').getAttribute("content"); | |
var params = { | |
URL: encodeURIComponent(document.querySelector('link[rel=canonical]').getAttribute("href")), |
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 | |
# | |
# Script to deploy from Github to WordPress.org Plugin Repository | |
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn | |
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo. | |
# Source: https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh | |
#prompt for plugin slug | |
echo -e "Plugin Slug: \c" | |
read PLUGINSLUG |
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
/** | |
* @author Joshua Heller | |
*/ | |
function hasClass(ele, cls) { | |
return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); | |
} | |
function addClass(ele, cls) { | |
if (!this.hasClass(ele, cls)) | |
ele.className += " " + cls; |
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
/** | |
* toggleClass() | |
* Expects parameters | |
* elem = DOM element (object, instanceof HTMLElement) | |
* cl = Class name (string) | |
*/ | |
var toggleClass = function(elem, cl) { | |
if (elem.className.indexOf(cl) != -1) { | |
elem.className = elem.className.replace(cl, ''); | |
} else { |
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('the_content', 'remove_empty_p', 20, 1); | |
function remove_empty_p($content){ | |
$content = force_balance_tags($content); | |
return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); | |
} |
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
To find the largest 10 files (linux/bash): | |
find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {} | |
To find the largest 10 directories: | |
find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {} | |
Alternatively or a quick view: |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>General Asymmetric Grid</h1> | |
<div id="asymmetric-general"> </div> |
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 | |
class Clean_Walker_Nav extends Walker_Nav_Menu { | |
/** | |
* Filter used to remove built in WordPress-generated classes | |
* @param mixed $var The array item to verify | |
* @return boolean Whether or not the item matches the filter | |
*/ | |
function filter_builtin_classes( $var ) { | |
return ( FALSE === strpos( $var, 'item' ) ) ? $var : ''; | |
} |
OlderNewer