Skip to content

Instantly share code, notes, and snippets.

@mesabuca
mesabuca / Collapse.tsx
Created April 17, 2025 08:35
Collapse, framer motion, tailwind
'use client';
import React, { useState, createContext, useContext, ReactNode } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import clsx from 'clsx';
interface CollapseContextProps {
isOpen: boolean;
toggle: () => void;
}
@mesabuca
mesabuca / Dropdown.tsx
Created April 17, 2025 08:34
Dropdown, framer motion, tailwind
'use client';
import React, { useState, createContext, useContext, ReactNode, useRef, useEffect } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import clsx from 'clsx';
interface DropdownContextProps {
isOpen: boolean;
toggle: () => void;
setIsOpen: (open: boolean) => void;
@mesabuca
mesabuca / Slider.tsx
Last active March 12, 2025 14:35
React Tailwind Framer Slider
import { createContext, useContext, useState, useRef, ReactNode, Children, ReactElement, cloneElement, useEffect } from "react";
import { motion, AnimatePresence } from "framer-motion";
// Context
const SliderContext = createContext<{
index: number;
setIndex: (i: number) => void;
next: () => void;
prev: () => void;
slideCount: number;
#!/bin/bash
echo "DENEME"
#include<stdio.h>
int main()
{
int x, y;
printf("Kordinatlari giriniz (x,y) : ");
scanf("%d%d", &x, &y);
if (x > 0 && y > 0)
printf("Coordinates are at 1. side\n");
else if (x < 0 && y > 0)
@mesabuca
mesabuca / Files Process in C
Last active February 15, 2016 07:51
Files Process in C
#include<stdio.h>
#include<stdlib.h>
int main()
{char prnt[1000],scn[20];
FILE *d, *dd, *ddd;
d=fopen("fileDestinaiton/filename","mode"); //if your file is the same place with program you can write just name
dd=fopen("print.txt","r+");
fprintf(dd,"%s",prnt);
fclose(dd);
#include <stdio.h>
int main ()
{
int var = 20; // actual variable declaration
int *ip; // pointer variable declaration
ip = &var; //store address of var in pointer variable
printf("Address of var variable: %x\n", &var );
// address stored in pointer variable
#include<stdio.h>
struct school
{
int no;
char name[20];
char surnema[20];
};
int main()
#include<stdio.h>
int addition(int no1 , int no2); //If you write your function after the main you should specify your function before the main
int main()
{int a,b,sum;
printf("Please enter two number\n");
scanf("%d %d",&a,&b);
sum=addition(a,b);
printf("Result : %d",sum);
}
#include<stdio.h>
int main()
{ //Arrays can save value how much you want.
int x[10]; //Also arrays have variables type when you want to variable just prit'[numberOfHowMuchYouWant]' This array can save 10 number
char name[20]; //Chars' arrays are using for sentences or words
printf("Enter your phone number and name");
scanf("%d %s",&x[1],name);
printf("Name: %s \nNo: %d",name,x[1]);
}