<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Next Door Hacker &#187; git</title>
	<atom:link href="http://www.nextdoorhacker.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nextdoorhacker.com</link>
	<description>I&#039;m just your friendly neighborhood hacker</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Removing editor swap files before commits in git</title>
		<link>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/</link>
		<comments>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 01:07:03 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/</guid>
		<description><![CDATA[I use git a lot. And I use just about any text editor in my system to edit files. And they tend to come with baggages of their own. Albeit useful, the swap files tend to linger on and eventually end up in my git repository. Here&#8217;s how to avoid that scenario.
Git (okay I remember [...]]]></description>
			<content:encoded><![CDATA[<p>I use git a lot. And I use just about any text editor in my system to edit files. And they tend to come with baggages of their own. Albeit useful, the swap files tend to linger on and eventually end up in my git repository. Here&#8217;s how to avoid that scenario.<br />
Git (okay I remember this from doing the same thing in subversion, so nothing new) has something called pre-commit. Pre-commit is just a script/action you can perform on the repository before committing. So, here&#8217;s what you need to do<br />
I&#8217;ll use vim here, but use whatever you like<br />
$ vim .git/hooks/pre-commit<br />
and put this:<br />
#!/bin/sh<br />
find . -name &#8216;*~&#8217; -exec rm \;<br />
find . -name &#8216;*.swp&#8217; -exec rm \;</p>
<p>This removes two types of files, those generated by vim and gedit. There should be a much more elegant way to include more file types, I&#8217;ll update them as I refine my pre-commit hook more. <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2010/01/removing-editor-swap-files-before-commits-in-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>EclipseMonkey hacking</title>
		<link>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/</link>
		<comments>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/#comments</comments>
		<pubDate>Sun, 03 May 2009 07:10:40 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[eclipsemonkey]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=95</guid>
		<description><![CDATA[I&#8217;d been wanting to do some programming with eclipse itself. However, writing a full blown plugin for something rather simple is not exactly fun. Then I discovered Eclipse Monkey a few days back. I decided to give it a run when I came across a simple problem of commenting a specific method in my code. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d been wanting to do some programming with eclipse itself. However, writing a full blown plugin for something rather simple is not exactly fun. Then I discovered Eclipse Monkey a few days back. I decided to give it a run when I came across a simple problem of commenting a specific method in my code. Yes, this is very useless but a good start IMO. <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So, here&#8217;s my first experience with Eclipse Monkey:<br />
This example just comments lines with stall function. Yeah kinda lame, but okay for a first shot IMO<br />
In the meantime, checkout <a href="https://github.com/prasincs/eclipsemonkey-scripts/tree ">https://github.com/prasincs/eclipsemonkey-scripts/tree </a></p>
<p>where I&#8217;ll be posting more of these eclipsemonkey scripts</p>
<pre class="brush: js;">
/*
* Menu: Editors &gt; Comment Stalls
* Kudos: Prasanna Gautam
* License: EPL 1.0
* DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript
* OnLoad: main()
*/
var comment = &quot;//&quot;;
function main(){
var sourceEditor = editors.activeEditor;

var valid = true;

// make sure we have an editor
if (sourceEditor === undefined) {
valid = false;
showError(&quot;No active editor&quot;);
}

if (valid){
var newSource = &quot;&quot;;
var source = sourceEditor.source;
var parts = source.split('\n');
for (var i = 0; i&lt; parts.length; i++){
if(match=parts[i].match(/^((?:\s+)?stall.+)/)){
newSource +=&quot;// &quot;;
}
newSource += parts[i] +&quot;\n&quot;;
}
sourceEditor.applyEdit(0,source.length, newSource);
}
}
</pre>
<p>For more info on Eclipse Monkey, visit:<br />
http://aptana.com/monkey/</p>
<p><strong>Update:</strong></p>
<p>Sorry for posting code from wrong file (one of the example ones)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
