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 leapPrevMinus = new DateTime(2011, 2, 27); | |
var leapPrev = new DateTime(2011, 2, 28); | |
var leapPrevPlus = new DateTime(2011, 3, 1); | |
var leapDayMinusMinus = new DateTime(2012, 2, 27); | |
var leapDayMinus = new DateTime(2012, 2, 28); | |
var leapDay = new DateTime(2012, 2, 29); | |
var leapDayPlus = new DateTime(2012, 3, 1); | |
var leapNextMinus = new DateTime(2013, 2, 27); |
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
# List File Line Count For Files In A Directory That Match A Given Pattern | |
$path = "C:\path\" | |
$filter = "*match*.csv" | |
Write-Output $path | |
Write-Output $filter | |
$files = Get-ChildItem -Path $path -Filter $filter | |
$files | ForEach-Object { | |
# Write-Output $_.FullName | |
Get-Content -Path ($path + $_) | Measure-Object -Line | Select-Object -ExpandProperty Lines | Write-Output | |
} |
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
static void Main(string[] args) | |
{ | |
// read input from local file (could also pass in via args) | |
var hexInput = File.ReadAllText("hexInput.txt"); | |
// convert to binary, strip off first two chars 'Ox' | |
var byteArray = StringToByteArray(hexInput.Substring(2)); | |
// write bytes to file | |
File.WriteAllBytes("output.file", byteArray); |
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
$url = "https://www.icanhazip.com/" | |
$webclient = New-Object System.Net.WebClient | |
$ipResp = $webclient.DownloadString($url) | |
$ip = $ipResp.ToString().Trim() | |
Write-Output $ip |
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
{ | |
"Records": [ | |
{ | |
"EventSource":"aws:sns", | |
"EventVersion":"1.0", | |
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx", | |
"Sns": { | |
"Type":"Notification", | |
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A", | |
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery", |
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
declare @table_name varchar(200) = 'dbo.mytablename' | |
select | |
'select ' + c.name + ', count(1) cnt from ' + @table_name + ' group by ' + c.name + ' order by 2 ' | |
from sys.columns c | |
where c.object_id = object_id(@table_name) |
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
UTC 24 12 | |
--- -- -- | |
00 19 07PM | |
01 20 08 | |
02 21 09 | |
03 22 10 | |
04 23 11 | |
05 00 12AM | |
06 01 01 | |
07 02 02 |
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 class UtmZoneInfo | |
{ | |
public string UtmZoneNumber { get; set; } | |
public string UtmZoneLetter { get; set; } | |
public string UtmZone { get; set; } | |
public double LongitudeCenter { get; set; } | |
public double LongitudeMinimum { get; set; } | |
public double LongitudeMaximum { get; set; } |
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
// source: https://msdn.microsoft.com/en-us/library/bb259689.aspx | |
//------------------------------------------------------------------------------ | |
// <copyright company="Microsoft"> | |
// Copyright (c) 2006-2009 Microsoft Corporation. All rights reserved. | |
// </copyright> | |
//------------------------------------------------------------------------------ | |
using System; | |
using System.Text; |
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
static void Main() | |
{ | |
var config = new JobHostConfiguration(); | |
// Log Console.Out to SQL using custom TraceWriter | |
// Note: Need to update default Microsoft.Azure.WebJobs package for config.Tracing.Tracers to be exposed/available | |
config.Tracing.Tracers.Add(new SqlTraceWriter( | |
TraceLevel.Info, | |
"{{SqlConnectionString}}", | |
"{{LogTableName}}")); |
OlderNewer