Skip to content

Instantly share code, notes, and snippets.

View karoltheguy's full-sized avatar

Carol Ouellet karoltheguy

View GitHub Profile
@karoltheguy
karoltheguy / HexToAscii.cpp
Last active August 29, 2015 14:02
Hexadecimal to ASCII in C++
#include <iostream>
#include <stdio.h>
using namespace std;
int hexToInt(char c)
{
int first = c / 16 - 3;
int second = c % 16;
int result = first*10 + second;
@karoltheguy
karoltheguy / module1
Last active August 29, 2015 14:17
Mass Auto Reply Outlook Macro
Sub SendReply(Item As Outlook.MailItem)
Dim strRecip As String
Dim Recipient As Outlook.Recipient
Dim objMsg As MailItem
'Save a template with a the content you want to reply and the CC addresses if needed, nothing else.
Set objMsg = Application.CreateItemFromTemplate("path of template .oft")
'Add sender of original email
@karoltheguy
karoltheguy / Program.cs
Last active February 1, 2017 19:08
Start Citrix Session with reference wfica.ocx(not embedded interop)
using System;
using System.Threading;
using WFICALib;
class Program
{
public static AutoResetEvent onLogonResetEvent = null;
/// This program demo's the basic of launching and ICO session from within an application.
static void Main(string[] args)
@karoltheguy
karoltheguy / gist:b3fde88c627b66b749c6080b236bcd51
Created February 15, 2017 20:41
Count all lines of code using powershell
(dir -exclude *.g.cs,*.i.cs,*.designer.cs,assemblyinfo.cs,app.* -include *.cs,*.xaml -recurse | select-string .).Count
//Missing exclusion of empty lines and comments(?)
@karoltheguy
karoltheguy / ObservableDictionary.cs
Created March 3, 2017 17:34
Observable Dictionary
public class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, INotifyCollectionChanged, INotifyPropertyChanged
{
private const string CountString = "Count";
private const string IndexerName = "Item[]";
private const string KeysName = "Keys";
private const string ValuesName = "Values";
private IDictionary<TKey, TValue> _Dictionary;
protected IDictionary<TKey, TValue> Dictionary
{
@karoltheguy
karoltheguy / IsDaylightSavingTime
Created April 21, 2017 17:26
Determine if given date is within DST clock shift - SQL Scalar Function
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Carol Ouellet
-- Create date: 2017-04-21
-- Description: Determine if given date is within DST clock shift
-- =============================================
CREATE FUNCTION IsDaylightSavingTime
@karoltheguy
karoltheguy / SplitString
Last active May 9, 2017 16:31
SQL Split string function
CREATE FUNCTION [dbo].[SplitString]
(
@List NVARCHAR(MAX),
@Delim VARCHAR(255)
)
RETURNS TABLE
AS
RETURN ( SELECT [Value] FROM
(
SELECT
@karoltheguy
karoltheguy / CreateHTMLTable
Created May 24, 2017 22:03
Make HTML table with SQL result
CREATE FUNCTION dbo.CreateHTMLTable(@SelectForXmlRawElementsXsinil XML)
RETURNS XML
AS
BEGIN
RETURN
(
SELECT
@SelectForXmlRawElementsXsinil.query('let $first:=/row[1]
return
@karoltheguy
karoltheguy / forloop.bat
Last active May 8, 2024 12:40
Batch file for loop csv
@for /F "tokens=1,2,3 skip=1 delims=," %%A in (test.txt) do (
@echo I am at %%A using login %%B:%%C
)
@karoltheguy
karoltheguy / exporttotext.sql
Created November 8, 2017 17:27
Export Column of text into individual files
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell',1;
RECONFIGURE
GO
CREATE TABLE TempProcessStore ([RowNo] [smallint] identity (1, 1)
,[name] nvarchar(128)