Skip to content

Instantly share code, notes, and snippets.

@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active November 15, 2024 08:56
A list of free email provider domains. 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.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@sebmarkbage
sebmarkbage / Enhance.js
Last active November 7, 2024 13:05
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@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) + ')'
@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
@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()
@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:
@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.
@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)
@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'])
@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: