Skip to content

Instantly share code, notes, and snippets.

View andrewkatz's full-sized avatar

Andrew Katz andrewkatz

  • Los Angeles, CA
View GitHub Profile
@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=""

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
}
/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
}
" Tomorrow Night - Full Colour and 256 Colour
" http://chriskempson.com
"
" Hex colour conversion functions borrowed from the theme "Desert256""
" Default GUI Colours
let s:foreground = "c5c8c6"
let s:background = "1a1a1a"
let s:selection = "373b41"
let s:line = "282a2e"
@andrewkatz
andrewkatz / gist:4552578
Created January 17, 2013 00:59
jasmine segfault
[~/dev/outright] [rails-3.0-upgrade ✗] rake jasmine:ci
Unable to load thrift_native extension. Defaulting to pure Ruby libraries.
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.txn" is no longer supported
/Users/andrewkatz/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby -S rspec /Users/andrewkatz/.rvm/gems/ree-1.8.7-2012.02@outright/gems/jasmine-1.3.1/lib/jasmine/run_specs.rb --colour --format progress -r /Users/andrewkatz/dev/outright/config/environment
Unable to load thrift_native extension. Defaulting to pure Ruby libraries.
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.txn" is no longer supported
Waiting for jasmine server on 58225...
[2013-01-16 16:58:23] INFO WEBrick 1.3.1
PROMPT=$'%{$fg[blue]%}[%~]%{$reset_color%}$(git_prompt_info) '
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=""