Skip to content

Instantly share code, notes, and snippets.

@jrothman
jrothman / . GetCognitoTokenOnDemand.js
Last active September 13, 2021 16:44 — forked from antstanley/.env
Get Cognito User Token
// get cognito token on demand
@drakodev
drakodev / Free_Disposable_ESP_Abuse_SPAM
Last active November 14, 2024 19:38
most comprehensive collection (183538) of free and disposable email provider domains, curated from multiple sources, including contributions from Okutbay and frankwarwick. This list has been further extended to include domains flagged as abusive, malware-associated, or considered risky by spam traps.
This file has been truncated, but you can view the full file.
# Email List Containing free and disposable email service providers.
# Some domains have been included as they have been trapped by SPAM, Anti-Malware Systems
# NOTE: Some domains may have stopped working
0-00.usa.cc
0-180.com
0-30-24.com
0-420.com
0-900.com
0-aa.com
@em-shea
em-shea / template.yaml
Last active June 17, 2020 21:11
An example SAM template for a Lambda & API Gateway app that sends messages using SNS
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An example SAM template for a Lambda & API Gateway app that sends messages using SNS.
Parameters:
# For any variables you don't want stored in your repo, you can pass them through the SAM deploy command
# Ie, sam deploy .... --parameter-overrides [email protected]
MyEmail:
Type: String
Resources:
@em-shea
em-shea / dynamodb-data-to-s3.py
Last active July 22, 2022 16:35
A Lambda function that scans a given DynamoDB table and writes the data to S3
import os
import json
import boto3
from datetime import datetime
# Import resources using AWS Python SDK (boto3) and specify the DynamoDB table to scan and S3 bucket to write file to
# Table and bucket name are passed as environment variables in SAM template
s3 = boto3.resource('s3')
bucket = s3.Bucket(os.environ['BUCKET_NAME'])
table = boto3.resource('dynamodb').Table(os.environ['TABLE_NAME'])
@amiantos
amiantos / index.js
Last active October 30, 2024 20:12
Zip Multiple Files from S3 using AWS Lambda Function
// Lambda S3 Zipper
// http://amiantos.net/zip-multiple-files-on-aws-s3/
//
// Accepts a bundle of data in the format...
// {
// "bucket": "your-bucket",
// "destination_key": "zips/test.zip",
// "files": [
// {
// "uri": "...", (options: S3 file key or URL)
@kematzy
kematzy / kematzy.hasura.audit_trail.sql
Last active January 29, 2024 17:48
Hasura AuditTrail by Kematzy
-- ## Kematzy Hasura AuditTrail
-- This is based on the [Hasura/audit-trigger](https://github.com/hasura/audit-trigger).
--
-- Changes from the Hasura version:
-- 1. Simplified audit table schema with these changes:
-- a. Renamed columns to lowerFirst format.
-- b. Changed order of columns.
-- c. Combined schema & table name into one column.
-- d. Stores the record `id` UUID value in the `rowId` column.
@niwinz
niwinz / dynamicObject.js
Last active November 26, 2019 03:37
GraphQL Dynamic Object.
const {GraphQLError} = require("graphql/error");
const {Kind} = require("graphql/language");
const g = require("graphql");
function parseLiteral(ast) {
switch (ast.kind) {
case Kind.STRING:
case Kind.BOOLEAN:
return ast.value;
case Kind.INT:
@jeffbrl
jeffbrl / describe_instances.py
Created February 27, 2018 17:28
How to make datetime.datetime json serializable - boto3 ec2 describe_instances
# Adapted from https://stackoverflow.com/questions/35869985/datetime-datetime-is-not-json-serializable
import datetime
import json
import boto3
def datetime_handler(x):
if isinstance(x, datetime.datetime):
return x.isoformat()
@ammarshah
ammarshah / all_email_provider_domains.txt
Last active November 16, 2024 05:45
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
@matthewdenobrega
matthewdenobrega / graphQLUtils.ts
Last active November 9, 2017 08:23
GraphQL query generator
// Angular imports
import { isArray, isBlank, isDate, isNumber, isStringMap, isPresent, isString } from 'angular2/src/facade/lang'
export class GraphQLUtils {
static createMutation(data: Object, dataDefinition: Object, method: string, mutationName?: string): string {
if (!method || !data) { return null }
let mutation: string = (mutationName || method) + '{' + method
mutation += '(' + GraphQLUtils.flattenObject(data) + ')'