Skip to content

Instantly share code, notes, and snippets.

@derhuerst
derhuerst / intro.md
Last active November 3, 2025 16:15
Installing Git on Linux, Mac OS X and Windows
@sdnts
sdnts / example.md
Last active January 10, 2023 20:50
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});
@shortjared
shortjared / list.txt
Last active December 2, 2025 11:10
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@lizturp
lizturp / cloudformation-kinesis-fh-delivery-stream.json
Last active November 3, 2022 03:34
AWS Cloudformation template to build a firehose delivery stream to S3, with a kinesis stream as the source. JSON, but it's fine.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for Kinesis Stream",
"Parameters": {
"Environment": {
"Description": "dev, stage, or prod - this is for bucket tags",
"Type": "String",
"MinLength": "3",
"MaxLength": "5"
}
@npearce
npearce / install-docker.md
Last active September 30, 2025 13:57
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@andreyryabtsev
andreyryabtsev / backmatting.ipynb
Last active June 5, 2024 04:56
BackMatting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dabit3
dabit3 / appsync-cdk-stack.ts
Last active December 30, 2021 16:17
Todo app AppSync API with CDK
import * as cdk from '@aws-cdk/core';
import { CfnApiKey, PrimaryKey, Values, GraphQLApi, MappingTemplate, FieldLogLevel, AttributeValues } from '@aws-cdk/aws-appsync'
import { AttributeType, BillingMode, Table } from '@aws-cdk/aws-dynamodb';
import * as lambda from '@aws-cdk/aws-lambda'
import { join } from 'path';
export class AppsyncCdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
@dabit3
dabit3 / auth.js
Last active January 17, 2021 02:39
Next.js Authentication Component
import React, { useEffect, useState } from 'react';
import Auth from 'aws-amplify'
import { css } from 'emotion';
import { useRouter } from 'next/router'
const primaryColor = "rgba(0,118,255,0.9)"
const intitialFormState = {
username: '',
email: '',
password: '',
@dabit3
dabit3 / testing-graphql.sh
Created September 17, 2020 15:28
GraphQL requests using CURL
# query
curl \
-X POST \
-H "x-api-key: xxx-xxxx" \
-H "Content-Type: application/json" \
-d '{ "query": "query { listUsers { name } }" }' \
https://app-id.appsync-api.us-east-1.amazonaws.com/graphql
# mutation with variables
curl \
@dabit3
dabit3 / customauthentication.js
Created October 8, 2020 15:23
Custom authentication flow with Amplify JS
import React, { useState, useEffect } from 'react';
import { API, Auth } from 'aws-amplify'
import { listPosts } from './graphql/queries'
const initialState = {
formState: 'signUp', username: '', password: '', email: '', authCode: ''
}
export default function App() {
const [posts, setPosts] = useState([])