Skip to content

Instantly share code, notes, and snippets.

View ryanlewis's full-sized avatar

Ryan Lewis ryanlewis

  • Leeds, United Kingdom
  • 18:40 (UTC +01:00)
View GitHub Profile
  1. Drain the meat from the brine.
  2. Pat dry with kitchen towel
  3. Mix approx 2-3 table spoons of salt, pepper, garlic powder and oil in a dish
  4. Rub the salt-oil mixture over the meat, ensuring you get it into the slits of the top layer of fat.
  5. Place on the roasting tray (where the bacon goes) with the grill in.
  6. Cover with foil to form a seal over the top.
  7. Roast for 5 to 6 hours
  8. 30 minutes before about to pull out of the oven, take off the foil
  9. Allow to rest for 20-30 minutes before serving
@ryanlewis
ryanlewis / SassMeister-input.scss
Created April 23, 2014 20:28
Generated by SassMeister.com.
// ----
// Sass (v3.3.5)
// Compass (v1.0.0.alpha.18)
// ----
@mixin image2x-retina($file, $type, $width, $height, $mod: '@2x') {
$fileName: $file + '.' + $type;
$retina: $file + $mod + '.' + $type;
background-image: url($fileName);
@ryanlewis
ryanlewis / CleanASPNETCrap.ps1
Created April 28, 2014 09:17
Clean out your ASP.NET Temporary files
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
Get-ChildItem "C:\Windows\Microsoft.NET\Framework*\v*\Temporary ASP.NET Files" -Recurse | Remove-Item -Recurse
@ryanlewis
ryanlewis / package.manifest
Created July 15, 2014 12:21
Label datatype stored as "TEXT"
{
propertyEditors: [
{
alias: "Epiphany.NoEditBig",
name: "Label (Big)",
editor: {
view: "~/umbraco/views/propertyeditors/readonlyvalue/readonlyvalue.html",
valueType: 'TEXT',
}
}
@ryanlewis
ryanlewis / StringArrayValueConverter.cs
Last active August 29, 2015 14:04
Property Value Converter for a array of strings
using System;
using Newtonsoft.Json;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
namespace Epiphany.PropertyEditorValueConverters
{
[PropertyValueType(typeof(string[]))]
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
public class StringArrayValueConverter : PropertyValueConverterBase
@ryanlewis
ryanlewis / your.csproj
Created July 25, 2014 15:15
How we add all assets in our Web projects
<Project>
<Target Name="BeforeBuild">
<Exec WorkingDirectory="..\.." Command="powershell.exe .\grunt-build.ps1 -target $(Configuration)" />
<ItemGroup>
<Content Include="css\**\*.css" />
<Content Include="js\**\*.js" />
<Content Include="js\**\*.js.map" />
<Content Include="fonts\**\*.*" />
<Content Include="img\**\*.png" />
<Content Include="img\**\*.gif" />
@ryanlewis
ryanlewis / RedirectToParent.cshtml
Created November 4, 2014 13:59
Redirect to Parent page template
@inherits UmbracoTemplatePage
@{
var parent = Model.Content.Parent;
while (true)
{
if (parent.TemplateId > 0 && parent.TemplateId != Model.Content.TemplateId)
{
break;
}
parent = parent.Parent;
@ryanlewis
ryanlewis / sublime.reg
Created March 12, 2015 09:58
Add "Open folder as Sublime project" to Explorer right-click menu
Windows Registry Editor Version 5.00
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@="Open Folder as &Sublime Project"
"Icon"="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\shell\sublime\command]
@ryanlewis
ryanlewis / ConfigureLuceneIndexing.cs
Created August 18, 2015 18:48
Hooking into the Lucene events with Umbraco
using System.Web.UI;
using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
using Umbraco.Core;
using Umbraco.Web;
namespace AMAZINGWEBSITE.Web.Core.ApplicationEventHandlers
{
public class ConfigureLuceneIndexing : IApplicationEventHandler
JSON.stringify = JSON.stringify || function (obj) {
var t = typeof (obj);
if (t != "object" || obj === null) {
// simple data type
if (t == "string") obj = '"'+obj+'"';
return String(obj);
}
else {
// recurse array or object
var n, v, json = [], arr = (obj && obj.constructor == Array);