This file contains hidden or 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 assetPrefix = process.env.NEXT_PUBLIC_ASSET_PREFIX || ""; | |
export const ALLOWED_WIDTHS = [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840] as const; | |
export type AllowedWidth = (typeof ALLOWED_WIDTHS)[number]; | |
export const getBackgroundImageUrl = (path: string, width: AllowedWidth = 1920, quality = 75) => { | |
const encodedUrl = encodeURIComponent(path); | |
return `${assetPrefix}/_next/image?url=${encodedUrl}&w=${width}&q=${quality}`; | |
}; |
This file contains hidden or 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 { NextRequest, NextResponse } from "next/server"; | |
import path from "path"; | |
import fs from "fs/promises"; | |
import sharp from "sharp"; | |
const SUPPORTED_FORMATS = ["avif", "webp", "jpeg", "png"] as const; | |
type Format = (typeof SUPPORTED_FORMATS)[number]; | |
const PUBLIC_ROOT = path.join(process.cwd(), "public"); | |
const CACHE_ROOT = path.join(process.cwd(), ".next/cache/images"); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) => { |
NewerOlder