In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| // thanks to @raganwald | |
| function spread(fn) { | |
| return Function.apply.bind( fn, null ); | |
| } | |
| function foo(x,y,z) { | |
| console.log(x,y,z); | |
| } | |
| function bar(fn) { |
##Make a shell script into a global command on OSX.
####This example will open app passed as param in TextMate
1 Create your script in /usr/local/bin on OSX, it will automatically be added to your $PATH
/usr/local/bin/tm.sh
2 Make script executable
##Smooth Scrolling Performs a smooth page scroll to an anchor on the same page.
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {| lsof -i TCP:63342 |
| sudo chown -R `whoami` ~/.npm | |
| sudo chown -R `whoami` /usr/local/lib/node_modules |
| lsof -i :9000 #or whatever port | |
| kill -9 pID |
| #!/bin/sh | |
| if [ -z $1 ]; | |
| then | |
| echo 'USAGE: specify a branch to delete' | |
| else | |
| #delete a local branch | |
| git branch -d $1 | |
| #delete a remote branch |
| models.OrgsModel = Backbone.Model.extend({ | |
| url: function() { | |
| return root + 'organizations.json'; | |
| }, | |
| behavior: function (org) { | |
| loc.org = org; | |
| utils.nav(org); | |
| }, | |
| defaultItem: function () { | |
| return loc.org; |
| <style> | |
| #rootEl { | |
| color:#FFFFFF; | |
| text-align:center; | |
| height:50px; | |
| width:150px; | |
| background-color:red; | |
| } | |
| </style> | |
| <div id="rootEl"><h3>Click Me</h3></div> |