Skip to content

Instantly share code, notes, and snippets.

@echo off
rmdir /S /Q "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\"
PAUSE
#deletes all files in the current directory except 5.txt)
rm -rf $(ls | grep -v 5.txt)
/*
prepends the client identifier to all occurences of a theme directory call
useful for when moving data from production to local dev
just update @ClientIdentifier to match the clients theme directory name.
WARNING: only run this locally, handwrite something if your going from local to prod
If you need to debug, just use this statement
SELECT CAST(REPLACE(CAST(HtmlText as nvarchar(max)), '/admin/theme/','/'+ @ClientIdentifier +'/admin/theme/') as ntext) FROM Html
/*
prepends the client identifier to all occurences of a theme directory call
useful for when moving data from local to production
just update @ClientIdentifier to match the clients theme directory name.
WARNING: YOU HAVE TO MANUALLY SET THE LENGTH IN SUBSTRING(HtmlText, 0, 6) = @ClientIdentifier TO MATCH THE LENGTH OF THE @ClientIdentifier.
If you need to debug, just use this statement
SELECT CAST(REPLACE(CAST(HtmlText as nvarchar(max)), '/admin/theme/','/'+ @ClientIdentifier +'/admin/theme/') as ntext) FROM Html
SELECT ci.ProductID, COUNT(ci.ProductID) AS Total
FROM CartItem AS ci INNER JOIN
SportPick AS sp ON sp.SportPickID = ci.ProductID
GROUP BY ci.ProductID, sp.Winner
ORDER BY Total
@jonezy
jonezy / updateconnectionstring.sql
Created November 29, 2010 15:12
changes all the connection strings to point to your local sql instance
UPDATE Site SET ConnectionString = REPLACE(ConnectionString, 'SDFMAXVCUS0667', 'NAMEOFYOURLOCALSQLSERVER')
@jonezy
jonezy / gist:822706
Created February 11, 2011 17:24
default heading sizes
/* resets the heading sizes */
h1 { font-size: 2em;}
h2 { font-size: 1.5em;}
h3 { font-size: 1.17em;}
h5 { font-size: .83em;}
h6 { font-size: .75em;}
@jonezy
jonezy / .gitignore
Created March 3, 2011 13:46
gitignore file for .net projects
bin
obj
*.suo
*.user
*.*~
@jonezy
jonezy / EmailHelper.cs
Created May 11, 2011 20:43
Static email methods that make life eas(ier)
using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Text.RegularExpressions;
namespace MiniRideAndDrive.Web {
public static class EmailHelper {
public static string EmailValidationExpression {
get {
return @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
using System;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using MiniRideAndDrive.Web.Data;
public static partial class Helpers {
public static string BaseUrl {