Skip to content

Instantly share code, notes, and snippets.

View jespernohr's full-sized avatar

Jesper Nøhr jespernohr

View GitHub Profile
public class CertificateExpireChecker
{
private TimeSpan TimeOut => TimeSpan.FromSeconds(5);
public string Url { get; }
public DateTime LimitDate => DateTime.Now;
public bool IsExists => Certificate != null;
public X509Certificate2 Certificate { get; private set; }
public string CommonName => Certificate?.SubjectName.Name.Split(',').FirstOrDefault(x => x.StartsWith("CN="));
public TimeSpan? DaysLeft => ExpiredDate - LimitDate;
@jrosell
jrosell / TwitterPowerQuery.pbi
Created December 11, 2017 13:27
This Power Query script gets an bearer token and performs a tweet search from the Twitter REST API
/*
Author: https://chris.koester.io/index.php/2015/07/16/get-data-from-twitter-api-with-power-query/
Twitter REST API
https://dev.twitter.com/oauth/application-only
Requires establishing a Twitter application in order to obtain a Consumer Key & Consumer Secret
https://apps.twitter.com/
IMPORTANT - The Consumer Key and Consumer secret should be treated as passwords and not distributed
*/
let