Tuesday, November 5, 2013
KnockoutJS Tips and Tricks
I wanted to share this video by Ryan Niemeyer, who talks about really useful things to know about KnockoutJS bit.ly/18004A5
Saturday, October 19, 2013
Autoformatting in Xcode
Xcode is not as helpful as Visual Studio when it comes to formatting code. Moreover, if your developers don't follow code standards as much as you'd like, you'll end up with ugly code. Probably the best option is to use Xcode formatter (https://github.com/octo-online/Xcode-formatter), which uses uncrustify to achieve the formatting. You can even edit the rules to follow your own code standards. I found it very helpful, since you can run it after each build.
Monday, October 7, 2013
Auto Layout on iOS Versions prior to 6.0 error
It happened to me after updating to Xcode 5. There are possible solutions to this error. In my case first I tried disabling the auto layout checkbox in the xib's that were causing this error. But this didn't seem like a clean solution. I googled a little more and found that the deployment target was set to 4.3, when it should be set to 6.0 since I'm using auto layouts.
It seems like Xcode 4 should also throw this error, but it didn't. So this error isn't related to Xcode 5, it's just that Xcode 5 does tell you about it.
It seems like Xcode 4 should also throw this error, but it didn't. So this error isn't related to Xcode 5, it's just that Xcode 5 does tell you about it.
Wednesday, September 4, 2013
Knockout performance in Internet Explorer 8
Knockout offers a lot of advantages, but when in comes to IE8 there are some things to consider:
1) Minimize the number of observables you have. Sometimes it's not necessary to have observables for everything, so if you don't need to observe a variable, don't declare it as one. I have received an alert in IE8 saying "a script is running slow in the page" because of this.
2) Plugins and advanced techniques sometimes generate the same alert "a script is running slow in the page". This happened to me when I used the mapping plugin, so I ended up doing the mapping manually instead of using the plugin. My guess is that the flexibility of the plugin comes with the need to execute more lines of code. That's why sometimes it's better to "hardcode" the steps instead of letting knockout "do the magic". At least for IE8.
Tuesday, August 6, 2013
Nice tips for Xcode
I'd like to share this post about time saving tips in Xcode. The ones I like the most (because I didn't know them) are the shortcuts:
command + shift + O
command + control + up arrow
command + shift + O
command + control + up arrow
Monday, July 8, 2013
Ninject with MVC4: No parameterless constructor defined for this object
I've been a big fan of StructureMap, but a few days ago I decided to investigate a simpler framework for DI. I heard about Ninject a long time ago and decided it was time to learn it by applying it to the controllers in MVC4. There are a lot of usefule posts out there that explain how to use it, just keep in mind 2 things:
1) Put your code in App_Start/NinjectWebCommon.cs instead of the global.asax
2) After finishing the tutorials, I got the error "No parameterless constructor defined for this object". This post from StackOverflow has the correct answer! Basically you need these 2 code snippets:
1) Put your code in App_Start/NinjectWebCommon.cs instead of the global.asax
2) After finishing the tutorials, I got the error "No parameterless constructor defined for this object". This post from StackOverflow has the correct answer! Basically you need these 2 code snippets:
public class NinjectControllerFactory : DefaultControllerFactory
{
private IKernel ninjectKernel;
public NinjectControllerFactory(IKernel kernel)
{
ninjectKernel = kernel;
}
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
return (controllerType == null) ? null : (IController) ninjectKernel.Get(controllerType);
}
}
ControllerBuilder.Current.SetControllerFactory(new NinjectControllerFactory(Kernel));
Friday, July 5, 2013
Setting the password for a Git repository in Continuous Integration systems
Continuous Integration systems like CC.NET or Hudson don't let you specify the username/password with which you'll connect to Git. But there's an easy way, just set the repository url to:
https://username:password@github.com/Test/MyProject.git
Subscribe to:
Posts (Atom)