snippet


  • (C#) Generate random readable passwords

    Here’s a super simple function that generates humanly readable passwords by weaving random consonants and wovels. The generated passwords are by no means secure. I did this for an application used to launch game servers and wanted to make the passwords be easy to communicate over Skype.

  • (C#) Swap two items in a generic list

    Put this in a static class. This will apply to Lists of any type. [c language=”language="#”] public static IList<T> Swap<T>(this IList<T> list, int indexA, int indexB) { if (indexB > -1 && indexB < list.Count) { T tmp = list[indexA]; list[indexA] = list[indexB]; list[indexB] = tmp; } return list; } [/c] Simply call it like…

  • Generate dummy data

    Here’s a great tool for generating dummy data for your database etc. www.generatedata.com

  • (C#) Scroll to bottom of a textbox

    Short snippet: [c language=”#”] textBox.SelectionStart = textBox.TextLength; textBox.ScrollToCaret(); [/c]