Skip to content

Instantly share code, notes, and snippets.

View KristofferRisa's full-sized avatar
🏠
Working from home

Kristoffer Risa KristofferRisa

🏠
Working from home
View GitHub Profile
@KristofferRisa
KristofferRisa / ip-from-ipconfig.ps1
Created November 13, 2018 10:24
A simple command to find local IP address using PowerShell.
((ipconfig | findstr [0-9].\.)[0]).Split()[-1]
@KristofferRisa
KristofferRisa / index.html
Created October 30, 2018 07:17
Auto refresh HTML file
data:text/html;charset=utf-8,
<head>
<meta http-equiv="refresh" content="0; url=http://localhost:64090/"/>
</head>
<body>
<style>body{margin:25px;font:16px calibri,'segoe ui'}</style>
<h3>Venter på svar</h3>
<ul>
<li>Set breakpoints in JavaScript/TypeScript in Visual Studio</li>
<li>Automatically break on script errors</li>
@KristofferRisa
KristofferRisa / refresh-google-chrome-design.md
Created August 3, 2018 06:26
Activate the new Google chrome design

Keybase proof

I hereby claim:

  • I am kristofferrisa on github.
  • I am kristofferrisa (https://keybase.io/kristofferrisa) on keybase.
  • I have a public key ASDp5JWiiMe8l5jO9zJoUA3SP6zRDHzfGsZL7pdnFGuDbAo

To claim this, I am signing this object:

#Add a new migration
dotnet ef migrations add InitialCreate
#Remove the most recent migration
dotnet ef migrations remove
#Update the database the latest version
dotnet ef database update
@KristofferRisa
KristofferRisa / dot-net-migration.ps1
Created March 18, 2017 10:11
Basic dot.net Entity Framework migration commands.
dotnet ef migrations add {MigrationName}
dotnet ef migrations remove
dotnet ef database update
Get-Content -Path "C:\scripts\test.txt" -Wait
@KristofferRisa
KristofferRisa / blank-link.html
Created August 31, 2016 16:25
The target="_blank" vulnerability fix
@KristofferRisa
KristofferRisa / GET.cs
Created March 28, 2016 13:24
HTTP request in .Net using HttpClient
using System.Net.Http;
using (var client = new HttpClient())
{
var responseString = client.GetStringAsync("http://www.example.com/recepticle.aspx");
}
<!-- return false prevents this default behaviour inside the form -->
<button onclick="location.href='/test';return false;">Test</button>