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
#delete all the remote tags with the pattern your looking for, ie. DEV- | |
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/% | |
#delete all your local tags | |
git tag | xargs -n 1 -i% git tag -d % | |
#fetch the remote tags which still remain | |
git fetch |
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
CultureSpecificFormats | |
= ====================================== ====================================== | |
d short date 12/10/2019 | |
D long date Tuesday, December 10, 2019 | |
f full date (long date + short time) Tuesday, December 10, 2019 10:18 AM | |
F full date (long date + long time) Tuesday, December 10, 2019 10:18:28 AM | |
g general date (short date + short time) 12/10/2019 10:18 AM | |
G general date (short date + long time) 12/10/2019 10:18:28 AM | |
m Month/Day date December 10 | |
M Month/Day date December 10 |
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
Regex r = new Regex("[<>:\"/|?*~]|\\.\\."); | |
// if it matches, you have bad characters in your Windows file name |
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
_NT_SYMBOL_PATH | |
srv*d:\symbols*https://msdl.microsoft.com/download/symbols | |
srv*c:\temp\symbols*https://msdl.microsoft.com/download/symbols | |
.sympath srv*c:\temp\symbols*https://msdl.microsoft.com/download/symbols | |
.reload | |
_NT_SYMBOL_PATH=SRV*C:\temp\symbols*https://msdl.microsoft.com/download/symbols;SRV*C:\temp\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com | |
"\Program Files (x86)\Windows Kits\8.1\Debuggers\x64\adplus.exe" -iis -hang -o d:\dump -mss d:\symbols |
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
msiexec /i MyApplication.msi /l*v MyLogFile.txt |
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
// these should cover 99% of what you need in C#. | |
// I find it easier to just copy/paste them then go to town. | |
// Of course, if you are adventurous, you can | |
// change your Visual Studio templates! | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Dynamic; |
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's say you have a list of DTOs (data tranfer objects) that someone | |
// posted on the web or anywhere. Items have been removed and added to it. | |
// You need to compare the input with what exists in the database | |
// and find out 1.) new items to add to the database, | |
// 2.) items to delete from the database, and | |
// 3.) items to update in the database. | |
// You don't want to continually rewrite that sort of thing over and over again, like I have. | |
// The problem with conventional methods is that the data types on either side of the | |
// equation are probably different types. | |
// The following will produce the items to add/delete/update by comparing them via |
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
-- SEE BELOW for Attribution... I have modified this sproc to incorporate additional data types | |
-- such as datetimeoffset, etc. | |
-- I have used it on MSSQL Server 2008R2 through 2017 | |
CREATE PROC [dbo].[sp_generate_merge] | |
( | |
@table_name varchar(776), -- The table/view for which the MERGE statement will be generated using the existing data | |
@target_table varchar(776) = NULL, -- Use this parameter to specify a different table name into which the data will be inserted/updated/deleted | |
@from nvarchar(max) = NULL, -- Use this parameter to filter the rows based on a filter condition (using WHERE) | |
@include_timestamp bit = 0, -- Specify 1 for this parameter, if you want to include the TIMESTAMP/ROWVERSION column's data in the MERGE statement |
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
select d.*, | |
stuff((select ', ' + f.Name | |
from FolderItem fi | |
join Folder f on fi.FolderId = f.FolderId | |
where d.DocumentId = fi.DocumentId | |
for xml path('')), 1, 2, '') as folders | |
from Document d |