Skip to content

Instantly share code, notes, and snippets.

View karanjariwala's full-sized avatar

KaranJariwala karanjariwala

View GitHub Profile
@karanjariwala
karanjariwala / FIX_MY_NAME.sh
Created March 25, 2023 22:19 — forked from the-vampiire/FIX_MY_NAME.sh
Django + PostgreSQL Google Cloud Flexible App Engine deployment templates [app.yaml, settings.py, Conda environment loader shell scripts]
# 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
@karanjariwala
karanjariwala / FroalaEditor.js
Created March 17, 2019 07:19
Document Editor using Froala
const EditorComponent = forwardRef(({ defaultContent }, ref) => {
// State
const [state, setState] = useReducer(
(prevState, nextState) => ({
...prevState,
...nextState
}),
{
content: defaultContent || ""
@karanjariwala
karanjariwala / PostEditor.js
Created March 17, 2019 06:07
Post Editor using Draft js plugins Editor
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(),
@karanjariwala
karanjariwala / rylpjy.markdown
Last active November 6, 2017 18:28
Task Runner