Skip to content

Instantly share code, notes, and snippets.

View PJensen's full-sized avatar

Pete Jensen PJensen

  • New England
View GitHub Profile
@PJensen
PJensen / MotleyFoolCapsRatingClient.cs
Last active January 4, 2018 01:54
Downloads CAPS ratings from the Motley Fool API
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml.Serialization;
@XVilka
XVilka / TrueColour.md
Last active October 29, 2024 09:43
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@PJensen
PJensen / FindDupesByHash.cs
Created August 17, 2012 01:33
Really quick hack to find duplicate files in a directory structure.
//
// FindDupesByHash.cs
//
// Author:
// pjensen <[email protected]>
//
// Description:
// Really quick hack to find duplicate files in a directory structure.
//
@PJensen
PJensen / FindDupes.cs
Last active April 8, 2021 17:38
Find duplicate files within directory structure.
//
// Main.cs
//
// Author:
// pjensen <[email protected]>
using System;
using System.Security.Cryptography;
using System.IO;
using System.Collections.Generic;
@PJensen
PJensen / nThNumber.cs
Created October 4, 2010 15:25
private static string nth(int n)
/// <summary>
/// Given a number (n) returns a string referring to that number (n)
/// using (st), (nd), (th), (rd) as suffixes.
/// </summary>
/// <param name="n">The number to convert to nth notation.</param>
/// <returns>The passed number in nth notation.</returns>
private static string nth(int n)
{
switch (n) {
case 11:
@PJensen
PJensen / a_RandomChoice.cs
Created September 20, 2010 16:50
Similar to Pythons Random-choice but for C#
/// <summary>
/// RandomChoice
/// <example>
/// <code>
/// var flowerColor = Dice.RandomChoice<Colour>(new List<Colour>()
/// {
/// new Colour(ConsoleColor.Magenta, ConsoleColor.Green),
/// new Colour(ConsoleColor.Red, ConsoleColor.Green),
/// new Colour(ConsoleColor.Yellow, ConsoleColor.Green),
/// new Colour(ConsoleColor.DarkMagenta, ConsoleColor.Green),