Skip to content

Instantly share code, notes, and snippets.

View gabrielgreen's full-sized avatar

Aaron Anodide gabrielgreen

  • Direct Agents
  • New York
View GitHub Profile
@gabrielgreen
gabrielgreen / gist:2597413
Created May 4, 2012 20:11
powershell script to delete old files and log what gets deleted
$d = "C:\db\backup"
$today = get-date -uformat "%Y_%m_%d"
$log = "C:\db\backup\" + "Purge_" + $today + ".log"
$a = Get-ChildItem $d -recurse
foreach($x in $a)
{
$y = ((Get-Date) - $x.CreationTime).Days
if ($y -gt 3 -and $x.PsISContainer -ne $True)
{
$deleted = "Deleting - " + $x.fullname + " - Last Write Time - " + $x.LastWriteTime
using System;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;
using DirectTrack;
using System.Linq;
namespace AOP
{
/// <summary>
@gabrielgreen
gabrielgreen / asp.net grid view extensions.aspx.cs
Created March 16, 2012 23:24
asp.net grid view extensions
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Web.UI.WebControls;
namespace ClientPortal
{
public static class Extensions
{
/// <extends><c>GridView</c></extends>
@gabrielgreen
gabrielgreen / Extend decimal type to return a formatted currency string
Created March 16, 2012 19:25
Extend decimal type to return a formatted currency string
public static string ToCurrencyString(this decimal amount, string currency)
{
var map = new Dictionary<string, string>
{
{"USD", "en-us"},
{"GBP", "en-gb"},
{"EUR", "de-de"},
{"AUD", "en-AU"},
{"CAD", "en-us"}
};
@gabrielgreen
gabrielgreen / gist:1158596
Created August 20, 2011 03:13
ef tdd attempt
using EomApp1.Formss.AB2.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;
namespace TestProject6
{
/// <summary>
@gabrielgreen
gabrielgreen / Example.xsd
Created July 16, 2011 10:42
Example XSD
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Lead">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="TName" />
<xs:element name="Interested" type="TBool" />
</xs:sequence>
</xs:complexType>
</xs:element>