This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps
argument of the connect
function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps
can take.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: postgresql | |
encoding: utf8 | |
database: campflame_development | |
pool: 5 | |
host: '' | |
test: | |
adapter: postgresql | |
encoding: utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Postgresql fancy datatypes! | |
* array | |
* hstore (=~ hash) | |
* json | |
* jsonb | |
Philippe Creux - [@pcreux](http://twitter.com/pcreux) |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "import task" | |
task :import, [:username, :password, :dbname, :path] do |t, args| | |
sh <<-SQL | |
PGPASSWORD=#{args[:password]} psql --username=#{args[:username]} --dbname=#{args[:dbname]} << EOF | |
\\copy films from #{args[:path]} (DELIMITER E'\t'); | |
EOF | |
SQL | |
end |
Get the git-promt.sh
script here. Put it somewhere like ~/.git-prompt.sh
. If you want to be all CLI about it, you could just run:
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
Now modify your your bash profile (it’s at ~/.bash-profile
, in case you’re new to this stuff). Before the part of the file that declares what your prompt will look like (PS1=[...]
), load in the script you just downloaded, like so:
# Load in the git branch prompt script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PurchaseApprover | |
# Implements the chain of responsibility pattern. Does not know anything | |
# about the approval process, merely whether the current handler can approve | |
# the request, or must pass it to a successor. | |
attr_reader :successor | |
def initialize successor | |
@successor = successor | |
end |
NewerOlder