This file contains hidden or 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
| if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
| var Storage = function (type) { | |
| function createCookie(name, value, days) { | |
| var date, expires; | |
| if (days) { | |
| date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); | |
| expires = "; expires="+date.toGMTString(); |
This file contains hidden or 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
| # Find and replace text in multiple files | |
| # http://www.24hourapps.com/2009/03/linux-tips-17-find-and-replace-text-in.html | |
| # Multiple file find and replace is a rarely used, but an extremely time saving, ability of | |
| # Linux that I cannot live without. It can be achieved by chaining a few commands together | |
| # to get the list of files you want to change (find), make sure the files contain the strings | |
| # you want to replace (grep), and do the replacements (sed). | |
| # Lets say we have a lot of code that uses the function registerUser that was implemented when | |
| # there was only one class of users, but now another class of users need to access the system |
This file contains hidden or 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
| [alias] | |
| edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`" | |
| add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`" | |
| lc = log ORIG_HEAD.. --stat --no-merges | |
| smash = merge --no-commit --log | |
| eat = branch -M | |
| prune-all = !git remote | xargs -n 1 git remote prune | |
| whois = "!sh -c 'git log -i --pretty=\"format:%an <%ae>\" --author=\"$1\" | sort -u' -" | |
| whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short |
This file contains hidden or 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 function will get post data associated with a specific meta key and meta value. | |
| * | |
| * By: Christian Gundersson, [email protected] | |
| * | |
| */ | |
| function pcpt_get_posts_by_meta ( $meta_key, $meta_value ) |
This file contains hidden or 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 | |
| /** | |
| * UUID class | |
| * | |
| * The following class generates VALID RFC 4122 COMPLIANT | |
| * Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
| * | |
| * UUIDs generated validates using OSSP UUID Tool, and output | |
| * for named-based UUIDs are exactly the same. This is a pure | |
| * PHP implementation. |
This file contains hidden or 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
| git status -s | awk '{print $2}' | sed 's/\(.*\)/rsync -cav \1 [email protected]:~\/\1/' | sh |
This file contains hidden or 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 | |
| /** | |
| * Plugin Name: Remove Builtin WP Taxonomies | |
| */ | |
| add_action( 'init', 'unregister_taxonomy' ); | |
| /** | |
| * Remove built in taxonomies | |
| * @author: Franz Josef Kaiser | |
| */ |
This file contains hidden or 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
| # vi: ft=dosini | |
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = [email protected] | |
| username = pksunkara | |
| [core] | |
| editor = nvim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| pager = delta | |
| [column] |
This file contains hidden or 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
| var getCachedJSON = function (url, callback) { | |
| var cachedData = window.localStorage[url]; | |
| if (cachedData) { | |
| log('Data already cached, returning from cache:', url); | |
| callback(JSON.parse(cachedData)); | |
| } else { | |
| $.getJSON(url, function (data) { | |
| log('Fetched data, saving to cache:', url); | |
| window.localStorage[url] = JSON.stringify(data); | |
| callback(data); |
This file contains hidden or 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 | |
| /* | |
| Plugin Name: Disable plugins when doing local dev | |
| Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
| Version: 0.1 | |
| License: GPL version 2 or any later version | |
| Author: Mark Jaquith | |
| Author URI: http://coveredwebservices.com/ | |
| */ |
OlderNewer