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.
| ; CouchDB Config | |
| ; Drop in PREFIX/local.d/npmjs.ini | |
| [couch_httpd_auth] | |
| public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev | |
| users_db_public = true | |
| [httpd] | |
| secure_rewrites = false |
| #!/bin/sh | |
| export SYSROOT=/home/julian/dev/rpi/rpi-buildroot/output/rootfs-debug/staging | |
| export PATH=/home/julian/dev/rpi/ct-ng/host/bin/:$PATH | |
| echo "Build" | |
| make -j9 V=1 || exit 0 | |
| echo "Install" | |
| make DESTDIR=$(pwd)/install/ install |
| build: | |
| $(CC) -o queue.o queue.c |
| var cluster = require('cluster'); | |
| var PORT = +process.env.PORT || 1337; | |
| if (cluster.isMaster) { | |
| // In real life, you'd probably use more than just 2 workers, | |
| // and perhaps not put the master and worker in the same file. | |
| cluster.fork(); | |
| cluster.fork(); | |
| cluster.on('disconnect', function(worker) { |
| function myLib() { | |
| return { | |
| code: function () {} | |
| , goes: function () {} | |
| , here: function () {} | |
| } | |
| } | |
| exporter('myLib', myLib); |
| // you can omit DI for _light_ dependencies | |
| var async = require('async'); | |
| module.exports.inject = function( dependencies ){ | |
| // no direct require of _heavy_ dependencies | |
| var mysql = dependencies.mysql; | |
| var redis = dependencies.redis; | |
| // do whatever |
| //Decodes Base64 | |
| #include <openssl/bio.h> | |
| #include <openssl/evp.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| int calcDecodeLength(const char* b64input) { //Calculates the length of a decoded base64 string | |
| int len = strlen(b64input); | |
| int padding = 0; |
| var fs = require('fs') | |
| function cat(file) { | |
| var stream = fs.createReadStream(file) | |
| stream.setEncoding('utf8') | |
| return function(write){ | |
| stream.on('error', write) | |
| stream.on('data', function(d){ write(null, d) }) | |
| stream.on('end', write) |
From https://gist.github.com/3050224
From http://blog.smartcore.net.au/smartos-the-basics/