- Convert data between incompatible type systems (Object Oriented structures to relational ones)
- Idea: Hide dev from DB Construction.
- Old years: logic in DB. Nowadays: logic in code (testable, with C# you express better your intents)
- SQL one-to-one (Department - Manager). one-to-many (Department - Employees). many-to-many (Student - Teacher).
- How to express them in C# ? (e.g. Customer - Order)
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
# Get cmdlets with specific verb | |
Get-Command -Verb Get | |
# Get cmdlets with specific verb | |
Get-Command -Noun Service | |
# Get cmdlets that end in "-Service" | |
Get-Command *-Service |
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
# useful commands for rabbitmqctl | |
# use sudo and drop .bat when run from Linux (no need in Windows): | |
# get status | |
rabbitmqctl.bat status | |
# list exchanges | |
rabbitmqctl.bat list_exchanges | |
# list bindings |
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
$smo = 'Microsoft.SqlServer.Management.Smo.' | |
$wmi = new-object ($smo + 'Wmi.ManagedComputer'). | |
# List the object properties, including the instance names. | |
$Wmi | |
# Enable the TCP protocol on the default instance. | |
$uri = "ManagedComputer[@Name='NT-44']/ ServerInstance[@Name='SQLEXPRESS']/ServerProtocol[@Name='Tcp']" | |
$Tcp = $wmi.GetSmoObject($uri) | |
$Tcp.IsEnabled = $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
-- see db collation (method 1): | |
EXECUTE sp_helpsort; | |
-- see db collation (method 2): | |
SELECT CONVERT (varchar, SERVERPROPERTY('collation')); | |
-- Take the Database Offline | |
ALTER DATABASE [myDB] SET OFFLINE WITH | |
ROLLBACK IMMEDIATE | |
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
# undo last commit (not pushed) | |
git reset HEAD~ | |
# delete remote branch | |
git push origin --delete feature/login | |
# stash changes, including untracked files and give a store message (git save has been deprecated in favor of git push) | |
git stash push --include-untracked --message "publish scripts & command performance tests" | |
# commit partial file changes |
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
# write to console | |
write-host "ok" | |
# use pipe to write to console | |
(1, 2, 3, 4, 5, 6) | % { write-host $_ } | |
# filter elements and write to console | |
(1, 2, 3, 4, 5, 6) | sort-object -descending | % { write-host $_ } | |
# get json from http |
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
# c : create archive | |
# j : use bzip2 (z for gzip) | |
# v : verbose | |
# f : use file | |
# (optional) S : handle sparse files efficiently | |
tar -cjvf vp-core_stable.tar.bzip2 vp-core_stable\ | |
# x : extract | |
tar xjvf vp-core_stable.tar.bz2 |
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
# checkout branch with changes | |
# --stdout used to produce 1 diff file, instead of n, where n # of commits. | |
git format-patch [branch_to_compare_to] --stdout > all.patch | |
# checkout to new branch. apply patch created | |
git apply all.patch |