Skip to content

Instantly share code, notes, and snippets.

View smourier's full-sized avatar

Simon Mourier smourier

View GitHub Profile
@smourier
smourier / App.config
Created June 14, 2017 14:53
SharpMap sample
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="GeoAPI" publicKeyToken="a1a0da7def465678" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.7.5.0" newVersion="1.7.5.0" />
@smourier
smourier / ScanBluetoothPorts.cs
Created August 1, 2017 06:51
ScanBluetoothPorts
using System;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
namespace ConsoleApp2
{
class Program
{
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Access.Dao;
using Microsoft.Win32;
namespace ConsoleApp2
{
class Program
@smourier
smourier / EnumShellFolders.cs
Created December 8, 2017 23:12
Enum Shell Folders
static void Interop()
{
SHCreateItemFromParsingName("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", IntPtr.Zero, typeof(IShellItem).GUID, out IShellItem item);
item.BindToHandler(IntPtr.Zero, BHID_SFObject, typeof(IShellFolder).GUID, out IShellFolder folder);
folder.EnumObjects(IntPtr.Zero, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS, out IEnumIDList list);
do
{
list.Next(1, out IntPtr pidl, out int fetched);
if (fetched == 0)
break;
@smourier
smourier / Form1.cs
Last active January 21, 2018 10:19
Testing with IListView
using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
/*
* Credit for this portion of Imgur Snipping Tool goes to Hans Passant from stackoverflow.com
* http://stackoverflow.com/questions/3123776/net-equivalent-of-snipping-tool
*
* Modified to work with multiple monitors.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
#requires -Modules AcmeSharp, Azure, AzureRM.Websites
#with support for custom subscription id - smourier - 2018/09/12
<#PSScriptInfo
.VERSION 1.4.4
.TITLE GetSSL - Azure Automation
.AUTHOR Dani Alonso, Lee Holmes
.GUID 21904884-3b46-4b37-b388-6a9958592401
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_image/network.dart';
import 'package:http/http.dart' as http;
import 'package:async/async.dart';
import 'package:flutter/foundation.dart';
// note: you'll just need to add 'http' and 'flutter_image' packages to pubspec.yaml
@smourier
smourier / Program.cs
Created February 19, 2020 10:56
List OneDrive root files
using System;
using System.Linq;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.Graph;
using Microsoft.Identity.Client;
namespace ConsoleApp18
{
// needs Microsoft.Graph and Microsoft.Graph.Auth nuget packages
@smourier
smourier / wpflayoutbug.cs
Created March 2, 2020 09:43
WPF layout bug
<Window
x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Width="800"
Height="450"
SizeToContent="WidthAndHeight">
<Grid>
<Grid.ColumnDefinitions>