Skip to content

Instantly share code, notes, and snippets.

@jdaigle
jdaigle / AMQPLinks.md
Last active February 17, 2016 16:45
AMQP Message Broker Architecture
using System;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Routing;
using ExpressionHelper = Microsoft.Web.Mvc.Internal.ExpressionHelper;
namespace MyProject
{
public static class UrlExtensions
{
using System;
using System.Web.Caching;
using System.Web.Mvc;
namespace MyWebApplication
{
public class ViewModelSpecifiedViewEngine : RazorViewEngine
{
public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
{
@jdaigle
jdaigle / gist:0ac8dea7c1cd664afe0a
Last active November 30, 2015 18:43
Blog Article Ideas
  • Tenants of CI and deployment. Build once, promote and publish artifacts. Test against release build (i.e. published artifacts). Compare TeamCity to TFS.
@jdaigle
jdaigle / gist:1d6cf7273e4f7eaca9c1
Last active November 13, 2015 14:04
Idea of Document Store on Top of MSSQL Server
Names:
HortonDB
API Inspiration:
https://github.com/JasperFx/Marten
https://github.com/ravendb/ravendb
@jdaigle
jdaigle / gist:08c38ccd4d05f129a907
Last active September 15, 2015 14:06
citations for git training
# History of version control
* http://ericsink.com/vcbe/html/history_of_version_control.html
* http://www.catb.org/~esr/writings/version-control/version-control.html
* http://blog.podrezo.com/git-introduction-for-cvssvntfs-users/
Comparison:
https://www.google.com/trends/explore#q=%2Fm%2F05vqwg%2C%20%2Fm%2F08441_%2C%20%2Fm%2F02rvgkm%2C%20%2Fm%2F012ct9%2C%20%2Fm%2F09d6g&cmpt=q&tz=Etc%2FGMT%2B4
https://www.google.com/trends/explore#q=%2Fm%2F05vqwg%2C%20%2Fm%2F08441_%2C%20%2Fm%2F02rvgkm%2C%20%2Fm%2F012ct9%2C%20%2Fm%2F08w6d6&cmpt=q&tz=Etc%2FGMT%2B4
@jdaigle
jdaigle / gist:2cbc5517784328b58f4b
Created June 9, 2015 01:43
query tables in mirth database by size
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
, SUBSTRING(relname FROM '[0-9]+')
, d.*
, ch.name
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
LEFT JOIN d_channels d ON cast(d.local_channel_id as varchar(5)) = SUBSTRING(relname FROM '[0-9]+')
LEFT JOIN channel ch ON ch.id = d.channel_id
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
@jdaigle
jdaigle / gist:c2842e9005c33e5be9ed
Created May 18, 2015 15:34
change line endings for source files
Get-ChildItem -file -Recurse -Filter *.cs | foreach {unix2dos.exe $_.FullName}
@jdaigle
jdaigle / gist:c4e2931e30b0e6c7a839
Created March 30, 2015 13:39
simple tsql counter table
-- CREATE TABLE [dbo].[Counter](
-- [id] [bigint] IDENTITY(1,1) NOT NULL,
-- [date] [date] NOT NULL,
-- [key] [varchar](100) NOT NULL,
-- [count] [int] NOT NULL,
-- CONSTRAINT [PK_Counter] PRIMARY KEY CLUSTERED ([id] ASC)
-- );
BEGIN TRAN
MERGE dbo.[Counter] as t
@jdaigle
jdaigle / gist:281c331e1265425cd1d1
Last active August 29, 2015 14:15
calc worker time for queries
select
qs.creation_time,
qs.last_execution_time
,qs.execution_count
,(CAST(qs.execution_count as decimal(18,4)) / (SUM(qs.execution_count) OVER (PARTITION BY 1))) AS perc_execution_count
,qs.total_worker_time -- microseconds
,CAST(qs.total_worker_time as decimal(18,4)) / CAST(qs.execution_count AS float) as avg_total_worker_time
--,SUM(qs.total_worker_time) OVER (PARTITION BY 1) AS total_total_worker_time
,(CAST(qs.total_worker_time as decimal(18,4)) / (SUM(qs.total_worker_time) OVER (PARTITION BY 1))) AS perc_total_worker_time