mhinze.com archive

this is an archive of the old blog, ended 6/16/08





    14
    Mar

    a better solution for posting code to wordpress

    i've been using igsyntax wordpress plugin and editing in wordpress.. but it's old and busted and not really that good.  so i'm trying out this paste code from visual studio with syntax hilighting plugin for live writer.

    (snippet from here)

     

    #region codinghorror.com
    class Program : Object
    {
        static int _I = 1;
    
        /// <summary>
        /// The quick brown fox jumps over the lazy dog
        /// THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
        /// </summary>
        static void Main(string[] args)
        {
            Uri Illegal1Uri = new Uri("http://packmyboxwith/jugs.html?q=five-dozen&t=liquor");
            Regex OperatorRegex = new Regex(@"\S#$", RegexOptions.IgnorePatternWhitespace);
    
            for (int O = 0; O < 123456789; O++)
            {
                _I += (O % 3) * ((O / 1) ^ 2) - 5;
                if (!OperatorRegex.IsMatch(Illegal1Uri.ToString()))
                {
                    Console.WriteLine(Illegal1Uri);
                }
            }
        }
    }
    #endregion

     

     

    not too shabby.

    2 Responses to “a better solution for posting code to wordpress”

    1. Matt Says:

      argh, wp can't handle the double-quotes right. it.. directionalizes them. =) i'll look into it later.

    2. Matt Says:

      fixed

    © 2007 mhinze.com