This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER_POOL_ID=POOL_ID | |
RUN=1 | |
until [ $RUN -eq 0 ] ; do | |
echo "Listing users" | |
USERS=`aws cognito-idp list-users --user-pool-id ${USER_POOL_ID} | grep Username | awk -F: '{print $2}' | sed -e 's/\"//g' | sed -e 's/,//g'` | |
if [ ! "x$USERS" = "x" ] ; then | |
for user in $USERS; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2020 Daniel Cortez Stevenson | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { isBefore, setHours, setMinutes, setSeconds, addMinutes, setMilliseconds } from 'date-fns' | |
const setTime = (x, h = 0, m = 0, s = 0, ms = 0) => setHours(setMinutes(setSeconds(setMilliseconds(x, ms), s), m), h) | |
const from = setTime(new Date(), 9) | |
const to = setTime(new Date(), 17) | |
const step = (x) => addMinutes(x, 30) | |
const blocks = [] | |
let cursor = from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Enable commands logging | |
PS4="> " | |
set -x | |
set -e | |
if ! [[ -x "$(command -v pip3)" ]]; then | |
apt-get update && apt-get install -y python3-pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<!-- Drop box --> | |
<div class="dropzone" | |
@dragover.prevent | |
@dragleave="dragleave" | |
@dragenter="dragenter" | |
@drop="drop" | |
ref="dropzone" | |
> | |
<!-- Box Label --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version" : "2017-02-28", | |
"operation" : "PutItem", | |
"key" : { | |
"shopID": $util.dynamodb.toDynamoDBJson($ctx.args.shopID), | |
"vendorID": $util.dynamodb.toDynamoDBJson($ctx.args.vendorID) | |
}, | |
"attributeValues": { | |
"name": $util.dynamodb.toDynamoDBJson($ctx.args.name) | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DaxIamRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: ${self:service.name}dax | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: "Allow" | |
Principal: | |
Service: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2018 Dineshkarthik Raveendran | |
from __future__ import print_function # Python 2/3 compatibility | |
import boto3 | |
import argparse | |
def replicate(table_name, existing_region, new_region, new_table_name): | |
""" | |
Replicate table in new region. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require("crypto") | |
function encrypt(key, data) { | |
var cipher = crypto.createCipher('aes-256-cbc', key); | |
var crypted = cipher.update(data, 'utf-8', 'hex'); | |
crypted += cipher.final('hex'); | |
return crypted; | |
} | |
var key = "supersecretkey"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Constants { | |
/** | |
* Contains the path to your Lambda function code. | |
*/ | |
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT"); | |
/** | |
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function: | |
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10 |
NewerOlder