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 { chakra, ThemingProps, useStyleConfig } from '@chakra-ui/react' | |
import NextImage, { ImageProps as NextImageProps } from 'next/image' | |
import { ReactElement } from 'react' | |
import { Sizes } from '../../theme/variables/image' | |
// TODO review props when NextJs is updated so we don't have to defined it here | |
/** | |
* ? Because NextJs typing is preventing auto-suggest for layout, width and height, | |
* ? we declare the styles differently in this component and will manage the switch | |
* ? to NextJs typings when calling NextJs `next/image` component |
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 Ws from '@adonisjs/websocket-client'; | |
import { toast } from 'react-toastify'; | |
import { eventChannel } from 'redux-saga'; | |
import { all, takeLatest, call, take, put, select } from 'redux-saga/effects'; | |
import { history } from '../../../services'; | |
import { | |
subscribeUserRequest, | |
subscribeChatRequest, | |
subscribeChatSuccess, |
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
{ | |
"terminal.integrated.fontSize": 14, | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.tabSize": 2, | |
"editor.fontSize": 18, | |
"editor.lineHeight": 26, | |
"editor.fontFamily": "Fira Code", |
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
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
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
// See tth.im/s3json for a full explanation of this code | |
const AWS = require('aws-sdk'); | |
const S3 = new AWS.S3(); | |
exports.handler = async (_, context) => { | |
try { | |
const query = 'SELECT * FROM s3object[*].results[*] r;'; | |
// test query is against data from https://swapi.co/api/planets/?page=2 |
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 Amplify, { Auth } from 'aws-amplify'; | |
const types = { | |
AUTHENTICATE: 'AUTHENTICATE', | |
SIGNOUT: 'SIGNOUT', | |
SET_ATTRIBUTES: 'SET_ATTRIBUTES', | |
}; | |
Amplify.configure({ | |
Auth: { |