Skip to content

Instantly share code, notes, and snippets.

View jamesattard's full-sized avatar

James A. jamesattard

View GitHub Profile
...
handleClick = () => {
this.setState({
activePlan: this.props.planPrice
});
};
...
<Button onClick={this.handleClick}>
{this.props.buttonLabel}
</Button>
<StyledServicePlanCard
planPrice={2}
buttonLabel="Buy Now"
/>
<StyledServicePlanCard
planPrice={5}
buttonLabel="Buy Now"
/>
<StripeCheckout
amount={this.props.planPrice * 100}
token={token => console.log(token)}
stripeKey={process.env.REACT_APP_STRIPE_KEY}
>
<Button>
{this.props.buttonLabel}
</Button>
</StripeCheckout>
@jamesattard
jamesattard / AppBar.js
Created February 28, 2018 17:27
AppBar Material UI with Styled Components
const StyledTypography = styled(Typography)`
flex: 1;
`;
const StyledButton = styled(Button)`
background: linear-gradient(45deg, #fe6b8b 30%, #ff8e53 90%);
border-radius: 3px;
border: 0;
color: white;
height: 48px;
@jamesattard
jamesattard / button.js
Created February 28, 2018 17:18
Material UI button styling
<Button variant="raised" color="primary">
Hello World
</Button>
@jamesattard
jamesattard / docker-install-amazonlinux.sh
Created February 6, 2018 13:24
Installing Docker on Amazon Linux
#!/bin/bash
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# log out and log in to pickup the added group
# Also install some common sense stuff
sudo yum install -y git
export GIT_SSH_COMMAND="ssh -o IdentitiesOnly=yes -i ~/Keys/my_other_key.pem
{
"configurations" : [
{
"zoo.cfg" : {
"properties_attributes" : { },
"properties" : {
"autopurge.purgeInterval" : "24",
"dataDir" : "/hadoop/zookeeper",
"autopurge.snapRetainCount" : "30",
"clientPort" : "2181",
export const fetchUser = () => async dispatch =>
dispatch({ type: FETCH_USER, payload: await axios.get("/api/current_user") });