Skip to content

Instantly share code, notes, and snippets.

View joeriks's full-sized avatar
💭
I may be slow to respond.

Jonas Eriksson joeriks

💭
I may be slow to respond.
View GitHub Profile
@joeriks
joeriks / sample.html
Created September 26, 2014 13:03
tapas live search with angularjs
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<style>
ul {padding-left:0}
li {list-style-none;margin-bottom:10px;}
</style>
<script>
angular.module('liveSearchModule', [])
@joeriks
joeriks / ArticlePageViewModel.cs
Last active March 8, 2021 08:14
PartialFor - resolve name of partial from type name or from UIHint (like DisplayFor)
public class ArticlePageViewModel {
// use partial view "TopMenuViewModel.cshtml"
public TopMenuViewModel TopMenu {get;set;}
// use partial view "WidgetsViewModel.cshtml"
public WidgetsViewModel Widgets {get;set;}
// use partial view "ExtraWidgets.cshtml"
[UIHint("ExtraWidgets")]
@joeriks
joeriks / delete.sql
Created August 27, 2014 12:36
Delete all templates from umbraco db
update cmsDocument Set templateId=null
DELETE FROM [dbo].[cmsDocumentType]
DELETE FROM umbracoNode WHERE nodeObjectType = '6FBDE604-4178-42CE-A10B-8A2600A2F07D'
DELETE FROM [dbo].[cmsTemplate]
@joeriks
joeriks / CreateDb.cshtml
Created August 22, 2014 07:31
Test DocumentDb from trywebsites.azurewebsites.net
@using Microsoft.Azure.Documents
@using Microsoft.Azure.Documents.Client
@using Microsoft.Azure.Documents.Linq
@using Newtonsoft.Json
@using Newtonsoft.Json.Bson
@using Newtonsoft.Json.Converters
@using Newtonsoft.Json.Linq
@using Newtonsoft.Json.Schema
@using Newtonsoft.Json.Serialization
@using System.Threading.Tasks
@joeriks
joeriks / output.txt
Last active August 29, 2015 14:05
Experimenting with DocumentDb - basic write and read (from ScottGu example) - and timing from local pc
Time to create connection and get collection 2513 ms
Time to perform simple query 448 ms
Andersen family:
{
"id": "AndersenFamily",
"lastName": "Andersen",
"parents": [
{
"firstName": "Thomas"
},
@joeriks
joeriks / 1readme.md
Last active May 22, 2018 21:08
Linqpad Extension method to generate csv with class (keep strongly typed) (Temp Tables in LinqPad)

##Preparation:

  1. Get Nuget CsvHelper

  2. Copy extension method to My Extensions in LinqPad

##Usage:

  1. Write your query (C# Statements)
@joeriks
joeriks / web.config
Created June 19, 2014 13:46
the mvc forum web config for use within virtual directory application inside umbraco application
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true"/>
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true"/>
@joeriks
joeriks / web.config
Created June 19, 2014 12:31
Reset umbraco web.config for sub application
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<remove extension=".cshtml" />
<remove extension=".vbhtml" />
@joeriks
joeriks / gist:11247871
Created April 24, 2014 09:21
the lazy first impressions nodejs from webstorm
1) tried to run the express project got the error
Error creating Node.js Express App. Wrong express generator
http://devnet.jetbrains.com/message/5513598#5513598
2) tried to run the nodejs boilerplate and then the initproject.bat
Fails as mongodb "Not compatible with your operating system or architecture.. x64"
3) tried to run a basic nodescript created from outside webstorm. No packages installed. Runs nicely, but no intellisense "Unresolved function require()"
@joeriks
joeriks / gist:9639731
Created March 19, 2014 11:24
necessary fixes in fsproj to make it build in azure deployment
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')"/>
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />