DonationCoder.com Forum

Main Area and Open Discussion => General Software Discussion => Topic started by: murratore on October 17, 2008, 09:14 AM

Title: Source Code / Code Snippet Manager
Post by: murratore on October 17, 2008, 09:14 AM
hi there
As far as i can judge there are many programmers in this forum.
what software do you use for managing code snippets / source code fragments? I don't mean real Source code management tools (like subversion or sourcesafe).

On bitsdujour there is a discount on monday for "Source Code Library", but I'm not sure if there are better tools.
http://www.bitsdujour.com/software/source-code-library/
Title: Re: Source Code / Code Snippet Manager
Post by: VideoInPicture on October 17, 2008, 02:39 PM
Right now, I simply create a hierarchy of directories that are labelled descriptively and by language category to store all the interesting and useful programs I come across that have source code. I only keep the ones that provide something interesting and useful that I can't do off the top of my head. I go through each of the program files I have source code to and try to understand what is happening so I burn it into my head. I like having the full source code to a program that demonstrates the use of the code instead of simply snippets because over the long term, I will probably forget how to use the snippet!

Often, I will use Google to locate source code if I don't store it locally.
Title: Re: Source Code / Code Snippet Manager
Post by: Jammo the OrganizedFellow on June 07, 2009, 11:23 PM
Anything new?
I'd like to resurrect this thread.

I have some snippets and code that I would like to maintain in an app like the one mentioned above. But I, like many of you, prefer Open Source or free.

I attempted to use Adobe AIR app called Snipply http://code.google.com/p/snippely/
didnt like it :(
Title: Re: Source Code / Code Snippet Manager
Post by: Jammo the OrganizedFellow on June 07, 2009, 11:49 PM
 :D

I found something ladies, gentlemen and coders!



It's got TONS of amazing features. A great one is:
Server Sychronization
To avoid having to carry a copy of the database from one PC to another gbCodeLib provides a built-in ability to FTP the current database files (source code, repository file, and object file) to a users' web site.

The app also has a portable version too INCLUDED!!! :)
gbFlashLib
For users who want to a carry their snippet database with them, usually in a USB Flash drive, a simpler version of gbCodeLib has been written. The portable version is called gbFlashLib. To use it, just copy two files - gbFlashLib.exe and gbCodeLib.txt - to any folder on your USB flash drive. Double-click on the EXE file in the flash drive to run the program. The gbFlashLib EXE file is included in the gbCodeLib distribution.

Best of all, gbCodeLib is free for non-commercial use (personal & educational).
Charge $30 for commercial or governmental environments.


gbCodeLib

gbCodeLib is a full-featured, multi-language
code librarian, powerful source code editor
and revision control manager. gbCodeLib has
an easy-to-use interface yet provides one of
the largest feature sets of any code librarian
available today. Over 1000 sample source code
snippets, including language mini-tutorials,
are included in the distribution.

gbCodeLib and its snippets can be updated online.

VB, VBA, VB.net, HTML, XML, Perl, ASP, PHP,
JavaScript, Java, Delphi, C++, C#, SQL and DOS
source code snippets are included in the distribution.


For more information, go to
the gbCodeLib home page at:

http://www.garybeene.com/gbware/gbcodelib.htm



EFF-ing awesome!
So glad I found this!
:P
Title: Re: Source Code / Code Snippet Manager
Post by: Jammo the OrganizedFellow on June 08, 2009, 12:23 AM
Beat to the punch.
I should have searched first.
https://www.donationcoder.com/forum/index.php?topic=10318.msg80133#msg80133 (https://www.donationcoder.com/forum/index.php?topic=10318.msg80133#msg80133)
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 08, 2009, 12:44 AM
It sounds nice but it does not have drag-drop and Python support.
Title: Re: Source Code / Code Snippet Manager
Post by: Jammo the OrganizedFellow on June 08, 2009, 01:06 AM
Am getting tons of Run-Time errors.
My thrill was too short-lived.

Any alternatives anyone?!
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 08, 2009, 01:15 AM
Well I think best is to use a text editor with file browser like Notepad++ which supports advanced coding features also. I personally use Eclipse IDE+Vim(with NerdTree) and Notepad++ once in a while. VIm is great for browsing code, it supports many languages but you might feel more comfortable with notepad++. Do not forget to download NP++ plugins.
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 08, 2009, 01:27 AM
Btw I forgot to mention this one

http://code-browser.sourceforge.net/

It could be useful
Title: Re: Source Code / Code Snippet Manager
Post by: widgewunner on June 08, 2009, 09:24 PM
After using the "Clip Collection" feature built into EditPad Pro, I'm coming to realize the benefits of using text snippets. The author of EditPad considers this feature so handy that he has written another whole app entirely dedicated to snippets called: "Ace Text (http://www.acetext.com/)". It is designed to work seamlessly with all Windows apps. I've already purchased four apps from JGSoft (and love them all), but haven't tried this one yet. May be worth a look...
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 12, 2009, 08:52 AM
I created a product for managing code snippets too called Snip-It Pro.
http://www.snipitpro.com/

I modelled it after how snippets were handled in Homesite and Dreamweaver so it docks to the side of your screen so you can use it with any application that suppots drag and drop.

Just released a new version a couple weeks ago that has some useful features like code snippet templates, automatic commenting, syntax highlighting, global hot keys and integration with Snipplr, a web community for sharing code snippets online.

Any feedback would be greatly appreciated.
Title: Re: Source Code / Code Snippet Manager
Post by: mouser on June 12, 2009, 09:01 AM
looks nice mtelligent  :up:
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 12, 2009, 12:21 PM
I bought Source Code Library off of Bits, and have been very satisfied with it.  It actually does *more* than I need it to, as it has functionality similar to DirectAccess and Surfulater also.  :up:
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 12, 2009, 01:27 PM
thanks mouser. I'll actually have Snip-It Pro at half price on Bits Du Jour Saturday July 11th.

Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 12, 2009, 01:34 PM
thanks mouser. I'll actually have Snip-It Pro at half price on Bits Du Jour Saturday July 11th.



I was just going to ask for DC discount. I have not tried but I will today.

The only thing I have not like it snapping behaviour. Is there a way to disable it ? I do not want to close the bar I just would like it to not to stay on to at all times
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 12, 2009, 02:57 PM
When you say snapping, you mean the docking? when you hit the close button, it doesn't exit. It can be brought back from the system tray.

You can also try unpinning it and it will autohide.

Hope that helps.

-Dave
Title: Re: Source Code / Code Snippet Manager
Post by: FSL on June 13, 2009, 10:27 AM
.
Why don't try my DTT (Developer's Tips & Tricks)?  It's free...  :)

(http://fsl.sytes.net/screenshots/dtt.png)

Free download from: DTT page (http://fsl.sytes.net/dtt.html)

Best regards,
FSL
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 13, 2009, 11:31 AM
.
Why don't try my DTT (Developer's Tips & Tricks)?  It's free...  :)

Free download from: DTT page (http://fsl.sytes.net/dtt.html)

Best regards,
FSL

I actually tried that one but it did not have drag and drop support. To me without that feature I do not feel any need for using another application really. Do not get me wrong it looks works very nice but personally I prefer dd over many other features.
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 15, 2009, 02:50 AM
When you say snapping, you mean the docking? when you hit the close button, it doesn't exit. It can be brought back from the system tray.

You can also try unpinning it and it will autohide.

Hope that helps.

-Dave

Dave, I personally am not big fan of docking apps but I am sure there are many who would prefer it due to convenience. So I closed it and tried to use it without the docking bar. But it seems like the main window is not handling the drag and drops the way the side bar was handling.  The other thing is that everytime I dd from FF it keeps asking me to specify a target. The thing is that I have been already dropping on target on the docking bar. 

I guess I am not used to the way your application has been designed. So I just keep hitting certain walls here.

It is a very nice app but I will pass on this one. Here are my reasons

-No dark themes(text, highlighting, background)
-Drag and drop support is mainly supported for the docking bar.
-no search highlighting (searched words)

Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 15, 2009, 02:07 PM
kartal, Thanks for the feedback.

Not sure what the firefox issue is. When I drag text from firefox to a folder in the toolbar dock, it creates a new snippet fine. I just need to type a description and save.

As far as dark themes, go, I am using a control vendor that provides themes, so until they make another layout available, i will add it.

Drag and Drop for the main window is something I am working on. That whole window is new to the program, it used to be a separate popup window for each snippet.

Search highlighting is a great idea, and something I will consider for the next point release.

Thanks,

-David
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 15, 2009, 04:07 PM
kartal, Thanks for the feedback.

Not sure what the firefox issue is. When I drag text from firefox to a folder in the toolbar dock, it creates a new snippet fine. I just need to type a description and save.
-David

David, that issue was happening with the main window. The snippet bar seems fine, it is just not my way of dealing with collecting information.

Another solution could be a dropbox instead of large side bar or customizable global shortcut support(windows key) for toggling the snippet bar.


I am really happy to hear about new stuff you are working on, definetely they will add great value.

Btw I did not have time to check out the folder structure. Is it saving files in flat files in folders? That would be great because it would make it easy to exchange between other applications.
Title: Re: Source Code / Code Snippet Manager
Post by: bmms on June 15, 2009, 07:11 PM
Shameless self-promotion:

PhraseExpress can save text and code snippets and organize them in categories. Additionally, it includes a clipboard cache, supports html/rtf text formatting and bitmaps in the text snippets.

Check it out at http://www.phraseexpress.com

It is free for personal use.
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 17, 2009, 10:46 PM
kartal, the snippets are xml files stored in normal windows folders. When you add a snippet collection (basically a high level folder), you specify the folder location where the xml files get saved. You can even put them on network shares so teams can use the same snippets.

I can probably easily add support for a global hot key to toggle the visibility of the docking bar. I already allow you to assign global hot keys to use specific snippets. I'll let you know when that is implemented.
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 18, 2009, 12:15 AM
kartal, the snippets are xml files stored in normal windows folders. When you add a snippet collection (basically a high level folder), you specify the folder location where the xml files get saved. You can even put them on network shares so teams can use the same snippets.

I can probably easily add support for a global hot key to toggle the visibility of the docking bar. I already allow you to assign global hot keys to use specific snippets. I'll let you know when that is implemented.


Hmm, I can see why xml is the choice for file format, but that means that the user cannot browse the snippets with another editor. I also tried exporting the a snippet but it is not giving any text based file choice, only archive format? So basically there is not any way to take the file(s) out of Snip-it pro except copy pasting I guess.

I am personally looking for an easy way to collect snippets but does not necessarily mean that I would want to be tied to Snippet application to browse them. Just an observation. I think you made a design desicion and it works fine as it is.


Please update this thread when you have the toggling. I would definetely try it.

Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 19, 2009, 08:01 AM
I Implemented the feature last night and just published it this morning.

CTRL, ALT, "S" will toggle the visibility of the snippet toolbar now.

By the way, There is another way to get snippets out of Snip-It Pro. You can publish them to Snipplr.com. Sign up for an account and enter your app ID into Snip-It Pro to enable this feature. Besides Snip-It Pro, there are plugins for Textmate and other programs that will allow you to get your snippets from Snipplr, so you won't be tied to Snip-It Pro. Snipplr is a pretty cool code snippet community, and every snippet you favorite, is viewable in Snip-It Pro.
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 19, 2009, 09:00 AM
One of the first things I notice is a lack of the ability to set your internet proxy.  Without that, I can't use it to access snipplr.  Do you have any intention of adding that ability?
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 19, 2009, 09:40 AM
Good Point. I actually hadn't thought about setting up a proxy. I'll look into it tonight and see if it's something I can easily add support for.

Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 19, 2009, 10:04 AM
I see you're using .NET.  Not sure if it's C#, or what libraries you're using to connect, but if you're using the out of the box support and are using C#, here's an example of setting a proxy...

Code: C# [Select]
  1. var result = new StringBuilder();
  2.             try
  3.             {
  4.               var transferProxy = new WebProxy("http://proxy:80/", true);
  5.               transferProxy.Credentials = new NetworkCredential("userId", "password", "Domain");
  6.               var transferRequest = WebRequest.Create("http://www.snipplr.com");
  7.               transferRequest.Proxy = transferProxy;
  8.               HttpWebResponse transferResponse = (HttpWebResponse)transferRequest.GetResponse();
  9.               System.IO.Stream outputStream = transferResponse.GetResponseStream();
  10.               System.Text.Encoding outputEncoding = System.Text.Encoding.GetEncoding("utf-8");
  11.               System.IO.StreamReader outputReader = new System.IO.StreamReader(outputStream, outputEncoding);
  12.               char[] chars = new Char[256];
  13.               int readCount = outputReader.Read(chars, 0, 256);
  14.               int totalRead = readCount;
  15.               while(readCount > 0)
  16.               {
  17.                 string str = new String(chars, 0, 256);
  18.                 result.Append(str);
  19.                 readCount = outputReader.Read(chars, 0, 256);
  20.               }
  21.               transferResponse.Close();
  22.               outputStream.Close();
  23.               outputReader.Close();
  24.             }
  25.             catch(Exception ex)
  26.             {
  27.               string str = ex.Message;
  28.             }

Caveat- I pulled this from some other code and scrubbed some of the identifying lines, so there may be extraneous lines in there or it may not compile offhand, but the code is correct.  Let me know if you have any questions, but it's pretty straightforward, and from what you've already done with snip-it, I'm sure it shouldn't be an issue.  :Thmbsup:

UPDATE: Made sure it still compiled and fixed an embarrassing oversight.
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 19, 2009, 10:10 AM
Snip-It Pro is written in C#.

The snipplr API is XML RPC so I am using the xmlrpc.net libraries at http://www.xml-rpc.net.

I can manually set the Proxy object like you described in your code snippet, or can just set it to the WebRequest.DefaultWebProxy which should (in theory) take the default proxy settings from Internet Explorer.

Would someone want to specify custom proxy settings for this one app, or just have it read the IE Settings?
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 19, 2009, 10:27 AM
I always allow a choice personally.  There might be a reason not to use the default proxy, so I just put a radio button to allow (a) default proxies or (b) custom proxy.  This also takes care of the case where IE won't play right, which I've had a problem with before.
Title: Re: Source Code / Code Snippet Manager
Post by: FSL on June 20, 2009, 08:47 AM
I actually tried that one but it did not have drag and drop support. To me without that feature I do not feel any need for using another application really.
Many thanks for your suggestion.  :)
I have added a full drag and drop support in the current release (for both: files and text blocks from other IDEs or editors).

Best regards,
FSL
Title: Re: Source Code / Code Snippet Manager
Post by: tinjaw on June 20, 2009, 09:40 AM
I have added a full drag and drop support in the current release (for both: files and text blocks from other IDEs or editors).

Yeah! I am off to download my registered version (with super special extra privileges  8) ).
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on June 20, 2009, 12:30 PM
I Implemented the feature last night and just published it this morning.

CTRL, ALT, "S" will toggle the visibility of the snippet toolbar now.

By the way, There is another way to get snippets out of Snip-It Pro. You can publish them to Snipplr.com. Sign up for an account and enter your app ID into Snip-It Pro to enable this feature. Besides Snip-It Pro, there are plugins for Textmate and other programs that will allow you to get your snippets from Snipplr, so you won't be tied to Snip-It Pro. Snipplr is a pretty cool code snippet community, and every snippet you favorite, is viewable in Snip-It Pro.
thanks for the addition
I will try it tonight

Just a side note, you know though ctrl+alt or similar combinations are generally could be used by many other applications. I generally think that offering "win" key combinations are better suited for global operations like toggling.

I have never tried Snipplr.com. I will also check it out today
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 21, 2009, 08:05 AM
Good Point kartal. I changed the key to "CTRL" "Windows Key" "S". Still needed to use "CTRL" because the "Windows Key" "S" toggles caps lock if you have one of those intelli keyboards MSFT sells.

Wraith808, the updated version also supports configuring proxy settings for connecting to Snipplr. Let me know if you have any issues with it.

You can download the latest version from:
http://www.snipitpro.com/tryItFree.html
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 21, 2009, 09:46 AM
Thanks!  I'll check it out when I get to work... it looks really good- both the app, and snipplr!
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 22, 2009, 09:32 AM
No joy on the Proxy settings, unfortunately.  I attempted to let it get default settings, then after that didn't work, I specified them manually, and never was able to get past the proxy.

Using WinXP Professional SP2.  Let me know if you need me to check anything else.
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 22, 2009, 11:37 AM
I'll look into things later tonight.

Did you specify a username/password/domain?

I might have to add code to pass the current credentials to the proxy, because right now, nothing is passed if you don't.
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 22, 2009, 11:58 AM
I specified username and password, but not domain.  I also specified a port on the proxy.
Title: Re: Source Code / Code Snippet Manager
Post by: mtelligent on June 29, 2009, 08:23 AM
Just an Update: I can reproduce, but still no fix.

I used to CCProxy to test having a proxy server.

The code worked fine, if I set CCProxy not to require authentication, but if I did, it wouldn't work. (Tried just username/password)

I tried changing from using NetworkCredential to the CredentialCache object, but still no dice.

Here's the code if anyone has any suggestions otherwise I'll keep plugging away at it:

if (config.UseCustomProxySettings)
                {
                    System.Net.WebProxy proxy = new System.Net.WebProxy(config.ProxyServerAddress);
                    if (config.UseProxyCredentials)
                    {
                         proxy.Credentials =  new NetworkCredential(config.ProxyUserName, config.ProxyPassword, config.ProxyDomain));
                    }
                    else
                    {
                        proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    }
                    SnipplrProxy.Proxy = proxy;                   
                }
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 29, 2009, 01:37 PM
Try this snippet and see if it works for you... It does for me in my code.

Code: C# [Select]
  1. var result = new StringBuilder();
  2.             try
  3.             {
  4.                 var transferProxy = new WebProxy("http://<proxyaddress>:<proxyport>/", true);
  5.                 transferProxy.Credentials = new NetworkCredential("<username>", "<password>", "<domain>");
  6.                 var transferRequest = WebRequest.Create("http://www.snipplr.com");
  7.                 transferRequest.Proxy = transferProxy;
  8.                 HttpWebResponse transferResponse = (HttpWebResponse)transferRequest.GetResponse();
  9.                 System.IO.Stream outputStream = transferResponse.GetResponseStream();
  10.                 System.Text.Encoding outputEncoding = System.Text.Encoding.GetEncoding("utf-8");
  11.                 System.IO.StreamReader outputReader = new System.IO.StreamReader(outputStream, outputEncoding);
  12.                 char[] chars = new Char[256];
  13.                 int readCount = outputReader.Read(chars, 0, 256);
  14.                 int totalRead = readCount;
  15.                 while(readCount > 0)
  16.                 {
  17.                     string str = new String(chars, 0, 256);
  18.                     result.Append(str);
  19.                     readCount = outputReader.Read(chars, 0, 256);
  20.                 }
  21.                 transferResponse.Close();
  22.                 outputStream.Close();
  23.                 outputReader.Close();
  24.             }
  25.             catch(Exception ex)
  26.             {
  27.                 string str = ex.Message;
  28.             }
  29.             StreamWriter fileOut = new StreamWriter("testProxy.txt");
  30.             fileOut.WriteLine(result.ToString());
  31.             fileOut.Close();
Title: Re: Source Code / Code Snippet Manager
Post by: wraith808 on June 29, 2009, 02:04 PM
I did a bit more investigation, and was able to get it to work with custom proxy servers.  I did need to enter the domain; I just used my Active Directory Domain root, and it started working.  The default proxy servers still does not work.  I'm doing a bit of looking around- it's a pretty slick app so far!   :Thmbsup:
Title: Re: Source Code / Code Snippet Manager
Post by: kartal on March 28, 2010, 12:12 AM
.
Why don't try my DTT (Developer's Tips & Tricks)?  It's free...  :)

Free download from: DTT page (http://fsl.sytes.net/dtt.html)

Best regards,
FSL

Hey this works under Linux under Wine as well :) And it seems like there is drag and drop now
Title: Re: Source Code / Code Snippet Manager
Post by: robinsiebler on April 27, 2010, 07:23 PM
Here is one that is free, simple and portable - CodeBank (http://www.zeraha.org/file.1.html)
Title: Re: Source Code / Code Snippet Manager
Post by: mouser on April 28, 2010, 03:50 PM
The CodeBank author (Nikola Dachev) looks like he has created a few nice programs: http://www.zeraha.org/
Title: Re: Source Code / Code Snippet Manager
Post by: iphigenie on April 29, 2010, 10:07 AM
I need to try the programs in this thread

Back in the 90s I registered a neat program called webgal - it was a snippet manager organised by context, for web development. It could even contain media, so your frequently used graphics tricks could be stored with image. I tried reinstalling but i cant get the registration to work and spidersoft no longer does webgal...

Anyway, recently bought clipcache to see if i can use it for that, but will try these tools here too