SSH and SFTP Clients for Windows

When I first started using SSH on Windows, I used PuTTY, which seems to be the most popular. However, I noticed it was lacking in so many ways. So, my current Windows SSH client of choice is ZOC. It’s not free, but if you use SSH a lot, then it’s worth it.

I also used to use FileZilla for FTP but now I’ve found WinSCP to be better. It supports synchronized browsing, file transfer presets / masks / filters, local and remote synching of files, and much more. It’s free.

Password-less SSH Authentication with PuTTy and Key Autoloading with Pageant

http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/pka-putty.html

http://www.dailyiteration.com/howto-passwordless-ssh-authentication-with-putty/

http://blog.shvetsov.com/2010/03/making-pageant-automatically-load-keys.html+

Note that in order for SSH authentication to work, you often need to set your .ssh folder and authorized_keys file permissions to specific values. Here are settings that I used that worked:

drwx------   2 ayahya ayahya  4096 Jul 13 14:23 .ssh
-rw-r--r--  1 ayahya ayahya 875 Jul 13 14:23 authorized_keys

Your private keys should always NOT be readable/writable by anyone but you

-rw------- 1 ayahya ayahya  951 Jul 17 14:00 id_rsa

Cloud Databases with REST API

Here are some cloud databases with REST API services that make building a web / mobile app with a backend database super easy.
Apigee Usergrid
1,000,000 requests per hour for FREE
Kinvey
1,000,000 requests per month for FREE
MongoLab
https://mongolab.com
240MB FREE
StackMob
60,000 requests per month for FREE
Parse
https://parse.com
1,000,000 requests per month for FREE
Google Cloud Storage
Not free
I went with Parse because it was the easiest to use.

HTML, CSS, & Javascript Frameworks

When developing a website, you often find yourself doing a lot of the same coding. Here are two nice HTML, CSS, and Javascript framework to get your going quickly.

FOUNDATION
http://foundation.zurb.com/

BOOTSTRAP
http://twitter.github.com/bootstrap/index.html

In addition, don’t forget to check out these HTML5 boilerplates which can come in pretty handy.

http://html5boilerplate.com/

http://html5boilerplate.com/mobile

Javascript: event.preventDefault + unbind

Let’s say you have a form and you want to prevent the default action of submitting the form from occurring when the submit button “submit” event is triggered. After the default action is prevented, however, you want the default action to occur. You can do that as follows:

$("form").submit(function(e) {
	e.preventDefault();
	/*  do something */
	$('form').unbind('submit').submit();
});

Javascript Client-Side Form Validation Using Server-Side Form Validation

When developing a web form, it’s always nice to provide users with the instant feedback of invalid form fields that you get with Javascript client-side form validation. However, some users may not have Javascript enabled and therefore you must have server-side form validation no matter what. This often results in two sets of form validation code for the same form. To simplify your code and maximize code reuse, you can use jQuery Tools Form and power your client-side form validation use your server-side validation rules. Following is an example:

Continue reading Javascript Client-Side Form Validation Using Server-Side Form Validation

Javascript Callbacks and Functions

A callback is a function that is passed as an argument to another function and is executed after its parent function has completed. The special thing about a callback is that functions that appear after the “parent” can execute before the callback executes. Another important thing to know is how to properly pass the callback. This is where I have often forgotten the proper syntax.

Callback without arguments

For a callback with no arguments you pass it like this:

[cc lang=”javascript”]
$.get(‘myhtmlpage.html’, myCallBack);
[/cc]

Note that the second parameter here is simply the function name (but not as a string and without parentheses). Functions in Javascript are ‘First class citizens’ and so can be passed around like variable references and executed at a later time. Continue reading Javascript Callbacks and Functions