Skip to content

Instantly share code, notes, and snippets.

View petekp's full-sized avatar

Pete Petrash petekp

View GitHub Profile
@petekp
petekp / gist:4b179c0ae66f54df844b232395e1e663
Created January 7, 2026 19:24
Claude Code audio notification when ready for input (macOS)
# Say Ready Hook for Claude Code (macOS)
Paste this into Claude Code:
---
Set up a "say ready" hook that announces the project name when you're ready for my input. This helps me know which terminal is ready when I have multiple sessions open.
Create ~/.claude/scripts/say-ready.sh with this content:
@petekp
petekp / textToJson.js
Last active August 29, 2020 01:48
Convert delimited .txt to .json
var fs = require('fs')
const jsonifyText = text => {
const cleaned = text
.toString()
.split("\n")
.filter(Boolean)
.map(item => item.split(/:(.+)/).filter(Boolean))
const structured = {
@petekp
petekp / Button.tsx
Created July 19, 2019 03:31
Substrate Themed Button Example
import * as React from 'react'
import {
TouchableOpacity,
StyleProp,
TouchableOpacityProps,
TextStyle,
Text,
} from 'react-native'
import { ThemedComponentLocked } from '../../typings'
@petekp
petekp / tsconfig.json
Created March 14, 2019 19:35
tsconfig.json for npm react component lib
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "src",
"declaration": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
@petekp
petekp / build.ts
Last active January 9, 2019 04:11
Node build script for creating distributable multi-format themes with Theo
import chalk from 'chalk'
import * as path from 'path'
import * as rimraf from 'rimraf'
import { promisify } from 'util'
import { flattenDeep } from 'lodash'
import { exec } from 'child_process'
import { upperFirst, camelCase } from 'lodash'
import { promises as fsPromise, lstatSync, readdirSync } from 'fs'
import { Format, Transform, TheoConfig } from '../typings/theo'
export declare const Theme: {
zIndex: {
alert: number
dialog: number
mesosphere: number
modal: number
navigationBar: number
popover: number
root: number
stratosphere: number
@petekp
petekp / cloudSettings
Last active October 15, 2019 22:18
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-15T22:18:01.816Z","extensionVersion":"v3.4.3"}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@petekp
petekp / taggify.js
Last active October 18, 2015 21:18
Wrap all characters in a string with any XHTML tag (ES6, lodash)
taggify(string, tag) {
let taggedChars = []
_.map(string, function(char) {
taggedChars.push(`<${tag}>${char}</${tag}>`)
})
return taggedChars.join('')
}