Skip to content

Instantly share code, notes, and snippets.

const showPasswordInput = () => <input type="password" />; // "password" means that characters are hidden when they're typed, for ex behind stars **********
const showCommentInput = () => <input type="text" />;
const Page = ({ user, children, onLogin, onAddComment }) => {
if (!user.isLoggedIn) {
return (
<Layout>
<h3>Please log in to see and post comments</h3>
{showPasswordInput()}
<button onClick={onLogin}>Login!</button>
</Layout>
);
}
#include <iostream>
#include <iterator>
#include <vector>
template<typename InputIterator1, typename InputIterator2, typename OutputIterator>
OutputIterator my_set_difference(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2,
OutputIterator out)
{
auto current1 = first1;
#include <iostream>
#include <vector>
#include <queue>
size_t leftChild(size_t index)
{
return (index + 1) * 2 - 1;
}
size_t rightChild(size_t index)
#include <iostream>
#include <vector>
#include <queue>
size_t leftChild(size_t index)
{
return (index + 1) * 2 - 1;
}
size_t rightChild(size_t index)
#include <iostream>
#include <string>
#include <boost/parameter.hpp>
BOOST_PARAMETER_NAME(firstName)
BOOST_PARAMETER_NAME(lastName)
BOOST_PARAMETER_NAME(age)
BOOST_PARAMETER_NAME(email)
#include <iostream>
#include <string>
#include <boost/parameter.hpp>
BOOST_PARAMETER_NAME(firstName)
BOOST_PARAMETER_NAME(lastName)
BOOST_PARAMETER_NAME(age)
BOOST_PARAMETER_NAME(email)
#include <iostream>
#include <string>
#include <boost/parameter.hpp>
BOOST_PARAMETER_NAME(firstName)
BOOST_PARAMETER_NAME(lastName)
BOOST_PARAMETER_NAME(age)
BOOST_PARAMETER_NAME(email)
#include <iostream>
#include <string>
#include <boost/parameter.hpp>
BOOST_PARAMETER_NAME(firstName)
BOOST_PARAMETER_NAME(lastName)
BOOST_PARAMETER_NAME(age)
BOOST_PARAMETER_NAME(email)
#include <iostream>
#include <string>
#include <boost/spirit/include/karma.hpp>
int main()
{
using boost::spirit::karma::int_;
using boost::spirit::karma::generate;