Skip to content

Instantly share code, notes, and snippets.

View jrunestone's full-sized avatar

Johan Runsten jrunestone

  • Toxic
  • Jönköping, Sweden
  • 23:23 (UTC +01:00)
View GitHub Profile
Here's how to make jQuery DataTables work with npm and webpack. DT checks for AMD compatibility first
which breaks when you're using CommonJS with webpack.
Install DT core: npm install datatables.net
Install a DT style: npm install datatables.net-bs (bootstrap)
Install the imports-loader webpack plugin: https://github.com/webpack/imports-loader#disable-amd
Create a loader "exception" just for DT in webpack.config.js:
module: {
loaders: [
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class QuadTextureScaler : MonoBehaviour
{
private Renderer rend;
private float textureWidthInUnits;
private float textureHeightInUnits;
private float pixelsPerUnit;
@jrunestone
jrunestone / episerver-generic-page-controller.cs
Last active August 29, 2018 11:50
A generic Episerver page controller with a default view model with generic types
public class DefaultPageController : PageControllerBase<PageTypeBase>
{
public DefaultPageController(IContentRepository contentRepository) : base(contentRepository)
{
}
public ActionResult Index(PageTypeBase currentPage)
{
Type origType = currentPage.GetOriginalType();
@jrunestone
jrunestone / episerver-inject-site-settings.cs
Created August 29, 2018 11:49
Inject site settings with Structuremap in Episerver
[InitializableModule]
public class DependencyInstaller : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
var container = context.StructureMap();
DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
context.Services.Add<SiteSettings>(sl =>
Combination of:
https://gist.github.com/Ta180m/e1471413f62e3ed94e72001d42e77e22
https://askubuntu.com/questions/1252007/opening-ubuntu-20-04-desktop-on-wsl2
(Use the script in the last link in your .bashrc to automatically setup and start both VcXsrv+gnome correctly).
Then:
Allow VcXsrv in Windows firewall (otherwise you will get a black screen)
Now you can put this on a Windows second desktop, and switch between Windows and Ubuntu! : - D
If you want to switch seamlessly between virtual desktops without ubuntu being minimized, replace -fullscreen with -nodecoration in the .bashrc script.