gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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 sumPromise = (a,b) => { | |
const p = new Promise((resolve, reject) =>{ | |
if(typeof a === 'number' && typeof b === 'number'){ | |
resolve(a+b) | |
} else { | |
reject(new Error('Tip düzgün deyil')) | |
} | |
}) |
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 { addWebpackModuleRule, override } = require('customize-cra') | |
module.exports = { | |
webpack: override( | |
addWebpackModuleRule({ | |
test: /\.css$/, | |
use: [ | |
{ | |
loader: "css-loader", | |
options: { |
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, { useRef } from 'react'; | |
import { SafeAreaView, StyleSheet, Text, Dimensions, Animated, View } from 'react-native'; | |
import { Font } from '../../../../ui/components'; | |
import { colors } from '../../../../common/constants'; | |
export const ScrollAnimatedHeader = ({ children }) => { | |
const scrollPosition = useRef(new Animated.Value(0)).current; | |
const minHeaderHeight = 45; | |
const maxHeaderHeight = 140; |
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
COMMIT | |
$ git reset HEAD^ <file> git commit --amend | |
If you accidentally commit changes to an existing file that you want to undo, then there are many ways to resolve, but I would prefer | |
LOG | |
$ git log --follow [file] | |
Lists version history for a file, including renames | |
$ git log --oneline --graph --decorate | |
An overview with reference labels and history graph. One commit |
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 pt from 'prop-types'; | |
import { Tooltip, OverlayTrigger } from 'react-bootstrap'; | |
/** | |
* A very expandable component for | |
* adding tooltip to elements easily. | |
* | |
* ``` | |
* <EasyTooltip |
A Pen by Babak Naghiyev 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
/* | |
Conclusion | |
On identical strings localCompare function is pretty fast, but if there is any difference, bitwise search function named "equals" is faster | |
*/ | |
const CACHE = 'cache-and-update-v2.0.1'; | |
// bitwise | |
function equals(a, b) { |
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
Show hidden characters
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react"], | |
"plugins": [ | |
[ | |
"@babel/plugin-proposal-class-properties", | |
{ | |
"loose": true | |
} | |
] | |
] |
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
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
NewerOlder