Skip to content

Instantly share code, notes, and snippets.

@karlitros
karlitros / maxRequestLength.xml
Created October 19, 2012 12:06
New value for the maxRequestLength attribute of the httpRuntime element in the web.config
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
@karlitros
karlitros / maxAllowedContentLength.xml
Created October 19, 2012 12:07
New value for the maxAllowedContentLength attribute of the requestLimits element in the web.config. This allows for uploading of much larger files.
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
@karlitros
karlitros / HSSFPatriarch.cs
Created October 19, 2012 12:41
An object that allows you to draw things on spreadsheets like textboxes
HSSFPatriarch _patriarch;
@karlitros
karlitros / IClientAnchor.cs
Created October 19, 2012 12:45
Creates an anchor point that your textbox will belong to.
IClientAnchor anchorpoint = new HSSFClientAnchor(0, 0, 1023, 255, startingColNum, startingRowNum, endColNum, endRowNum);
@karlitros
karlitros / HSSFTextbox.cs
Created October 19, 2012 12:51
Creates a textbox for NPOI, and puts something in it.
HSSFTextbox myTextBox = _patriarch.CreateTextbox(anchorpoint) as HSSFTextbox;
myTextBox.String = new HSSFRichTextString("Your text goes in here!");
using System.Collections.Generic;
using System.Globalization;
public static IEnumerable<string> GetCountryList()
{
List<string> cultureList = new List<string>();
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
foreach (CultureInfo culture in cultures)
@karlitros
karlitros / UmbracoSitemapProviderReference.xml
Last active August 29, 2015 14:00
Comment this bit out of an umbraco web.config file when you want publishing times to improve when publishing large amounts of content
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true" />
</providers>
</siteMap>
@karlitros
karlitros / bindWithDelayExample.js
Last active August 29, 2015 14:02
Demonstrates how bindWithDelay could be used for validating a password after the user's finished entering it
$("input.myTextField").bindWithDelay("keyup", function() {
console.info('We\'re now ready to validate the password');
passwordValidationFunction(this.val());
}, 1000);
@karlitros
karlitros / CheckWindowConsole.js
Created September 18, 2014 16:08
Check to make sure window.console is not undefined before writing to console.log for Internet Explorer
if(window.console != undefined)
{
console.log('test!');
}
@karlitros
karlitros / CORS_Web.Config
Created February 20, 2015 17:12
A snippet of the web.config that partly enables CORS
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=9" />
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>