<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>One More Take</title>
	<atom:link href="https://www.onemoretake.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.onemoretake.com</link>
	<description></description>
	<lastBuildDate>Thu, 17 Mar 2016 00:21:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Importing Stripe Transactions Into Xero</title>
		<link>https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=importing-stripe-transactions-into-xero</link>
					<comments>https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Thu, 17 Mar 2016 00:21:06 +0000</pubDate>
				<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=472</guid>

					<description><![CDATA[<p>If you happen to be using Xero for your company accounts and Stripe for your transactions, you will probably have discovered that reconciling the bank records against the transactions in Stripe is not the easiest thing to. It means exporting from Stripe and messing around in Excel before importing into Xero. This was way too <a class="read-more" href="https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/">Importing Stripe Transactions Into Xero</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>If you happen to be using Xero for your company accounts and Stripe for your transactions, you will probably have discovered that reconciling the bank records against the transactions in Stripe is not the easiest thing to. It means exporting from Stripe and messing around in Excel before importing into Xero.</p>
<p>This was way too much hassle for me, so I have thrown together a NodeJS script to do the boring work for me and I have made it available on Github:</p>
<p><a href="https://github.com/danspam/stripe-xero">https://github.com/danspam/stripe-xero</a></p>
<p>Instructions are in the readme and there is a little bit of manual work each time you run it to change the &#8216;since&#8217; date but that is good enough for me. If anyone out there has the time and inclination to improve upon it and make it even more automatic, then I am very happy to take pull requests.</p>
<p>Enjoy!</p><p>The post <a href="https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/">Importing Stripe Transactions Into Xero</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2016/03/16/importing-stripe-transactions-into-xero/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Redirect Sub-sub Domains on Multi-Tenanted Websites</title>
		<link>https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=redirect-sub-sub-domains-on-multi-tenanted-websites</link>
					<comments>https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Wed, 30 Apr 2014 23:03:44 +0000</pubDate>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=448</guid>

					<description><![CDATA[<p>I run the SOP creation and implementation website Way We Do. It is a multi-tenanted website in as far as each company that signs up chooses their own subdomain and can customize the branding. During the sign up process, we had to be very clear to the non-technical user exactly what choosing a subdomain was <a class="read-more" href="https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/">Redirect Sub-sub Domains on Multi-Tenanted Websites</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I run the <a href="http://www.waywedo.com">SOP creation and implementation website Way We Do</a>. It is a multi-tenanted website in as far as each company that signs up chooses their own subdomain and can customize the branding. During the sign up process, we had to be very clear to the non-technical user exactly what choosing a subdomain was and what it meant. We think we have now minimised the confusion surrounding this but I recently received an email from Google Webmaster Tools adding a twist to the problem:</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-449" src="http://www.onemoretake.com/wp-content/uploads/2014/04/subsubdomainemail-300x184.png" alt="subsubdomainemail" width="300" height="184" srcset="https://www.onemoretake.com/wp-content/uploads/2014/04/subsubdomainemail-300x184.png 300w, https://www.onemoretake.com/wp-content/uploads/2014/04/subsubdomainemail.png 514w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>It appears that even though out users were understanding what choosing a subdomain meant, they couldnt help themselves typing &#8216;www&#8217; before the reset of their chosen URL. Now even though we own a wildcard SSL certificate for *.waywedo.com, this does not really mean wildcard-as-in-anything-before-the-domain-part. It just means any subdomain name and a sub-subdomain requires a different certificate. Unfortunately the result is a nasty certificate error for any user who unknowingly adds the www on the front of their subdomain.</p>
<p>The fix is fairly easy &#8211; a 301 redirect via .htaccess or IIS url rewrite. We use IIS and so this means adding the following to the web.config:</p>
<pre lang="xml"> 
<rule name="Redirect sub-subdomain" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^www\.(.*)\.YOURDOMAIN\.com$" />
    </conditions>
    <action type="Redirect" url="https://{C:1}.YOURDOMAIN.com/{R:1}" redirectType="Permanent" />
</rule>  
</pre>
<p>As long as a user does not type https before the www, their mistyped url should now be redirected seamlessly to the correct url without the nasty certificate error.</p><p>The post <a href="https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/">Redirect Sub-sub Domains on Multi-Tenanted Websites</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2014/04/30/redirect-sub-sub-domains-on-multi-tenanted-websites/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Minifying a RequireJS Website During Publish With Visual Studio</title>
		<link>https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minifying-a-requirejs-website-during-publish-with-visual-studio</link>
					<comments>https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Sat, 25 Jan 2014 05:42:02 +0000</pubDate>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=430</guid>

					<description><![CDATA[<p>I have recently been working on converting my web application to use requirejs. I have been very happy with the benefits of moving to a modular approach but optimizing using r.js during the deploy to test/production did not seem very elegant. Most solutions suggest building your javascript into a release folder within your project and <a class="read-more" href="https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/">Minifying a RequireJS Website During Publish With Visual Studio</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I have recently been working on converting <a href="http://www.waywedo.com">my web application</a> to use <a href="http://requirejs.org/">requirejs</a>. I have been very happy with the benefits of moving to a modular approach but optimizing using r.js during the deploy to test/production did not seem very elegant. Most solutions suggest building your javascript into a release folder within your project and then manipulating your initial requirejs starting point or the configuration to point the release folder (<a href="http://www.novanet.no/blog/yngve-bakken-nilsen/dates/2013/6/making-requirejs-play-nice-with-aspnet-mvc/">see here for an example</a>). This seem to cause two issue:</p>
<ol>
<li>An additional folder and contents for release that I had no interest in seeing in my development workspace.</li>
<li>A non-standard way of declaring your initial requirejs starting point.</li>
</ol>
<p>What I wanted was for the optimization to occur during the deploy process &#8211; web publish in my case. I soon discovered that you can <a href="http://msdn.microsoft.com/en-us/library/ff398069">extend the web publish process in either the .pubxml publish profile files or by adding a [projectname].wpp.targets </a>file. These files are msbuild files and thanks to a <a href="http://sedodream.com/2012/10/09/VSWebPublishHowToIncludeFilesOutsideOfTheProjectToBePublished.aspx">couple</a> of <a href="http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx">posts</a> by Sayed Ibrahim Hashimi and by poking around the msbuild files used for publishing, I figured out that during the publish I could:</p>
<ol>
<li>Run node.exe to build the requirejs javascript</li>
<li>Replace the non-built javascript with the version I built in the previous step</li>
</ol>
<p>This meant that my requirejs starting point would not need changing at all and the building of the javascript can occur outside my development workspace.</p>
<p>To build the javascript you need a build.js configuration file (see requirejs documentation), node.exe and r.js. You need to put them in a directory that can be referenced during the publish process. The build.js should be configured to output the built files to a directory that can also be accessed during the publish process. The rest of the magic is done in my .wpp.targets file,  which I share below with comments on how to customise it to suit your own setup:</p>
<pre lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <!-- This is the path to where node.exe is along with r.js and your build.js file for requirejs optimization-->
    <!-- You need to replace the bit in brackets with a relative path from your project folder-->
    <RequireJsBuildDir Condition=" '$(RequireJsBuildDir)' == '' ">$(MSBuildProjectDirectory)\[PATH TO FOLDER]</RequireJsBuildDir>
    <NodeExePath Condition=" '$(NodeExePath)' == '' ">$(RequireJsBuildDir)\node.exe</NodeExePath>
    <BuildRequireJSCommand>"$(NodeExePath)" r.js -o build.js </BuildRequireJSCommand>
    <!--This extends the publish process at the point where it has gathered the list of files to publish-->
    <OnAfterPipelineCollectFilesPhase>
      ReplaceJs;
      $(OnAfterPipelineCollectFilesPhase);
    </OnAfterPipelineCollectFilesPhase>
  </PropertyGroup>

    <!--This target builds the javascript-->
  <Target Name="AfterBuild">
    <Message Text="Building requirejs javascript..." Importance="high"></Message>
    <Exec Command="$(BuildRequireJSCommand)" ContinueOnError="false" WorkingDirectory="$(RequireJsBuildDir)"/>
  </Target>
  <!--This target removes everything from the js folder in your project with the output of the built javascript-->
  <Target Name="ReplaceJs">
    <Message Text="Replacing javascript with built version..." Importance="high"/>
    <ItemGroup>
        <!--Replace the bit in brackets with the path to the requirejs build output relative to this file-->
        <_BuiltJavascript Include="$(MSBuildThisFileDirectory)[PATH TO FOLDER]\**\*" />
        <!--This removes the unbuilt javascript from the project, update the folder if yours isnt in /js -->
        <FilesForPackagingFromProject Remove="js\**\*" ></FilesForPackagingFromProject>
         <!--This puts the files found in the build output folder into the /js folder. Change the folder as necessary -->
        <FilesForPackagingFromProject Include="%(_BuiltJavascript.Identity)" >
            <DestinationRelativePath>js\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
        </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>
</Project>
</pre><p>The post <a href="https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/">Minifying a RequireJS Website During Publish With Visual Studio</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2014/01/24/minifying-a-requirejs-website-during-publish-with-visual-studio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ReCSS with Combres Support</title>
		<link>https://www.onemoretake.com/2012/05/08/recss-with-combres-support/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recss-with-combres-support</link>
					<comments>https://www.onemoretake.com/2012/05/08/recss-with-combres-support/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Wed, 09 May 2012 11:52:27 +0000</pubDate>
				<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=418</guid>

					<description><![CDATA[<p>I have made extensive use of the great bookmarklet ReCSS that reloads a page&#8217;s css without reloading the entire page. It saves masses of time when developing UI but I noticed that on certain projects it has no effect. I realised that this was because those projects were using the equally useful Combres resource combining <a class="read-more" href="https://www.onemoretake.com/2012/05/08/recss-with-combres-support/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2012/05/08/recss-with-combres-support/">ReCSS with Combres Support</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I have made extensive use of the great bookmarklet <a href="http://david.dojotoolkit.org/recss.html" target="_blank">ReCSS</a> that reloads a page&#8217;s css without reloading the entire page. It saves masses of time when developing UI but I noticed that on certain projects it has no effect.</p>
<p>I realised that this was because those projects were using the equally useful <a href="http://combres.codeplex.com/" target="_blank">Combres</a> resource combining library for .Net. Combres uses a number in the url path for caching, and without changing that, any updates to the css file will not be delivered to the browser.</p>
<p>Today I sat down and tweaked the ReCSS bookmarklet so that it checks the url for the /combres.axd path in the urls and changes the number in the url if it is present.</p>
<p>Here is the <a href="javascript:(function(){void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0%20%26%26%20s.href){var%20h=s.href.replace(/(%26|\%3F)forceReload=\d+/,''),myregexp=/(.*\/combres\.axd\/.+\/)(-%3F\d+)\/$/im,match=myregexp.exec(h);if(match%20!=null){s.href=match[1]+(new%20Date().valueOf())+'/';}else{s.href=h+(h.indexOf('%3F')%3E=0%3F'%26':'%3F')+'forceReload='+(new%20Date().valueOf());}}}})();})();">updated ReCSS bookmarklet</a>. Enjoy.</p><p>The post <a href="https://www.onemoretake.com/2012/05/08/recss-with-combres-support/">ReCSS with Combres Support</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2012/05/08/recss-with-combres-support/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>TFS Build And Multiple Websites In One Web Role On Azure</title>
		<link>https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tfs-build-and-multiple-websites-on-azure</link>
					<comments>https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Thu, 09 Jun 2011 01:00:53 +0000</pubDate>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[tfs build]]></category>
		<category><![CDATA[web roles]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=391</guid>

					<description><![CDATA[<p>Since the 1.3 sdk update, setting up multiple websites on a single web role is pretty straight forward. However, there is a little bit of a gotcha when using TFS build to compile and publish the packages. The problem is that when you combine two or more website projects into a single role, the azure <a class="read-more" href="https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/">TFS Build And Multiple Websites In One Web Role On Azure</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Since the 1.3 sdk update, setting up multiple websites on a single web role is <a href="http://msdn.microsoft.com/en-us/library/gg433110.aspx">pretty straight forward</a>. However, there is a little bit of a gotcha when using TFS build to compile and publish the packages. </p>
<p>The problem is that when you combine two or more website projects into a single role, the azure project still only compiles the primary website within the project. The other projects seem to just be copied from the location specified physicalDirectory attribute and included in the published package. Ensuring those are included in the package during the build process on your TFS Build server is fairly straight forward &#8211; you just add them in the &#8216;Items to Build&#8217; of your build definition (before the cloud project!). However, what that does not do is transform the web.config files of those projects. The build seems to only compile the code and none of the extra tasks.</p>
<p>Discovering this took up two days of investigating &#8211; the problem manifested in a strange authentication cookie domain issue because our config transform should have replaced the authentication settings. Once we realised what was happening, fixing it did not take so long. </p>
<p>We add an after build event that transforms the config files in the project files but only if it looks like we are on the build server. Unload the website project in question and edit the .csproj file. Add an AfterBuild target as follows:</p>
<pre lang="xml">
<Target Name="AfterBuild">
    <!-- other tasks may already be here -->
    <TransformXml Condition="Exists('$(OutDir)\_PublishedWebsites\$(TargetName)')"
                  Source="Web.config" Transform="$(ProjectConfigTransformFileName)"
                  Destination="$(OutDir)\_PublishedWebsites\$(TargetName)\Web.config" />
</Target>
</pre>
<p>What this does is run the transforms on the web.config files if the build server _PublishedWebsites directory exists. </p>
<p>The only thing lacking here is the file tidy up &#8211; the original config files still remain and are deployed in the package along with other files that are usually removed during the build. This does not effect the website in any way but it would be nice to remove those too. Any suggestions on how would be gratefully received.</p><p>The post <a href="https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/">TFS Build And Multiple Websites In One Web Role On Azure</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2011/06/08/tfs-build-and-multiple-websites-on-azure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A JQuery UI Dropdown List</title>
		<link>https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-better-jquery-ui-combo-box</link>
					<comments>https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/#comments</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 06:22:08 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[combobox]]></category>
		<category><![CDATA[jquery ui]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=363</guid>

					<description><![CDATA[<p>In a recent iteration of find.ly that I have been working on, I was asked to create a form that is far removed from the look of standard browser form controls. In particular, the dropdown lists look nothing like the native control and could not be reproduced using only css. This led me to the <a class="read-more" href="https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/">A JQuery UI Dropdown List</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>In a recent iteration of <a href="http://find.ly">find.ly</a> that I have been working on, I was asked to create a form that is far removed from the look of standard browser form controls. In particular, the dropdown lists look nothing like the native control and could not be reproduced using only css.</p>
<p>This led me to the <a href="http://jqueryui.com/demos/autocomplete/#combobox">jQuery UI combox</a> which uses the jQuery UI autocomplete control. This worked very nicely except that it is not a dropdown list that users are most used to seeing. As soon as the new form entered QA, I was pinged with a message saying that it was a bit awkward to use and would probably be difficult for users. I couldn&#8217;t disagree with that and this motivated me to try and see if I could make it more like a dropdown list.</p>
<p>After a few hours of head scratching, I am ready to present the first version of my control, which I would say is about 90% faithful to the feel of native control. There are a few things it does not do but I feel I am close enough to release it to the world for criticism. </p>
<p><a href="http://www.onemoretake.com/wp-content/uploads/2011/04/combodemo.htm" target="_blank">Try the demo</a></p>
<p>Here is the code:</p>
<pre lang="javascript">
(function ($) {
    $.widget("ui.combobox", {
        _create: function () {
            var self = this,
				select = this.element.hide(),
				selected = select.children(":selected"),
				value = selected.val() ? selected.text() : "",
				regSearch = /^[^a-zA-Z0-9]*([a-zA-Z0-9])/i,
				comboData = select.children("option").map(function () {
					if (this.value ) {
						var text = $(this).text(), 
							labelHtml = self.options.label ? self.options.label(this) : text; //allows list customization
						
						return {
							label: labelHtml,
							value: text,
							option: this
						};
					}
				});
				
            var input = this.input = $("<input type='text' />")
					.insertAfter(select)
					.val(value)
					.keydown( function( event ) {
							var keyCode = $.ui.keyCode;
							switch( event.keyCode ) {
								case keyCode.PAGE_UP:
								case keyCode.PAGE_DOWN:
								case keyCode.UP:
								case keyCode.DOWN:
								case keyCode.ENTER:
								case keyCode.NUMPAD_ENTER:
								case keyCode.TAB:
								case keyCode.ESCAPE:
									//let autocomplete handle these
									break;
								default:
									//prevent autocomplete doing anything
									event.stopImmediatePropagation();
									//only react to [a-zA-Z0-9]
									if ((event.keyCode < 91 &#038;&#038; event.keyCode > 59)
										|| (event.keyCode < 58 &#038;&#038; event.keyCode > 47)) {
										
										var str = String.fromCharCode(event.keyCode).toLowerCase(), currVal = input.val(), opt;
										
										//find all options whose first alpha character matches that pressed
										var matchOpt = select.children().filter(function() {
											var test = regSearch.exec(this.text);
											return (test && test.length == 2 && test[1].toLowerCase() == str);
										});
										
										if (!matchOpt.length ) return false;
										
										//if there is something selected we need to find the next in the list
										if (currVal.length) {
											var test = regSearch.exec(currVal);
											if (test && test.length == 2 && test[1].toLowerCase() == str) {
												//the next one that begins with that letter
												matchOpt.each(function(ix, el) {
													if (el.selected) {
														if ((ix + 1) <= matchOpt.length-1) {
															opt = matchOpt[ix + 1];
														}
														return false;
													}
												});
											}
										} 
										
										//fallback to the first one that begins with that character
										if (!opt)
											opt = matchOpt[0];
										
										//select that item
										opt.selected = true;
										input.val(opt.text);
										
										//if the dropdown is open, find it in the list
										if (input.autocomplete("widget").is(":visible")) {
											input.data("autocomplete").widget().children('li').each(function() {		
												var $li = $(this);
												if ($li.data("item.autocomplete").option == opt) {
													input.data("autocomplete").menu.activate(event,$li);
													return false;
												}
											});
										}
									}
									//ignore all other keystrokes
									return false;
									break;
								}
					  })
					.autocomplete({
					    delay: 0,
					    minLength: 0,
					    source: function (request, response) { response(comboData); },
					    select: function (event, ui) {
					        ui.item.option.selected = true;
					        self._trigger("selected", event, {
					            item: ui.item.option
					        });
					    },
					    change: function (event, ui) {
							if (!ui.item) {					
								var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i"),
									valid = false;
								select.children("option").each(function () {
									if ($(this).text().match(matcher)) {
										this.selected = valid = true;
										return false;
									}
								});
								if (!valid) {
									// remove invalid value, as it didn't match anything
									$(this).val("");
									select.val("");
									input.data("autocomplete").term = "";
									return false;
								}
							}
					    }
					})
					.addClass("ui-widget ui-widget-content ui-corner-left")
					.click(function() { self.button.click(); })
					.bind("autocompleteopen", function(event, ui){
						//find the currently selected item and highlight it in the list
						var opt = select.children(":selected")[0];
						input.data("autocomplete").widget().children('li').each(function() {		
							var $li = $(this);
							if ($li.data("item.autocomplete").option == opt) {
								input.data("autocomplete").menu.activate(event,$li);
								return false;
							}
						});
					});

            input.data("autocomplete")._renderItem = function (ul, item) {
                return $("<li></li>")
					.data("item.autocomplete", item)
					.append("<a href='#'>" + item.label + "</a>")
					.appendTo(ul);
            };
			
            this.button = $("<button type='button'>&nbsp;</button>")
					.attr("tabIndex", -1)
					.attr("title", "Show All Items")
					.insertAfter(input)
					.button({
					    icons: {
					        primary: "ui-icon-triangle-1-s"
					    },
					    text: false
					})
					.removeClass("ui-corner-all")
					.addClass("ui-corner-right ui-button-icon")
					.click(function () {
					    // close if already visible
					    if (input.autocomplete("widget").is(":visible")) {
					        input.autocomplete("close");
					        return;
					    }

					    // pass empty string as value to search for, displaying all results
					    input.autocomplete("search", "");
					    input.focus();
					});
        },
		
		//allows programmatic selection of combo using the option value
        setValue: function (value) {
            var $input = this.input;
            $("option", this.element).each(function () {
                if ($(this).val() == value) {
                    this.selected = true;
                    $input.val(this.text);
					return false;
                }
            });
        },

        destroy: function () {
            this.input.remove();
            this.button.remove();
            this.element.show();
            $.Widget.prototype.destroy.call(this);
        }
    });
})(jQuery);
</pre>
<p>The particular functions I tried to add are:</p>
<ul>
<li>Removal of any standard textbox typing characteristics</li>
<li>Typing in the textbox jumps to the item begining with that letter</li>
<li>Hitting the same letter continuously cycles through the items beginning with that letter</li>
<li>Programatically select an item using the value</li>
<li>Retain navigation through list via arrow keys/paging</li>
<li>Opening the list jumps to the selected item</li>
</ul>
<p>Feel free to take it and use it but I am very keen on any improvements that can be made, so please let me know what you think. </p>
<p>I know that performance is a bit of a problem with large lists but stopping autocomplete from rebuilding the list each time it is displayed is a little tricky and would mean changing more of it&#8217;s private functions &#8211; something I was hoping to avoid. Suggestions welcome.</p>
<p>*Edit: I totally had my terminology messed up. I was calling my control a combobox which it absolutely isnt. It is a dropdown list, so I have updated the post to reflect that. *places dunce hat on*</p><p>The post <a href="https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/">A JQuery UI Dropdown List</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2011/04/17/a-better-jquery-ui-combo-box/feed/</wfw:commentRss>
			<slash:comments>19</slash:comments>
		
		
			</item>
		<item>
		<title>Git Extensions Quick Tip &#8211; Updating remotes</title>
		<link>https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-extensions-updating-remotes</link>
					<comments>https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/#comments</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Tue, 22 Feb 2011 07:05:45 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=357</guid>

					<description><![CDATA[<p>I have both a desktop and a laptop that I work on and use Git Extensions. Every so often I create a branch on one machine, commit it and then push it to my remote origin. My problem is that when I boot up my other machine, I can never remember how to see that <a class="read-more" href="https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/">Git Extensions Quick Tip – Updating remotes</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I have both a desktop and a laptop that I work on and use Git Extensions. Every so often I create a branch on one machine, commit it and then push it to my remote origin. My problem is that when I boot up my other machine, I can never remember how to see that new branch on the origin in order to pull it down and continue working on it. So mainly for my benefit, here are two different ways to do it:</p>
<ol>
<li>Open up a git bash and type &#8216;git fetch&#8217;  or&#8230;</li>
<li>Click on Remotes->manage remote repositories, click on the Default Pull Behaviour tab, click Update all remote branch</li>
</ol>
<p>Its a little bit hidden away in the Git Extension UI, so thats probably why I have so much of a problem finding it.</p>
<p><a href="http://www.onemoretake.com/wp-content/uploads/2011/02/updateremote.jpg"><img decoding="async" src="http://www.onemoretake.com/wp-content/uploads/2011/02/updateremote-300x120.jpg" alt="Update remote repositories" title="Update remote repositories" width="300" height="120" class="alignnone size-medium wp-image-358" srcset="https://www.onemoretake.com/wp-content/uploads/2011/02/updateremote-300x120.jpg 300w, https://www.onemoretake.com/wp-content/uploads/2011/02/updateremote.jpg 667w" sizes="(max-width: 300px) 100vw, 300px" /></a></p><p>The post <a href="https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/">Git Extensions Quick Tip – Updating remotes</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2011/02/21/git-extensions-updating-remotes/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Using a Resource File for NHibernate Validation Messages</title>
		<link>https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=resource-file-nhibernate-validation</link>
					<comments>https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/#comments</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Sat, 20 Nov 2010 06:15:39 +0000</pubDate>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[nhibernate]]></category>
		<category><![CDATA[resource files]]></category>
		<category><![CDATA[validation]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=344</guid>

					<description><![CDATA[<p>I have recently started using NHibernate for a project because I wanted something that would work in Mono on linux and coupled with Fluent NHibernate, seemed like the best choice to work with MySql. It wasn&#8217;t long before I began to use the NHibernate Validator framework to provide some validation on my models. Using it <a class="read-more" href="https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/">Using a Resource File for NHibernate Validation Messages</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I have recently started using NHibernate for a project because I wanted something that would work in Mono on linux and coupled with Fluent NHibernate, seemed like the best choice to work with MySql. </p>
<p>It wasn&#8217;t long before I began to use the NHibernate Validator framework to provide some validation on my models. Using it is similar to Data Annotation Validators which I had used in another project and I liked the way you could use resource files to provide the error messages the Data Annotation Validators produce.</p>
<p>It seemed to take me ages to figure out the equivalent in the NHibernate Validator framework, as I had to piece it together from several other articles which talked about various customizations that could be done. In the end it turns out that its not very difficult to do at all. Here&#8217;s how:</p>
<p>Firstly, when validating your models, you need to point the validation engine to your resource file in the configuration:</p>
<pre lang="csharp">
//create engine
var engine =  new ValidatorEngine();

//configure and add resource file
var configure = new FluentConfiguration();
configure.SetCustomResourceManager("My.Website.Resources.ValidationMessages", Assembly.Load("MyWebsite"));
engine.Configure(configure);

//engine configured, now you can validate
var errors = engine.Validate(myentity);
</pre>
<p>To specifiy which resource value to use, you specify the resource key in the attribute wrapped in curly brackets as follows:</p>
<pre lang="csharp">

public class MyEntity {

  [NotNullNotEmpty(Message = "{ResourceKeyWithCurlyBrackets}")]
  public string SomeProperty { get; set; }

}

</pre>
<p>&#8230;and thats all there is to it, the text in the resource file should appear in the validation results.</p><p>The post <a href="https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/">Using a Resource File for NHibernate Validation Messages</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2010/11/19/resource-file-nhibernate-validation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>CodeIgniter Snippets for Visual Studio</title>
		<link>https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=codeigniter-snippets-for-visual-studio</link>
					<comments>https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/#respond</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Tue, 20 Jul 2010 08:28:37 +0000</pubDate>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs.php]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=336</guid>

					<description><![CDATA[<p>I thought I would share something I have been using for quite a while now and find incredibly useful. They are two snippets for Visual Studio that create the standard file start and file end for php files in the codeigniter framework. If you are not sure what I mean then check out the files <a class="read-more" href="https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/">CodeIgniter Snippets for Visual Studio</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I thought I would share something I have been using for quite a while now and find incredibly useful. They are two snippets for Visual Studio that create the standard file start and file end for php files in the <a href="http://codeigniter.com">codeigniter framework</a>. If you are not sure what I mean then check out the files that make up the framework &#8211; you will notice that they all tend to start with:</p>
<pre lang="php">
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
</pre>
<p>and end with:</p>
<pre lang="php">
/* End of file MyFile.php */
/* Location: ./path/to/file/MyFile.php */
</pre>
<p>The line at the start of the file is a security measure to stop files being executed outside the framework, whilst the end is just informative but useful anyhow.</p>
<p>I like to do the same thing with all the files I create for my applications but found the typing tedious and because I use the <a href="http://jcxsoftware.com/">VS.php</a> in Visual Studio, I decided to write a couple of snippets to do it for me. </p>
<p>If you are not familiar with snippets in Visual Studio or how to get the following xml to work as a snippet, you can <a href="http://msdn.microsoft.com/en-us/library/ms165392%28VS.80%29.aspx">read all about then on msdn</a>. Anyhow, without further ado, here they are:</p>
<p>filestart.snippet:</p>
<pre lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>filestart</Title>
      <Author>Dan Sargeant</Author>
      <Description>CodeIgniter File start to stop direct script access</Description>
      <HelpUrl></HelpUrl>
      <SnippetTypes>
          <SnippetType>Expansion</SnippetType>
	      <SnippetType>SurroundsWith</SnippetType>
	  </SnippetTypes>
      <Shortcut>filestart</Shortcut>
    </Header>
    <Snippet>
      <Code Language="PHP" Kind="" Delimiter="$"><![CDATA[<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
]]&gt;</Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
</pre>
<p>fileend.snippet:</p>
<pre lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>fileend</Title>
      <Author>Dan Sargeant</Author>
      <Description>CodeIgniter file ending</Description>
      <Shortcut>fileend</Shortcut>
      <SnippetTypes>
          <SnippetType>Expansion</SnippetType>
	      <SnippetType>SurroundsWith</SnippetType>
	  </SnippetTypes>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>filename</ID>
          <ToolTip>Filename</ToolTip>
          <Default>myfile.php</Default>
        </Literal>
        <Literal>
          <ID>directory</ID>
          <ToolTip>Directory</ToolTip>
          <Default>models</Default>
		  </Literal>
      </Declarations>
      <Code Language="PHP"><![CDATA[
/* End of file $filename$*/
/* Location: ./application/$directory$/$filename$*/]]&gt;</Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
</pre><p>The post <a href="https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/">CodeIgniter Snippets for Visual Studio</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2010/07/19/codeigniter-snippets-for-visual-studio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Convert to Apple Lossless Codec: The Easy Way</title>
		<link>https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=convert-to-apple-lossless-codec</link>
					<comments>https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/#comments</comments>
		
		<dc:creator><![CDATA[Dan]]></dc:creator>
		<pubDate>Fri, 02 Jul 2010 12:47:46 +0000</pubDate>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[alac]]></category>
		<category><![CDATA[ape]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[flac]]></category>
		<guid isPermaLink="false">http://www.onemoretake.com/?p=331</guid>

					<description><![CDATA[<p>Playing lossless codecs like APE or FLAC in itunes or on your iphone is not so easy as there is no native support for them. Converting them to the Apple equivalent is also quite tricky. Many people recommend installing media players that support this conversion or purchasing a commercial product to do it. However, there <a class="read-more" href="https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/">Convert to Apple Lossless Codec: The Easy Way</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Playing lossless codecs like APE or FLAC in itunes or on your iphone is not so easy as there is no native support for them. Converting them to the Apple equivalent is also quite tricky. Many people recommend installing media players that support this conversion or purchasing a commercial product to do it. However, there is a free and easy way to convert your files in Windows that does not require any installation.</p>
<p>The key to it is the use of the <a href="http://ffmpeg.arrozcru.org/autobuilds/">windows port of ffmpeg</a>. It can convert just about anything to anything. However, it is a command line tool and converts one file at a time which means a lot of typing if you want to convert an entire album. I spent a little time the other day figuring out a small batch file that can be used to convert and entire albumn in on go. I thought I&#8217;d share it with you. Just create a file called say, <em>convert.bat</em> and place one of the following in it:</p>
<p>For Monkey&#8217;s Audio APE files:</p>
<pre lang="dos">
for /f "tokens=*" %%a IN ('dir /b *.ape') do call ffmpeg -i "%%~na%%~xa" -acodec alac "%%~na.m4a"
</pre>
<p>For FLAC files:</p>
<pre lang="dos">
for /f "tokens=*" %%a IN ('dir /b *.flac') do call ffmpeg -i "%%~na%%~xa" -acodec alac "%%~na.m4a"
</pre>
<p>Then all you have to do is place your batch file, along with ffmpeg.exe into the directory that contains the files you want to convert and run the batch file. It will convert every file in the directory to apple lossless. Easy.</p><p>The post <a href="https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/">Convert to Apple Lossless Codec: The Easy Way</a> first appeared on <a href="https://www.onemoretake.com">One More Take</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.onemoretake.com/2010/07/02/convert-to-apple-lossless-codec/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
