Skip to content

Instantly share code, notes, and snippets.

View chrismcv's full-sized avatar

Chris McVittie chrismcv

  • Blue Zinc IT
  • Belfast
View GitHub Profile
@chrismcv
chrismcv / RsaKeyConverter.cs
Created August 15, 2019 08:03 — forked from GlitchedPolygons/RsaKeyConverter.cs
Useful extension method class for converting RSA key strings back and forth from and to XML/PEM. Kudos to misaxi (https://github.com/misaxi), a huge thank you for the original gist!
using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Security.Cryptography;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.OpenSsl;
@chrismcv
chrismcv / data.cs
Last active May 31, 2017 16:10 — forked from gistlyn/data.cs
Join with Alias
using System.Collections.Generic;
using System.Data;
using ServiceStack;
using ServiceStack.OrmLite;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
@chrismcv
chrismcv / main.cs
Created May 12, 2017 14:13 — forked from mythz/main.cs
Custom SQL with Custom Select Fields demo
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
@chrismcv
chrismcv / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console