This file contains hidden or 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
| docker build . | |
| docker build -t blog/posts . | |
| docker run [image id or image tag] | |
| docker run -it [image id or image tag][cmd] eg. sh | |
| docker ps | |
| docker exec -it [container id][cmd] | |
| docker logs [container id] | |
| docker stop my_container | |
| sudo systemctl stop docker |
This file contains hidden or 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
| type Props={ | |
| name:string | |
| } & (MaleProps | FemaleProps) | |
| type MaleProps={ | |
| gender:'male' | |
| salary:number | |
| } | |
| type FemaleProps={ |
This file contains hidden or 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
| EXEC sp_spaceused |
This file contains hidden or 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
| exec sp_updatestats | |
| public class ApplicationDbContext : DbContext | |
| { | |
| public ApplicationDbContext() | |
| { | |
| Database.SetCommandTimeout(150000); | |
| } | |
| } |
This file contains hidden or 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 reset --soft HEAD~3 | |
| git commit -m "New message for the combined commit" | |
| git push -f origin MyBranch |
This file contains hidden or 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
| DECLARE @PageNumber AS INT | |
| DECLARE @RowsOfPage AS INT | |
| DECLARE @SortingCol AS VARCHAR(100) ='FruitName' | |
| DECLARE @SortType AS VARCHAR(100) = 'DESC' | |
| SET @PageNumber=1 | |
| SET @RowsOfPage=4 | |
| SELECT FruitName,Price FROM SampleFruits | |
| ORDER BY | |
| CASE WHEN @SortingCol = 'Price' AND @SortType ='ASC' THEN Price END , | |
| CASE WHEN @SortingCol = 'Price' AND @SortType ='DESC' THEN Price END DESC, |
This file contains hidden or 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
| DependencyResolver.Current.GetService<IFeatureFlagService>(); |
This file contains hidden or 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
| async function getZipAsync(form) { | |
| let response = await fetch("/BuyerReport/NewCharges" + '?' + (new URLSearchParams($(form).serialize())).toString()); | |
| let res = await response.blob(); | |
| if (res.type === 'application/zip') { | |
| const downloadUrl = window.URL.createObjectURL(res); | |
| const link = document.createElement('a'); | |
| link.setAttribute('href', downloadUrl); | |
| link.setAttribute('download', 'new charges report'); | |
| link.style.display = 'none'; | |
| document.body.appendChild(link); |
This file contains hidden or 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
| //arranging groupBy deviceId and Qty | |
| var result = []; | |
| cartItems.reduce(function (res, value) { | |
| if (!res[value.deviceId]) { | |
| res[value.deviceId] = { deviceId: value.deviceId, qty: 0 }; | |
| result.push(res[value.deviceId]) | |
| } | |
| res[value.deviceId].qty += value.qty; |
This file contains hidden or 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 | |
| ku.CONSTRAINT_NAME AS "Foreign key", | |
| -- CONCAT("`", ku.TABLE_SCHEMA, "`.`", ku.TABLE_NAME, "`") AS "In", | |
| ku.TABLE_NAME AS "In", | |
| GROUP_CONCAT(ku.COLUMN_NAME) AS "Source column", | |
| CONCAT("`", ku.REFERENCED_TABLE_SCHEMA, "`.`", ku.REFERENCED_TABLE_NAME, "`") AS "References", | |
| GROUP_CONCAT(ku.REFERENCED_COLUMN_NAME) AS "Target column" | |
| FROM information_schema.KEY_COLUMN_USAGE AS ku | |
| WHERE ku.REFERENCED_TABLE_SCHEMA = 'dev.bidenergy.com' | |
| AND ku.REFERENCED_TABLE_NAME = 'site' |
NewerOlder