Skip to content

Instantly share code, notes, and snippets.

@atifaziz
atifaziz / JamesFormatter.cs
Created January 5, 2009 10:49
Updated JamesFormatter from Fun with Named Formats
// http://haacked.com/archive/2009/01/04/fun-with-named-formats-string-parsing-and-edge-cases.aspx#70316
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Web.UI;
namespace StringLib
{
using System.Web;
@ntulip
ntulip / HtmlSanitizer.cs
Created February 7, 2011 14:22
HTML Sanitizer for C#
/**
Copyright (c) 2009 Open Lab, http://www.open-lab.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@unicodefreak
unicodefreak / gist:1901458
Created February 24, 2012 14:59
Include tag for underscore template
// based on http://emptysquare.net/blog/adding-an-include-tag-to-underscore-js-templates/
// include tag for underscore templates
// <% include template-id %>
var _underscore_template = _.template;
_.template = function(str, data) {
// match "<% include template-id %>"
return _underscore_template(
str.replace(
/<%\s*include\s*(.*?)\s*%>/g,
#!/usr/bin/env bash
set -eu
## The Godeps file is expected to have lines like so:
#
# github.com/nu7hatch/gotrail v2.6
#
## where the first element is the import path and the second is a tag
## or commit SHA in the project.