I have a bad habit of leaving an open SSH session sitting there and then coming back to it to realize that it’s dead. In the past, I’ve just killed the terminal to end it. Here’s a better way:
<Enter>~.
That’s the enter key followed by the tilda character followed by a period.
To explain, SSH has a few different escape sequences. To see them, run ~? while in an open SSH session. Here they are:
mcrittenden@freshbox$ ~?
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
As you can see, ~. is the escape sequence to terminate the connection, and the note at the end says that they’re only recognized immediately following a newline, hence <Enter>~.
Ever been in a situation where you need to do something on click except if it’s already been done, in which case you undo it? Previously, I would do this by setting a class on the first click and then checking for that class to see if it’s already been clicked.
Turns out, there’s a function that makes it easier. Just sticking this here in hopes that someone else stumbles on it.
There’s a pretty common and nice looking that lets you fade to a different background image when you hover over a link, div, etc. For an example, see Dragon Interactive’s navigation. That method basically involves adding an empty span tag inside the link or div, and setting it to take up the full available space but be transparent. Then, on hover, you fade it into view (and you can set whatever background image you want on it so it looks nice and pretty).
However, that method doesn’t work on form submit button inputs since you can’t add HTML inside an <input> tag (since they’re self-closing). So you’re stuck trying to figure out another method. Here’s a simple one that worked for me.
Basically, instead of setting a span inside the element, you wrap the element in a div, so you’re basically doing the opposite. Then, you can set whatever background image you want on the div, and write a bit of jQuery that, on hover, fades the button to an opacity of 0.01 (so it’s transparent, showing the div’s background image instead of the button’s, but still clickable).
Here’s some code to illustrate:
The HTML for the submit button
The jQuery which wraps the submit button in a div and does the fading on hover/mouseout
The CSS to replace the button with an image (using a large negative text-indent which is just my preferred method) and to set the background image on the background div
Give me a shout if you try it out and have trouble.
If you’re looking for a version that works with Komodo Edit 6, here it is. Took me forever to find that.
A simple function to check whether a string is in valid HH:MM (or H:MM…the hours don’t have to be zero padded) format.
I always thought that link title attributes (i.e., the little tooltips you get when hovering over a link) are important for accessibility. Turns out, I was mistaken.
Actually most screen-readers will not read the title attribute of a link when there is also link text in the anchor. Also most keyboard only users will not get the content of the title attribute as it is usually only available to those with a pointing device.
[…] Bottom line is that title is for non-important information, users must be able to determine the purpose of a link without using the content of the title attribute.
- Source
We were testing an HTML newsletter and a certain element was moved way down below where it in Outlook should be for no apparent reason. After some debugging, we realized that Outlook screws things up right where a page break would be when printing it.
If you’re having a weird spacing issue in HTML emails in Outlook 2007, try printing your email. If the spacing issue is right where the page breaks, you can be pretty sure that this is the problem. It appears that Outlook has a bug where page breaks screw up formatting even when just looking at it on screen (which should have nothing to do with page breaks).
So to fix it, we need to tell Outlook to break the page right BEFORE the issue when printing, using style="page-break-before: always". For example, if the issue is right on a certain table row, then make that <tr> into:
<tr style="page-break-before: always">
Worked for me.
I’ve been steadily building up a collection of good background music for coding. If you’re interested, here are a few bands/artists I’d recommend:
- This Will Destroy You
- The American Dollar
- The Album Leaf
- Amiina
- Eluvium
- Philip Glass
- Brian Eno
- Harold Budd
- Aphex Twin (the ambient stuff)
- Boards Of Canada
- Carbon Based Lifeforms
- Explosions in the Sky