Skip to content

Instantly share code, notes, and snippets.

@RichardLindhout
RichardLindhout / sns_ses.go
Last active May 27, 2021
Code from https://github.com/web-ridge/sns_ses - Amazon SQS (Message Queuing Service) golang convert and parse to json structs of notification-contents of the Amazon SNS message of the Amazon SES service (Amazon Simple Email Service) (// https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html#top-level-json-object)
View sns_ses.go
package sns_ses
import "time"
type NotificationType string
const (
NotificationTypeBounce NotificationType = "Bounce"
NotificationTypeComplaint NotificationType = "Complaint"
NotificationTypeDelivery NotificationType = "Delivery"
@RichardLindhout
RichardLindhout / CSGMesh.ts
Last active Feb 10, 2021
CSGMesh.ts fix bug in production
View CSGMesh.ts
// ## License
//
// Copyright (c) 2011 Evan Wallace (http://madebyevan.com/), under the MIT license.
// THREE.js rework by thrax
//
// # class CSG
// Holds a binary space partition tree representing a 3D solid. Two solids can
// be combined using the `union()`, `subtract()`, and `intersect()` methods.
//
// Differences Copyright 2020-2021 Sean Bradley : https://sbcode.net/threejs/
@RichardLindhout
RichardLindhout / Run commands
Created May 28, 2020
Add React Fast Refresh to create-react-app
View Run commands
yarn add customize-cra customize-cra-react-refresh --dev
@RichardLindhout
RichardLindhout / config-overrides.js
Created May 28, 2020
Enable React-Fast-Refresh in Create React App
View config-overrides.js
/* config-overrides.js */
const { override } = require('customize-cra')
const { addReactRefresh } = require('customize-cra-react-refresh')
module.exports = override(addReactRefresh())
@RichardLindhout
RichardLindhout / index.css
Created May 27, 2020
Make create-react-app error screen react less irritating while developing but still viewable
View index.css
body > iframe {
left: auto !important;
width: 50px !important;
right: 0 !important;
border-left: 2px solid red !important;
opacity: 0.6 !important;
transition: all 300ms;
}
body > iframe:hover {
width: 50% !important;
@RichardLindhout
RichardLindhout / gist:81a4b7592e5a53b22f841a3377a823c2
Created Feb 10, 2020
Closable modal scroll friendly React Native
View gist:81a4b7592e5a53b22f841a3377a823c2
import React, { useRef, useCallback } from 'react'
import {
View,
Keyboard,
Animated,
ScrollView,
TouchableWithoutFeedback,
StyleSheet,
} from 'react-native'
@RichardLindhout
RichardLindhout / FlowBlockFinder.tsx
Created Nov 30, 2019
Warning: Asynchronous triggered a user-blocking update that suspended.
View FlowBlockFinder.tsx
import React, {
Suspense,
useState,
// @ts-ignore - useDeferredValue does not exist yet in types
useDeferredValue,
useCallback,
ChangeEvent,
} from 'react'
import TextField from '@material-ui/core/TextField'
import LinearProgress from '@material-ui/core/LinearProgress'
View gist:bcb3d137ebd019b9cabe7f3e215dcb51
import React, { Component } from 'react'
import PT from 'prop-types'
import Field, { isTextInput } from './Field'
import { get } from 'lodash'
class Fields extends Component {
// componentDidMount() {
// const { fields } = this.props
// // since focus on fields doesn't work as expected
// // in react native we do an autofocus on mount instead
// // of passing the autofocus prop to the the text field