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 / index.html
Created October 16, 2019 14:15 — forked from DavidWells/index.html
Webpack DLL setup for projects. How it works: https://github.com/MoOx/phenomic/issues/532#issuecomment-233830928
<!doctype html public>
<meta charset="utf-8"/>
<title>HTML with venderPackages.dll.js</title>
<body>
<div id="root"></div>
<!-- node_modules/PROJECT-NAME-TEMP-FOLDERNAME-dll/vendorPackages.dll.js generated by postinstall.js running webpack with webpack.dll.config.js -->
<script src="/vendorPackages.dll.js"></script>
<script src="/__build__/bundle.js"></script>
</body>
</html>
@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>
@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 / 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 / km-0414.md
Last active April 24, 2021 16:48
Norwegian keyboard mapping for XRDP
@oledid
oledid / rdp_audio_settings.md
Last active July 19, 2017 15:08
Remote Desktop audio settings
@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 / 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 / turn-off-screen.ps1
Created September 24, 2015 07:15
PowerShell: Turn off computer screen
# Source: http://www.powershellmagazine.com/2013/07/18/pstip-how-to-switch-off-display-with-powershell/
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
@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