Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile
eventsource
go-eventsource
client/client
toggleCvc: ->
@cvc_container ||= @form.find(".payment-cvc")
@cvc_content ||= @cvc_container.contents()
cvc = @cvc_content.find('input').val()
if !cvc || /^\s*$/.test(cvc)
@cvc_content.remove()
showCvc: ->
@cvc_container.html(@cvc_content)
stripeHidden = _.template """
<div>
<input type='hidden' name='stripeToken' value='<%= id %>' />
<input type='hidden' name='payment_method[name]' value='<%= name %>' />
<input type='hidden' name='payment_method[last4]' value='<%= last4 %>' />
<input type='hidden' name='payment_method[exp_month]' value='<%= exp_month %>' />
<input type='hidden' name='payment_method[exp_year]' value='<%= exp_year %>' />
</div>
"""
stripeHidden = _.template """
<div>
<input type='hidden' name='stripeToken' value='<%= id %>' />
<input type='hidden' name='payment_method[name]' value='<%= name %>' />
<input type='hidden' name='payment_method[last4]' value='<%= last4 %>' />
<input type='hidden' name='payment_method[exp_month]' value='<%= exp_month %>' />
<input type='hidden' name='payment_method[exp_year]' value='<%= exp_year %>' />
</div>
"""
#!/usr/bin/env bash
say "Did you run test?"
while true; do
read -p "Do your run tests? [yn]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit 1;;
* ) echo "Please answer yes or no.";;
esac
@jhsu
jhsu / images.md
Last active December 14, 2015 14:29

high five

quotasaurusrex

@jhsu
jhsu / waffles.md
Last active December 14, 2015 11:59
@jhsu
jhsu / giffy
Last active December 11, 2015 11:18
#!/usr/bin/env bash
# Giffy - Convert video to gif.
#
# Author: Joseph Hsu (@jhsu)
# Dependencies: imagemagick, ffmpeg
#
# inspired by Richard Schneeman (@schneems)
# http://schneems.com/post/41104255619/use-gifs-in-your-pull-request-for-good-not-evil
If a dog chews shoes, whose shoes does he choose?
chip shop chips