Skip to content

Instantly share code, notes, and snippets.

View ikushlianski's full-sized avatar
🔨

Ilya Kushlianski ikushlianski

🔨
View GitHub Profile
@pikanji
pikanji / graphql-directives.js
Last active June 17, 2023 21:33
Amplify GraphQL Directive Definitions
import gql from 'graphql-tag';
// https://docs.amplify.aws/cli-legacy/graphql-transformer/directives/
const clientSchemaExtensions = gql`
# https://docs.amplify.aws/cli/graphql/data-modeling/#how-it-works
directive @model(
queries: ModelQueryMap
mutations: ModelMutationMap
subscriptions: ModelSubscriptionMap
timestamps: TimestampConfiguration
@elviswolcott
elviswolcott / delete-layer.sh
Created January 26, 2020 08:05
Delete all Lambda layer versions across all regions
layer=$1
get_regions () {
echo $(aws ssm get-parameters-by-path --region "us-east-1" --path /aws/service/global-infrastructure/services/lambda/regions --query 'Parameters[].Value' --output text | tr '[:blank:]' '\n' | grep -v -e ^cn- -e ^us-gov- | sort -r)
}
regions=$(get_regions)
get_versions () {
echo $(aws lambda list-layer-versions --layer-name "$layer" --region "$region" --output text --query LayerVersions[].Version | tr '[:blank:]' '\n')
}
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active June 3, 2024 20:19
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@gustavwennerblom
gustavwennerblom / gist:b17a6b8c12a6e10f88306ad3e42f26bd
Last active November 23, 2022 23:43
Adding prettier to a CRA project

Adding prettier to a CRA project

Previously, I've had some problem to reliaby configure code formatting with Prettier in VSCode, in the context of a create-react-app proejct. Today, it worked like a charm, and this is what I did.

Preconditions:

  • react-scripts: "3.1.1"
  • react: "^16.9.0"
  • react-dom: "^16.9.0"
  • Dirk Baeumer's ESLint VSCode extension installed and running
@gene1wood
gene1wood / google-drive-symlink.md
Last active May 23, 2024 14:54
Google Drive symlink
@kyranjamie
kyranjamie / countries.enum.ts
Last active April 28, 2024 09:30
TypeScript enum Country Codes ISO 3166
export enum Country {
Afghanistan = 'AF',
AlandIslands = 'AX',
Albania = 'AL',
Algeria = 'DZ',
AmericanSamoa = 'AS',
Andorra = 'AD',
Angola = 'AO',
Anguilla = 'AI',
Antarctica = 'AQ',
@rais38
rais38 / gist:5766980
Created June 12, 2013 16:35
Create patch from stash
git stash show -p stash@{0} > Stash0.patch