Skip to content

Instantly share code, notes, and snippets.

@branch14
Created December 11, 2012 14:15
Show Gist options
  • Select an option

  • Save branch14/4258871 to your computer and use it in GitHub Desktop.

Select an option

Save branch14/4258871 to your computer and use it in GitHub Desktop.

Revisions

  1. branch14 revised this gist Dec 11, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ruby-signaturepad-to-image.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # see https://github.com/thomasjbradley/signature-pad for more details

    instructions = JSON.load(data).map { |h| "line #{h['mx']},#{h['my']} #{h['lx']},#{h['ly']}" } * ' '
    system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png'
    system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png"
  2. branch14 created this gist Dec 11, 2012.
    4 changes: 4 additions & 0 deletions ruby-signaturepad-to-image.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # see https://github.com/thomasjbradley/signature-pad for more details

    instructions = JSON.load(data).map { |h| "line #{h['mx']},#{h['my']} #{h['lx']},#{h['ly']}" } * ' '
    system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png'