Skip to content

Instantly share code, notes, and snippets.

=====HOC====
AddFoo.js
const AddFoo = props =>
<Button onClick={() => props.onAdd(props.data)} title={props.title} />
export default graphql(CreateFoo, {
  props: props => ({
    onAdd: foo => props.mutate({
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[credential "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/<project-name>-dev/"]
UseHttpPath = true
helper = !aws --profile <project-name>-devdeveloper codecommit credential-helper $@
@CodySwannGT
CodySwannGT / lookmanohands.sh
Created May 3, 2019 01:26
Delete unattached customer managed AWS policies
while :; echo $(aws iam list-policies --no-only-attached --scope Local --output text --query 'Policies[?AttachmentCount==`0`]|[0:1].Arn'); do aws iam delete-policy --policy-arn $(aws iam list-policies --no-only-attached --scope Local --output text --query 'Policies[?AttachmentCount==`0`]|[0:1].Arn') || true; done
@CodySwannGT
CodySwannGT / apigateway-endpoints.sh
Created May 7, 2019 18:58
Get API Gateway endpoints
#!/bin/bash
REGION=$(aws configure get region)
REST_APIS=$(aws apigateway get-rest-apis --query items[*].id --output text)
for i in $(echo $REST_APIS | tr " " "\n")
do
STAGES=$(aws apigateway get-stages --rest-api-id $i --query item[*].stageName --output text)
for j in $(echo $STAGES | tr " " "\n")
do
Root Account - AWS Account #A
- IAM
- Users
- cody
- Groups:
- Client1Project1StagingGroup
- Policy: CanAssumeRoleForClient1Project1Staging
- Client1Project1DevGroup
- Policy: CanAssumeRoleForClient1Project1Dev
- Client1Project1ProdGroup
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iam:CreatePolicy",
"iam:CreateGroup",
"iam:AddUserToGroup",
@CodySwannGT
CodySwannGT / formatOdds.js
Created September 28, 2019 14:59
formatOdds.js
// (Collect Amount - Bet Amount) / Bet Amount
// Ex: If the Collect Amount is $1,000 and the Bet Amount is $100, then the Odds are 9.00/1
// IF the Odds are less than 1.00, then there is a different formula of:
// (1/((Collect Amount - Bet Amount) / Bet Amount)) * -100.00
// Ex: If the Collect Amount is $900 and the Bet Amount is $600, then the Odds are -200.00
const formatOdds = (collectAmount, betAmount) => {
const collect = parseFloat(collectAmount)
<img width="320" height="66" src="https://imgur.com/5znmEJ3.png" />
<img width="320" height="80" src="https://i.imgur.com/kQCBprn.png" />
<p>By filling out this form, you are agreeing to be contacted by a member of Friends of the Everglades and/or bullsugar.org.</p>
<p>Please make sure you fill out all the form fields so we can properly process your submission</p>
<footer class="jss267">
<div class="MuiContainer-root MuiContainer-fixed MuiContainer-maxWidthLg">
<div class="MuiGrid-root MuiGrid-container MuiGrid-justify-xs-space-around">
<div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-md-3"><a href="/">Contact</a>
<p class="MuiTypography-root MuiTypography-caption">7582 Las Vegas Blvd S. Ste 347
<br>Las Vegas, NV
<br>89123</p>
<p class="MuiTypography-root MuiTypography-caption">[email protected]</p>
</div>
<div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-md-3"><a href="/pages/faq">FAQs</a><a href="/pages/about">About PropSwap</a></div>