Skip to content

Instantly share code, notes, and snippets.

@archer884
archer884 / PipeDownWIthArgs
Created October 22, 2014 21:59
Simple command line tool for generating HTML from Markdown
using CommonMark;
using System;
using System.IO;
using System.Linq;
namespace PipeDown
{
class Program
{
static void Main(string[] args)
@archer884
archer884 / SortedEnumThingy
Created October 16, 2014 15:56
Victory is mine.
public static MvcHtmlString SortedEnumDropDownListFor<TModel, TEnum>(
this HtmlHelper<TModel> htmlHelper,
Expression<Func<TModel, TEnum>> expression,
bool descending = false)
{
var propertyInfo = (expression.Body as MemberExpression).Member as PropertyInfo;
var options = Enum.GetValues(typeof(TEnum)).Cast<TEnum>().Select(code => new SelectListItem()
{
Selected = code.Equals((TEnum)propertyInfo.GetValue(htmlHelper.ViewData.Model)),
Text = code.ToString(),
open System
module Decimal =
let Zero = 0M
let One = 1M
let ceil (d: decimal): decimal = System.Math.Ceiling(d)
let floor (d: decimal): decimal = System.Math.Floor(d)
@archer884
archer884 / ChoiceMaker
Last active August 29, 2015 14:07
Simplifies management and decision-making processes
using System;
using System.Linq;
namespace ChoiceMaker
{
class Program
{
static void Main(string[] args)
{
if (!args.Any())
@archer884
archer884 / EpisodeStitcher
Created September 3, 2014 02:50
Episode stitcher togetherer
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace _01_Episodes
{