Skip to content

Instantly share code, notes, and snippets.

View andrewkatz's full-sized avatar

Andrew Katz andrewkatz

  • Los Angeles, CA
View GitHub Profile

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:

# 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 %>
@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
}
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 / spacegray_slack_theme
Last active August 29, 2015 14:08
Spacegray Slack Theme
#2B303B,#2B303B,#8FA1B3,#2B303B,#343D46,#C0C5CE,#A3BE8C,#BF616A
@andrewkatz
andrewkatz / andrewkatz.zsh-theme
Last active April 20, 2022 17:53
andrewkatz.zsh-theme
PROMPT=$'%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info) '
RPROMPT=''
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}•%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@andrewkatz
andrewkatz / .slate
Created March 5, 2014 20:41
Slate config
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config keyboardLayout qwerty
config windowHintsBackgroundColor 0;0;0;0.8
config windowHintsShowIcons true
/usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:258:in `dup': can't dup TrueClass (TypeError)
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:258:in `normalize'
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:229:in `[]='
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:151:in `mount'
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/jekyll-1.2.1/lib/jekyll/commands/serve.rb:19:in `process'
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/jekyll-1.2.1/bin/jekyll:100:in `block (2 levels) in <top (required)>'
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /usr/local/opt/rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /usr/local/op
irb(main):007:0> fog.directories
Excon::Errors::SocketError: no such service 443/tcp (SocketError)
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/socket.rb:149:in `connect'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/ssl_socket.rb:103:in `connect'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/socket.rb:32:in `initialize'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/ssl_socket.rb:8:in `initialize'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/connection.rb:361:in `new'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/connection.rb:361:in `socket'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/connection.rb:105:in `request_call'
from /Users/andrewkatz/dev/aggregation/vendor/gems/excon-0.25.3/lib/excon/middlewares/mock.rb:42:in `request_call'
@andrewkatz
andrewkatz / .zshrc
Created May 6, 2013 17:22
Simple command for ssh'ing into rails hosts. Thanks to @trobrock for the ruby script.
# Usage:
# rails_ssh release cron
# => ssh release@ec2-xx-xx-xx-xx.compute-1.amazonaws.com
rails_ssh()
{
username=$1
hostname="$(ruby $HOME/Scripts/parse_cap_config.rb $2)"
ssh $username@$hostname
}