Skip to content

Instantly share code, notes, and snippets.

import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.2
import QtMultimedia 5.0
Window {
id: mainWindow
title: "QApplication"
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
@spooky
spooky / MomentJsFormatConverterTest.cs
Created May 9, 2013 07:44
tests for MomentJsFormatConverter.cs
public class MomentJsFormatConverterTest
{
[TestClass]
public class ConvertToMomentJsFormatTest
{
[TestMethod]
public void TestDefaultDateAndTimeFormat()
{
Assert.AreEqual("YYYY-MM-DD HH:mm", MomentJsFormatConverter.ConvertFormat("g"));
}
@spooky
spooky / MomentJsFormatConverter.cs
Created May 9, 2013 07:42
moment.js to .net format converter
public static class MomentJsFormatConverterExtensions
{
public static string ConvertToMomentJsFormat(this HtmlHelper html, string format)
{
if (html == null)
throw new ArgumentNullException("html");
return MomentJsFormatConverter.ConvertFormat(format);
}
}
@spooky
spooky / Assets
Created December 10, 2012 15:00
Used to render embeded resources
public class Assets
{
private static IBundleResolver resolver;
internal static IBundleResolver Resolver
{
get { return resolver ?? BundleResolver.Current; }
set { resolver = value; }
}
private static IHtmlString RenderTag(string template, params string[] attributes)
@spooky
spooky / EmbededStyleBundle
Created December 10, 2012 14:52
for using embeded scripts in bundles
public class EmbededStyleBundle : EmbededResourceBundle
{
public EmbededStyleBundle(Assembly assembly, string virtualPath) : base(assembly, virtualPath, "text/css", new CssMinify())
{
}
}
@spooky
spooky / EmbededScriptBundle
Created December 10, 2012 14:51
for using embeded scripts in bundles
public class EmbededScriptBundle : EmbededResourceBundle
{
public EmbededScriptBundle(Assembly assembly, string virtualPath) : base(assembly, virtualPath, "text/javascript", new JsMinify())
{
ConcatenationToken = ";";
}
}
@spooky
spooky / EmbededResourceBundle
Created December 10, 2012 14:50
allows using embeded resources for bundling
public abstract class EmbededResourceBundle : Bundle
{
private Assembly assembly;
private readonly HashSet<string> resourceNames = new HashSet<string>();
private readonly string contentType;
public EmbededResourceBundle(Assembly assembly, string virtualPath, string contentType, params IBundleTransform[] transforms) : base(virtualPath, null, transforms)
{
this.assembly = assembly;
this.contentType = contentType;
@spooky
spooky / rebundler
Created December 10, 2012 14:41
a hack to make mvc4 bundling work with mvc contrib portable areas
public class Rebundler
{
private readonly Assembly assembly;
private readonly string virtualPath;
private readonly HashSet<string> resourceNames = new HashSet<string>();
public Rebundler(Assembly assembly, string virtualPath)
{
this.assembly = assembly;
this.virtualPath = virtualPath;
@spooky
spooky / site.styl
Created October 8, 2012 13:24
quick stylus version of site.css - using the vervbose syntax
link-color = #bca36c;
hover-color = #004263;
disabled-color = #bbb;
text-color = #333;
html {
height:100%;
}
body {