Top Answer!
If you are at a certain branch mybranch
, just go ahead and git checkout commit_hash
. Then you can return to your branch by git checkout mybranch
. I had the same game bisecting a bug today :)
Also, you should know about git bisect.
I could just hit nodejs.org and get the new image, but figured there had to be an easier way. It turns out there is -- you can upgrade your local Node.js with NPM:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
The n package represents a Node helper, and running the last command upgrades node to the latest stable version. Instead of using stable
, you could specify a desired version:
sudo n 0.12.2
Once your install is complete, you can confirm you version with another command:
node -v
You’ve decided that you’re going to work on issue #53 in whatever issue-tracking system your company uses. To create a branch and switch to it at the same time, you can run the git checkout
command with the -b
switch:
$ git checkout -b iss53
Switched to a new branch "iss53"
This is shorthand for:
$ git branch iss53
$ git checkout iss53
Switch back to your master branch:
$ git checkout master
Switched to branch 'master'
Next, you have a hotfix to make. Let’s create a hotfix branch on which to work until it’s completed:
$ git checkout -b hotfix
Switched to a new branch 'hotfix'
$ vim index.html
$ git commit -a -m 'fixed the broken email address'
[hotfix 1fb7853] fixed the broken email address
1 file changed, 2 insertions(+)
You can run your tests, make sure the hotfix is what you want, and merge it back into your master branch to deploy to production. You do this with the git merge
command:
$ git checkout master
$ git merge hotfix
Updating f42c576..3a0874c
Fast-forward
index.html | 2 ++
1 file changed, 2 insertions(+)
After your super-important fix is deployed, you’re ready to switch back to the work you were doing before you were interrupted. However, first you’ll delete the hotfix
branch, because you no longer need it – the master
branch points at the same place. You can delete it with the -d
option to git branch:
$ git branch -d hotfix
Deleted branch hotfix (3a0874c).
To remove a remote branch (if you know what you are doing!)
git push origin :hotfix
more at git-scm.com
Get list of all 'input' objects using JavaScript, without accessing a 'form' object.
function getFormData(formID) {
var container, inputs, len, index, data = {};
// get the container element
container = document.getElementById(formID);
// find it's child 'input' elements
inputs = container.getElementsByTagName('input');
for(index = 0, len = inputs.length; index < len; index++) {
if(inputs[index].name) {
data[inputs[index].name] = inputs[index].value;
}
}
return data;
}
Test with this.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="" id='my-form'>
<input type="text" name="user" id="user" value="tommy" />
<input type="text" name="pass" id="pass" value="qwerty" />
<input type="submit" value="GO">
</form>
</body>
</html>
You need the following ssl configuration in your VirtualHost:
<VirtualHost donvercety.tk:443>
ServerName donvercety.tk
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/donvercety.tk.key
SSLCertificateFile /etc/apache2/ssl/donvercety.tk.cert
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
# ...
</VirtualHost>
You will also need all the settings and sections required for a regular HTTP host, such as DocumentRoot and
You can create a key and certificate yourself instead of downloading them from this page. This makes your key more secure. To generate a key:
openssl genrsa -out donvercety.tk.key 2048
And the certificate:
openssl req -new -x509 -key donvercety.tk.key -out donvercety.tk.cert -days 3650 -subj /CN=donvercety.tk