Skip to content

Instantly share code, notes, and snippets.

View ozcanzaferayan's full-sized avatar
⚛️
Overreacting

Özcan Zafer AYAN ozcanzaferayan

⚛️
Overreacting
View GitHub Profile
@ozcanzaferayan
ozcanzaferayan / redis.js
Created March 22, 2024 01:17
Ev yapımı Redis tarifi
const redis = {
// Anahtar-değer çiftleri
"anahtar1": "değer1",
"anahtar2": "değer2",
// Bir liste benzetimi
"listeAnahtarı": ["eleman1", "eleman2", "eleman3"],
// Bir set benzetimi (JavaScript Set kullanarak)
"setAnahtarı": new Set(["eleman1", "eleman2"]),
@ozcanzaferayan
ozcanzaferayan / app.config.ts
Created February 25, 2024 09:55
Expo create custom plugin
import type { ConfigContext, ExpoConfig } from "@expo/config";
const defineConfig = (_: ConfigContext): ExpoConfig => ({
name: "My project",
slug: "my-project",
plugins: [
["./plugins/mylibrary.plugin.js"],
],
});
@ozcanzaferayan
ozcanzaferayan / myProject.code-snippets
Last active February 23, 2024 13:30
React Create Component Snippet
{
"Component": {
"prefix": ["comp"],
"body": [
"import { View, Text } from 'react-native'",
"import React from 'react'",
"",
"type Props = {}",
"",
"const ${TM_FILENAME_BASE} = (props: Props) => {",
@ozcanzaferayan
ozcanzaferayan / useTabPress.ts
Created February 10, 2024 12:14
useTabPress.ts
import { useNavigation } from "expo-router";
import { useEffect } from "react";
import { FlatList } from "react-native";
export const useTabPressScroll = <T>(ref: React.RefObject<FlatList<T>>) => {
const navigation = useNavigation();
useEffect(() => {
// @ts-expect-error tabPress is not in the type
const unsub = navigation.addListener("tabPress", (evt) => {
if (navigation.isFocused()) {
@ozcanzaferayan
ozcanzaferayan / App.tsx
Last active January 26, 2024 13:39
React Native Donut Chart with react-native-svg
import React from 'react';
import { View } from 'react-native';
export const App: React.FC = () => {
return (
<View style={{flexDirection: 'row', justifyContent:'center'}}>
<DonutChart radius={15} percentage={25} width={100}/>
<DonutChart radius={15} percentage={65} width={100}/>
<DonutChart radius={15} percentage={70} width={100}/>
@ozcanzaferayan
ozcanzaferayan / pasta.jpeg
Last active December 7, 2023 18:12
Pasta
pasta.jpeg
@ozcanzaferayan
ozcanzaferayan / preRequest.js
Created August 25, 2023 15:04
Postman pre-request script for setting token
const authRequest = {
url: `${pm.collectionVariables.get("baseUrl")}/auth`,
method: "POST",
header: {
"Version": pm.collectionVariables.get("Version"),
},
body: {
mode: "application/json",
raw: JSON.stringify({
username: pm.collectionVariables.get("Username"),
@ozcanzaferayan
ozcanzaferayan / App.tsx
Created March 31, 2020 00:56
react-native-shimmer-placeholder with API example
/* eslint-disable prettier/prettier */
import React, {useEffect, useState} from 'react';
import {
SafeAreaView,
StyleSheet,
Text,
StatusBar,
View,
Image,
FlatList,
@ozcanzaferayan
ozcanzaferayan / Roadmap.md
Last active July 14, 2023 00:28
Frontend Roadmap

Algoritmalar

  • Atama Operatörü (Assignment operator) =
    • x + y = z (Yasak)
    • x = 2
    • x = y + z
  • Algoritma adımları
1. Başla
2. X'i olustur
3. X'e 3 degerini ata
@ozcanzaferayan
ozcanzaferayan / 10product.json
Last active May 23, 2023 13:25
100k Data gist
[
{
"id": 1,
"name": "Product 1",
"price": 486.09,
"quantity": 72,
"category": "Home & Kitchen",
"description": "This is product 1."
},
{