Skip to content

Instantly share code, notes, and snippets.

@mistersourcerer
Created October 10, 2012 15:06

Revisions

  1. mistersourcerer revised this gist Oct 10, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion color.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ LANG="ruby"

    if [ -n "$2" ]
    then
    LANG=$2; echo "veio aqui né?";
    LANG=$2;
    fi

    if [ -a "$1" ]
  2. mistersourcerer created this gist Oct 10, 2012.
    16 changes: 16 additions & 0 deletions color.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/bash
    #http://pygments.org/docs/cmdline/

    LANG="ruby"

    if [ -n "$2" ]
    then
    LANG=$2; echo "veio aqui né?";
    fi

    if [ -a "$1" ]
    then
    pygmentize -l $LANG -f rtf $1 | pbcopy
    else
    pbpaste | pygmentize -l $LANG -f rtf | pbcopy
    fi
    5 changes: 5 additions & 0 deletions usage.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    color myfile.rb
    # or, if you have the code in your "Cmmd + C area"
    color

    # now just go to the keynote and hit Cmmd + V