In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| # I miss 'watch' on OS X | |
| watch () { | |
| clear | |
| if [ -z $2 ] | |
| then | |
| time="5" # Saneish default | |
| watchedcmd=$1 | |
| else | |
| time=$(echo $1 | sed -e 's/-n//') |
| # www.fduran.com | |
| # redirect from apache port (:8080 for ex for tomcat etc) to subdomain | |
| # in apache config: | |
| <VirtualHost *:80> | |
| ServerName subdomain.example.com | |
| ProxyPass / http://127.0.0.1:8080/ | |
| ProxyPassReverse / http://127.0.0.1:8080/ | |
| </VirtualHost> |
| <?php | |
| // Output screenshot: | |
| // http://cl.ly/NsqF | |
| // ------------------------------------------------------- | |
| include_once 'console.php'; | |
| // ::log method usage | |
| // ------------------------------------------------------- | |
| Console::log('Im Red!', 'red'); |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| // this is the background code... | |
| // listen for our browerAction to be clicked | |
| chrome.browserAction.onClicked.addListener(function (tab) { | |
| // for the current tab, inject the "inject.js" file & execute it | |
| chrome.tabs.executeScript(tab.ib, { | |
| file: 'inject.js' | |
| }); | |
| }); |