A Pen by Karan Jariwala on CodePen.
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
# when you call conda deactivate this script will be executed | |
# removes the environment variables automatically on environment deactivation | |
# this goes in /anaconda3/envs/ENVIRONMENT-NAME/etc/conda/deactivate.d | |
# CHANGE FILE NAME TO 'env_vars.sh' (gist requires unique file names...) | |
unset DEBUG SECRET_KEY DB_HOST DB_PORT DB_NAME DB_USER DB_PASSWORD STATIC_URL |
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
const EditorComponent = forwardRef(({ defaultContent }, ref) => { | |
// State | |
const [state, setState] = useReducer( | |
(prevState, nextState) => ({ | |
...prevState, | |
...nextState | |
}), | |
{ | |
content: defaultContent || "" |
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
class PostEditor extends Component { | |
constructor(props) { | |
super(props); | |
this.mentionPlugin = createMentionPlugin({ | |
entityMutability: "IMMUTABLE", | |
mentionComponent: MentionComponent // since we want to remove the entire name at once. | |
}); | |
this.state = { | |
editorState: EditorState.createEmpty(), |