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
<Switch | |
style={{ transform: [{ scaleX: 0.9 }, { scaleY: 0.9 }] }} | |
onValueChange={handleValueChange} | |
value={value} | |
ios_backgroundColor={value ? '#B3BCB4' : '#B6B6B6'} | |
trackColor={{ | |
false: '#B6B6B6', | |
true: '#B3BCB4', | |
}} | |
thumbColor={value ? palette.green : palette.gray} |
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
"postinstall": "husky install", | |
"validate-branch-name": { | |
"pattern": "^(feature|release|hotfix)/(KB-[0-9]+)-([a-zA-Z]+)", | |
"errorMsg": "Invalid branch name, please use name rule like this: feature/KB-123-implementNewLogic" | |
} | |
husky | |
husky-check-email | |
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
export default function PressableHighlight(props) { | |
return ( | |
<Pressable | |
android_ripple={{ | |
color: '#676B5F', | |
}} | |
style={({ pressed }) => [ | |
Platform.select({ | |
ios: { | |
backgroundColor: pressed ? 'rgba(0,0,0,0.1)' : 'transparent', |
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 React from 'react' | |
import {View, Platform} from 'react-native' | |
const ARBITRARY_SIZE = 1000 | |
const ArbitrarySizeViewIos = (props) => { | |
if (Platform.OS !== 'ios') return null | |
const backgroundColor = props?.backgroundColor |
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 React from 'react' | |
import {SafeAreaView} from 'react-native-safe-area-context' | |
const SafeAreaBackground = ({ | |
children = null, | |
backgroundColorTop = '', | |
backgroundColorBottom = '', | |
}) => { | |
return ( | |
<> |
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
#!/bin/bash | |
# | |
# Pre-commit hooks | |
# Check branch name | |
BRANCH_NAME_LENGTH=`git rev-parse --abbrev-ref HEAD | grep -E '^(?!((fix|feature)\/[a-zA-Z0-9\-]+)$).*' | wc -c` | |
if [ ${BRANCH_NAME_LENGTH} -eq 0 ] ; then | |
echo -e '\E[37;44m'"\033[1mERROR\033[0m in pre-commit hook: vim .git/hooks/pre-commit" | |
echo "Branch name should be like feature/lowerUpper09-EXY-134 - brand is two letters" |
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
git remote add customer [email protected]:anatooly/test.git | |
git co -b main <Initial commit> | |
git merge --squash master | |
git commit -m <Commit text> | |
git push customer | |
or | |
rsync -rv --exclude=.git --exclude=node_modules --exclude=.next dev-dir/ customer-dir | |
manual commit & push from customer-dir |
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
//content script = ship, feature component = morpheus. | |
console.log("Morpheus injected"); | |
const features = new Map(); | |
function messageToMorpheus(msg) { | |
window.postMessage({ direction: "from-ship", message: msg }, "*"); | |
} | |
chrome.runtime.onMessage.addListener((msg, _, sendResponse) => { |
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
// @doc https://codesandbox.io/s/react-app-auth-bc99t?fontsize=14&hidenavigation=1&theme=dark&file=/src/original.js:0-1988 | |
import React from 'react' | |
const sleep = time => new Promise(resolve => setTimeout(resolve, time)) | |
const getUser = () => sleep(1000).then(() => ({username: 'elmo'})) | |
// .then(() => null) | |
const AuthContext = React.createContext() | |
function AuthProvider({children}) { |
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
{ | |
"Create React.FC typescript component RN/Relay fragment": { | |
"scope": "javascript,typescript", | |
"prefix": "#react-fc", | |
"body": [ | |
"import React from 'react'", | |
"import { StyleSheet, View, Text } from 'react-native'", | |
"import { graphql, useFragment } from 'react-relay/hooks'", | |
"import { ${TM_FILENAME_BASE}_data$$key } from '__generated__/${TM_FILENAME_BASE}_data.graphql'", | |
"", |
NewerOlder