Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

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>
@ashtewari
ashtewari / dabblet.css
Created December 11, 2013 16:05
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;
@ashtewari
ashtewari / TestSignedXml.js
Last active December 20, 2015 20:59
nodeunit unit test for validating xml-crypto generated signed xml.
var testrunner = require('nodeunit').reporters.default;
process.chdir(__dirname);
testrunner.run(['.']);
exports.testSignedXml = function(test){
var SignedXml = require('xml-crypto').SignedXml
, fs = require('fs')
, dom = require('xmldom').DOMParser;
/* List all columns in the current database that are of datetimeoffset datatype */
Use $(DbName)
go
SELECT c.Object_ID
, OBJECT_NAME(c.OBJECT_ID) TableName
,c.name AS ColumnName
,SCHEMA_NAME(t.schema_id) AS SchemaName
@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);