Skip to content

Instantly share code, notes, and snippets.

View dzenand's full-sized avatar
🎯
Focusing

Dzenan dzenand

🎯
Focusing
View GitHub Profile
@dzenand
dzenand / useHttpMutation.tsx
Last active August 21, 2023 08:14
A custom hook that wraps around the fetch API to make HTTP requests
import { startTransition, useCallback, useState } from "react";
interface HttpError {
status: number;
message: string;
}
type RequestBody = BodyInit | Record<string, unknown>;
/// <summary>
@dzenand
dzenand / TouchInjector.cs
Created July 24, 2013 08:49
Wrapper around Windows InjectTouchInput API
using System;
using System.Runtime.InteropServices;
namespace Utilities.Input
{
/// <summary>
/// Use this Classes static methods to initialize and inject touch input.
/// </summary>
public class TouchInjector
@dzenand
dzenand / UIAUtils
Created July 24, 2013 08:45
UI Automation snippets
AutomationElement element = AutomationElement.FromPoint(pointer);
if (element != null)
{
var isInvokable = element.GetCurrentPropertyValue(AutomationElement.IsInvokePatternAvailableProperty);
if (isInvokable != null )
{
var invokePattern = element.GetCurrentPattern(InvokePattern.Pattern) as InvokePattern;
if (invokePattern != null)
invokePattern.Invoke();