Skip to content

Instantly share code, notes, and snippets.

View pjmagee's full-sized avatar
🤨

Patrick Magee pjmagee

🤨
View GitHub Profile
<?xml version='1.0' ?>
<xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" />
<xsl:template match="/">
<html>
<head>
<title>Customers Information</title>
</head>
<body>
public class Program
{
private static readonly string ScriptsPath = Path.Combine(Environment.CurrentDirectory, "Scripts");
public static string PathFor(string script)
{
return Path.Combine(ScriptsPath, script);
}
public static void Main(string[] args)
@pjmagee
pjmagee / creationdate.ps1
Created May 28, 2013 01:25
Sets the creation date to a set of folders in directory based on the current date.
# sets the folder creation date to the specified date variable
# version 0.0.1
# author: Patrick Magee
#######################
$choice = ""
$dir = ""
$date = [datetime]::Today
while ($choice -notmatch "[y|n]") {
using System;
using System.Linq;
using System.Threading;
using IrcDotNet;
using IrcDotNet.Ctcp;
namespace IRCEXAMPLES.Messaging
{
/// <summary>
/// Contains the connection between an irc client and server.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using AutoMapper;
using NUnit.Framework;
namespace StackOverFlowAnswers
{
#region http://stackoverflow.com/questions/16558005/how-can-i-set-default-value-to-exceptions-in-automapper-while-mapping-from-strin/16558388#16558388
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by mono configure 2.11.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --prefix=/opt/mono-2.11
## --------- ##
## Platform. ##
./configure CC=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspeccache-gcc
LD=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ld
RANLIB=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ranlib
CFLAGS="-I/usr/local/powerpc-none-linux-gnuspe/include -mcpu=8548 -mhard-float -mfloat-gprs=double"
LDFLAGS="-L/usr/local/powerpc-none-linux-gnuspe/lib" --host=powerpc-unknown-linux --target=powerpc-unknown-linux --build=i686-pc-linux --prefix=/usr/local
string name = "patrick";
var sw = Stopwatch.StartNew();
// LINQ
name = string.Concat(name.OrderBy(c => c));
sw.Elapsed.Dump("OrderBy: " + name);
// Array.Sort
sw = Stopwatch.StartNew();
return stringArray.Zip(intArray, (key, value) => new KeyValuePair<string, int>(key, value)).ToDictionary(d => d.Key, d => d.Value);
14. Not saving the project before committing changes. Before committing any changes, save the M# Project in the IDE so that msharp modules and database changes are serialised prior to committing your changes.
This is a shooting offence.
15.
Not closing M# before pulling remote changes. Before pulling from any git remote branch, you MUST ‘Save and Close’ the project in M#. Only saving is not sufficient enough, once you have pulled changes, if the project in M# is still open, it will be using the original meta database it used when opening the project even after you pulled changes, which will result in huge consequences such as unintentionally deleted forms and unexpected behaviour.
This is a euthanizing offence.