Author: , Posted on Wednesday, May 16th, 2012 at 2:11:44pm

http://www.macrumors.com/2011/07/20/how-to-disable-lions-resume-feature/

ssh -o TCPKeepAlive=no -o ServerAliveInterval=15 username@remotehost

After 1 day of testing I no longer experience this problem to such an obvious extent (so far it actually seems like it’s fixed altogether). The net.inet.tcp.keepidle and net.inet.tcp.keepintvl variables were modified in /etc/sysctl.conf. Their values were extremely low. I don’t know how this happened. The solution was to set these values to their default values net.inet.tcp.keepidle=7200000 and net.inet.tcp.keepintvl=75000 using the “sudo sysctl -w” command.

http://online.wsj.com/article/SB10001424052702304192704577404434001058726.html

Get More Done
Advice from executives, meeting planners and trainers on productive meetings:

•Set a clear agenda.

•Impose a ‘no devices’ rule or schedule periodic tech breaks for email, texts and phone calls.

•Redirect people back to the agenda when they ramble or digress.

•Draw out quiet people by asking them in advance for a specific contribution.

•Do a ’round robin,’ when appropriate, to allow everyone to contribute.

•Ask early for objections to keep them from derailing discussions later.

•Limit the length of slide presentations.

•Interrupt people who talk too long or talk to each other.

•Set an ending time for the meeting and stick to it.

How To Determine HTTP Protocol Using PHP

Author: , Posted on Friday, May 11th, 2012 at 11:46:53am

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https:" : "http:";

How To Check If Any Radio Button In A Group Is Checked Using jQuery

Author: , Posted on Wednesday, May 9th, 2012 at 9:03:51am
1
2
3
4
5
6
7
8
9
if ( ! jQuery('input[name=yourRadioGroup]').is(':checked') ) return false;
 
~OR~
 
if (! jQuery('input[name=yourRadioGroup]:checked').val()) {
   alert('Please make a selection...');
} else {
  alert('Thank you for making a selection!');
}
if ( ! jQuery('input[name=yourRadioGroup]').is(':checked') ) return false;

~OR~

if (! jQuery('input[name=yourRadioGroup]:checked').val()) {
   alert('Please make a selection...');
} else {
  alert('Thank you for making a selection!');
}

How To Trim Whitespace From Exploded Elements In PHP

Author: , Posted on Monday, May 7th, 2012 at 10:54:31am

Here is a one-liner that explodes a string and trims whitespace from each element:

$array = array_map('trim',explode(',',$str));

How To Cache WordPress Using Amazon S3 & CloudFront CDN

Author: , Posted on Thursday, May 3rd, 2012 at 4:07:03pm

I found a fantastic tutorial on using the W3 Total Cache plugin with Amazon’s S3/CDN that I had to share:
http://www.makeuseof.com/tag/give-wordpress-blog-lightning-fast-speeds-w3-total-cache/

The basic gist of the article says to do the following:

  1. Install and activate the W3 Total Cache plugin
  2. Sign up for Amazon Web Services (AWS)
  3. Obtain your AWS Access and Secret key pair
  4. In AWS S3, create a new bucket.
    In my experience, it is best to name a bucket using all lowercase letters and dashes ONLY.
  5. In AWS CloudFront, create a new distribution using the new bucket you created in the previous step.
  6. Return to your WordPress blog and find the Performance menu on the left menu, and choose General Settings.
  7. Activate the CDN, then enter and save your AWS credentials.
  8. Run the Test Save for the bucket.
  9. Export your various media and other files to the bucket/CDN.
  10. Done. Enjoy the vastly improved response time for your site.

How To Fix jQuery submit() Problems

Author: , Posted on Wednesday, May 2nd, 2012 at 2:11:48pm

If you have a named submit button in your form, submit() will fail.

The solution is to change

1
<input type="submit" name="submit" value="hello" />
<input type="submit" name="submit" value="hello" />

to

1
<input type="submit" value="hello" />
<input type="submit" value="hello" />

Here is a link to the bug report on jquery: http://dev.jquery.com/ticket/4652

TGIF and for Naomi (not in that order!)

Author: , Posted on Friday, April 27th, 2012 at 7:57:00am

I love my wife and I am SO glad it is Friday. Heading to the doctor for a check-up. I am sure he will want to take blood to check my diabetes. ICK.

Looking forward to getting a massage later from Gary of Hillsborough Massage, then off to Elements for our weekly repast.

My grandfather is doing better, but is still in rehab after being hospitalized for pneumonia.

How To Install LESSC Using node.js

Author: , Posted on Thursday, April 26th, 2012 at 3:49:19pm

I did this as root. YMMV…

gem uninstall less (just in case you used the old way...)

git clone git://github.com/ry/node.git
(or use wget http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz; tar xvzf node-*)

cd node
./configure
make
make install
cd ..
curl http://npmjs.org/install.sh | sh
npm install less
ln -s /usr/lib/nodejs/less/bin/lessc /usr/bin/lessc

How to Calculate the Last Day of the Month in PHP

Author: , Posted on Tuesday, April 24th, 2012 at 8:02:39pm


$lastDay = date("Y-m-t", strtotime("-3 months"));
$firstDay = date("Y-m-01", strtotime("-3 months"));

How To Replace All Line Breaks With <br /> Using JavaScript

Author: , Posted on Monday, April 16th, 2012 at 8:33:16am
1
yourUpdatedVar = yourOriginalVar.replace(/\n/g, '');
yourUpdatedVar = yourOriginalVar.replace(/\n/g, '');