söndag 27 oktober 2013

edit remote application in Eclipse

http://stackoverflow.com/a/4216878/517457

RSE may already be included in your current Eclipse installation. To check in Eclipse Indigo go to Window > Open Perspective > Other... and choose Remote System Explorer from the Open Perspective dialog to open the RSE perspective.
To create an SSH remote project from the RSE perspective in Eclipse:
  1. Define a new connection and choose SSH Only from the Select Remote System Type screen in the New Connection dialog.
  2. Enter the connection information then choose Finish.
  3. Connect to the new host. (Assumes SSH keys are already setup.)
  4. Once connected, drill down into the host's Sftp Files, choose a folder and select Create Remote Project from the item's context menu. (Wait as the remote project is created.)
If done correctly, there should now be a new remote project accessible from the Project Explorer and other perspectives within eclipse. With the SSH connection set-up correctly passwords can be made an optional part of the normal SSH authentication process. A remote project with Eclipse via SSH is now created.

måndag 16 september 2013

SEO redirects 101

http://moz.com/blog/save-your-website-with-redirects

Jquery form plugin

http://jsfiddle.net/KvXK4/1/

http://stackoverflow.com/a/12954102

http://stackoverflow.com/a/12650849

http://stackoverflow.com/a/8191682

http://www.playframework.com/documentation/1.2.7/routes#anamecontenttypesSettingcontenttypesa

lördag 14 september 2013

Virtualbox, to copy the image to another computer

http://jen3ral.wordpress.com/2009/03/02/copying-a-virtualbox-virtual-machine-onto-another-host-computer/

To copy the image to another computer:
  1. Close VirtualBox if it’s running.
  2. Go to your home folder and enable show hidden files through the View menu.
  3. Find the .VirtualBox folder, go to the HardDisks folder and copy the .vdi file you want to use.  In my case  I burned the file to a DVD because we have so many people who will be needing to save this in their home directory.
  4. Now go to the other host computer you want to use that .vdi file on and open VirtualBox if you’ve never opened it on the new host machine before.  This will create the .VirtualBox folder.  Then paste it in the same place (user’s home directory -> show hidden files -> .VirtualBox -> HardDisks).  You might need to create the HardDisks folder yourself.
  5. Edit the permissions of the file in order for it to work.  All I did was right-click on it after moving the file over and give read & write permissions to the owner, which should have your username there.  You can change the permissions to the group and others sections if needed later, but that wasn’t necessary for me.
Once you’ve copied the disk image you need to create a new machine and register that hard disk with VirtualBox on the target host machine:
  1. From the VirtualBox window click the New button.  This will open the New Virtual Machine Wizard.
  2. VM Name and OS Type – Give it a name and pick the type & version of the virtual machine OS.
  3. Memory – Just leave it as the default.  You can change it later if you notice any problems.
  4. Virtual Hard Disk – This is where you select the hard disk you copied in to the home directory earlier.  So click on existing and when the Virtual Media Manager window comes up choose to Add.  It should take you to the correct folder so just select the image file and click open, then select.
  5. You’re done, it’ll take you back to the main window with the new virtual machine you just created based off the existing image file.
If you notice things running slowly you can shut down the machine, go to settings, and change the base memory allocation.  It’ll be screaming at you in red or orange text if you’ve allocated too much.

onsdag 11 september 2013

ref: http://stackoverflow.com/a/1052246/517457


Figured it out.
Turns out Internet Explorer chokes if you use anything other than "javascript" in the language attribute of the script tag.
I was using version numbers appended onto javascript in the language attribute, which was causing IE not to load prototype.js

tisdag 10 september 2013

Extend JQuery UI dialog

ref: http://stackoverflow.com/a/17763712

var defaults = {
  autoOpen: false,
  draggable: false,
  resizable: false,
  closeOnEscape: true,
  modal: true,
  height: 'auto',
  width: 200,
  position: ['top', 150]
};
and then use $.extend with the specific options you want to override:
$('.detail-view').dialog($.extend({}, defaults, {
  width: 600
}));
$('.forgotpass').dialog($.extend({}, defaults, {
  width: 400
}));
You could encapsulate this in a function:
function createDialog(selector, options) {
    $(selector).dialog($.extend({}, defaults, options));
}

createDialog('.detail-view', {
  width: 600
});
createDialog('.forgotpass', {
  width: 400
});
Or of course if it's just width:
function createDialog(selector, width) {
    $(selector).dialog($.extend({}, defaults, {width: width}));
}

createDialog('.detail-view', 600);
createDialog('.forgotpass', 400);

JQuery form plugin issue < IE10

https://github.com/malsup/form/issues/302

and

https://drupal.org/node/1675794

even better actually, use chromeframe


<meta http-equiv="X-UA-Compatible" content="chrome=1">

Add This slows page loading and the solution

The solution is to load AddThis script in asynchronous mode. This would prevent AddThis from loading other assets except the initial script. After loading this initial script your website will break connection with the AddThis server and load itself further. When your website’s DOM has fully loaded, you can call the init() function of AddThis to resume loading of AddThis assets.
To do this, just add the following parameters to your script call
async=1&domready=1
So, instead of the following code:
1<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f3e33c72b9a4e40"></script>
Use this one (change the pubid parameter to your pubid):
1<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f3e33c72b9a4e40&async=1&&domready=1"></script>
And then call the init() function right before closing the body tag
1<!-- Call for AddThis init() function -->
2<script>
3    function initAddThis()
4     {
5          addthis.init()
6     }
7     initAddThis();
8</script>
You’ll see that your AddThis widget is loading faster than before. Of course there could be other reasons that might be slowing down your website. You should look at them separately.

ref:
http://techwelkin.com/slow-addthis-reason-and-solution#.Ui7RjaydnLY

tisdag 11 juni 2013

Break anchor inside table cells


http://stackoverflow.com/a/5889731

example:

td a { word-break: break-all;}

söndag 6 januari 2013

lördag 5 januari 2013

Backup Windows client to linux server

http://blog.dmitryleskov.com/small-hacks/pushing-files-from-windows-to-linuxunix-hosts-with-cwrsync/