Skip to content

Instantly share code, notes, and snippets.

@iamphill
iamphill / Gruntfile.js
Last active Aug 29, 2015
Grunt IIS kill on exit
View Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
// Some other grunt tasks
iisexpress: {
server: {
options: {
path: require('path').resolve('.') + '/[PATH OF WEBSITE HERE]',
killOn: 'iis.kill'
}
}
View file.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Caching;
using System.IO;
using Umbraco.Core.Models;
using Umbraco.Core.Logging;
/// <summary>
@iamphill
iamphill / inner.js
Created Jan 22, 2014
IE8 doesn't have window.innerWidth or window.innerHeight So here is two functions to help with that.
View inner.js
/**
* Get window width
**/
var getWindowWidth = function() {
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
};
/**
* Get window height
**/
@iamphill
iamphill / snippet.cs
Last active Dec 23, 2015
Create a snippet of text with the specified length
View snippet.cs
public static string CreateSnippet(string s, int length)
{
if (String.IsNullOrEmpty(s))
{
return "";
}
const string Ellipsis = "...";
if (s.Length > length)
{
@iamphill
iamphill / gist:5338003
Created Apr 8, 2013
Popup Present Model View
View gist:5338003
- (void)presentModalViewController:(UIViewController *)modalViewController fromView:(UIView *)view
{
if(SYSTEM_VERSION_LESS_THAN(@"6.0")) {
[modalViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:modalViewController animated:YES completion:nil];
} else {
modalViewController.modalPresentationStyle = UIModalPresentationFormSheet;
UIGraphicsBeginImageContext(self.view.window.frame.size);
[self.view.window.layer renderInContext:UIGraphicsGetCurrentContext()];
@iamphill
iamphill / gradients
Created Jan 9, 2013
CSS Gradients, includes IE. For future reference when I need the IE filter, who can actually remember that?!
View gradients
background:#ffffff;
background: -webkit-linear-gradient(top, #ecebeb 0%, #ffffff 50%, #ecebeb 100%);
background: -moz-linear-gradient(top, #ecebeb 0%, #ffffff 50%, #ecebeb 100%);
background: -o-linear-gradient(top, #ecebeb 0%, #ffffff 50%, #ecebeb 100%);
background: linear-gradient(top, #ecebeb 0%, #ffffff 50%, #ecebeb 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ecebeb');
You can’t perform that action at this time.