code-snippets

Is there a way to embed on code snippet into another?

Let's assume that I have snippet A snippet B where snippet A contains snippet B n times with n > 1. Right now I have copied the content of snippet B into snippet A. This has the disadvantage, that whenever I change snippet B, I have to additionally change snippet A. Therefore, my question is whether there is some kind of statemen...

Visual Studio 2010 Snippets - Current Date

I'm making a snippet for a file header in Visual Studio 2010. I want the date to match whenever the snippet was executed. Is this possible? ...

Format Eclipse code snippets for blog publishing?

Visual Studio has a plugin that allows one to copy code from any editor (C#, HTML, XML) and then paste it with HTML formatting that preserves the syntax highlighting, etc. This is very handy for publishing code samples/examples to a wep page/blog. I have seen one old (2006?) plugin for java to html conversion, but are there any broader ...

Quickly sharing temporary snippets between developers

I am looking for a quick way to share code snippets between developers. Visual studio allows you to use a file share as a repository for snippets, but the VS Snippet manager seems more oriented towards "permanent" snippets you want to keep around. I'm just looking for a good way to send a block of code to another developer to look at, ...

Snippet Designer/Editor for Visual Studio 2010

What Editors/Designers for creating Visual Studio 2010 Snippets are there? I would like to be able to put in different replacements (ie spots where the text should be replaced). A low incidence of blocking bugs is also nice. So far the only one I have seen is Snippet Editor 2.1. I am going to dig into it and see how it works, but I d...

Web code re-use, How do you organize your scripts snippets?

In every web project most of the time the code is just being re-use. From the drop-down navigation, Rotating Header to CSS Grids. This process makes your workflow more faster and more efficient. I'm wondering how do people organized those scripts? Where do you store it? How do you break it down into category (javascript,css,php etc.)? so...

How to share bash/shell code snippets taken from command prompt with syntax coloring

Hi there. I'm looking for some way to share code snippets taken directly from command prompt. For example: plinjasa@pllzpc029 ~ $ ls plinjasa@pllzpc029 ~ $ mkdir maindir plinjasa@pllzpc029 ~ $ ls -l total 0 drwxr-xr-x+ 1 plinjasa Domain Users 0 2010-08-26 15:22 maindir plinjasa@pllzpc029 ~ $ cd maindir plinjasa@pllzpc029 ~/maindir ...

Choose File Dialog

Can someone write me a complete choose file dialog? Maybe one where you can filter out all files except for ones with specific extensions? The internet needs such an example. I have not found anything lightweight enough to implement easily into on of my projects. The only other options seem to being using OI FileManger's open intents, bu...

Is there a script to manage/search python snippets which understands python code like nullege.com?

I have a folder full of python snippets and want to search it in a more intelligent way than grep. Is there already a script which parses python snippets to AST and lets you search it, like http://nullege.com? For example, if you have the following code: class InspectionFrame(wx.Frame): def SaveSettings(self, config): w, h ...

mapping already exists for ^I in vim

I have added the following lines to the vimrc file so that i could use s-tab for indenting map <esc>[Z <s-tab> ounmap <esc>[Z After i have added this , i get the following error. I use SnippetsEmu plugin Error detected while processing function <SNR>15_SnipMapKeys: line 10: E227: mapping already exists for ^I How do i solve this ...

Difficulty with Windows Azure Training Kit

I downloaded the Windows Azure Training Kit. I'm using Visual Studio 2010, although I also have VS 2008 on my machine. I ran the downloaded installer, and was directed to an HTML page. I'm doing the "Intro to Windows Azure for VS 2010 Developers" lab. Following instructions, I launched the VS 2010 command prompt, and ran SetupLab.cmd. ...

Can I have a code snippet in VS 2010 where the replacement replaces multiple items.

I have a very simple code snitppet that looks like this: <asp:Label Text="$Name$" runat="server" AssociatedControlID="$txtName$" /> <asp:TextBox runat="server" ID="$txtName$" /> <br /> What I was hoping was that the $txtName$ would be changed in both places, but it doesn't, only the first instance is changed and I can't even tab over ...

Tiny snippet for converting 4 hex characters to an integer in C

I need to parse strings of four hex characters to an integer. The characters appear inside a longer string, and there are no separators - I just know the offset they can be found in. The hex characters are case insensitive. Example with offset 3: "foo10a4bar" -> 4260 I'm looking for a snippet that is Short (too much code always crea...

Grab x number of words before and after a given keyword?

How can I go about grabbing [x] number of words before and after a given keyword in a string in PHP? I am trying to tokenize results from a mysql query tailored to the keyword as a snippet. ...

How to find code-snippets licensed elsewhere in our code-base

Hello all, Over the past year I've developed a sizable software package in collaboration with a few others, that we now want to license properly (lawyers, valorisation and everything). For this to work though we need to be sure no-one inadvertently supplied code licensed elsewhere, for instance by copy-pasting snippets from Open Source ...

.Net4\vs2010 versions of c# snippets

Does anyone know if there are 'extra' .Net4\vs2010 versions of c# snippets like there was for vs05 version (http://msdn.microsoft.com/en-us/vstudio/aa718338.aspx or as mentioned here)? I know I can import the 05 versions, or create my own, but wonder if there updated ones that use the newer .Net 4 (or I guess 3.x) features. ...

Useful list of visual studio 2010 C# intellisense code snippets

I'm seeking a list of C# code snippets that would make our work faster inside visual studio 2010. PS. I'm talking about code snippets in visual studio as the extension. Ctrl+K, Ctrl+X, to access code snippets.... For example, I saw one in a screen cast where the guy typed 'pi' and pressed some other button. The snippet created this for...

Code Snippet in a Collapsed region.

I am trying to add a code snippet and I want this code to appear in a region. So I tried something like this in the snippet file. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"&gt; <CodeSnippet Format="1.0.0"> <Header> <Title> rg Code Snippet for Region </Title> ...

visualstudio 2010 VB.NET customizing the code automatically displayed when I write New

When in a code editor I write Sub New (enter) The editor automatically inserts: Sub New() ' This call is required by the designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. End Sub How can I customize the code it writes? Can't find it in the code snippets manager. ...

Gedit xml snippets problem.

Hello guys, I am trying to add some good php snippets for all the functions available on the online reference and I just finished writing a script to automate that task ( and it's still loading and making me the xml files for snippets ) but there is a problem with the generated snippets xml files that I can't figure out. Whenever I add o...