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
name: Deploy CDK Project | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed |
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
name: Deploy CDK Project | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed |
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
const axios = require('axios') | |
axios({ | |
url: `https://api.github.com/repos/${username}/${repoName}/transfer`, | |
method: 'POST', | |
data: { | |
new_owner: `${orgName}`, | |
}, | |
headers: { | |
Accept: 'application/vnd.github.v3+json', |
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
/** | |
* @param data { { amplify: { environment: string, command: string, subCommand: string, argv: string[] } } } | |
* @param error { { message: string, stack: string } } | |
*/ | |
import { execSync } from 'child_process' | |
import { writeFileSync, readFileSync, copyFileSync, rmSync } from 'fs' | |
const hookHandler = async (data, error) => { | |
const VERCEL_ENVVAR_NAME = 'NEXT_PUBLIC_AMPLIFY_CONFIG' |
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
import React from 'react' | |
import Amplify from 'aws-amplify' | |
import { | |
AmplifyAuthenticator, | |
AmplifySignOut, | |
AmplifySignUp, | |
} from '@aws-amplify/ui-react' | |
import { AuthState, onAuthUIStateChange } from '@aws-amplify/ui-components' | |
import config from '../aws-exports' |
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
const cheerio = require('cheerio') | |
const axios = require('axios').default | |
async function fetchFollowerCounts(usernames) { | |
const followerData = usernames.map((username) => { | |
return axios.get(`https://mobile.twitter.com/${username}`).then((res) => { | |
const $ = cheerio.load(res.data) | |
const searchContext = `a[href='/${username}/followers']` | |
const followerCountString = $(searchContext) | |
.text() |
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
import React from "react"; | |
import logo from "./logo.svg"; | |
import "./App.css"; | |
import Amplify, { API } from "aws-amplify"; | |
import { withAuthenticator } from "aws-amplify-react"; | |
Amplify.configure({ | |
Auth: { | |
identityPoolId: "us-east-1:af865d51-my-identity-pool930304c62ee1", | |
region: "us-east-1", |
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
// First let's grab a form | |
console.log('first') | |
const someForm = document.getElementById('some-form') | |
// Next, we'll add an event listener with the event and a callback function | |
// Note that the anonymous function is | |
someForm.addEventListener('submit', (evt) => { | |
console.log('second') | |
//this is an asynchronous function. |
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
//! How to get all records from a Dynamo DB Table and store as regular JSON | |
// 1. Run the following command in the terminal | |
// * Note that the output will be in Dynamo JSON format | |
// aws dynamodb scan --region REGION --profile PROFILE_NAME --table-name TABLE_NAME > exports.json | |
// 2. Convert from Dynamo JSON to regular JSON. | |
const AWS = require('aws-sdk') | |
const fs = require('fs') |
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
{ | |
"Count": 1, | |
"Items": [ | |
{ | |
"name": { | |
"S": "Michael Liendo" | |
}, | |
"kids": { | |
"N": "3" |
NewerOlder