Skip to content

Instantly share code, notes, and snippets.

View richkuz's full-sized avatar

Rich Kuzsma richkuz

View GitHub Profile
@richkuz
richkuz / github-projectv2-projectnext-notes.md
Created August 7, 2022 13:56
Notes about using the new GitHub ProjectV2 API

Notes on GitHub ProjectV2 API

GitHub Projects Beta aka GitHub Projects Next aka GitHub ProjectNext is now known as GitHub ProjectV2 in the API.

It's not immediately obvious how to use the new API, especially if you're coming from the old beta API.

You no longer need to set the HTTP header: GraphQL-Features: projects_next_graphql.

You still need to add your GitHub personal access token to the Authorization header, e.g. Authorization: Basic ghp_...

@richkuz
richkuz / insert-date-mac-osx.md
Created June 12, 2020 15:35
Insert ISO-8601 formatted date yyyy-mm-dd on Mac OSX using a keyboard shortcut

Recently, I converted to using ISO-8601 formatted dates as much as possible, e.g. 2020-06-12. As a meme, I hope this catches on. Dates written this way are internationally recognizable, no confusion over mm/dd/yy or dd/mm/yy. They are sortable. And, when used consistently, they are easy to search; no worries about case sensitivity, or Jun/June spellings. Don’t take my word for it, though. Randall Munroe agrees. So does GitLab.

Here's how to create a keyboard shortcut to insert the current date formatted as ISO-8601.

  1. Launch Automator, and create a new Service.

  2. This particular service receives no input.

  3. Drag in Run AppleScript to the service.

@richkuz
richkuz / obsidian-default-note-title.md
Created May 18, 2023 13:21
Obsidian: How to set the default title of a new note

How to set the default title of a new note in Obsidian

I wanted to set the default title of new notes created via Cmd+N to be formatted like "2023-05-18 New", "2023-05-18 New 2", ...

I also wanted all new notes created via Cmd+N to go in the new folder.

  1. Create a folder called e.g. new

  2. In "Files & Links" settings, set "Folder to create new notes in" to new

  3. Create a folder called e.g. templates and add a file called e.g. Default with this content:

@richkuz
richkuz / effective-delegation.md
Created November 9, 2023 20:42
Effective Delegation

To delegate effectively to a new team, you have to explain the following:

  1. Context and goal
  2. Expected results
  3. What to do
  4. How to do it

As the team grows and they learn how to do the work, it become sufficient and appropriate to explain only the first three bullet points. As the team further progresses, you can communicate the first 2 bullet points and the team will figure out what to do and how to do it. Finally, with high performing teams/individuals, you can provide context and the goal, and the team defines the rest.

@richkuz
richkuz / jira-bookmarklet.md
Created October 25, 2023 22:20
Bookmarklet to create Jira issues with default values provided

Jira Issue Create Bookmarklet

This bookmarklet lets you pop the Jira "Create Issue" dialog with values pre-populated. You have to be on a Jira page for this to work.

Create a new Bookmark in Chrome:

Bookmark name: “whatever”

URL:

@richkuz
richkuz / jira-query-issues.graphql
Created June 16, 2023 11:49
Jira GraphQL API Query Issues with links
# Example Jira GraphQL API to fetch a Cloud ID, query for issues with JQL, and get issues with links, i.e. child issues
#
# Run this in https://developer.atlassian.com/platform/atlassian-graphql-api/graphql/explorer/
#
# In the GraphQL explorer UI, at the bottom, add these Request Headers:
# {
# "X-ExperimentalApi" : "JiraIssueSearch"
# }
#
query fetchCloudId {
@richkuz
richkuz / select-range.js
Created May 25, 2023 01:54
JavaScript to select a range of text in a paragraph excluding HTML markup
// Given an element, select a range of text given a start and end character position offset relative
// to the element's innerText, not counting any HTML markup in the element.
// Partial credit: https://stackoverflow.com/questions/16662393/insert-html-into-text-node-with-javascript
function injectMarkerIntoTextNode(node, startIndex) {
// startIndex is beginning location of the text to inject a span
let parentNode = node.parentNode;
var s = node.nodeValue;
var beforePart = s.substring(0, startIndex);
@richkuz
richkuz / blazerPageBookmarklet.js
Created April 13, 2023 13:17
Add paging, CSV, and JSON export support to Blazer UI
// Adds a "Page Results" button to a Blazer query and buttons to export (copy or download) results as JSON or CSV.
//
// To use this, open a Blazer query on the "Edit" page, open Chrome Dev Tools, paste all this code and hit Enter.
//
// When paging, the Blazer query must contain an expression like this that can be used to cursor through results:
//
// WHERE product.order_id >= 0 ORDER BY product.order_id LIMIT 100
// or:
// WHERE agreements.id >= '00000000-0000-0000-0000-000000000000' ORDER BY agreements.id LIMIT 100
//
@richkuz
richkuz / growth-productivity.md
Created February 27, 2023 13:27
Growth vs Productivity

Growth versus Productivity

image

When you're growing, you're not producing as much. When you're producing a lot, you're probably not learning as much. Invest in growth to expand the breadth and depth of what you can produce.

@richkuz
richkuz / slack-expectations.md
Created February 9, 2023 14:14
My expectations for Slack response times

My expectations for Slack response times

I'm an engineering manager. For engineers, context switching to check Slack is extremely expensive. I aim to minimize that expense!

I have very low expectations for quick response times on Slack. On the contrary, it puts my mind at ease when folks don't always respond immediately on Slack. Take time to craft a meaningful response. Stay focused on your own tasks or meetings, and respond only after you have a moment.

Slack is an asynchronous medium. I generally expect folks will respond to Slack messages at some point during the day, when they can.

99.999% of my Slack messages are not urgent, even when I use @ mentions.