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://coreygilmore.com/blog/2011/07/20/bookmarklet-scroll-to-the-first-new-tweet/ | |
*/ | |
javascript:(function(){ | |
if( document.getElementsByClassName ) { | |
var t=document.getElementsByClassName("last-new-tweet")[0]; | |
if(t) { | |
window.scrollTo(0, t.offsetTop + t.offsetParent.offsetTop ); | |
} | |
} 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
/** | |
* Out a MySQL-style table of data | |
* See: http://coreygilmore.com/blog/2009/02/02/print-a-mysql-style-table-with-php/ | |
* | |
* @param array $data Associative array of data to output. | |
* @param array $header_keys Optional; Assoc array of display names to use for headers. Keys must match those of $data. Defaults to keys of $data. | |
* @param string $glue String to join lines with, defaults to newline. | |
* @return string | |
* | |
*/ |
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://coreygilmore.com/blog/2008/05/29/generic-paging-links-with-coldfusion/ | |
---> | |
<cffunction name="paginate_links" access="public" output="false" returntype="any" hint="Return links to paginated results, heavily based on paginate_links() <http://trac.wordpress.org/ticket/3159> from WordPress <http://wordpress.org/> by Michael D Adams <http://blogwaffe.com/>"> | |
<cfargument name="link_format" required="YES" type="string" default="" hint="Link format. Use %PAGE% for the page number placeholder (required), %SHOW% for the paging size (optional)" /> | |
<cfargument name="prev_next" required="YES" type="boolean" default="true" hint="Show previous/next links" /> | |
<cfargument name="prev_text" required="YES" type="string" default="« Previous" hint="Text for 'Previous Page' link" /> | |
<cfargument name="next_text" required="YES" type="string" default="Next »" hint="Text for 'Next Page' link" /> | |
<cfargument name="end_size" required="YES" type="numeric" default="1" hint="How many numbe |
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://coreygilmore.com/blog/2008/05/08/merge-structs-in-coldfusion/ | |
---> | |
<cfscript> | |
function struct_merge() { | |
var base = {}; | |
var i = 1; | |
for( i = 1; i LTE ArrayLen(arguments); i=i+1 ) { | |
if( IsStruct(arguments[i]) ) { |
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://coreygilmore.com/blog/2008/05/01/mimic-phps-empty-function-in-coldfusion/ | |
---> | |
<cfscript> | |
function empty(val) { | |
/** | |
* Return TRUE if one of the following conditions | |
* for a defined variable is met: | |
* - A *trimmed* string is empty | |
* - An array or struct is empty |
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://coreygilmore.com/blog/2010/02/04/applescript-to-generate-a-securid-token-and-automatically-connect-to-a-cisco-vpn/ | |
----------------------------------------------- | |
-- Automated token generation and VPN logins | |
-- Copyright 2010, Corey Gilmore | |
-- http://coreygilmore.com/ | |
-- Last Modified: 2010-02-04 | |
------------------------------------------------ | |
set theConnection to "My VPN" -- the name of your VPN connection | |
set thePin to "" -- set to "" to prompt every time (recommended) |
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
# From discussion at http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# Is a useful one-liner which will give you the full directory name of the script no matter where it is being | |
# called from | |
# Or, to get the dereferenced path (all directory symlinks resolved), do this: | |
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# These will work as long as the last component of the path used to find the |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\weinre] | |
"Type"=dword:00000010 | |
"Start"=dword:00000002 | |
"ErrorControl"=dword:00000001 | |
"ImagePath"="C:\\Path\\To\\srvany.exe" | |
"DisplayName"="weinre" | |
"WOW64"=dword:00000001 | |
"ObjectName"="LocalSystem" |
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
$ cd /path/to/wordpress/wp-content/plugins/ | |
$ for foo in `find . -maxdepth 1 -type d` ; do p=$(basename $foo) ; n=`grep "Plugin Name" "$p/$p.php" | cut -d':' -f2-` ; echo -e "$p\t$n" ; done |
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 | |
/** | |
* Log all filter and action calls. | |
* | |
* Actions and filters are logged to two separate global variables $_x_wp_filters and $_x_wp_actions respectively. | |
* Hardcode loading this in wp-settings.php to generate a complete tree of filters/actions. | |
* Add `require_once( '/path/to/hook-logging.php' );` after `require_once( ABSPATH . WPINC . '/plugin.php' );` | |
* | |
*/ | |
function x_all_hook_logging($args) { |
OlderNewer