Skip to content

Instantly share code, notes, and snippets.

View bbg's full-sized avatar
👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk

Batuhan Göksu bbg

👍
"Our true mentor in life is science."   Mustafa Kemal Atatürk
View GitHub Profile
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@bbg
bbg / error.log
Created November 21, 2022 13:47
tRPC Next 13 Error
yarn build
yarn run v1.22.19
$ dotenv -e .env.production -- next build
info - Loaded env from /Users/batuhangoksu/@Sandbox/next13-trpc-minimal/.env.production
warn - You have enabled experimental feature (appDir) in next.config.js.
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
info - Creating an optimized production build
info - Compiled successfully
@bbg
bbg / ConventionalCommitsEmoji.md
Created August 5, 2022 10:27 — forked from parmentf/ConventionalCommitsEmoji.md
Emoji for Conventional Commits
Type Emoji code
feat :sparkles:
fix 🐛 :bug:
docs 📚 :books:
style 💎 :gem:
refactor 🔨 :hammer:
perf 🚀 :rocket:
test 🚨 :rotating_light:
build 📦 :package:
@bbg
bbg / server-preload.js
Created July 19, 2022 07:37 — forked from justjake/server-preload.js
Customizing NextJS for error reporting and Datadog APM (dd-trace) integration. See https://jake.tl/notes/2021-04-04-nextjs-preload-hack
// @ts-check
"use strict"
/**
* Set up datadog tracing. This should be called first, so Datadog can hook
* all the other dependencies like `http`.
*/
function setUpDatadogTracing() {
const { tracer: Tracer } = require('dd-trace')
const tracer = Tracer.init({
@bbg
bbg / generic.ts
Last active July 17, 2022 12:19
generic-component-styled
/// <reference types="styled-jsx" />
import clsx from 'clsx';
import React, { Fragment } from 'react';
type Property = {
display:
| 'block'
| 'inline-block'
| 'inline'
@bbg
bbg / generic.tsx
Created July 16, 2022 05:37
Generic Component
import clsx from 'clsx';
type GenericOwnProps<E extends React.ElementType = React.ElementType> = {
children: string;
as?: E;
cls?: string | Record<string, string> | string[];
};
type GenericProps<E extends React.ElementType> = GenericOwnProps<E> &
Omit<React.ComponentProps<E>, keyof GenericOwnProps>;
@bbg
bbg / css-properties.json
Created July 15, 2022 12:38 — forked from cblanquera/css-properties.json
CSS properties via JSON
{
"align-content": {
"moz": false,
"webkit": true,
"syntax": "(stretch)|(center)|(flex-start)|(flex-end)|(space-between)|(space-around)|(initial)|(inherit)",
"initial": "stretch",
"values": [
"stretch",
"center",
"flex-start",
const Box = twx('div')`
bg-red
p-2 lg:p-4
rounded-sm lg:rounded-lg
${props => props?.size === 'small' && 'text-sm'}
`
// it's allow especialization
const ErrorBox = twx(Box)`
import axios from 'axios'
type TUsers = {
page: number
per_page: number
total: number
total_pages: number
data: Array<{
id: number
email: string
@bbg
bbg / Stack.tsx
Created January 12, 2022 18:59 — forked from jckw/Stack.tsx
Stitches Stack component for Figma-style positioning.
import { styled } from "@stitches/react"
const Stack = styled("div", {
display: "flex",
variants: {
dir: {
col: { flexDirection: "column" },
row: { flexDirection: "row" },
},