Last active
November 3, 2016 23:05
-
-
Save taveras/162860deae8f62a6d774292abe6442f4 to your computer and use it in GitHub Desktop.
Revisions
-
taveras revised this gist
Nov 3, 2016 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,6 @@ vim ${2}-tmp -c "%g/^#/normal dd" \ -c "%normal A;" \ -c "%g/\S\/\;/normal f;hx" \ -c "%g/\/ /normal Ex" \ -c "wq" cat ${2}-tmp | awk '!x[$0]++' > $2 -
taveras revised this gist
Sep 13, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,10 +9,10 @@ yes | cp $1 ${2}-tmp # %g/\S\/\;/normal f;hx # Removes trailling slash for second segment # %g/\/ /normal Ex # Removes trailing slash for first segment # %normal Vgu # Lower cases all characters # wq # Save file and quit # open vim and run the above ex commands # awk '!x[$0]++' # remove duplicate lines without sorting vim ${2}-tmp -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -
taveras revised this gist
Sep 13, 2016 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # copy file 1 to file 2, and overwrite file 2 if necessary yes | cp $1 ${2}-tmp # %g/^#/normal dd # Deletes all comments # %normal Elcw # Collapses whitespace between segments @@ -14,11 +14,13 @@ yes | cp $1 $2 # open vim and run the above ex commands vim ${2}-tmp -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "%g/\S\/\;/normal f;hx" \ -c "%g/\/ /normal Ex" \ -c "%normal Vgu" \ -c "wq" cat ${2}-tmp | awk '!x[$0]++' > $2 rm ${2}-tmp -
taveras revised this gist
Sep 8, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ yes | cp $1 $2 # open vim and run the above ex commands vim $2 -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "%g/\S\/\;/normal f;hx" \ -
taveras revised this gist
Sep 8, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ yes | cp $1 $2 # open vim and run the above ex commands vim -T dumb -X -n --noplugin $2 -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "%g/\S\/\;/normal f;hx" \ -
taveras revised this gist
Sep 8, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,8 @@ yes | cp $1 $2 # %g/^#/normal dd # Deletes all comments # %normal Elcw # Collapses whitespace between segments # %normal A; # Adds semicolon to the end of each line # %g/\S\/\;/normal f;hx # Removes trailling slash for second segment # %g/\/ /normal Ex # Removes trailing slash for first segment # %normal Vgu # Lower cases all characters # %sort u # Sort all redirects, remove duplicates # wq # Save file and quit @@ -17,8 +17,8 @@ yes | cp $1 $2 vim -T dumb --noplugin $2 -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "%g/\S\/\;/normal f;hx" \ -c "%g/\/ /normal Ex" \ -c "%normal Vgu" \ -c "%sort u" \ -c "wq" -
taveras revised this gist
Sep 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # copy file 1 to file 2, and overwrite file 2 if necessary yes | cp $1 $2 # %g/^#/normal dd # Deletes all comments # %normal Elcw # Collapses whitespace between segments # %normal A; # Adds semicolon to the end of each line # g/\S\/\;/normal f;hx # Removes trailling slash for second segment -
taveras revised this gist
Sep 6, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ yes | cp $1 $2 # open vim and run the above ex commands vim -T dumb --noplugin $2 -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "g/\S\/\;/normal f;hx" \ -
taveras created this gist
Sep 6, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/bash # copy file 1 to file 2, and overwrite file 2 if necessary yes | cp $1 $2 # %g/^#/normal dd # Deletes all command lines # %normal Elcw # Collapses whitespace between segments # %normal A; # Adds semicolon to the end of each line # g/\S\/\;/normal f;hx # Removes trailling slash for second segment # g/\/ /normal Ex # Removes trailing slash for first segment # %normal Vgu # Lower cases all characters # %sort u # Sort all redirects, remove duplicates # wq # Save file and quit # open vim and run the above ex commands vim $2 -c "%g/^#/normal dd" \ -c "%normal Elcw " \ -c "%normal A;" \ -c "g/\S\/\;/normal f;hx" \ -c "g/\/ /normal Ex" \ -c "%normal Vgu" \ -c "%sort u" \ -c "wq"