Skip to content

Instantly share code, notes, and snippets.

View ercnshngit's full-sized avatar

Ercan ercnshngit

View GitHub Profile
@ercnshngit
ercnshngit / innosetup-linux-macos.org
Created October 30, 2025 07:16 — forked from amake/innosetup-linux-macos.org
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@ercnshngit
ercnshngit / sidebar.tsx
Created February 5, 2025 09:35
Shadcn multi sidebar support in sidebar.tsx
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { VariantProps, cva } from "class-variance-authority"
import { PanelLeft } from "lucide-react"
import { useIsMobile } from "@/hooks/use-mobile"
import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Separator } from "@/components/ui/separator"
@ercnshngit
ercnshngit / layout.tsx
Created May 16, 2024 07:20
Simple react popup manager
import React from 'react'
export default function layout({children}) {
return (
<html>
<body>
<PopupManagerContextProvider>
{children}
</PopupManagerContextProvider>
</body>
@ercnshngit
ercnshngit / nextjs_deploy.sh
Last active March 25, 2024 10:09
Nextjs seamless deploy with pm2
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
export LC_ALL=C
set -a # automatically export all variables
source .env
set +a # stop automatically exporting variables
@ercnshngit
ercnshngit / json-parse.ts
Created February 19, 2024 11:02
TypeSafe and FailSafe JSON parse
export function jsonParse<T>(json: string | null) {
try {
if (!json) return null;
return JSON.parse(json) as T;
} catch (error) {
return null;
}
}
@ercnshngit
ercnshngit / apiUtils.js
Created April 19, 2023 08:57
Rest Api Frontend utilities
export const BASE_URL = "";
export const baseFetch = async (
url: string,
method: string = "POST",
options: any,
) => {
let isSuccess = false;
let error = "";
let data = null;
@ercnshngit
ercnshngit / useFetch.js
Last active April 19, 2023 08:58
just a basic fetching snippet with abort controller
import { useState, useEffect } from 'react'
export const useFetch = (url) => {
const [data, setData] = useState(null)
const [isPending, setIsPending] = useState(false)
const [error, setError] = useState(null)
useEffect(() => {
const controller = new AbortController()