Skip to content

Instantly share code, notes, and snippets.

View neo125874's full-sized avatar

Jim neo125874

View GitHub Profile
@nathan-fiscaletti
nathan-fiscaletti / Fader.cs
Last active March 29, 2023 04:29
A C# class used to control fading forms in and out
using System;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FormFader
{
/// <summary>
/// An object used to control fading forms in and out.
/// </summary>
class Fader
@DanielSWolf
DanielSWolf / Program.cs
Last active May 2, 2024 18:33
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@jbtule
jbtule / AESGCM.cs
Last active October 30, 2023 21:14
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
@spooky
spooky / rebundler
Created December 10, 2012 14:41
a hack to make mvc4 bundling work with mvc contrib portable areas
public class Rebundler
{
private readonly Assembly assembly;
private readonly string virtualPath;
private readonly HashSet<string> resourceNames = new HashSet<string>();
public Rebundler(Assembly assembly, string virtualPath)
{
this.assembly = assembly;
this.virtualPath = virtualPath;