Skip to content

Instantly share code, notes, and snippets.

List<MyClass> matches = new List<MyClass>();
foreach(MyClass item in items){
if(item.Category == selectedCategory)
{
matches.Add(item);
}
}
List<MyClass1> list = new List<MyClass1>();
MyClass1 item = new MyClass1();
list.Add(item);
list.Remove(item);
@slynch13
slynch13 / LessTransform.cs
Created September 12, 2012 02:20
dotless css bundle transform without imports
public class LessTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
response.Content = Less.Parse(response.Content, null);
response.ContentType = "text/css";
}
}
@slynch13
slynch13 / LessTransform With Path
Created September 10, 2012 06:02
dotless css bundle transform
public class LessTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
var parser = new Parser();
var importPath = context.HttpContext.Server.MapPath(context.BundleVirtualPath);
parser.Importer = new BundleImporter(importPath);
var env = new Env { Compress = true, Debug = true, KeepFirstSpecialComment = true, DisableVariableRedefines = false };