Saturday 28 July 2012

Troubleshooting Heroku/Git deployment

Trouble  shooting Heorku/Git deployment


Problem1:  Permission denied (publickey).
git push heroku master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Solution:
  Add public key to heroku:
heroku keys:add ~/.ssh/id_rsa.pub

Problem 2: error:src refspec master does not match any.
$ git push heroku master
error: src refspec master does not match any.
error: failed to push some refs to 'git@heroku.com:bliss.git'

Solution:
 You never committed. So, first commit and proceed.
$~ git commit -m 'initial commit'
$~ git push origin master

Wednesday 25 July 2012

How to move an item to an empty list using jquery?

If you understand the question then you might know it's related to jquery-ui sortable function which though successfully helped to move items between list but fail to add item in a list when it gets empty.

It was earlier reported as a bug and solution to this one was to add width and height to your list.
http://bugs.jqueryui.com/ticket/2940




<ul id="sortable1" class="connectedSortable">
 <li class="ui-state-default">Item 1</li>
 <li class="ui-state-default">Item 2</li>
 <li class="ui-state-default">Item 3</li>
 <li class="ui-state-default">Item 4</li>
 <li class="ui-state-default">Item 5</li>
</ul>

<ul id="sortable2" class="connectedSortable">
 <li class="ui-state-highlight">Item 1</li>
 <li class="ui-state-highlight">Item 2</li>
 <li class="ui-state-highlight">Item 3</li>
 <li class="ui-state-highlight">Item 4</li>
 <li class="ui-state-highlight">Item 5</li>
</ul>



First task: Make them sortable among them.

 <script>
 $(function() {
  $( "#sortable1, #sortable2" ).sortable({
   connectWith: ".connectedSortable"
  }).disableSelection();
 });
 </script>



Second task: Add element to empty list


bingooo .You can't.

Solution:

Add height to your UL /OL list. I gave it by adding padding to it.

.connectedSortable{
   padding-bottom: 10px;
}

Friday 20 July 2012

Errors while compiling libssh2 and their remedies


While building libssh2 you may come across zlib.h or unistd.h related error.  Solution to each problem is given below.


1) ...\comp.c(40) : fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory

Download zlib developer files fromt this link: http://gnuwin32.sourceforge.net/packages/zlib.htm

Download link: http://gnuwin32.sourceforge.net/downlinks/zlib-lib-zip.php



2)..\zconf.h(289) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory


zlib under windows requires libgw32c

To compile with zlib on windows libgw32c is required http://gnuwin32.sourceforge.net/packages/libgw32c.htm to prevent:
c:\program files\gnuwin32\include\zconf.h(289) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

Download link: http://gnuwin32.sourceforge.net/downlinks/libgw32c-lib-zip.php