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
import time | |
import os | |
from github import Github | |
MESSAGE = """ | |
## :bangbang: ACTION REQUIRED :bangbang: | |
We've updated our formatting configuration for C++ code. (see #22725) |
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
import shutil | |
import os | |
import re | |
# This is the directory of https://github.com/kfstorm/leetcode-1/tree/master/solution | |
dest_dir = "../leetcode-1/solution" | |
dest = {int(re.match(r'^\d+', d).group(0)): os.path.join(dest_dir, d) for d in os.listdir(dest_dir) if os.path.isdir(os.path.join(dest_dir, d))} | |
# This is the directory of https://github.com/kfstorm/LeetCode | |
src_dir = "." |
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
[byte[]] $WrongBytes = 0x00,0xEF,0xFE,0xFF | |
Get-ChildItem -Include *.bat,*.cmd -Recurse | ForEach-Object { | |
$content = Get-Content $_ -Encoding Byte | |
if ($WrongBytes.Contains($content[0])) | |
{ | |
echo $_.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
-Dawt.useSystemAAFontSettings=lcd | |
-Dswing.aatext=true |
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
$rootPath = "D:\Advertiser" | |
$deleteFileBefore = New-Object -typename System.DateTime -argumentlist (2013,12,25,0,0,0) | |
$root = New-Object -typename System.IO.DirectoryInfo -argumentlist $rootPath | |
foreach ($file in $root.GetFiles(“*”, [System.IO.SearchOption]::AllDirectories)) | |
{ | |
if ($file.LastWriteTime -le $deleteFileBefore) | |
{ | |
echo ("Deleting", $file.FullName -join " "); |
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
$files = Get-ChildItem -Recurse | Where-Object {!$_.PSIsContainer} | Where-Object { $_.Name -match '^(.*)((?<!(\.g|\.i))\.cs|\.xaml|\.c|\.cpp|\.h)$' } | |
Select-String -Path $files -Pattern "[a-zA-z]+://[^\s""]+" -AllMatches | % { $_.Matches.Groups[0].Value } | select $_ -Unique | sort |
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
$r1 = "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall" | |
$r2 = "Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall" | |
$r3 = "Registry::HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | |
$r4 = "Registry::HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | |
(Dir $r1) + (Dir $r2) + (Dir $r3) + (Dir $r4) | where {$_.GetValue("SystemComponent") -ne 1}| where {$_.GetValue("ParentDisplayName") -eq $null} | %{$_.GetValue("DisplayName")} | sort -Unique | |
pause |