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.
| require 'json' | |
| # JSON parser tag, creating map for use in jekyll markdown | |
| # Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com) | |
| # Released under APL 2.0 | |
| # usage: {% jsonball varname from TYPE PARAM %} | |
| # | |
| # where TYPE is one of {data,var,file,page}, described below |
| # Tested on OSX Yosemite 10.10.4 | |
| # there is also an updated version (work in progress) for El Capitan here https://gist.github.com/guycalledseven/31ffe35eca056838b06b | |
| # XXX TODO | |
| # should I disable com.google.Keystone.Agent ?? | |
| # http://applehelpwriter.com/2014/07/13/how-to-remove-googles-secret-update-software-from-your-mac/ | |
| # Stop DS_Store file creation on network connections | |
| # restart Finder afterwards |
| module.exports = function(config) { | |
| config.set({ | |
| basePath: '../../', | |
| frameworks: ['jasmine', 'jquery-2.1.0'], | |
| plugins: [ | |
| 'karma-babel-preprocessor', | |
| 'karma-jquery', | |
| 'karma-jasmine', | |
| 'karma-mocha-reporter', | |
| ], |
| const CLOUDINARY_REGEX = /^.+\.cloudinary\.com\/(?:[^\/]+\/)(?:(image|video)\/)?(?:(upload|fetch)\/)?(?:(?:[^_/]+_[^,/]+,?)*\/)?(?:v(\d+|\w{1,2})\/)?([^\.^\s]+)(?:\.(.+))?$/; | |
| const url = 'http://res.cloudinary.com/oz/image/upload/v1454951830/moments/musicreach/f3432155-1be9-4510-9c3a-c1672c21fc89/f5de39a0-7ad0-48de-b53b-1d148856bcb8_540_pv.jpg'; | |
| const matches = CLOUDINARY_REGEX.exec(url); | |
| console.log(matches); | |
| /* | |
| [ | |
| 'http://res.cloudinary.com/oz/image/upload/v1454951830/moments/musicreach/f3432155-1be9-4510-9c3a-c1672c21fc89/f5de39a0-7ad0-48de-b53b-1d148856bcb8_540_pv.jpg', | |
| 'image', // resource_type | |
| 'upload', // type |
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |