Skip to content

Instantly share code, notes, and snippets.

View CreativeNotice's full-sized avatar

Ryan Mueller CreativeNotice

View GitHub Profile
@CreativeNotice
CreativeNotice / ryan-favorite-windows-dev-setup.md
Last active May 19, 2020 21:39
Ryan's favorite Windows dev setup

Why

Because as developers we establish our workspace over the years to be most comfortable and effecient for ourselves. I've had to reinstall Windows or have gotten a new laptop a few times in the last few years and realize I don't have my favoirite setup and tools documented anywhere.

This is a very opnionated document because it's for myself. If you happen to arrive here, that's cool, leave me some comments if you see an error or have a suggestion, but don't get offened if I don't change my setup. It's personal after all.

From Scratch

Hi Ryan, you're installing from scratch...

First steps

  1. New PC, so make sure you're on the work domain first thing!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
...
</handlers>
<staticContent>
...
</staticContent>
<defaultDocument>
@CreativeNotice
CreativeNotice / gist:9db86d0b17b61882e08a
Last active August 29, 2015 14:08
MS SQL Get All User Roles for DBs
sp_MSForEachDB '
USE [?]
SELECT db_name() dbname, dbU.[name] AS [user], dbGp.[name] AS [Group]
FROM sys.database_role_members AS dbRM
JOIN sys.database_principals AS dbU ON dbU.[principal_id] = dbRM.[member_principal_id]
JOIN sys.database_principals AS dbGp ON dbGp.[principal_id] = dbRM.[role_principal_id]
'
@CreativeNotice
CreativeNotice / gist:9ebe66692320d2c6d053
Created October 24, 2014 16:20
Format US phone number.
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');
}
};
@CreativeNotice
CreativeNotice / QueryToArrayOfStructures
Last active August 29, 2015 14:07
An update to Nathan Dintenfass' function at http://www.cflib.org/udf/QueryToArrayOfStructures. I've removed pre CF9 support to save a couple lines.
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);
}
@CreativeNotice
CreativeNotice / xmlToStruct
Last active August 29, 2015 14:01
Allows you to convert a cfml xml document into a structure.
/**
* @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 = {};
@CreativeNotice
CreativeNotice / provinces_hash.json
Created October 28, 2013 21:16 — forked from mshafrir/states_hash.json
North American Regions
{
"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",
@CreativeNotice
CreativeNotice / pulsar.js
Last active December 26, 2015 11:29
Simple function to pulsate element using jQuery animate.
/**
* 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 ) {
@CreativeNotice
CreativeNotice / gist:5170596
Created March 15, 2013 15:18
Detailed Directory List Similar to CF's native DirectoryList but returns these additional pieces of info: datelastmodified, name, size, type, directory, hidden, pathname.
/**
* 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.
@CreativeNotice
CreativeNotice / isKeyValueInArray
Created December 3, 2012 19:46
Testing if an Array of Structs contains a key / value pair.
/**
* 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
*/