Skip to content

Instantly share code, notes, and snippets.

@ccellar
ccellar / versioninfo.cs
Created February 11, 2016 11:32
Versioninfo
var applicationDetails = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
var applicationName = applicationDetails.ProductName;
var applicationVersion = applicationDetails.ProductVersion;
@ccellar
ccellar / BusDriver.bat
Created July 21, 2015 14:40
BusDriver Example
BusDriver.exe move -from:"rabbitmq://user:password@rabbitmqhost/vhost/consumer_error"
-to:"rabbitmq://user:password@rabbitmqhost/vhost/consumer_restore" -count:500
[alias]
s = status -sb
last = log -p --max-count=1 --word-diff
co = checkout
standup = log --since yesterday --oneline --author ''
aliases = config --get-regexp alias
amend = commit --amend
bl = blame -w -M -C
branches = branch -rav
changed = status -sb
@ccellar
ccellar / appsettings.cs
Last active August 29, 2015 14:04
appsettings.cs
var location = Assembly.GetExecutingAssembly().Location;
var directory = Path.GetDirectoryName(location);
var file = Path.Combine(directory, "config.config");
var t = new ExeConfigurationFileMap();
t.ExeConfigFilename = file;
var config = ConfigurationManager.OpenMappedExeConfiguration(t, ConfigurationUserLevel.None);
var value = config.AppSettings.Settings["hello"].Value;
javascript:(function(e,a,g,h,f,c,b,d){
if(!(f=e.jQuery)||g>f.fn.jquery||h(f))
{
c=a.createElement("script");
c.type="text/javascript";
c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";
c.onload=c.onreadystatechange=function(){
if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete"))
{
h((f=e.jQuery).noConflict(1),b=1);
@ccellar
ccellar / CRM.Redeplyoment.SetupUser.sql
Created September 27, 2013 06:22
Updates the MSCRM_Config with a new setup user to be able to start a redeployment
--Source: http://social.microsoft.com/Forums/en-US/crmdeployment/thread/020049fc-d4a3-4570-b70f-6e073f9afdfc
--Listing Users and with their roles
SELECT
SU.DomainName
,SU.SetupUser
,SU.IsDisabled
,SU.AccessMode
,SUR.SystemUserId
,RB.Name [Role]
@ccellar
ccellar / Create-CRM2011Redist.ps1
Created September 4, 2013 14:29
build a redist folder to install Dynamics CRM 2011 without an internet connection
# see http://blogs.msdn.com/b/crminthefield/archive/2013/08/14/use-powershell-build-a-redist-folder-to-install-dynamics-crm-2011-without-an-internet-connection.aspx
#begin Script
#Function to Show an Open Folder Dialog and return the directory selected by the user.
function Read-FolderBrowserDialog([string]$Message, [string]$InitialDirectory)
{
$app = New-Object -ComObject Shell.Application
$folder = $app.BrowseForFolder(0, $Message, 0, $InitialDirectory)
if ($folder) { return $folder.Self.Path } else { return '' }
}
@ccellar
ccellar / select-timezone-infos.sql
Created April 12, 2013 07:53
This script shows the time zone settings for all users
select ub.TimeZoneBias, ub.TimeZoneCode, su.DomainName
from UserSettingsBase ub, SystemUser su
where ub.SystemUserId = su.SystemUserId
@ccellar
ccellar / CRM.2011.Restore-Org-On-Same-Deployment.sql
Last active December 11, 2015 05:49
This script has to be executed on a copy of an organization database which should be restored on the same CRM deployment
-- Source
-- http://social.microsoft.com/Forums/is/crmdeployment/thread/b8dfb946-bb02-4fb9-a92f-22ffb8b7071c
DECLARE @OldOrganizationId uniqueidentifier, @NewOrganizationId uniqueidentifier
-- The Old OrganizationId
SET @OldOrganizationId = (SELECT TOP(1) OrganizationId FROM OrganizationBase)
-- The New OrganizationId
SET @NewOrganizationId = (SELECT NEWID())
@ccellar
ccellar / missing-indexes.sql
Last active December 10, 2015 21:18
List database indexes which might be helpful
SELECT
migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure,
'CREATE INDEX [missing_index_' + CONVERT (varchar, mig.index_group_handle) + '_' + CONVERT (varchar, mid.index_handle)
+ '_' + LEFT (PARSENAME(mid.statement, 1), 32) + ']'
+ ' ON ' + mid.statement