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 usecases of submodules:
- Separate big codebases into multiple repositories.
that I bookmarked but never had enough time to read
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
const store = createStore((state = { counter: 0 }, action) => { | |
switch(action.type) { | |
case "INCREMENT": | |
return { counter: state.counter + 1 } | |
case "DECREMENT": | |
return { counter: state.counter - 1 } | |
default: | |
return state | |
} | |
}) |
[ | |
{ "country": "Austria", "code": "AT" }, | |
{ "country": "Belgium", "code": "BE" }, | |
{ "country": "Bulgaria", "code": "BG" }, | |
{ "country": "Croatia", "code": "HR" }, | |
{ "country": "Cyprus", "code": "CY" }, | |
{ "country": "Czech Republic", "code": "CZ" }, | |
{ "country": "Denmark", "code": "DK" }, | |
{ "country": "Estonia", "code": "EE" }, | |
{ "country": "Finland", "code": "FI" }, |
pragma solidity ^0.4.19; | |
contract ERC721 { | |
string constant private tokenName = "My ERC721 Token"; | |
string constant private tokenSymbol = "MET"; | |
uint256 constant private totalTokens = 1000000; | |
mapping(address => uint) private balances; | |
mapping(uint256 => address) private tokenOwners; | |
mapping(uint256 => bool) private tokenExists; | |
mapping(address => mapping (address => uint256)) private allowed; | |
mapping(address => mapping(uint256 => uint256)) private ownerTokens; |
contract ERC721 { | |
// ERC20 compatible functions | |
function name() constant returns (string name); | |
function symbol() constant returns (string symbol); | |
function totalSupply() constant returns (uint256 totalSupply); | |
function balanceOf(address _owner) constant returns (uint balance); | |
// Functions that define ownership | |
function ownerOf(uint256 _tokenId) constant returns (address owner); | |
function approve(address _to, uint256 _tokenId); | |
function takeOwnership(uint256 _tokenId); |