π΅βπ«
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Still want to catch undefined variables, but don't exit on errors | |
set -u | |
# Script configuration | |
DEFAULT_REPO_DIR="$HOME/github" | |
DEFAULT_AI_COMMAND="ask cm -m gemini-2.0-flash" | |
LOG_FILE="/tmp/git-auto-commit-$(date +%Y%m%d-%H%M%S).log" | |
MAX_RETRIES=3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileoverview Creates an ICS calendar file with recurring events based on provided configuration | |
*/ | |
import ical, { ICalEventRepeatingFreq, ICalWeekday } from 'ical-generator'; | |
import { writeFileSync } from 'fs'; | |
import { DateTime } from 'luxon'; | |
import yargs from 'yargs'; | |
import { hideBin } from 'yargs/helpers'; | |
import type { ICalRepeatingOptions } from 'ical-generator/dist/index.d.ts'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileoverview A utility for converting ICS (iCalendar) files to JSON format with customizable output options. | |
* Supports flattening nested structures, removing fields, renaming keys, and filtering by date range. | |
*/ | |
import { lines2tree } from 'icalts'; | |
import { $ } from 'bun'; | |
import { Command } from 'commander'; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A script to parse ICS (iCalendar) files and convert them to JSON format. | |
* Supports processing either a single file or scanning a directory for multiple .ics files. | |
* | |
* @module ics-parser | |
* | |
* Usage: | |
* - Process single file: node ics-parser.ts path/to/file.ics | |
* - Process all .ics files in root: node ics-parser.ts --root | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script automates the process of adding secrets from a local .env file to a GitHub repository. | |
* It uses the GitHub API to encrypt and store secrets securely using libsodium encryption. | |
* | |
* @module github-secrets | |
* | |
* How to run this script: | |
* | |
* For npm: | |
* 1. Install dependencies: npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use server'; | |
import { exec } from 'node:child_process'; | |
import fs from 'node:fs'; | |
import path from 'node:path'; | |
import { promisify } from 'node:util'; | |
import { logger } from '@/utils'; | |
const execPromise = promisify(exec); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Provider } from 'jotai/react'; | |
import type { ReactNode } from 'react'; | |
/** | |
* Type definition for a React component that can accept children | |
* @template P - The props type for the component | |
*/ | |
type ComponentWithChildren<P = {}> = React.ComponentType<P & { children?: ReactNode }>; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import { type StoreState, createGlobalStore } from '@/core/store'; | |
import type React from 'react'; | |
import { createContext, useContext, useRef } from 'react'; | |
import { useStore } from 'zustand'; | |
/** | |
* React context to provide the global store throughout the application. The context | |
* holds a reference to the store created by createGlobalStore or null if not yet initialized. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { execSync } from 'child_process'; | |
import fs from 'fs'; | |
import path from 'path'; | |
import type { PackageJson } from 'type-fest'; | |
const packageJsonPath = path.join(process.cwd(), 'package.json'); | |
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) as PackageJson; | |
const dependencies = Object.keys(packageJson.dependencies || {}); | |
const devDependencies = Object.keys(packageJson.devDependencies || {}); | |
const allDependencies = [...dependencies, ...devDependencies]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs'; | |
import path from 'path'; | |
import depcheck from 'depcheck'; | |
import { $ } from 'bun'; | |
import type { PackageJson } from 'type-fest'; | |
// If you're coming from GitHub Gist, you can remove or change this | |
const rootDir = path.join(__dirname, '..'); // Go up one level to project root | |
const packageJsonPath = path.join(rootDir, 'package.json'); | |
console.log('Checking:', packageJsonPath); |