Skip to content

Instantly share code, notes, and snippets.

@ridomin
ridomin / StartUWPFromCommandLine.ps1
Created August 31, 2016 17:14
Run UWP app from command line
<#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
#Based on https://www.visualstudio.com/docs/build/scripts/index
# Enable -Verbose option
[CmdletBinding()]
$VersionRegex = "\d+\.\d+\.\d+\.\d+"
$ManifestVersionRegex = " Version=""\d+\.\d+\.\d+\.\d+"""
if (-not $Env:BUILD_BUILDNUMBER)
{
"%PROGRAMFILES(X86)%\MSBuild\14.0\bin\msbuild.exe" /p:AppxBundlePlatforms="x86|x64|ARM" /p:AppxBundle=Always /p:configuration="release"
@ridomin
ridomin / nuget.cmd
Last active September 23, 2016 06:08
Use latest Nuget
PowerShell (New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','nuget.exe');Start-Process 'nuget.exe' %1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
namespace ZumoExtensions
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
toastTextElements[0].AppendChild(toastXml.CreateTextNode("msg"));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(DateTime.Now.ToString()));
ToastNotification toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);

Keybase proof

I hereby claim:

  • I am ridomin on github.
  • I am rido (https://keybase.io/rido) on keybase.
  • I have a public key whose fingerprint is A5E4 1E2C 584F A668 A7E1 F7AE 8D48 67D5 0420 8497

To claim this, I am signing this object:

namespace Rido.SingleInstance
{
public class SingleInstanceManager<T> : Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
where T: System.Windows.Application, new()
{
T app;
public SingleInstanceManager()
{
base.IsSingleInstance = true;
}
awk -v cmd='openssl x509 -noout -subject' '
/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
@ridomin
ridomin / SSLInspector.cs
Created January 10, 2018 03:20
SSLInspector
namespace SSLInspector
{
using System;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
class Program
{