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
// ==UserScript== | |
// @name Tidy Yammer | |
// @version 1.2 | |
// @include http*://*yammer.com/* | |
// ==/UserScript== | |
/* | |
* Original idea by dwnz http://userscripts.org/scripts/review/107377 | |
* Updated 04/13/2012 by @CreativeNotice |
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
<cfscript> | |
/** | |
* queryToCsv | |
* Allows us to pass in a query object and returns that data as a CSV. | |
* This is a refactor of Ben Nadel's method, http://www.bennadel.com/blog/1239-Updated-Converting-A-ColdFusion-Query-To-CSV-Using-QueryToCSV-.htm | |
* @param {Query} q {required} The cf query object to convert. E.g. pass in: qry.execute().getResult(); | |
* @param {Boolean} hr {required} True if we should include a header row in our CSV, defaults to TRUE | |
* @param {String} d {required} Delimiter to use in CSV, defaults to a comma (,) | |
* @return {String} CSV 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
public Boolean function structKeyHasValue( required struct s, required any o) | |
{ | |
return ( structKeyExists(s,o) && len(s[o]) > 0); | |
} |
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
/** | |
* isKeyValueInArray() | |
* @displayname Is Key In Array | |
* @hint Allows you to loop over array of structures and check if there's atleast one containing a key/value pair. | |
* @param Array arr Array of structures Required | |
* @param String key The key to look for. | |
* @param String value The value of the key to look for. | |
* @returnType Boolean | |
* @since 0.0.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
/** | |
* DetailedDirectoryList | |
* @displayname Detailed Directory List | |
* @hint Similar to CF's native DirectoryList but returns these additional pieces of info: datelastmodified, name, size, type, directory, hidden, pathname | |
* Inspired by code from Anuj Gakhar with modifications by Ed Martin. (http://www.anujgakhar.com/2007/11/08/java-version-of-cfdirectory-updated/) | |
* @author Ryan Mueller http://creativenotice.com, @CreativeNotice | |
* @param String path The system path for the directory to search. Required. | |
* @param Numeric count Number of results to return. | |
* @param Boolean recurse Should we recurse into child directories? Default = FALSE Required. | |
* @param String listInfo How should we respond? query or array are you options. Default = 'query' Required. |
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
/** | |
* pulsar | |
* @description Will change the element's opacity in a recursing manner. | |
* @param {Object} elm A DOM or jQuery element object | |
* @param {Object} options Options to override defaults, see var settings for those available | |
* @return {Void} | |
* | |
* @see jQuery.animate http://api.jquery.com/animate/ | |
*/ | |
var pulsar = function( elm, options ) { |
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
{ | |
"AB": "Alberta", | |
"BC": "British Columbia", | |
"MB": "Manitoba", | |
"NB": "New Brunswick", | |
"NL": "Newfoundland and Labrador", | |
"NS": "Nova Scotia", | |
"ON": "Ontario", | |
"PE": "Prince Edward Island", | |
"QC": "Quebec", |
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 Raymond Camden | |
* @see http://www.raymondcamden.com/index.cfm/2012/1/4/Converting-XML-to-JSON--My-exploration-into-madness | |
* @updated Ryan Mueller | |
* @hint Fixes some issues with the original code, though I don't remember what they were ;-) | |
* @returntype Struct | |
*/ | |
public function xmlToStruct(xml x) { | |
var s = {}; | |
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
private array function QueryToArrayOfStructures( required query theQuery ){ | |
var theArray = []; | |
var cols = ListtoArray(theQuery.columnlist); | |
for( var row=1; row <= theQuery.recordcount; row=row+1 ){ | |
var thisRow = {}; | |
for( var col=1; col <= arraylen(cols); col=col+1 ){ | |
thisRow[cols[col]] = theQuery[cols[col]][row]; | |
} | |
arrayAppend(theArray, thisRow); | |
} |
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
public string function formatPhoneNumber(string phone){ | |
var clean_number = Right( ReReplaceNoCase(arguments.phone, "[^\d]", "", "ALL"), 10); | |
if( Len(clean_number) == 10){ | |
return '('& Left(clean_number,3) &') '& Mid(clean_number,4,3) &'-'& Right(clean_number,4); | |
}else{ | |
throw('Phone number is to short.', 'InvalidArgument'); | |
} | |
}; |
OlderNewer