Skip to content

Instantly share code, notes, and snippets.

@samdenty
samdenty / README.MD
Last active February 5, 2026 12:40
VS Code CSS addition to increase readability on file tree.

How to install

Custom CSS plugin

Install the custom CSS plugin, then make a file on your computer that will hold your custom CSS, I like to make one in my home directory called ~/.vscodestyles.css and then add the CSS into it.

Once done, open your command palette and select enable custom CSS and JS

using System.Runtime.InteropServices;
public class FileOperationAPIWrapper
{
/// <summary>
/// Possible flags for the SHFileOperation method.
/// </summary>
[Flags]
public enum FileOperationFlags : ushort
{
@michyprima
michyprima / LayoutModification.xml
Created January 5, 2018 22:21
Make Windows 10 non-LTSB bareable (dism stuff is for 1709)
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6">
</defaultlayout:StartLayout>
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
@ebidel
ebidel / monitor_internet_connection.js
Last active February 28, 2018 18:32
Puppeteer: monitor status of internet connectivity using headless Chrome
Moved to https://github.com/ebidel/puppeteer-examples/blob/master/monitor_internet_connection.js

YouTube video downloader

Script Node.JS for downloading videos from YouTube. You can use some options to choose the features of the video, like format, size, etc. This script only produce a file video.sh_, with all commands to download a video from YouTube.

Requirements

  • NodeJS 8.4.0 or higher.
@keithga
keithga / Get-LatestUpdate.ps1
Last active September 26, 2024 21:54
script to get latest build.
<#
.SYNOPSIS
Get the latest Cumulative update for Windows
.DESCRIPTION
This script will return the list of Cumulative updates for Windows 10 and Windows Server 2016 from the Microsoft Update Catalog.
.NOTES
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved.
@t-mat
t-mat / desktopsmallicon.cmd
Last active February 4, 2023 18:39
[Win32] [Powershell] Set Desktop Small Icon
@setlocal enabledelayedexpansion & set "ARGS=%*" & powershell -nop -ex Bypass -c "Add-Type (gc '%~dpf0'|select -Skip 1|Out-String); exit [Program]::Main();" & exit /b !ERRORLEVEL!
using System;
using System.Runtime.InteropServices;
public static class Program {
[DllImport("user32.dll")]
static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle);
[DllImport("user32.dll", EntryPoint="GetWindowLongPtr")]
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 19, 2026 02:55
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@KZeronimo
KZeronimo / package-full.ps1
Last active January 17, 2025 17:51
Winget based Boxstarter Script - Full - Windows 10/11
# Set TLS 1.2
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
# Import Choco Install-*
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force
# Set up choco cache location to work around Boxstarter Issue 241
$chocoCache = (Join-Path ([Environment]::GetEnvironmentVariable("LocalAppData")) "Temp\ChocoCache")
New-Item -Path $chocoCache -ItemType directory -Force
# Remove *.tmp from the choco cache directory so the ad-hoc package installs using Install-ChocolateyPackage behave idempotently - this is a hack
@jpoehls
jpoehls / kill-processes.ps1
Created April 4, 2017 20:54
kill-processes.ps1
# kill-processes.ps1
# This script supports being run with -WhatIf and -Confirm parameters.
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param (
# Regex of the states that should be included in the process killing field.
[string]$IncludeStates = '^(Disc)$', # Only DISCONNECTED sessions by default.
# Regex of the processes to kill
[string]$KillProcesses = '^(OUTLOOK)$', # Only OUTLOOK by default.
[int]$GracefulTimeout = 15 # Number of seconds to wait for a graceful shutdown before forcefully closing the program.