Stop Nano from adding newline character to end-of-file

I use Nano for all of my cli text file editing and I had always noticed that it puts a newline at the bottom of the file, but this has never bothered me much. Well today it caused me quite a headache at work, so I had to figure out how to MAKE IT STOP.

My googling turned up this post at Ask Ubuntu. It has the answer for many linux editors, not just Nano.

The solution for Nano was simply to launch it with the -L option.
nano -L myfile.txt

Posted in Googling for Answers, Linux Tagged ,

Debian: show a list of all packages that are to be upgraded with apt

This is a super easy one, and can easily be found in the man page, but I’ve googled it enough times that I think it’s worth including here. To see packages with available upgrades, without installing them, use the -u option: apt-get upgrade -u

Posted in Googling for Answers, Linux Tagged , ,

jQuery: Execute a callback once, after a class based animation completes

I was developing some web recently and ran into a jQuery problem that was new to me. I was using a class selector to fade a group of elements, and using a callback function which would fire after the fade was complete. Something like this:

[note color=#DDD] [/note]

The problem is that I only wanted to the callback function to execute once, but it was executing for each element in the class. Now, this is expected behavior, but it’s not what I wanted, so I had to find a way to get it to only execute one time, after all the animations were finished.

I asked my good friend google about it, and sure enough, he had an answer.

The trick is to use the last() function to target the last item in the group, then use the queue() function to add a callback to the end of that element’s animation. Finally, dequeue() is used to remove the callback once it’s been run.

[note color=#DDD] [/note]

Brilliant! And I take absolutely no credit for this, all praise goes to

Posted in Googling for Answers, Web Development Tagged