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
# WIP # | |
# remove *local* branches merged into origin/master | |
#&"git" branch -d @(git branch --merged origin/master | Select-String -Pattern "^\*|(develop|master)$" -NotMatch) | |
# remove *remote* branches merged into origin/master | |
#&"git" push origin -d @((git branch -r --merged origin/master | Select-String -Pattern ".*(origin/(qa1|qa2|prod)$)" -NotMatch) -Replace " *origin/","") |
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
gitk --all `git reflog | cut -d " " -f 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
(() => { | |
let added = 0; | |
let removed = 0; | |
const fileItem = $(".iterable-item.file"); | |
fileItem.each((i, element) => { | |
added += parseInt($(element).find(".lines-added")[0].innerHTML); | |
removed += parseInt($(element).find(".lines-removed")[0].innerHTML); | |
}); |
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
git checkout -b branch1 | |
touch test.txt | |
git add . | |
git commit -m "Commit 1" | |
for i in `seq 1 10`; do echo $i >> test.txt; done | |
git add . | |
git commit -m "Commit 2" | |
git checkout -b branch2 | |
mv test.txt renamed.txt | |
git add . |
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
BEGIN:VCALENDAR | |
BEGIN:VEVENT | |
DTSTART:20190327 | |
DTEND:20190327 | |
RRULE:FREQ=MONTHLY;WKST=MO;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-3 | |
SUMMARY:Petrol Card | |
END:VEVENT | |
END:VCALENDAR |
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
# Run as admin (https://chocolatey.org/install) | |
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
## Common | |
choco install 7zip.install -y | |
choco install adb --version 33.0.3 -y | |
choco install adobereader -y --pin | |
choco install anydesk.install -y | |
choco install chocolateygui -y --params='/ShowConsoleOutput /DefaultToDarkMode /DefaultToTileViewForLocalSource=$false' | |
choco install discord.install -y --pin |
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
# Variables | |
$repoURL = "git@ssh.dev.azure.com:v3/example/example/example" # or "https://dev.azure.com/example/example/_git/example" | |
$sourceBranch = ("$env:BUILD_SOURCEBRANCH" -replace "refs/heads/") | |
$tagName = ($sourceBranch -replace ".*/(v.*)", '$1') # or $(Get-Date -Format yyy-MM-dd) | |
$userEmail = "email@example.com" | |
$userName = "Example" | |
Write-Host "##[debug] repoURL: $repoURL" | |
Write-Host "##[debug] sourceBranch: $sourceBranch" | |
Write-Host "##[debug] tagName: $tagName" | |
Write-Host "##[debug] userEmail: $userEmail" |
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
(() => { | |
const fileHeading = $(".diff-container .heading").find(".aui-buttons:first"); | |
const minimizeButton = $("<button>").addClass('aui-button').text('Minimize'); | |
minimizeButton.click(function (element) { | |
const fileContents = $(element.target).closest('div.diff-container').find(".diff-content-container"); | |
fileContents.toggle(); | |
}); | |
fileHeading.append(minimizeButton); |
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
-- rename DEFAULT constraints -- | |
DECLARE @sql NVARCHAR(MAX) = N'' | |
SELECT @sql += | |
-- SELECT | |
N'exec sp_rename ' + QUOTENAME(schemas.name + '.' + sys.default_constraints.name) + ', ''DF_' + sys.tables.name + '_' + | |
sys.all_columns.name + ''';' | |
FROM sys.all_columns | |
INNER JOIN sys.tables ON all_columns.object_id = tables.object_id | |
INNER JOIN sys.schemas ON tables.schema_id = schemas.schema_id | |
INNER JOIN sys.default_constraints ON all_columns.default_object_id = default_constraints.object_id |
OlderNewer