Skip to content

Instantly share code, notes, and snippets.

View Strajk's full-sized avatar
🐣
knock knock…

Pavel 'Strajk' Dolecek Strajk

🐣
knock knock…
View GitHub Profile
// Name: Rename script files to match their name
// Description: Renames script file names to match their name (// Name: Foo Bar -> foo-bar.ts)
import "@johnlindquist/kit"
import { stripName } from "@johnlindquist/kit"
import * as fs from "fs/promises"
import dedent from "dedent"
// just for documentation purposes
let exampleScript = {
// Name: Install app from dmg in Downloads
/// Implementation notes:
/// - dmg file name can be different from mounted volume name, e.g. UIBrowser302.dmg -> /Volumes/UI Browser 3.0.2.0
/// - dmg might contain License agreement that needs to be accepted, e.g. UIBrowser302.dmg
/// - dmg might contain other files than just the app, e.g. Extras folder and README.rtf, see UIBrowser302.dmg
import "@johnlindquist/kit"
import fs, {statSync, unlinkSync} from "fs";
import {join} from "path";
// Name: Edit selected in editor, then paste back
import "@johnlindquist/kit"
import flourite from 'flourite';
import fs from "fs"
// Demos:
// https://stackoverflow.com/questions/ask
// https://github.com/Strajk/setup/issues/new
// Name: Log Past X Minutes to Calendar
// Description: Asks for duration in minutes, event title, and (on first use) calendar name
// Author: Pavel 'Strajk' Dolecek <www.strajk.me>
// Twitter: @straaajk
// me.strajk:status SHARED
const minutes = await arg("Enter the duration (in minutes) to log retroactively")
const title = await arg("Describe the activity you want to log")
let calendar = await env("SCRIPTKIT_LOG_CALENDAR_NAME", {
// Menu: Super Search across multiple websites
// Description: Search multiple websites, in bulk, in your browser
// Author: Pavel 'Strajk' Dolecek <www.strajk.me>
// Twitter: @straaajk
//// Shortcut: command option ;
// me.strajk:status WIP
// BEWARE: Discord search requires my userscript:
// https://github.com/Strajk/setup/blob/master/user-scripts/discord-search-from-q-url-param.user.js
@Strajk
Strajk / chatgpt-restore-cmdk-new-chat.user.js
Created November 1, 2024 19:53
Userscript to Restore cmd+k shortcut for new chat, new history search is now cmd+shift+k
// ==UserScript==
// @name ChatGPT: Restore cmd+k shortcut for new chat
// @description Restore cmd+k shortcut for new chat, new history search is now cmd+shift+k
// @version 0.1
// @author strajk <[email protected]> (https://github.com/Strajk)
// @match https://chatgpt.com/*
// @grant none
// ==/UserScript==
(function () {
@Strajk
Strajk / gitlab.js
Created February 5, 2018 21:10
Gitlab with promises
const gitlab = require('gitlab')({
url: process.env.GITLAB_URL,
token: process.env.GITLAB_TOKEN
})
const promisifier = function (fn) {
return function (...args) {
return new Promise(resolve => {
args.push(resolve);
### Keybase proof
I hereby claim:
* I am strajk on github.
* I am strajk (https://keybase.io/strajk) on keybase.
* I have a public key whose fingerprint is 46DA FBBD E5AE 17AE D229 AB7D CF9A B872 DA89 EE02
To claim this, I am signing this object: