Skip to content

Instantly share code, notes, and snippets.

View grandsilence's full-sized avatar
💻
Freelancer

Grand Silence grandsilence

💻
Freelancer
View GitHub Profile
@grandsilence
grandsilence / SwitchVirtualDesktopByTaskbarScroll.ahk
Created November 27, 2023 12:10
Windows AutoHotKey script switch virtual desktops by mouse scroll on taskbar or by Alt+Right / Alt+Left
#If MouseIsInvolumecontrolarea() and not WinActive("ahk_class TscShellContainerClass")
WheelUp::Send {LControl down}#{Right}{LControl up}
WheelDown::Send {LControl down}#{Left}{LControl up}
#If
MouseIsInvolumecontrolarea()
{
CoordMode, Mouse, Screen
MouseGetPos, xpos, ypos
if (ypos > A_ScreenHeight-60 and xpos <= A_ScreenWidth-500)
@grandsilence
grandsilence / QueryableExtensions.cs
Created January 20, 2024 20:09
C# .WhereIf(bool, predicate) LINQ Queryable Extension Method
using System.Linq.Expressions;
public static class QueryableExtensions
{
public static IQueryable<T> WhereIf<T>(this IQueryable<T> queryable, bool condition, Expression<Func<T, bool>> predicate)
{
return condition ? queryable.Where(predicate) : queryable;
}
}