Skip to content

Instantly share code, notes, and snippets.

View vector623's full-sized avatar

David Gallmeier vector623

View GitHub Profile
@vector623
vector623 / FormsAuthenticationTicketHelper.cs
Last active September 5, 2019 23:01 — forked from dazinator/FormsAuthenticationTicketHelper.cs
Decrypt a Legacy ASP.NET Forms Authentication Cookie (that uses SHA1 validation, and AES encryption) - without horrendous dependencies on system.web.. This allows you to decrypt a forms authentication cookie that was created in ASP.NET 3.5, from an ASP.NET 5 application.
internal static class FormsAuthenticationTicketHelper
{
private const byte CURRENT_TICKET_SERIALIZED_VERSION = 0x01;
private const int MAX_TICKET_LENGTH = 4096;
// Resurrects a FormsAuthenticationTicket from its serialized blob representation.
// The input blob must be unsigned and unencrypted. This function returns null if
// the serialized ticket format is invalid. The caller must also verify that the
// ticket is still valid, as this method doesn't check expiration.
@vector623
vector623 / c#-to-rust.md
Last active May 5, 2019 23:28 — forked from carols10cents/c#-to-rust.md
C# to Rust Cheat Sheet

C# to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in C# and Rust so that programmers most comfortable with C# can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Table of Contents

@vector623
vector623 / redshift-cheatsheet.sql
Last active September 13, 2018 12:15 — forked from rudylee/redshift-cheatsheet.sql
Redshift Cheatsheet
## General Stuff
### List of all tables
SELECT * FROM pg_catalog.pg_tables
### Create new user and give it superuser access
create user adminuser createuser password '1234Admin';
alter user adminuser createuser;
### Create user without superuser privilege
@vector623
vector623 / PhantomRunner.cs
Created February 20, 2018 17:57 — forked from DotNetNerd/PhantomRunner.cs
Grabbing a site in C# using phantomJS
class Program
{
static void Main(string[] args)
{
var grabby = new Grabby();
string output = grabby.Grab("http://www.dotnetnerd.dk/cv");
Console.WriteLine(output);
File.WriteAllText("c:\\test.html", output);
}