Skip to content

Instantly share code, notes, and snippets.

View vojtaholik's full-sized avatar
:octocat:
🍀

Vojta Holik vojtaholik

:octocat:
🍀
View GitHub Profile
@vojtaholik
vojtaholik / page.tsx
Last active December 13, 2023 14:50
feat: resizable panels
import ResizablePanels from '../_components/resizable-panels'
import {cookies} from 'next/headers'
const EditorLayout = () => {
const defaultLayout = getDefaultLayout()
return (
<div className="flex h-full flex-grow flex-col">
<ResizablePanels defaultLayout={defaultLayout} />
</div>
)
// Name: Watch Screenshots Dir
// Watch: ~/Desktop/screenshots
// Description: Don't forget to run following command in your terminal to set default screenshot directory in macOSX: defaults write com.apple.screencapture location ~/Desktop/screenshots
import "@johnlindquist/kit";
import cloudinary from "cloudinary";
import trash from "trash";
const DIR = "screenshots";
const NOTIFY_SOUND_FILE_PATH = false; // home("Desktop/come-here-notification.mp3");
// Menu: Record Screen
// Shortcut: shift cmd 5
/** @type {import("@johnlindquist/kit")} */
await applescript(`
-- # Setup to do a screen recording.
# tell application "QuickTime Player" to new screen recording
import {Button} from '@package/ui/button'
import {ThemeProvider} from '@package/ui/use-theme'
import {appUniqueTheme} from './theme'
const Page = () => {
return (
<ThemeProvider theme={appUniqueTheme} />
<Button />
</ThemeProvider>
)
// Menu: Tinify
// Description: Compress selected images with Tinify
// Author: Vojta Holik
// Twitter: @vjthlk
let tinify = await npm("tinify");
let fs = await import("fs");
let selectedFiles = await getSelectedFile();
tinify.key = await env("TINIFY_API_KEY", {
import {publicProcedure, router} from '@skillrecordings/skill-lesson'
import {isEmpty} from 'lodash'
import {getToken} from 'next-auth/jwt'
import {getSubscriberFromCookie} from '@skillrecordings/skill-lesson/utils/ck-subscriber-from-cookie'
export const offerRouter = router({
getNextOffer: publicProcedure.query(async ({ctx}) => {
const token = await getToken({req: ctx.req})
const subscriber = await getSubscriberFromCookie(ctx.req)
// Name: Markdown to Portable Text
/** @type {import("@johnlindquist/kit")} */
const { markdownToRichText } = await npm("@tryfabric/martian");
const showdown = await npm("showdown");
const input = await getSelectedText();
const output = markdownToRichText(input);
const converter = new showdown.Converter();
const html = converter.makeHtml(input, {
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>
Email Course (1) The Start to Understanding Internet
</title>
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
import "@johnlindquist/kit"
// Menu: App Launcher
// Description: Search for an app then launch it
// Author: John Lindquist
// Twitter: @johnlindquist
let createChoices = async () => {
let apps = await fileSearch("", {
onlyin: "/",
import "@johnlindquist/kit"
// Menu: App Launcher
// Description: Search for an app then launch it
// Author: John Lindquist
// Twitter: @johnlindquist
let createChoices = async () => {
let apps = await fileSearch("", {
onlyin: "/",