Skip to content

Instantly share code, notes, and snippets.

Avatar
😃

David Wells DavidWells

😃
View GitHub Profile
@wlib
wlib / LICENSE
Last active Apr 19, 2021
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
View LICENSE
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@singledigit
singledigit / Install-AWS-SAM.sh
Last active Feb 15, 2021
Install AWS SAM on Linux using the new Linux installer
View Install-AWS-SAM.sh
curl -L https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip -o aws-sam-cli-linux-x86_64.zip
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
sudo ./sam-installation/install
where sam
sam --version
@mdlavin
mdlavin / template.yml
Created Jan 23, 2021
Amplify custom auth domain template.yml
View template.yml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
env:
Type: String
authCognitoResourceUserPoolId:
Type: String
Mappings:
CustomAuthDomains:
@mdlavin
mdlavin / amplify-custom-auth-domain-app.js
Created Jan 23, 2021
Amplify Custom Auth Domain Config Update
View amplify-custom-auth-domain-app.js
import awsconfig from "./aws-exports";
import Amplify from "@aws-amplify/core";
// Find the User Pool ID for your production deployment in
// the AWS Console
if (awsconfig.aws_user_pools_id === "us-east-1_M7n6RNrq9") {
awsconfig.oauth.domain = "auth.yourdomain.com;
}
Amplify.configure(awsconfig);
View gist:a14e7a589a6f270fb44190a05594d15b
// connect route
const apigatewayroutesocketconnect = new apigateway.CfnRoute(this, "apigatewayroutesocketconnect", {
apiId:apigatewaysocket.ref,
routeKey: "$connect",
authorizationType: "AWS_IAM",
apiKeyRequired: false,
operationName: "ConnectRoute",
target: "integrations/"+new apigateway.CfnIntegration(this, "apigatewayintegrationsocketconnect", {
apiId: apigatewaysocket.ref,
integrationType: "AWS_PROXY",
@kentcdodds
kentcdodds / .gitignore
Last active Mar 16, 2021
This will create a Google Voice "native" app on your computer
View .gitignore
node_modules
View Better Stripe Invoice Generator by @levelsio
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@kentcdodds
kentcdodds / README.md
Last active Dec 30, 2020
user-package-stats
View README.md

user-package-stats

I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.

Feel free to try it yourself. Just change the username passed to getUserDownloadStats.

By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.

You can use it with npx like so:

@swinton
swinton / README.md
Last active Dec 3, 2020
Automatically sign your commits from GitHub Actions, using the REST API
View README.md

Verified commits made easy with GitHub Actions

image

So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?

Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN, and the GitHub CLI, gh, which is pre-installed on GitHub's hosted Actions runners.

You don't have to configure the git client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT and DESTINATION_BRANCH to suit your needs.

@FermiDirak
FermiDirak / reactathon2020.js
Created Nov 30, 2020
Learn static code analysis in React!
View reactathon2020.js
import jscodeshift from "jscodeshift";
import fs from "fs";
import path from "path";
const projectDirectory = "my/project/root/directory";
///////////////////////////////////////////////////////////////////////////////
// util functions
///////////////////////////////////////////////////////////////////////////////