Skip to content

Instantly share code, notes, and snippets.

View richkuz's full-sized avatar

Rich Kuzsma richkuz

  • LinkSquares
  • Amherst, NH
View GitHub Profile
@richkuz
richkuz / looker-min-max-datetime-calculation.md
Last active November 9, 2024 13:09
Compute max date time in a Looker calculation expression

In a Looker table calculation custom expression you can compute the max or min value of a date time object using an expression like this:

max(
  (100 * 100 * 100 * 100 * 100 * extract_years(${table.created_at})) +
  (100 * 100 * 100 * 100 * extract_months(${table.created_at})) +
  (100 * 100 * 100 * extract_days(${table.created_at})) +
  (100 * 100 * extract_hours(${table.created_at})) +
  (100 * extract_minutes(${table.created_at})) +
 (extract_seconds(${table.created_at}))
@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 / 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 / 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.

@richkuz
richkuz / character-sheet.md
Created February 1, 2023 20:58
Character sheet

Character sheet

We filled out character sheets at Elastic as a team building exercise. I wrote this in 2022. I figured I'd work in the open and share it with the world.

What is your name? Preferred name?

Richard Kuzsma. Last name is pronounced "Kooz-mah".