Skip to content

Instantly share code, notes, and snippets.

@cristea2017
Last active October 5, 2023 07:55
Show Gist options
  • Save cristea2017/3aeb89889c9a9ba9bd52908458f5dcf7 to your computer and use it in GitHub Desktop.
Save cristea2017/3aeb89889c9a9ba9bd52908458f5dcf7 to your computer and use it in GitHub Desktop.
vscode
{
"prettier.singleQuote": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.columnSelection": false,
"editor.cursorBlinking": "expand",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorWidth": 2,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 12.5,
"editor.inlineSuggest.enabled": true,
"editor.multiCursorModifier": "alt",
"editor.quickSuggestionsDelay": 0,
"editor.showUnused": true,
"editor.suggestSelection": "recentlyUsedByPrefix"
}

{ // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. // Placeholders with the same ids are connected. // Example: "description": { "prefix": "desc", "description": "add header description", "body": [ "/**", "|--------------------------------------------------", "| $1", "|--------------------------------------------------", "*/", "" ] }, "reduxDisp": { "prefix": "reduxDisp", "body": [ "const dispatch = useAppDispatch();" ], "description": "reduxDisp" }, "handlePress": { "prefix": "handlePress", "body": [ "const handlePress = React.useCallback(() => {}, []);", "" ], "description": "handlePress" }, "customHook": { "prefix": "customHook", "body": [ "import { useState } from "react";", "import { useEffect } from "react";", "import { AppState, AppStateStatus } from "react-native";", "", "export const useIsForeground = (): boolean => {", " const [isForeground, setIsForeground] = useState(true);", "", " useEffect(() => {", " const onChange = (state: AppStateStatus): void => {", " setIsForeground(state === "active");", " };", " const listener = AppState.addEventListener("change", onChange);", " return () => listener.remove();", " }, [setIsForeground]);", "", " return isForeground;", "};" ], "description": "customHook" }, "uiComponent": { "prefix": "uiComponent", "body": [ "import React from 'react';", "", "import {Column} from './Column';", "", "type Props = {", " val: any;", "};", "const $TM_FILENAME_BASE = ({}: Props) => {", " return ;", "};", "", "export default $TM_FILENAME_BASE;", "" ], "description": "uiComponent" }, "reduxTemplateComponent": { "prefix": "reduxTemplateComponent", "body": [ "import React from "react";", "import { connect, ConnectedProps } from "react-redux";", "import { createSelector } from "redux-views";", "", "type Props = {} & ReduxProps;", "", "const $TM_FILENAME_BASE = (props: Props) => {", " if (!props.cross) return null;", " return;", "};", "", "const getData = createSelector([], () => {", " return {};", "});", "", "const connector = connect(getData, {});", "", "type ReduxProps = ConnectedProps;", "", "export default connector($TM_FILENAME_BASE);", "" ], "description": "reduxTemplateComponent" } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment