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
1. create a node and name it 404 | |
2. in umbracoSettings.config add the id of the node you just created to <errors><error404> | |
3. add <httpErrors existingResponse="PassThrough"/> to <system.webServer> in web.config |
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
@HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)@Url.Content("~/" + img.Url + "?h=1000&q=90") |
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
1. download chrome canary (like chrome beta) | |
2. create a alias/.bat-file (if you want) | |
MAC: | |
open terminal and do: | |
~/.bash_profile | |
navigate to a new line and add: | |
alias corsdev=’open -n -a /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --args --disable-web-security’ |
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
~/.bash_profile | |
ex: | |
alias utv2='cd /Volumes/Utv/Umb/' | |
alias mobildev='open -n -a /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --args --disable-web-security' |
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
@using Newtonsoft.Json | |
Response.Clear(); | |
Response.Buffer = true; | |
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8; | |
Response.Write(JsonConvert.SerializeObject(new { | |
Fraktkostnad = @shop.Basket.FormattedShippingAmount, | |
Total = @shop.Basket.FormattedRowTotalAmount, | |
Moms = @shop.Basket.FormattedRowTotalVatAmount |
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
function getWatchers(root) { | |
root = angular.element(root || document.documentElement); | |
var watcherCount = 0; | |
function getElemWatchers(element) { | |
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope); | |
var scopeWatchers = getWatchersFromScope(element.data().$scope); | |
var watchers = scopeWatchers.concat(isolateWatchers); | |
angular.forEach(element.children(), function (childElement) { | |
watchers = watchers.concat(getElemWatchers(angular.element(childElement))); |
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
var groupedPerCountry = resellersNode.Children() | |
.Where(c => !string.IsNullOrWhiteSpace(c.GetPropertyValue<string>("dealerCountry"))) | |
.ToList() | |
.ToLookup(c => c.GetPropertyValue<string>("dealerCountry").CleanUpper()); | |
foreach (var group in groupedPerCountry) | |
{ | |
@shopscontainer(group, group.Key) | |
} |
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
install plugin | |
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git | |
in config.xml | |
<access origin="https://foo.se/api/*"/> | |
in index.html | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com foo.se https://foo.se; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"> | |
<!--http://www.raymondcamden.com/2015/05/25/important-information-about-cordova-5--> | |
<!--http://content-security-policy.com/--> |
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 static Regex rgx = new Regex("[^a-zA-Z0-9-]"); | |
public static string CreateProductUrl(this UmbracoHelper umbraco, IPublishedContent product) | |
{ | |
var prodname = product.Name.ToLower() | |
.Replace(" ", "-") | |
.Replace("å", "a") | |
.Replace("ä", "a") | |
.Replace("ö", "o"); |
OlderNewer