Skip to content

Instantly share code, notes, and snippets.

View haydenmc's full-sized avatar
🍍

Hayden McAfee haydenmc

🍍
View GitHub Profile
#include <Unknwn.h>
#include <winrt/Windows.Foundation.h>
using namespace winrt;
using namespace Windows::Foundation;
static constexpr GUID server_clsid // DAA16D7F-EF66-4FC9-B6F2-3E5B6D924576
{
0xdaa16d7f, 0xef66, 0x4fc9, { 0xb6, 0xf2, 0x3e, 0x5b, 0x6d, 0x92, 0x45, 0x76 }
};
#include <Unknwn.h>
#include <winrt/Windows.Foundation.h>
using namespace winrt;
using namespace Windows::Foundation;
struct Stringable : implements<Stringable, IStringable>
{
hstring ToString()
{
@DraTeots
DraTeots / HighResolutionTimer.cs
Last active November 6, 2024 01:33
HighResolutionTimer for .NET
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
namespace HighResolutionTimer
{
@bitristan
bitristan / BLEPeripheral.java
Created July 15, 2015 11:57
Create a ble peripheral service
package com.example.android.bluetoothleadvertiser;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattServer;
import android.bluetooth.BluetoothGattServerCallback;
import android.bluetooth.BluetoothGattService;
@Ciantic
Ciantic / MyElement.ts
Last active January 28, 2016 18:25
CustomElement inheritance in TypeScript (before it's fixed)
import customelement = require('./customelement');
export class MyElement extends customelement.CustomHTMLElement {
public myTest() {
// "this" is fully qualified, includes all methods e.g. addEventListener, dispatchEvent
console.log("this", this);
console.dir(this);
}
}
@altrive
altrive / Get-VMConsole.ps1
Created January 13, 2014 10:52
Sample code to handle Hyper-V VM keyboard via CIM namespace "root\virtualization\v2"
#Requires -Version 3
#Requires -RunAsAdministrator
function Get-VMConsole
{
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string] $VMName
)
@shilrobot
shilrobot / package.sh
Created June 27, 2012 16:54
Making mkbundle work on Windows
#!/bin/bash
# If this doesn't work, ensure you have UNIX line endings in this file
# (\n, not \r\n.) You can use Notepad++ to switch them.
# Cygwin package requirements: gcc-mingw, pkg-config
# If you want to pass -z to mkbundle: mingw-zlib1, mingw-zlib-devel
# crash immediately if anything bad happens
set -o errexit
set -o nounset