Skip to content

Instantly share code, notes, and snippets.

View pnp0a03's full-sized avatar

pnp0a03

View GitHub Profile
@pnp0a03
pnp0a03 / gist:3af5127162b5f9816e9098d8f702e88f
Created March 16, 2019 04:31
Using GetNativeSystemInfo from UWP app
View gist:3af5127162b5f9816e9098d8f702e88f
[DllImport("api-ms-win-core-sysinfo-l1-2-3.dll")]
static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
public ushort processorArchitecture;
ushort reserved;
public uint pageSize;
@pnp0a03
pnp0a03 / WheelClock.UWP.17134.csproj
Created March 4, 2019 13:18
WWC csproj 17763 vs 17134
View WheelClock.UWP.17134.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{452A5469-20F7-402F-87FD-27BFA0AABB56}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WheelClock</RootNamespace>
@pnp0a03
pnp0a03 / Futalocation.xaml.cs
Last active January 28, 2018 02:30
GenerateActivityAsync
View Futalocation.xaml.cs
private async Task<bool> GenerateActivityAsync(FutaThreadView.PostsLoadFinishedEventArgs e)
{
UserActivityChannel channel = UserActivityChannel.GetDefault();
UserActivity userActivity = await channel.GetOrCreateUserActivityAsync(e.Url);
userActivity.ActivationUri = new Uri(e.Url.Replace("http://", "ddlgf10://") + "?View=Post");
userActivity.VisualElements.DisplayText = e.Title + " " + GenerateCardSubTitle(e);
var cardstring = GenerateCardJsonString(e);
// To use the adaptive card, enable this line.
@pnp0a03
pnp0a03 / Futalocation.xaml.cs
Created January 28, 2018 01:40
GenerateCardJsonString
View Futalocation.xaml.cs
private string GenerateCardJsonString(FutaThreadView.PostsLoadFinishedEventArgs e)
{
string retVal = "";
string title = e.Title;
string subTitle = GenerateCardSubTitle(e);
AdaptiveCard card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));
card.BackgroundImage = new Uri(e.ThumbUrl);
View AdaptiveCard Sample
{
"type": "AdaptiveCard",
"version": "1.0",
"backgroundImage": "http://i.4cdn.org/c/1515200423386.jpg",
"body": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"text": "Megumin Thread #12",
@pnp0a03
pnp0a03 / Main.xaml.cs
Created November 5, 2017 09:28
FCU commandline sample - Main.xaml.cs
View Main.xaml.cs
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ProcessPassedCommandlineArguments(e.Parameter);
}
public void ProcessPassedCommandlineArguments(object arguments)
{
tbArguments.Text = arguments as string;
}
@pnp0a03
pnp0a03 / Main.xaml
Created November 5, 2017 09:19
FCU commandline - main.xaml
View Main.xaml
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@pnp0a03
pnp0a03 / Appx.xaml.cs
Last active November 5, 2017 09:16
FCU commandline option - OnActivated Override
View Appx.xaml.cs
protected override void OnActivated(IActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
if(ActivationKind.CommandLineLaunch == args.Kind)
{
var commandArgs = args as CommandLineActivatedEventArgs;
var operation = commandArgs.Operation;
string arguments = operation.Arguments;
string activationPath = operation.CurrentDirectoryPath;
@pnp0a03
pnp0a03 / Package.appxmanifest.xml
Last active November 5, 2017 10:22
FCU - commandline
View Package.appxmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap mp">
<Identity Name="55884DDLG.FCUTrial" Publisher="CN=0ADFD460-31D2-4A92-A4A8-DF66FF78B5F8" Version="1.1.1.0" />
<mp:PhoneIdentity PhoneProductId="f0696861-c4dc-44b1-87f7-97601f0c45c3" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>FCU Trial</DisplayName>
<PublisherDisplayName>DDLG</PublisherDisplayName>
@pnp0a03
pnp0a03 / Package.appxmanifest.xml
Created November 5, 2017 07:02
FCU Commandline sample - Package.appxmanifest
View Package.appxmanifest.xml
<?xml version="1.0" encoding="utf-8"?><Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"  xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap mp">  <Identity Name="55884DDLG.FCUTrial" Publisher="CN=0ADFD460-31D2-4A92-A4A8-DF66FF78B5F8" Version="1.1.1.0" />  <mp:PhoneIdentity PhoneProductId="f0696861-c4dc-44b1-87f7-97601f0c45c3" PhonePublisherId="00000000-0000-0000-0000-000000000000" />  <Properties>    <DisplayName>FCU Trial</DisplayName>    <PublisherDisplayName>DDLG</PublisherDisplayName>    <Logo>Assets\StoreLogo.png</Logo>  </Properties>  <Dependencies>    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />  </Dependencies>  <Resources>    <Resource Language="x-generate" />  </Resources>  <Applications>    <Application Id="App" Executable="$targetnameto