Skip to content

Instantly share code, notes, and snippets.

View mattbrailsford's full-sized avatar

Matt Brailsford mattbrailsford

View GitHub Profile
using System.Web.Mvc;
using TheOutfield.Website.XsltExtensions;
namespace TheOutfield.Website.Controllers
{
public class DisqusController : Controller
{
[HttpGet]
[OutputCache(Duration = 300, VaryByParam = "threadId")]
public JsonResult GetCommentCount(int threadId)
@mattbrailsford
mattbrailsford / PublishedContentExtensions.cs
Last active August 29, 2015 13:57
A JQuery like API for Umbraco
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.WebPages;
using Umbraco.Core.Models;
using Umbraco.Web;
namespace Our.Umbraco.Api.Jq
{
public static class PublishedContentExtensions
@mattbrailsford
mattbrailsford / HelloWorld.js
Created March 25, 2014 18:27
A simple hello world Espruino gist
print("hello world from gist!");
Welcome to Node-RED
===================
C:\Users\User\Documents\GitHub\NodeREDWebkit\src\NodeREDWebkit.App\node_modules\node-red\red\server…:69
14 Aug 08:36:08 - [red] Version: 0.8.1 util.js:611
14 Aug 08:36:08 - [red] Loading palette nodes util.js:611
js-bson: Failed to load c++ bson extension, using pure JS version
Warning: Native modules not compiled. XOR performance will be degraded.
Warning: Native modules not compiled. UTF-8 validation disabled.
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep` c:\Users\User\Documents\GitHub\NodeREDWebkit\src\NodeREDWebkit.App\node_modules\simple-xmpp\node_mo…:36
#include "L9110.h"
#include "spark_wiring.h"
///////////////////////////////////////////
/// Public
//////////////////////////////////////////
/// Constructor
L9110::L9110() { }
<!-- GZip static file content. Overrides the server default which only compresses static files over 2700 bytes -->
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
@mattbrailsford
mattbrailsford / package.manifest
Last active August 29, 2015 14:15
Example of creating a dropdown list paramter editor for Umbraco 7
{
propertyEditors: [
{
alias: "ButtonStylePicker",
name: "Button Style Picker",
editor: {
view: "dropdown"
},
isParameterEditor: true,
defaultConfig: {
#!/usr/bin/python
#
# OLED Library for Raspberry Pi
#
# Author : Matt Brailsford/Robert Coward/Paul Carpenter (based on driver by Matt Hawkins/)
# Site : http://www.raspberrypi-spy.co.uk
# http://www.pcserviceslectronics.co.uk
# http://www.circuitbeard.co.uk
#
# Date : 06/03/2015
@mattbrailsford
mattbrailsford / HtmlHelperExtensions.cs
Last active August 29, 2015 14:17
Helper methods for registering JS / CSS dependencies, including inline blocks.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Mvc;
using System.Web.WebPages;
namespace UmbracoCms.Web
{
public static class HtmlHelperExtensions
{
@mattbrailsford
mattbrailsford / CountryAppender.js
Last active August 29, 2015 14:22
CountryAppender.js
angular.module("umbraco").config(["$provide", function ($provide) {
$provide.decorator("entityResource", function ($delegate, $q) {
var getByIdsFn = $delegate.getByIds;
$delegate.getByIds = function (ids, type) {
var result = getByIdsFn.apply(null, arguments);
var loadRegionInfo = function(data, idx, def) {