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
$^s:: ; only capture actual keystrokes | |
SetTitleMatchMode, 2 ; match anywhere in the title | |
IfWinActive, Sublime Text 2 ; find Sublime Text | |
{ | |
Send ^s ; send save command | |
IfWinExist, Mozilla Firefox ; find firefox | |
{ | |
WinActivate ; use the window found above | |
Send ^r ; send browser refresh | |
WinActivate, Sublime Text 2 ; get back to Sublime Text |
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
Gå in på sidan på IISen så finns en MIME-typ hanterare. Lägg till | |
Detta skapar också en web.config fil! NICE! |
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
Bookmarklet: | |
javascript: var x,log=[],total=0;for (x in localStorage){log.push(x + " = " + ((localStorage[x].length * 2)/1024/1024).toFixed(2) + " MB"); total+=localStorage[x].length * 2}; log.push("Total = " + (total/1024/1024).toFixed(2)+ " MB"); alert(log.join("\n")); | |
Console: | |
for(var x in localStorage)console.log(x+"="+((localStorage[x].length * 2)/1024/1024).toFixed(2)+" MB"); |
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
@{ | |
var longitude = Location.Longitude.ToString() ?? null; | |
var latitude = Location.Latitude.ToString() ?? null; | |
var googlemapSource = "https://www.google.com/maps/embed/v1/"; | |
if (!string.IsNullOrEmpty(latitude) && !string.IsNullOrEmpty(longitude)) | |
{ | |
// map mode | |
googlemapSource += "place?"; |
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))); |
OlderNewer