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
##################### | |
# PREREQUISITES | |
##################### | |
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Set-TaskbarSmall | |
# Console | |
cinst PowerShell | |
cinst poshgit |
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
// This file was initially generated by Windows Terminal 1.4.3243.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
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
grep -rnw --include *.csproj --include *.config '/mnt/e/Source/Repos' -e '[pattern]' > find.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
git rm -r --cached FolderName | |
git commit -m "Removed folder from repository" | |
git push origin master |
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
Alias: | |
git config --global alias.add-commit "!git add -A && git commit" | |
Usage: | |
git add-commit -m "My commit message" | |
Alias: | |
git config --global alias.lg "log --oneline --decorate --all --graph" | |
Usage: | |
git lg |
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
-- http://en.gravatar.com/sqlmonger | |
SELECT | |
QuoteName(OBJECT_SCHEMA_NAME(referencing_id)) + '.' + QuoteName(OBJECT_NAME(referencing_id)) AS [this Object...], | |
o.type_desc, | |
ISNULL(QuoteName(referenced_server_name) + '.', '') | |
+ ISNULL(QuoteName(referenced_database_name) + '.', '') | |
+ ISNULL(QuoteName(referenced_schema_name) + '.', '') | |
+ QuoteName(referenced_entity_name) AS [... depends ON this missing entity name] | |
,sed.referenced_class_desc | |
,case when o.type_desc in( 'SQL_STORED_PROCEDURE' ,'SQL_SCALAR_FUNCTION' ,'SQL_TRIGGER' ,'VIEW') |
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
// Startup.cs | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddTransient<Func<key, IRepository<model>>>(serviceProvider => key => | |
{ | |
var repositoryServiceFactory = new RepositoryServiceFactory(); | |
return repositoryServiceFactory.Build(key, Configuration); | |
}); | |
} | |
. |
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
-- From - http://www.itprotoday.com/software-development/cheat-sheet-calculating-important-dates. | |
--First Day of Last Year | |
SELECT DATEADD(YEAR, DATEDIFF(YEAR, '19000101', GETDATE()) - 1 , '19000101') AS [First Day of Last Year]; | |
GO | |
--First Day of This Year | |
SELECT DATEADD(YEAR, DATEDIFF(YEAR, '19000101', GETDATE()), '19000101') AS [First Day of This Year]; | |
GO |
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
... | |
public void DetatchAllEntities() | |
{ | |
ChangeTracker.Entries().Where(dbEntityEntry => dbEntityEntry.Entity != null).ToList().ForEach(e => e.State = System.Data.Entity.EntityState.Detached); | |
} | |
... |
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
public class Utf8StringWriter : StringWriter | |
{ | |
public override Encoding Encoding => Encoding.UTF8; | |
} |
NewerOlder