Skip to content

Instantly share code, notes, and snippets.

View jmyrland's full-sized avatar

Jørn A. Myrland jmyrland

View GitHub Profile
@jmyrland
jmyrland / Dockerfile
Created May 15, 2015 13:46
Docker mounted volume removes node_modules
# Set the base image to stable version of node
FROM node:0.12.2
# Install nodemon
RUN npm install -g nodemon
# Provides cached layer for node_modules
COPY package.json /tmp/package.json
RUN cd /tmp && npm install --production
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
@jmyrland
jmyrland / .readme.md
Created March 3, 2015 09:41
Simple exception logging for ASP.NET MVC

Simple exception logging for ASP.NET MVC

  1. Add the ExceptionUtility.cs and ErrorHandlerAttribute.cs
  2. Add the ErrorHandlerAttribute to your base controller to start logging errors. Like:
  [ErrorHandler]
  public class BaseController : Controller
  {
 // ...
@jmyrland
jmyrland / Falling-squares.markdown
Created March 13, 2014 13:02
A Pen by Jørn A. Myrland.
@jmyrland
jmyrland / ZigZag-edges.markdown
Created March 13, 2014 12:15
A Pen by Jørn A. Myrland.
@jmyrland
jmyrland / snippet.cs
Created June 5, 2013 13:19
SharePoint: is user member of group function.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace Example
@jmyrland
jmyrland / notepad.html
Last active December 18, 2015 02:48 — forked from jdkanani/notepad.html
Real-time markdown editor/converter, with basic twitter bootstrap styles.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
/**
* Related to http://stackoverflow.com/questions/16528539/mongoose-query-for-an-array-of-dictionaries
*/
var mongoose = require('mongoose'),
db = mongoose.connect('mongodb://localhost/test');
var blogSchema = new mongoose.Schema({
group: String,
writing: [{
@jmyrland
jmyrland / test.js
Last active January 19, 2024 18:51
Socket-io load test?
/**
* Modify the parts you need to get it working.
*/
var should = require('should');
var request = require('../node_modules/request');
var io = require('socket.io-client');
var serverUrl = 'http://localhost';
@jmyrland
jmyrland / .readme.md
Last active December 16, 2015 16:08
Episerver 7 - Dynamic page for vomiting all dynamic data store objects

Episerver 7 - Dynamic page for vomiting all dynamic data store objects

Provides functionality for:

  • Exporting dynamic data stores to excel
  • Deleting single dynamic data store objects.

Set the stores you want to list in the stores, for example:

protected static List<object> stores = new List<object>()

{