Skip to content

Instantly share code, notes, and snippets.

View ilkay-alti's full-sized avatar

ilkay Altınışık ilkay-alti

View GitHub Profile
xsetwacom --set 12 button 3 "key PgUp"
xsetwacom --set 12 button 2 "key PgDn"
@ilkay-alti
ilkay-alti / info.ts
Last active February 14, 2023 12:26
husky lint-staged prettier eslint adding
yarn add -D prettier eslint husky lint-staged
npm pkg set scripts.prepare="husky install"
if not git installation
git init
git add .
git commit -m "first commit"
npm run prepare
npx husky add .husky/pre-commit "yarn lint-staged --concurrent false"
git add .husky/pre-commit
git commit -m "Keep calm and commit"
// React Native component
const multiRemoveData = async () => {
try {
await AsyncStorage.multiRemove(["places", "food"]);
} catch (error) {
console.log(error);
}
};
// React Native component
const places = {
name: "İlkay",
country: "Turkey"
};
const food = {
name: "Rice"
};
const places = {
name: "İlkay",
country: "Turkey"
};
const food = {
name: "Spaghetti Pasta"
};
const firstData = ["places", JSON.stringify(places)];
// React Native component
const getMultipleData = async () => {
try {
const savedData = await AsyncStorage.multiGet(["city", "user"]);
console.log(savedData);
} catch (error) {
console.log(error);
}
};
// React Native component
const removeData = async () => {
try {
const savedUser = await AsyncStorage.clear();
} catch (error) {
console.log(error);
}
};
// React Native component
const removeUser = async () => {
try {
await AsyncStorage.removeItem("user");
} catch (error) {
console.log(error);
}
};
// React Native component
const value = {
name: "Innocent"
};
const mergeUser = async () => {
try {
await AsyncStorage.mergeItem("user", JSON.parse(value));
} catch (error) {
// React Native component
const getUser = async () => {
try {
const savedUser = await AsyncStorage.getItem("user");
const currentUser = JSON.parse(savedUser);
console.log(currentUser);
} catch (error) {
console.log(error);
}