Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Taber appakz

  • Articulate
  • Tallahassee, FL
View GitHub Profile
View Customer_Info_Sheet.html
<form id="create_pdf_form">
<fieldset>
<legend>Create Customer Info Sheet PDF</legend>
<div>
<label id="first_name_prompt_id" for="first_name_input_id">First Name</label>
<input name="first_name_input" id="first_name_input_id"/>
</div>
<div>
<label id="last_name_prompt_id" for="last_name_input_id">Last Name</label>
<input name="last_name_input" id="last_name_input_id"/>
@appakz
appakz / file_timestamp_to_datetime.cs
Created Oct 18, 2015
Windows File Timestamp ticks to DateTime
View file_timestamp_to_datetime.cs
const long fileTimestampTicks = 130892436116060259;
var windowsFileTimestampDate = DateTime.FromFileTime(fileTimestampTicks);
@appakz
appakz / ticks_comparison.cs
Created Oct 18, 2015
Compare DateTime.Ticks with Windows File Timestamp ticks
View ticks_comparison.cs
var utcNowTicks = DateTime.UtcNow.Ticks;
const long fileTimestampTicks = 130892436116060259;
var ticksDiff = utcNowTicks - fileTimestampTicks;
var ticksDifTimeSpan = TimeSpan.FromTicks(ticksDiff);
var totalYears = ticksDifTimeSpan.TotalDays/365;
Console.WriteLine(totalYears);
@appakz
appakz / datetime_ticks_ctor.cs
Created Oct 18, 2015
Construct DateTime from Ticks
View datetime_ticks_ctor.cs
const long ticks = 635807955799055730;
var someDate = new DateTime(ticksValue);
@appakz
appakz / sample_sms_data.xml
Last active Oct 18, 2015
Sample Windows Phone SMS Data Export
View sample_sms_data.xml
<Message>
<Recepients />
<Body>Hello World!</Body>
<IsIncoming>true</IsIncoming>
<IsRead>true</IsRead>
<Attachments />
<LocalTimestamp>130892436116060259</LocalTimestamp>
<Sender>+15555555555</Sender>
</Message>
View PresentationLoop.cs
static void Main(string[] args)
{
do
{
Console.Write("Enter command or 'exit' to quit: > ");
var command = Console.ReadLine();
if ((command ?? string.Empty).Equals("exit", StringComparison.OrdinalIgnoreCase))
{
Console.WriteLine("Quitting.");
break;
@appakz
appakz / CFClientBase.CFContractSerializerInfo.cs
Created Apr 1, 2013
Equals and GetHashCode methods for
View CFClientBase.CFContractSerializerInfo.cs
namespace Microsoft.Tools.ServiceModel
{
/// <summary>
/// Partial class / struct implementation for doing proper Equals behavior of the CFContactSerializerInfo struct
/// so that it can be properly used in the Dictionary in the CFClientBase.
/// </summary>
/// <typeparam name="TChannel"></typeparam>
public partial class CFClientBase<TChannel>
where TChannel : class
{
@appakz
appakz / gist:3013243
Created Jun 28, 2012
SQL Server HierarchyID.IsDescendantOf() behavior
View gist:3013243
declare @rootId HierarchyId = HierarchyId::Parse('/1/')
declare @descendantId HierarchyId = HierarchyId::Parse('/1/1/')
--make sense:
select @descendantId.IsDescendantOf(@rootId) --returns 1
select @rootId.IsDescendantOf(@descendantId) --returns 0
--not so much sense:
select @descendantId.IsDescendantOf(@descendantId) --returns 1
select @rootId.IsDescendantOf(@rootId) --returns 1
@appakz
appakz / countLOC.ps1
Created Jan 25, 2012
Quick and dirty powershell script for counting lines in each file of a folder
View countLOC.ps1
#Quick and dirty PS script for counting lines of code in a directory. Output is dumped to a simple CSV file.
#Note that this script doesn't count blank lines.
#Parameters:
# path - the path containing the code files (note that the script will recurse through subfolders
# outputFile - fully qualified path of the file to dump the CSV output
# include (Optional) - file mask(s) to include in the count (deafults to *.*)
# exclude (Optional) - file mask(s) to exclude in the count (defaults to none)
# Example (count lines in target path including *.cs but excluding *.designer.cs)
# .\countLOC.ps1 -path "C:\code\MyProject" -outputFile "C:\code\loc.csv" -include "*.cs" -exclude "*.designer.cs"
param([string]$path, [string]$outputFile, [string]$include = "*.*", [string]$exclude = "")