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 aesAlgorithm = new System.Security.Cryptography.AesManaged(); | |
aesAlgorithm.GenerateIV(); | |
aesAlgorithm.GenerateKey(); | |
var key = aesAlgorithm.Key; | |
var iv = aesAlgorithm.IV; | |
Console.WriteLine(key.Length); | |
Console.WriteLine(key); | |
Console.WriteLine(iv.Length); | |
Console.WriteLine(iv); |
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
let inverse x = 1.0/x | |
let inverseNext x = 1.0/(x+2.0) | |
let substractNextInverse x = inverse x - inverseNext x | |
let skip4List accuracy = [1.0 .. 4.0 .. accuracy] | |
let add a b = a + b | |
let inverses accuracy = (List.map substractNextInverse (skip4List accuracy)) | |
let PI accuracy = (List.reduce add (inverses accuracy)) * 4.0 | |
let pi10000000 = PI 10000000.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
Uri sourceBaseUri; | |
var isValidUri = Uri.TryCreate("ftp://somedomain.com/somefolder/someotherfolder/somefile.zip", UriKind.Absolute, out sourceBaseUri); | |
if(isValidUri) | |
{ | |
Console.WriteLine("URI is valid"); | |
} | |
if(sourceBaseUri.Scheme == Uri.UriSchemeFtp) | |
{ |
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 static class DependencyObjectExtensions | |
{ | |
/// <summary> | |
/// Creates a new instance of the same type and copies all properties and values. | |
/// </summary> | |
/// <typeparam name="T">A type that extends DependencyObject</typeparam> | |
/// <param name="source"></param> | |
/// <returns>A new instance that represents a copy of the properties and values of the original instance.</returns> |
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
<% foreach (var key in Request.Cookies.AllKeys) | |
{ | |
Response.Write(string.Format("Key:{0}|Value:{1}|\r\n", key, Request.Cookies[key].Value)); | |
} %> |
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
@using Sitecore.Mvc.Presentation | |
@using Sitecore.Mvc | |
@model RenderingModel | |
@{ | |
Layout = null; | |
} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width" /> |
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
& 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\vsdiffmerge' "file1.txt" "file2.txt" |
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
<Content Include="Sitecore_Data\Unicorn\Default Configuration\\**\*.yml"> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</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
$targetFileName = 'c:\temp\ItemRenderings.txt' | |
function Show-Rendering | |
{ | |
param ($renderingItem) | |
$renderingName = $renderingItem.Name | |
$renderingId = $renderingItem.Id | |
$placeholderName = $renderingItem.Placeholder | |
"Rendering Item: $renderingId | $renderingName | $placeholderName" | Out-File $targetFileName -Append | |
} | |
$devices = [Sitecore.Configuration.Factory]::GetDatabase("master").Resources.Devices.GetAll() |
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
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
... | |
<ExcludeFilesFromDeployment>File1.aspx;Folder2\File2.aspx</ExcludeFilesFromDeployment> | |
<ExcludeFilesFromDeployment>**\.svn\**\*.*</ExcludeFilesFromDeployment> | |
<ExcludeFoldersFromDeployment>Folder1;Folder2\Folder2a</ExcludeFoldersFromDeployment> | |
</PropertyGroup> |
OlderNewer