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
#put in your web.config or app.config | |
<configuration> | |
<connectionStrings configSource="connections.config"/> | |
</configuration> | |
#this is your connections.config which can be used for several projects, transformations Release,Debug etc. | |
<configuration> |
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
var smtp = new SmtpClient | |
{ | |
Host = "smtp.gmail.com", | |
Port = 587, | |
EnableSsl = true, | |
DeliveryMethod = SmtpDeliveryMethod.Network, | |
UseDefaultCredentials = false, | |
Credentials = new NetworkCredential(fromAddress.Address, "yourApplicationSpecificPassword") | |
}; | |
using (var message = new MailMessage(fromAddress, toAddress) |
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
google.visualization.events.addListener(chart, 'ready', function () { | |
chart-container.innerHTML = '<img src="' + chart.getImageURI() + '">'; | |
}); | |
<div id='png'></div> | |
document.getElementById('png').outerHTML = '<a href="' + chart.getImageURI() + '">Printable chart</a>'; |
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 async Task ListLabels() | |
{ | |
UserCredential credential; | |
using (var stream = new FileStream("client_secrets_desktop.json", FileMode.Open, FileAccess.Read)) | |
{ | |
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets, | |
new[] { GmailService.Scope.GmailReadonly }, | |
"user", CancellationToken.None); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<link href="Content/bootstrap.css" rel="stylesheet" /> | |
</head> | |
<body> |
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
<handlers> | |
<add name="HtmlFileHandler" path="*.html" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/> | |
</handlers> | |
routes.MapRoute( | |
name: "Default", | |
url: "{controller}/{action}.html", | |
defaults: new { controller = "Home", action="Index" } | |
); | |
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
.ytp-ad-overlay-container{ | |
display: none; | |
} |
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
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[Logs]( | |
[Id] [int] IDENTITY(1,1) NOT NULL, | |
[Message] [nvarchar](max) NULL, | |
[MessageTemplate] [nvarchar](max) NULL, |
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
Thought experiment: | |
Listened to eight .NET Rocks episodes yesterday while driving. One episode was about C# 6.0 with Bill Wagner | |
(http://www.dotnetrocks.com/default.aspx?showNum=1029), another about DDD with Steve Smith and Julie Lerman | |
(http://www.dotnetrocks.com/default.aspx?showNum=1023) where they specifically also discussed DDD's notion of | |
an anti-corruption layer, which aims to provide a neutral zone between different domains. The combination of | |
the two episodes gave me the following idea which I'll jot down here quickly. | |
Don't go "you dont do that in DDD, because .." since that's not the point. The point is efficiency and avoiding | |
data copies. Also, I'm not planning on doing anything further with it, so if anyone wants to take this somewhere, |
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
<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" /> | |
<httpCompression noCompressionForHttp10="false" noCompressionForProxies="false" dynamicCompressionDisableCpuUsage="93" dynamicCompressionEnableCpuUsage="93" staticCompressionDisableCpuUsage="99" staticCompressionEnableCpuUsage="99"> | |
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" dynamicCompressionLevel="4" /> | |
</httpCompression> | |