This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$env:Path.split(";") | ForEach-Object { | |
Get-ChildItem -Path $_ -ErrorAction SilentlyContinue | |
} | Where-Object { $env:PATHEXT.ToLower() -match $_.Extension.ToLower() } | Select-Object FullName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public ListNode deleteMiddle(ListNode head) { | |
// Edge case: return nullptr if there is only one node. | |
if (head.next == null) | |
return null; | |
// Initialize two pointers, 'slow' and 'fast'. | |
ListNode slow = head, fast = head.next.next; | |
// Let 'fast' move forward by 2 nodes, 'slow' move forward by 1 node each step. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UnionFind { | |
private int[] root; | |
private int[] rank; | |
public UnionFind(int n) { | |
this.root = new int[n]; | |
this.rank = new int[n]; | |
for (int i = 0; i < n; ++i) { | |
this.root[i] = i; | |
this.rank[i] = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm uninstall -k --user 0 com.eterno | |
pm uninstall -k --user 0 com.king.candycrushsaga | |
pm uninstall -k --user 0 com.opera.max.oem | |
pm uninstall -k --user 0 com.opera.max.preinstall | |
pm uninstall -k --user 0 com.snapchat.android | |
pm uninstall -k --user 0 in.amazon.mShop.android.shopping | |
pm uninstall -k --user 0 in.mohalla.sharechat | |
pm uninstall -k --user 0 in.mohalla.video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified version of code from where I got this: https://ourcodeworld.com/articles/read/1072/how-to-convert-a-html-svg-node-to-base64-with-javascript-in-the-browser | |
// $0 gets the currently selected element in 'inspect element' mode in dev tools. make sure you have selected the SVG tag element | |
var serializedSVG = new XMLSerializer().serializeToString($0); | |
var base64Data = window.btoa(serializedSVG); | |
// printing on to console which would be a clickable link | |
console.log("data:image/svg+xml;base64," + base64Data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
for /F %%i in ('adb shell settings get global private_dns_mode') do set dnsmode=%%i | |
for /F %%i in ('adb shell settings get global private_dns_specifier') do set dnshost=%%i | |
echo current dns setting is: !dnsmode! | |
if "!dnsmode!"=="hostname" ( | |
echo current dns host is: !dnshost! | |
echo turning off private dns... | |
adb shell settings put global private_dns_mode off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem to disable private dns | |
adb shell settings put global private_dns_mode off | |
rem to enable private dns with hostname (example with dns.adguard.com) | |
adb shell settings put global private_dns_mode hostname | |
adb shell settings put global private_dns_specifier dns.adguard.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance, force | |
global PreviousActiveWindow | |
; Requires windows terminal preview: https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701 | |
#`:: | |
DetectHiddenWindows, On | |
if (WinExist("ahk_class CASCADIA_HOSTING_WINDOW_CLASS")) { | |
if(WinActive("ahk_class CASCADIA_HOSTING_WINDOW_CLASS")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Requires Null Keyboard https://play.google.com/store/apps/details?id=com.wparam.nullkeyboard | |
rem Author: Sharun Kumar | |
setlocal ENABLEDELAYEDEXPANSION | |
for /F %%i in ('adb shell settings get system screen_brightness') do set brightness=%%i | |
for /F %%i in ('adb shell settings get secure default_input_method') do set ime=%%i | |
for /F "tokens=1,2,3,4,5,6,7,8" %%G in ('adb shell media volume --get') do ( | |
set vol=%%J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
set firstline=. | |
set secondline=. | |
@FOR /F "tokens=1 delims=^^" %%G IN ('dir /s /a "%~1"') DO ( | |
set firstline=!secondline! | |
set secondline=%%G | |
) | |
echo !firstline! |