Skip to content

Instantly share code, notes, and snippets.

View oledid's full-sized avatar
😃
On duty

Ole Morten Didriksen oledid

😃
On duty
View GitHub Profile
@oledid
oledid / web.config
Created June 19, 2015 09:37
IIS Add headers to disable client-side caching for static file
<?xml version="1.0"?>
<configuration>
<location path="index.html">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-cache, no-store, must-revalidate" />
<add name="Pragma" value="no-cache" />
<add name="Expires" value="0" />
</customHeaders>
@oledid
oledid / refresh-path.ps1
Last active September 24, 2015 07:16
PowerShell: Refresh process PATH from machine and user PATHs
# place this script in a place which will always be in the PATH
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
@oledid
oledid / install-kxstitch-v1.3.0.2-on-ubuntu-14.04-trusty.sh
Last active December 11, 2015 08:33
Build and install kxstitch v1.3.0.2 on ubuntu 14.04 trusty
# tested with ubuntu-mate 14.04 2015-12-11 by @oledid
# gist license: MIT
sudo apt-get update
sudo apt-get install git cmake build-essential doxygen libmagick++-dev kdelibs-bin kdelibs5-dev
cd /usr/local/src
mkdir kde
cd kde
git clone https://github.com/KDE/kxstitch.git kxstitch
cd kxstitch
@oledid
oledid / windows.h__.js
Created February 19, 2017 20:00
windows.h.js INFINITY
var ffi = require('ffi'),
ref = require('ref'),
Struct = require('ref-struct'),
Library = require('./Library'),
Type = ref.Type,
NULL = ref.NULL,
isNull = ref.isNull;
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums'];
@oledid
oledid / rdp_audio_settings.md
Last active July 19, 2017 15:08
Remote Desktop audio settings
@oledid
oledid / register a myget feed.markdown
Created August 17, 2017 13:02 — forked from xavierdecoster/register a myget feed.markdown
Store MyGet credentials in your roaming user profile NuGet.config

Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).

Store credentials in machine-level nuget.config (non-transferable)

nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
@oledid
oledid / elevated.ps1
Last active August 18, 2017 21:57
PowerShell: Run script as administrator
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
Set-Location $PSScriptRoot
# do stuff
@oledid
oledid / web.config
Created June 19, 2015 10:10
IIS Redirect HTTP to HTTPS
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
@oledid
oledid / How to measure disk-performance in Windows.md
Created September 5, 2017 10:15
How to measure disk-performance in Windows
@oledid
oledid / CommonEntityBaseExtensions.cs
Last active March 15, 2019 13:07
Serialize LLBLGEN Entity to json without LLBLGEN-specific fields
using System.Collections.Generic;
using System.Dynamic;
using Newtonsoft.Json;
using Your.ORM.EntityClasses; // <- replace
namespace Your.Namespace // <-
{
public static class CommonEntityBaseExtensions
{
/// <summary>