- open new tab:
Cmd + t - next tab:
Cmd + Shift + ] - previous tab:
Cmd + Shift + [
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| window.onscroll = function() { | |
| var d = document.documentElement; | |
| var offset = d.scrollTop + window.innerHeight; | |
| var height = d.offsetHeight; | |
| console.log('offset = ' + offset); | |
| console.log('height = ' + height); | |
| if (offset >= height) { | |
| console.log('At the bottom'); |
| // License: MIT - https://opensource.org/licenses/MIT | |
| // Author: Michele Locati <[email protected]> | |
| // Source: https://gist.github.com/mlocati/7210513 | |
| function perc2color(perc) { | |
| var r, g, b = 0; | |
| if(perc < 50) { | |
| r = 255; | |
| g = Math.round(5.1 * perc); | |
| } | |
| else { |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso