Project

snipgem

0.0
No commit activity in last 3 years
No release in over 3 years
Using simple tags, you can mark snips in your code without interrupting your workflow. At the end of the day, run 'snip' to gather your snips from all your code for easy review. Compatible with Ruby and JavaScript. Visit the GitHub homepage for further instructions and developer contact details.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 1.0
~> 10.0
~> 3.0
 Project Readme

Snip

Your code, snipped

Snip is an open source code snippet manager. With a simple command line interface, you can easily tag and save your code for future review.

New in release 0.0.9 (3/4/15)

Language support has been expanded to the following languages:

  • JavaScript (existing)
  • Ruby (existing)
  • ERB (existing)
  • HTML
  • CSS
  • Python
  • PHP

Languages can be easily added through the lib/languages/languages.rb file. Submit an issue or pull request to have additional support added.

Search (with snip -s) is now smarter, with no case sensitivity and matching for individual words throughout the body of your snippet.

New in release 0.0.8 (2/8/15)

Snip now includes a clipboard functionality. Copy the code you want to save to your clipboard, then run snip -c. You'll be asked to specify a language type and a title.

Snippet search has been added in 0.0.8. From the commandline, run snip -a to see all of your snippets. To see only a certain language (rb, js, erb), specify as follows snip -s js. To search within the content of the snippet (for example, for any content with 'angular' in it), snip -s "angular".

Other miscellaneous functionality can be referenced with snip --help.

How it works

Snip uses simple, easy-to-remember tags that you place inside your code during your normal workflow:

# <$> Using a times loop
5 times do |x|
  puts x
end
 # </$>

At the end of the day, run snip <filename/directory> to update your snippet file with a single file or a whole directory of tagged files:

# **** Snippet 1: Using a times loop ****
# Snipped from test.rb:4 on 12/08/2014
5 times do |x|
  puts x
end

The original file tags will be modified slightly with <*$*> tags so you can rerun snip on your directory without duplicating old files.

Setup

Installation: Snip requires Ruby and Ruby gems on your computer.

To install:

gem install snipgem

First time use:

snip -f ~/desktop/

where '~/desktop/' can be the name of any directory you would like to save your my_snips file to. Run snip -f again to re-set the directory if you move the location of the my_snips file.

Future use:

snip directory_name/

or

snip filename.rb

Send feedback or bug reports to jgerminario@gmail.com.