Popular recipes tagged "snippet"http://code.activestate.com/recipes/tags/snippet/popular/2015-09-18T15:04:09-07:00ActiveState Code Recipes10 lines for a beginner to try out the Spyder IDE for python programming (Python)
2015-09-18T15:04:09-07:00mai3ahttp://code.activestate.com/recipes/users/4192857/http://code.activestate.com/recipes/579100-10-lines-for-a-beginner-to-try-out-the-spyder-ide-/
<p style="color: grey">
Python
recipe 579100
by <a href="/recipes/users/4192857/">mai3a</a>
(<a href="/recipes/tags/error/">error</a>, <a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/spyder/">spyder</a>, <a href="/recipes/tags/stuffthatworks/">stuffthatworks</a>).
</p>
<p>This python code generates no lint errors and just print out a few numbers.</p>
<p>Useful if you use the Spyder IDE for the first time, which provides NOTHING to get you started.</p>
A Template for Crash-Resistant Toggle-Macros (JavaScript)
2010-10-07T00:51:42-07:00Eric Promislowhttp://code.activestate.com/recipes/users/4166930/http://code.activestate.com/recipes/577418-a-template-for-crash-resistant-toggle-macros/
<p style="color: grey">
JavaScript
recipe 577418
by <a href="/recipes/users/4166930/">Eric Promislow</a>
(<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/template/">template</a>).
</p>
<p>If you've followed my postings here lately (<a href="http://code.activestate.com/recipes/users/4166930/" rel="nofollow">http://code.activestate.com/recipes/users/4166930/</a>), you'll see that I've been playing with what I call "toggle macros", macros that toggle a state on and off, with different behaviors for each state. Unfortunately I found that it was easy to get Komodo to crash on shutdown. Meanwhile I wanted to build a framework to make it easier to build these.</p>
<p>This recipe accomplishes both. It looks like putting a listener on a view object can trigger this crash, but so can storing a method on a view object, even with a unique name.
So while I wanted to use the "view.view_closing" event, I can't, and I notice no other core Komodo code is. The template instead uses a global hash, ko.extensions.togglers,
to store the code objects. And now I'm not getting a crash.</p>
Komodo Snippet Wrapper macro (JavaScript)
2011-05-25T20:52:56-07:00Jeff Griffithshttp://code.activestate.com/recipes/users/835605/http://code.activestate.com/recipes/577168-komodo-snippet-wrapper-macro/
<p style="color: grey">
JavaScript
recipe 577168
by <a href="/recipes/users/835605/">Jeff Griffiths</a>
(<a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/toolbox/">toolbox</a>).
</p>
<p>A simple Macro that wraps the current selection in a code block supplied by the requested snippet.</p>
JasperServer.cgi. It works (Python)
2009-11-28T10:34:40-08:00Martchenkohttp://code.activestate.com/recipes/users/4172446/http://code.activestate.com/recipes/576970-jasperservercgi-it-works/
<p style="color: grey">
Python
recipe 576970
by <a href="/recipes/users/4172446/">Martchenko</a>
(<a href="/recipes/tags/cgi/">cgi</a>, <a href="/recipes/tags/jasperreports/">jasperreports</a>, <a href="/recipes/tags/snippet/">snippet</a>).
Revision 2.
</p>
<p>running jasperreports over pythons CGI</p>
code snippets (C)
2009-08-17T18:10:19-07:00J Yhttp://code.activestate.com/recipes/users/4170398/http://code.activestate.com/recipes/576856-code-snippets/
<p style="color: grey">
C
recipe 576856
by <a href="/recipes/users/4170398/">J Y</a>
(<a href="/recipes/tags/snippet/">snippet</a>, <a href="/recipes/tags/struct_tm/">struct_tm</a>).
Revision 3.
</p>
<p>code snippets</p>