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
void Main() | |
{ | |
string pattern = @"^(AB|DD|DG|EH|FK|G|HS|IV|KA|KW|KY|ML|PA|PH|TD|ZE)\d{1,2}\s?(\d[\w]{2})"; | |
string postcode = "AB6 5DD"; | |
Match match = Regex.Match(postcode, pattern, RegexOptions.IgnoreCase); | |
if (match.Success) | |
{ | |
"Scotland".Dump(); |
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
UPDATE [dbo].[NDCPackage] | |
SET [NDCPACKAGECODE]= | |
( | |
CASE CHARINDEX('-', [NDCPACKAGECODE]) | |
WHEN 5 THEN REPLACE('0'+SUBSTRING([NDCPACKAGECODE],CHARINDEX('', [NDCPACKAGECODE]), LEN([NDCPACKAGECODE])+1), '-', '') | |
WHEN 6 THEN CASE (CHARINDEX('-', REVERSE([NDCPACKAGECODE]))) | |
WHEN 3 THEN REPLACE(LEFT([NDCPACKAGECODE], (CHARINDEX('-', [NDCPACKAGECODE])))+'0'+SUBSTRING([NDCPACKAGECODE], CHARINDEX('-', [NDCPACKAGECODE])+1, LEN([NDCPACKAGECODE])), '-', '') | |
WHEN 2 THEN REPLACE(STUFF([NDCPACKAGECODE], LEN([NDCPACKAGECODE])- CHARINDEX('-', REVERSE([NDCPACKAGECODE]))+1, 1, '0'), '-', '') | |
END | |
END |
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
For Learning Azure | |
https://docs.microsoft.com/en-gb/learn/paths/azure-fundamentals/ | |
https://docs.microsoft.com/en-gb/learn/paths/store-data-in-azure/ | |
https://docs.microsoft.com/en-us/learn/paths/deploy-a-website-with-azure-app-service/ | |
https://docs.microsoft.com/en-gb/learn/paths/administer-containers-in-azure/ |
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
Scott Gu | |
https://weblogs.asp.net/scottgu/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
} | |
/* | |
##Device = Laptops, Desktops | |
##Screen = B/w 1025px to 1280px |
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
CSS - Hand Book | |
----------------- | |
https://medium.freecodecamp.org/the-css-handbook-a-handy-guide-to-css-for-developers-b56695917d11 | |
PDF - | |
https://flaviocopes.com/page/ebooks-links/ |
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 the following in console, this should add jquery support to the head of the document, then jquery can be used in console | |
var script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script); |
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
//ORGINALLY TAKEN FROM https://gist.github.com/rustyswayne/598049064a02fce1597c | |
//------------------------------------------------------------------------------ | |
// Adding the shipmethod is typically done in the back office through the UI. | |
// Interested in the use case to dynamically add theses? | |
var key = Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey; | |
var defaultCatalogKey = Constants.DefaultKeys.Warehouse.DefaultWarehouseCatalogKey; | |
// this would have to be done through the back office as it uses an internal service | |
var us = MerchelloContext.Current.Services.StoreSettingService.GetCountryByCode("US"); |
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
First method is try http://embedresponsively.com/ | |
-------------- | |
Second Method | |
--------------- | |
CSS | |
.video-container { | |
position: relative; | |
padding-bottom: 56.25%; /*16:9*/ |
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
Refer https://github.com/east-sussex-county-council/Escc.Web.SecurityConfig | |
**Content Security Policy is quite a bit of restricting the contents that the client can have, so had to be thought out before implementing** | |
Content-Security-Policy - This is pretty hard to implement as this http-header is to whitelist what contents are allowed in the web site. | |
Refer : https://rehansaeed.com/content-security-policy-for-asp-net-mvc/ & https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<remove name="X-Powered-By" /> | |
<add name="X-Frame-Options" value="SAMEORIGIN" /> | |
<add name="X-Content-Type-Options" value="nosniff" /> |
NewerOlder