Built-in git GUI
gitk
Use colorful git output
git config color.ui true
Show log on just one line per commit
git config format.pretty oneline
Use interactive adding
git add -i
var varToString = function(varObj) {
return Object.keys(varObj)[0]
}
var someVar = 42;
console.log(varToString({someVar}));
// change underscore template setings
_.templateSettings = {
evaluate: /\{%([\s\S]+?)%\}/g,
interpolate: /\{\{([\s\S]+?)\}\}/g,
escape: /\{\{-([\s\S]+?)\}\}/g
};
{% %}
{{ }}
{{- }}
At the Cloudstock hackathon December 6th, 2010, Brian Mulloy presented "Teach a Dog to REST," asking the question: where are all the elegant REST APIs we'd all hoped to see? While many claim REST has arrived, many APIs in the wild exhibit arbitrary, productivity-killing deviations from true REST.
Enable hash in the url
for routing in Backbone when using bootstrap tabs
Try this code. It adds tab href
to url
+ opens tab based on hash on page load:
$(function(){
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
$('.nav-tabs a').click(function (e) {
$(this).tab('show');
var scrollmem = $('body').scrollTop() || $('html').scrollTop();
window.location.hash = this.hash;
$('html,body').scrollTop(scrollmem);
});
});