Skip to content

Instantly share code, notes, and snippets.

@ashtewari
ashtewari / gist:5091144
Created March 5, 2013 15:35
Unit test fails because TimeZoneInfo does not use the correct DST transitions.
/// <summary>
/// Is the specified datetime DST?
/// </summary>
[TestMethod]
public void DST_Started_On_April_27_1980()
{
var ts = new DateTime(1980, 4, 15, 12, 0, 0);
var isDst = Utils.EasternTimeZone.IsDaylightSavingTime(ts);
## Transfer data in Azure Storage Tables from one Azure Storage Account to another
## Download and install AzCopy -- https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/
## Get the Preview version of AzCopy in order to access Table Storage. The current stable version works with Blob storage only.
## Tables will be created if they don't exist
$source_acct = "Source_Azure_Storage_Account_Name"
$source_key="Source_Azure_Storage_Account_Key"
$destination_acct="Destination_Azure_Storage_Account_Name"
$destination_key="Destination_Azure_Storage_Account_Key"
private static void ExecuteTwoMethodsOpeningTwoConnections(string connectionString)
{
using(TransactionScope scope = new TransactionScope())
{
ExecuteCommandA(connectionString);
ExecuteCommandB(connectionString);
Console.WriteLine("Both records are written to database transactionally.");
scope.Complete();
}
private static void ExecuteSqlTransactionUsingTransactionScope(string connectionString)
{
using(TransactionScope scope = new TransactionScope())
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = connection.CreateCommand();
private static void ExecuteSqlTransaction(string connectionString)
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
SqlCommand command = connection.CreateCommand();
SqlTransaction transaction;
@ashtewari
ashtewari / dabblet.css
Created October 16, 2014 11:48
Untitled
/*final-css*/
.speech-bubble {
text-align:center;
font:40px/100px Arial, sans-serif;
color:#fff;
background:red;
width:300px;
height:100px;
margin:auto;
position: absolute;
<!--ash-->
<div class="speech-bubble">ash</div>