largest source of APIs
How to undo (almost) anything with Git
Fix the last commit message
Scenario: You just typo’d the last commit message, you did
git commit -m "Fxies bug #42"
but beforegit push
you realized that really should say “Fixes bug #42”.Undo with:
git commit --amend
orgit commit --amend -m "Fixes bug #42"
What’s happening:
git commit --amend
will update and replace the most recent commit with a new commit that combines any staged changes with the contents of the previous commit. With nothing currently staged, this just rewrites the previous commit message.Undo “local” changes
Scenario: The cat walked across the keyboard and somehow saved the changes, then crashed the editor. You haven’t committed those changes, though. You want to undo everything in that file—just go back to the way it looked in the last commit.
Undo with:
git checkout -- <bad filename>
Stanford SHA256.js javascript hash libarary
* An older version of this implementation is available in the public
* domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh,
* Stanford University 2008-2010 and BSD-licensed for liability
* reasons.
jQuery Mobile: Creating dialogs
Any page can be presented as a modal dialog by adding the data-rel=”dialog” attribute to the page anchor link. When the “dialog” attribute is applied, the framework adds styles to add rounded corners, margins around the page and a dark background to make the “dialog” appear to be suspended above the page.