Skip to content

Instantly share code, notes, and snippets.

View andrewkatz's full-sized avatar

Andrew Katz andrewkatz

  • Los Angeles, CA
View GitHub Profile
alias gphu='gph -u origin'
gpqt()
{
last_commit=$(git log -1 --pretty=%B)
message=${1:-$last_commit}
echo "$message\n@trobrock" | gpq -F -
}
xpq()
@andrewkatz
andrewkatz / csrf.js
Created April 14, 2021 19:03
Fetch Turbo stream
export default function () {
const token = document.querySelector('meta[name="csrf-token"]')
return token ? token.getAttribute('content') : null
}
# frozen_string_literal: true
# Easier access to components in templates. So instead of doing:
#
# <%= render SectionComponent.new(title: 'Foo') do |c| %>
# <p>My content</p>
#
# <% c.subsection do %>
# <p>Cool</p>
# <% end %>

Keybase proof

I hereby claim:

  • I am andrewkatz on github.
  • I am andrewkatz (https://keybase.io/andrewkatz) on keybase.
  • I have a public key ASBYv0OU5sFiOhz_H0GhWmrv2_lw3T5hrh5BhC1CnUh4swo

To claim this, I am signing this object: