Skip to content

Instantly share code, notes, and snippets.

View ryanlewis's full-sized avatar

Ryan Lewis ryanlewis

  • Leeds, United Kingdom
  • 23:48 (UTC +01:00)
View GitHub Profile
@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 / 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 / google_twunter_lol
Created May 27, 2014 14:28 — forked from jamiew/google_twunter_lol
Naughty word list, compiled by Google and @jamiew
4r5e
5h1t
5hit
a55
anal
anus
ar5e
arrse
arse
ass
@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 / 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);
  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 / cleanImageGenCache.js
Last active December 28, 2015 10:29
Remove all the ImageGen cache files and directories from a root media folder. npm install underscore q optimist OR npm install underscore q optimist -g
#!/usr/bin/env node
var _ = require('underscore');
var fs = require('fs');
var Q = require('q');
var argv = require('optimist')
.usage('Usage: $0 -base [directory')
.demand(['base'])
.describe('base', 'Media directory')
.argv;
@ryanlewis
ryanlewis / twitter-responsive.css
Created October 15, 2013 20:41
User style for twitter.com to make the main desktop design responsive
@media screen and (max-width:840px) {
.wrapper {
width: 100%;
padding-left: 0;
padding-right: 0;
background: none !important;
}
.dashboard, .content-main {
width: auto ;
@ryanlewis
ryanlewis / Pager.cshtml
Created August 27, 2013 16:41
A Razor/ASP.NET MVC pager that is adaptable for any project (Developed for Umbraco)
@model Epiphany.Web.Models.PagerViewModel
@{
var showPages = 5;
var maxPage = (int) Math.Ceiling((decimal) Model.Total/Model.PageSize);
}
@*[[ PAGER PAGE:@Model.Page PAGESIZE:@Model.PageSize TOTAL:@Model.Total MAXPAGE:@maxPage ]]*@
<div class="pagination">
@ryanlewis
ryanlewis / gist:6112001
Last active December 20, 2015 09:59
Get difference between two commits. Powershell snippet to filter out a list of changed files by extension from git diff --stat
git diff 1.0.2 HEAD --stat=200
git diff 1.0.2 HEAD --stat=500 | where {$_ -Match ".cshtml|.css"} | %{$line=$_.split(" "); write-host $line[1] }
git diff 1.0.2 HEAD --stat=200 | where {$_ -Match ".cshtml|.cs"} | %{$l=$_.split(" "); $file=$l[1]; $file=$file.replace("Umbraco.Site", ""); write-host $file }