Skip to content

Instantly share code, notes, and snippets.

View batur's full-sized avatar
👨‍💻
Solving Problem

Batur Akkurt batur

👨‍💻
Solving Problem
View GitHub Profile
@batur
batur / tailwind.config.ts
Created February 9, 2024 07:51
Tailwind config sample
import type { Config } from 'tailwindcss';
const numbers = [...Array(600).keys()].map((number) => number / 2);
const handleNumbers = (): Record<number, string> => {
let numberObject = {};
numbers.forEach((number) => {
numberObject = { ...numberObject, [number]: `${number / 4}rem` };
});
@batur
batur / compose.js
Created June 29, 2023 10:36
Compose Function in JS
const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
@batur
batur / index.js
Created June 29, 2023 10:33
Deep Freezing in JS
const deepFreeze = obj => {
Object.keys(obj).forEach(prop => {
if (typeof obj[prop] === 'object') deepFreeze(obj[prop]);
});
return Object.freeze(obj);
};
@batur
batur / Crisp.tsx
Last active August 18, 2021 14:38
Crisp integration on Next.js(above v11.1.0)
import React, { useEffect } from 'react';
import Script from 'next/script';
declare global {
interface Window {
$crisp: any;
CRISP_WEBSITE_ID: string;
}
}
@batur
batur / Crisp.tsx
Created August 18, 2021 14:33
Crisp integration on Next.js(below v11.1.0)
import React, { useEffect } from 'react';
import Head from 'next/head';
declare global {
interface Window {
$crisp: any;
CRISP_WEBSITE_ID: string;
}
}