Skip to content

Instantly share code, notes, and snippets.

@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 / umbraco-jul-fix.ps1
Created July 22, 2014 10:54
Powershell script to resolve the Umbraco security advisory released 21 July 2014
Param(
[Parameter(Mandatory=$true)] $path
)
$proxyHtm = @"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Repo proxy</title>
</head>
@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 ;