<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Bob Belderbos</title>
	
	<link>http://bobbelderbos.com</link>
	<description>Software Developer</description>
	<lastBuildDate>Wed, 15 May 2013 20:53:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bbelderbos" /><feedburner:info uri="bbelderbos" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>bbelderbos</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Some shell tricks for more efficient command line use</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/Pw8lPXz6TS8/</link>
		<comments>http://bobbelderbos.com/2013/05/be-more-productive-with-unix-shell/#comments</comments>
		<pubDate>Wed, 15 May 2013 20:34:23 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Shell scripting]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2388</guid>
		<description><![CDATA[In this post some Shell / Unix techniques I use over and over again to be more efficient at the command line. Aliases (.bashrc) save time. When I type &#8220;lt&#8221;, shell runs &#8220;ls -lrth&#8221;, &#8220;ht&#8221; lets me go to &#8220;/Applications/XAMPP/htdocs&#8221;. All those seconds add up over time. Stay in the same terminal, putting programs in &#8230;]]></description>
				<content:encoded><![CDATA[<p> In this post some Shell / Unix techniques I use over and over again to be more efficient at the command line.</p>
<p><span id="more-2388"></span></p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<ul>
<li> Aliases (.bashrc) save time. When I type &#8220;lt&#8221;, shell runs &#8220;ls -lrth&#8221;, &#8220;ht&#8221; lets me go to &#8220;/Applications/XAMPP/htdocs&#8221;. All those seconds add up over time. </li>
<li> Stay in the same terminal, putting programs in the background. I use this often in Vim: ctrl-z to suspend Vim, do stuff at the command line, go back to Vim with &#8220;fg&#8221; (when suspending > 1 process, use &#8220;jobs&#8221; and fg #number to toggle between them)</li>
<li> Diff two command outputs without creating files. For example, taking out the &#8220;title&#8221; of one of my pages I could do a diff between the local version and the remote site: </li>
<pre>
$ diff &lt;(cat header.php) &lt;(ssh bob &#39;cat ~/public_html/fbreadinglist/header.php&#39;)
42a43
&gt;   &lt;title&gt;&lt;?php  echo $title; ?&gt;&lt;/title&gt;
</pre>
<p>In  the parenthesis (subshell) can go any command, quite a powerful technique.</p>
<li> I use sed daily to search and replace patterns from the command line, but its regex engine is archaic: you have to escape capturing parenthesis (), you don&#8217;t have +, {}, non-greediness (*?). You can achieve a richer regex engine by using a perl oneliner with: perl -pe &#8216;s/pattern/replace/g&#8217;. So same syntax but replacing &#8220;sed&#8221; with &#8220;perl -pe&#8221;. This is a great alternative to have when text parsing from the command line gets more complicated.</li>
<li> Search history: press Ctrl-R and you get (reverse-i-search)`&#8217;: -> here you can type a string to search through your shell history. This saves a lot of time compared to hitting many times the up-key.</li>
<li> Navigation: use &#8220;cd -&#8221; to go to the previous directory (like a back button). If I need to sidetrack, I type bash to do work in a new shell, when exiting this new shell, I can continue where I left.</li>
<li> &#8220;set -e&#8221; in a shell script will cause it to die inmediately when any command does not return 0 (= ok status). This is useful to spot errors soon and not continue with bad assumptions.</li>
<li> Execute in combination with find: change permission on all 664 files to 664: $ find . -perm 644 -exec chmod 664 {} \; </li>
<p>Another example is to recursively search project files for &#8220;todo&#8221; actions: $ find . -name &#8216;*.py&#8217; -exec grep -inH &#8220;todo&#8221; {} \;</p>
<p>A variant on this is the use of xargs which reads items from pipes / stdin: $ find *py |xargs grep -l todo 2>/dev/null</p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<li> Command substitution: same as last example but with a for loop and using this technique: $ for i in $(find . -perm 644); do chmod 664 $i; done</li>
<p>In the () can go any command, I use this often to loop over a the output of a command or script.</p>
<li> Brace expansion allows you to quickly copy files: $ cp file{,.org}</li>
<li> Sometimes the &#8220;ls&#8221; command is too verbose, to see only subdirectories use the -d switch: $ ls -d */</li>
<li> Use shortcuts to move around on the command line. You can set bash in emacs or vi mode, see <a href="http://www.hypexr.org/bash_tutorial.php" target="_blank">here</a>. I use ctrl+a/e/u/l the most to respectively go to start/end line, delete all before cursor, and to clear the screen. </li>
<li> Change you prompt. Mine: PS1=&#8217;[\u@\h \W$(__git_ps1 " (%s)")]\$ &#8216; == [bbelderbos@Bob-Belderboss-MacBook-Pro posts (master)]$</li>
<p> Note that I use <a href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh" target="_blank">git-prompt.sh</a> to show the current git branch in my prompt.</p>
<li> Useful to know about mkdir: the -m lets you specify the permissions of the dir: $ mkdir -m 777 dir_with_777_perms ; the -p option lets you create directory trees: $ mkdir -p /deep/file/tree/level4/level5/level6</li>
<li> No cat is needed for grep:</li>
<pre>
# extra process
$ cat tmp/a/longfile.txt | grep string 
#&Acirc;&nbsp;this is better / faster
$ grep string tmp/a/longfile.txt
</pre>
<li> Redirect stderr to stdout is easy: add 2>&#038;1 to your command: $ find / -name foo 2>&#038;1</li>
</ul>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>What are your favourite Shell / Unix tricks?</h3>
<p>Of course the tips above are just a fraction of what is possible. Please share your time-savers in the comments below &#8230;</p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/Pw8lPXz6TS8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/05/be-more-productive-with-unix-shell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/05/be-more-productive-with-unix-shell/</feedburner:origLink></item>
		<item>
		<title>Fundamental SSH tricks when working across multiple hosts</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/glqsHZ1qv5k/</link>
		<comments>http://bobbelderbos.com/2013/05/ssh-tricks-remote-servers/#comments</comments>
		<pubDate>Sun, 12 May 2013 10:33:23 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh-copy-id]]></category>
		<category><![CDATA[ssh-keygen]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2381</guid>
		<description><![CDATA[Time to note down some SSH tricks. Vim, Git, Unix, SSH! All very efficient when you spend some time learning the ins and outs. Key-based login It is hard to keep up with many hostnames and passwords so first thing to set up is a key-based login. First run ssh-keygen -t dsa and then ssh-copy-id &#8230;]]></description>
				<content:encoded><![CDATA[<p>Time to note down some SSH tricks. Vim, Git, Unix, SSH! All very efficient when you spend some time learning the ins and outs.</p>
<p><span id="more-2381"></span></p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>Key-based login</h3>
<p>It is hard to keep up with many hostnames and passwords so first thing to set up is a <a href="http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/" target="_blank">key-based login</a>. First run ssh-keygen -t dsa and then <a href="http://linux.die.net/man/1/ssh-copy-id" target="_blank">ssh-copy-id</a> (if not present check out this <a href="http://www.ipreferjim.com/2011/07/hostgator-ssh-warns-too-many-authentication-failures/" target="_blank">one-liner</a>)</p>
<h3>The power of ~/.ssh/config</h3>
<p><a href="http://linux.die.net/man/5/ssh_config" target="_blank">Man</a>. Check out this <a href="http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/" target="_blank">nice intro</a>. Using this file is more convenient than shell aliases. I even used this file to solve a mysterious &#8220;Too many authentication failures for [user]&#8221; which happened (ssh -v) when multiple keys were offered to the remote host!</p>
<h3>X11 forwarding</h3>
<p>Run ssh -X host to show remote X applications on your local screen (if X is running on your local machine)</p>
<h3>Run commands on a remote server</h3>
<p>ssh user@remote_host &#8216;cmd&#8217; &#8211; this is a powerful way to quickly analyze data on different hosts without the burden of logging in and copying terminal output. See a nice <a href="http://www.linuxjournal.com/article/6602?page=0,2" target="_blank">Perl loop example</a>.</p>
<h3>Pipe data from/to a remote system</h3>
<p>One of my favorites: see <a href="http://www.symkat.com/ssh-tips-and-tricks-you-need" target="_blank">this post</a> for two powerful examples:</p>
<ul>
<li> 1. send a big directory to a another server compressing / uncompressing it via the pipe-to-ssh: </li>
<p> $ tar -cz content | ssh user@remote_host &#8216;tar -xz&#8217;</p>
<p> The other way around works just as well to get files off a remote server: $ ssh remote_host tar c content/ | tar xv</p>
<li> 2. backup a remote mysql database to STDOUT and receive it via pipe/SSH as STDIN to import it into a local DB: </li>
<p> $ ssh user@remote_host &#8216;mysqldump -udbuser -ppassword dbname&#8217; | mysql -uroot -ppassword backup</p>
<h3>Mount a remote directory</h3>
<p> $ sshfs user@remote_host:/home/user/documents local_folder/ &#8211; see this <a href="http://www.itworld.com/it-managementstrategy/261500/16-ultimate-openssh-hacks?page=0,1" target="_blank">ssh hacks post</a>.</p>
<h3>Practical example</h3>
<p> This just happened trying to convert this post from text to html:</p>
<pre>
$ perl parsepost.pl 2013.05.12_ssh_tricks.txt 
Can&#39;t locate HTML/Entities.pm in @INC ...
</pre>
<p> Instead of fixing it right away I took the opportunity to try a quick workaround via ssh:</p>
<pre>
# cat the txt post to STDOUT,
# via pipe/ssh to remote server it goes into perl script as STDIN (-), 
# the result is redirected to a file on my local server,
# note that I can do &quot;ssh bob&quot; thanks to my .ssh/config setup ;)
$ cat 2013.05.12_ssh_tricks.txt | ssh bob &lt;path&gt;/perl/wordpress_parse_post.pl - &gt; 2013.05.12_ssh_tricks.html
</pre>
<h3>Only the beginning</h3>
<p> Forwarding, tunneling, proxies, access to services through a firewall &#8230;  much more is possible. Check out <a href="http://matt.might.net/articles/ssh-hacks/" target="_blank">SSH: More than secure shell</a> for other SSH use cases.</p>
<h3>Your favorite SSH trick/ hack?</h3>
<p> Feel free to comment below &#8230;</p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like> </p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/glqsHZ1qv5k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/05/ssh-tricks-remote-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/05/ssh-tricks-remote-servers/</feedburner:origLink></item>
		<item>
		<title>Mastering Git: 5 useful tips to increase your skills</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/FpJVe4t_b5I/</link>
		<comments>http://bobbelderbos.com/2013/03/master-intermediate-git-operations/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 17:00:00 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Software development]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitk]]></category>
		<category><![CDATA[rebase]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[stash]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2374</guid>
		<description><![CDATA[A little over a year ago I wrote my first post on git with some basics. I just started using it and since then I never looked back. A follow-up post of some more basic to intermediate Git operations &#8230; Git has definitely saved me a lot of time and gave my projects much better &#8230;]]></description>
				<content:encoded><![CDATA[<p> A little over a year ago I wrote <a href="http://bobbelderbos.com/2012/02/git-in-a-nutshell/" target="_blank">my first post on git</a> with some basics. I just started using it and since then I never looked back. A follow-up post of some more basic to intermediate Git operations &#8230;</p>
<p><span id="more-2374"></span></p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<p>Git has definitely saved me a lot of time and gave my projects much better structure (you become better at committing (smaller) chunks of code!). I am also not afraid anymore to make changes, which leads to more freedom when coding. In this article, some random things I learned, in a couple of months I will follow up with an &#8220;advanced Git&#8221; post &#8230;</p>
<h3>Branching</h3>
<p> Braches are cheap (<a href="http://git-scm.com/book/ch3-1.html" target="_blank">41 bytes</a>), and it is very convenient to work on bugs, new features, try out ideas in isolation (without touching the main branch aka master).</p>
<p> So first thing I now do when working on something non-trivial:</p>
<pre>
$ git checkout -b new_branch_name
</pre>
<p> Which creates and puts you on the new branch at once (longer version: $ git branch new_branch_name &#038;&#038; git checkout new_branch_name). To merge? Simple:</p>
<pre>
# go to receiver branch
#&nbsp;any changes on branch you come from need to be committed
$ git checkout master 
# fold the branch in if happy with changes
$ git merge new_branch_name
</pre>
<p>Best is to merge often, the longer you diverge from master, the more likely you have to solve merge conflicts.</p>
<h3>Rebasing</h3>
<p> Today <a href="http://shop.oreilly.com/product/0636920017462.do" target="_blank">I learned</a> about a new concept: <a href="http://git-scm.com/book/en/Git-Branching-Rebasing" target="_blank">rebasing</a>. This basically allows you to clean up history: you can make it appear that all work happened in series, even though it originally happened in parallel. I also understand it allows you to move branches forward in time so that they stay closer to master.</p>
<p>!! Note that you want to do this on local commits only, because you effectively are changing history, don&#8217;t do this on code that has been shared (pushed to the remote repo). Now that I branch more often, I can see me using this feature &#8230;</p>
<h3>Undo commands</h3>
<p> Again, something to do before pushing code to a team, but to correct your last commit, easy:</p>
<pre>
$ git commit --amend
</pre>
<p> This not only lets you change your commit message, it also allows you to add new files (git add .) which then will be committed into the last commit you are amending.</p>
<p> Sometimes you are not happy with commits before the last one; &#8211;amend cannot help you there, but git reset does. You want to be cautious with this command though:</p>
<pre>
# undo commit, but keep files in changed state
$ git reset --soft tree-ish (e.g. HEAD^) 
#&nbsp;undo commit and also delete the changes, as if the change(s) never happened
$ git reset --hard tree-ish (e.g. HEAD^)

# example wiping out last commit: 
$ git log -2
commit d4d479a6121d6757dfcf49795dc0d7134be474f6
..
    test commit

commit 60cbc505273e6f583f347844069106fb1ffde5eb
..

$ git reset --hard HEAD^
HEAD is now at 60cbc50 make an extra div for flexible content under the video
$ git status
# On branch new_feature
nothing to commit (working directory clean)
</pre>
<p> See <a href="http://stackoverflow.com/questions/927358/how-to-undo-the-last-git-commit" target="_blank">here</a> for a good explanation of the different switches of git reset.</p>
<p> Also handy: to revert uncommited changes just do :</p>
<pre>
$ git checkout -- file(s)
</pre>
<p> &#8230; and the changes on the file(s) are cancelled. About <a href="http://git-scm.com/book/ch2-4.html" target="_blank">undoing in git</a>.</p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>Useful tools</h3>
<p> There are a lot, just a few handy things I learned in the tool&#8217;s space:</p>
<ul>
<li> Visualization of git history: check out <a href="http://stackoverflow.com/questions/1570535/guide-to-understanding-gitk" target="_blank">gitk</a>, or create the following alias to graphically see branches etc in the log: </li>
<pre>
$ git config --global --add alias.lol &quot;log --graph --decorate --pretty=oneline --abbrev-commit --all&quot;
</pre>
<li> Learn to use a <a href="http://bobbelderbos.com/2012/03/push-code-remote-web-server-git/" target="_blank">bare repo</a>. Some time ago I made <a href="http://bobbelderbos.com/2012/07/simple-bash-script-to-clone-remote-git-repositories/" target="_blank">a script</a> that saves time creating remotes on my hosting server.</li>
<li> Use <a href="http://git-scm.com/book/en/Git-Basics-Tips-and-Tricks" target="_blank">autocomplete</a> and show the current branch in your <a href="https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh" target="_blank">shell prompt</a>. Configure the following in your shell init file:</li>
<pre>
#&nbsp;from .bashrc
..
source ~/.git-completion.bash
source ~/.git-prompt.sh
PS1=&#39;[\u@\h \W$(__git_ps1 &quot; (%s)&quot;)]\$ &#39; 

#&nbsp;prompt now shows active branch
[bbelderbos@Bob-Belderboss-MacBook-Pro youtube_feed (master)]$ git checkout -b new_feature
Switched to a new branch &#39;new_feature&#39;
[bbelderbos@Bob-Belderboss-MacBook-Pro youtube_feed (new_feature)]$ 
</pre>
<li> <a href="http://git-scm.com/book/en/Git-Tools-Stashing" target="_blank">Stashing</a> allows you to store some edits to a stack when you&#8217;re not ready to commit them and you need to move branches for example (git doesn&#8217;t allow to switch branch when there are pending changes):</li>
<pre>
$ git status 
#&nbsp;dirty files
$ git stash save
$ git status #&nbsp;= clean
$ git checkout other_branch # pending changes would abort this command, now I can
$ git stash apply stash@{0} # use &quot;pop&quot; to wipe it out of the stack
$ git status #&nbsp;change now shows up in the destination branch I am on
</pre>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>File changes in >1 commits:</h3>
<pre>
$ git add -p
</pre>
<p> This is a form of interactive committing, by showing hunks of the file (-p stands for &#8211;patch mode) that you can add to the commit or not. Below an example. I actually heard about this feature today, and I just tested it writing this blog. The great thing about Git (and Vim for that matter) is the easiness to test out things which give you direct feedback. As you get handier with the commands you see it is easy to undo anything, understanding a small subset of git commands and you can test things out without making a mess, besides, it is hard to really loose work in Git &#8230;</p>
<pre>
# making two edits to style.css
# 1. adding padding to body
#&nbsp;2. increasing font-size of p
$ git diff 
diff --git a/style.css b/style.css
..
@@ -2,6 +2,7 @@ body {
..
+  padding: 5px;
 }
..
+p {
+  font-size: 1.1em;
+}
 
# add file in --patch / interactive mode, note the &quot;Stage this hunk&quot; questions
# I only stage the first change
$ git add -p
diff --git a/style.css b/style.css
index 88a2b04..13a1311 100644
--- a/style.css
+++ b/style.css
@@ -2,6 +2,7 @@ body {
   font : 75%/1.5 &quot;Lucida Grande&quot;, Helvetica, &quot;Lucida Sans Unicode&quot;, Arial, Verdana, sans-serif;
   color:#000; background-color: #f2f2f2;  
   margin: 0 5px;
+  padding: 5px;
 }
 a {
   color: #900;
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y
@@ -80,4 +81,7 @@ span.inactive {
   padding: 2px 6px 2px 6px;
   cursor: default;
 }
+p {
+  font-size: 1.1em;
+}
 
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? n

# gs is a bash alias for &quot;git status&quot;
$ gs
..
..
# modified:   style.css

# first commit (with 1 of the 2 changes)
$ git commit -m &quot;added padding&quot;
[new_feature 95c7c53] added padding
 1 file changed, 1 insertion(+)

#&nbsp;left is the second change (which was not staged with the first commit)
$ git diff style.css
diff --git a/style.css b/style.css
index c0a0a96..13a1311 100644
--- a/style.css
+++ b/style.css
@@ -81,4 +81,7 @@ span.inactive {
   padding: 2px 6px 2px 6px;
   cursor: default;
 }
+p {
+  font-size: 1.1em;
+}

# adding the 2nd change 
$ git add .
$ git commit -m &quot;increased font-size&quot;
[new_feature 809e00a] increased font-size
 1 file changed, 3 insertions(+)

# changes have gone in two commits
$ git  diff HEAD^..HEAD
diff --git a/style.css b/style.css
index c0a0a96..13a1311 100644
--- a/style.css
+++ b/style.css
@@ -81,4 +81,7 @@ span.inactive {
   padding: 2px 6px 2px 6px;
   cursor: default;
 }
+p {
+  font-size: 1.1em;
+}
 
$ git  diff HEAD^^..HEAD^
diff --git a/style.css b/style.css
index 88a2b04..c0a0a96 100644
--- a/style.css
+++ b/style.css
@@ -2,6 +2,7 @@ body {
   font : 75%/1.5 &quot;Lucida Grande&quot;, Helvetica, &quot;Lucida Sans Unicode&quot;, Arial, Verdana, sans-serif;
   color:#000; background-color: #f2f2f2;  
   margin: 0 5px;
+  padding: 5px;
 }
 a {
   color: #900;
</pre>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>Git is a huge subject</h3>
<p> &#8230; and learning more of it pays off: it saves time and you can improve software quality by making smart commits, isolate work in branches, etc. </p>
<p> It is also a generic skill: you can use it for any project, be it Javascript, PHP, C++, Python, or whatever changes you want to keep track of: a blog, or if you write a book.</p>
<p>I hope this rather random selection of tips has been useful, what other git operations do you often use to improve / speed up your work flow?</p>
<pre>
$ git add 2013.03.24_git_intermediate.txt
$ git commit -m &quot;git post done&quot;
</pre>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/FpJVe4t_b5I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/03/master-intermediate-git-operations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/03/master-intermediate-git-operations/</feedburner:origLink></item>
		<item>
		<title>Twitter Digest – January / February 2013</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/awsDe0uptYo/</link>
		<comments>http://bobbelderbos.com/2013/03/twitter-digest-january-february-2013/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 19:29:26 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tweet digest]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2370</guid>
		<description><![CDATA[#agile #amazon #api #books #css #facebook #firefox #fonts #gcli #git #github #google #hacker #instagram #javascript #jquery #mac #movies #phone #php #productivity #programming #python #reading #responsive #scripting #spanishtv #theme #tools #twitter #ubuntu #vim #web #webdesign #wordpress nettuts &#8211; Team Collaboration With #Github http://t.co/WhlHjB58Dj — Bob Belderbos (@bbelderbos) February 28, 2013 @mor10 thanks for your awesome Anaximander &#8230;]]></description>
				<content:encoded><![CDATA[<p>#agile #amazon #api #books #css #facebook #firefox #fonts #gcli #git #github #google #hacker #instagram #javascript #jquery #mac #movies #phone #php #productivity #programming #python #reading #responsive #scripting #spanishtv #theme #tools #twitter #ubuntu #vim #web #webdesign #wordpress<br />
<span id="more-2370"></span></p>
<blockquote class="twitter-tweet"><p>nettuts &#8211; Team Collaboration With <a href="https://twitter.com/search/#Github" target="_blank">#Github</a> <a href="http://t.co/WhlHjB58Dj" title="http://t.co/WhlHjB58Dj" target="_blank">http://t.co/WhlHjB58Dj</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307263254089048065" data-datetime="2013-02-28T22:57:23+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/@mor10" target="_blank">@mor10</a> thanks for your awesome Anaximander theme, I liked it so much I applied it to my blog. I also learned a lot from your lynda course.</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307256414810824706" data-datetime="2013-02-28T22:30:12+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Website re-design: making it fully responsive &#8211; <a href="http://t.co/u8F2LBVuRu" title="http://t.co/u8F2LBVuRu" target="_blank">http://t.co/u8F2LBVuRu</a> <a href="https://twitter.com/search/#WebDesign" target="_blank">#WebDesign</a> <a href="https://twitter.com/search/#Wordpress" target="_blank">#Wordpress</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307250808007847936" data-datetime="2013-02-28T22:07:55+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Why 2013 Is the Year of <a href="https://twitter.com/search/#Responsive" target="_blank">#Responsive</a> <a href="https://twitter.com/search/#Web" target="_blank">#Web</a> Design <a href="http://t.co/QKvP8WQWPW" title="http://t.co/QKvP8WQWPW" target="_blank">http://t.co/QKvP8WQWPW</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307232440768921600" data-datetime="2013-02-28T20:54:56+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>interesting, a journalist journey into learning to code from scratch in 1 year with code academy <a href="http://t.co/6vKW9vzEKc" title="http://t.co/6vKW9vzEKc" target="_blank">http://t.co/6vKW9vzEKc</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307230133843001344" data-datetime="2013-02-28T20:45:46+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#agile" target="_blank">#agile</a> best practices by code school <a href="http://t.co/L43IkWCV2q" title="http://t.co/L43IkWCV2q" target="_blank">http://t.co/L43IkWCV2q</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/307230023406977024" data-datetime="2013-02-28T20:45:20+00:00">February 28, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@python_fun:" target="_blank">@python_fun:</a> Django 1.5 released: Django 1.5 introduces support for a configurable User model. The basic Django User model &#8230; <a href="http:/" title="http:/" target="_blank">http:/</a> &#8230;</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306876543123202048" data-datetime="2013-02-27T21:20:44+00:00">February 27, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@mashable:" target="_blank">@mashable:</a> 9 Apps Built by Self-Taught Coders <a href="http://t.co/vK1AianTfa" title="http://t.co/vK1AianTfa" target="_blank">http://t.co/vK1AianTfa</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306876406657339394" data-datetime="2013-02-27T21:20:11+00:00">February 27, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Practical Programming (2nd edition): An Introduction to Computer Science Using Python 3 <a href="http://t.co/tst4nYulRv" title="http://t.co/tst4nYulRv" target="_blank">http://t.co/tst4nYulRv</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306874044320460800" data-datetime="2013-02-27T21:10:48+00:00">February 27, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>My site is now fully responsive &#8230; It looks cool on desktop, ipad, iphone etc <a href="http://t.co/qdTjrhefFS" title="http://t.co/qdTjrhefFS" target="_blank">http://t.co/qdTjrhefFS</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306499831348744192" data-datetime="2013-02-26T20:23:48+00:00">February 26, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Toggle auto-indenting for code paste <a href="https://twitter.com/search/#vim" target="_blank">#vim</a> tricks <a href="http://t.co/uJVKXEh2cC" title="http://t.co/uJVKXEh2cC" target="_blank">http://t.co/uJVKXEh2cC</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306123286268489728" data-datetime="2013-02-25T19:27:33+00:00">February 25, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>very good course on <a href="https://twitter.com/search/#wordpress" target="_blank">#wordpress</a> <a href="https://twitter.com/search/#responsive" target="_blank">#responsive</a> <a href="https://twitter.com/search/#theme" target="_blank">#theme</a> design <a href="http://t.co/bpb9n88iaR" title="http://t.co/bpb9n88iaR" target="_blank">http://t.co/bpb9n88iaR</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/306115282005524480" data-datetime="2013-02-25T18:55:45+00:00">February 25, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#css" target="_blank">#css</a> reference <a href="https://t.co/uexhw3T7ku" title="https://t.co/uexhw3T7ku" target="_blank">https://t.co/uexhw3T7ku</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/305624364903198720" data-datetime="2013-02-24T10:25:01+00:00">February 24, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>smashing magazine has an awesome <a href="https://twitter.com/search/#responsive" target="_blank">#responsive</a> design <a href="http://t.co/GEaK5uLuda" title="http://t.co/GEaK5uLuda" target="_blank">http://t.co/GEaK5uLuda</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/305560239321796608" data-datetime="2013-02-24T06:10:12+00:00">February 24, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Web design trends 2013 &#8211; interesting features <a href="http://t.co/LC6l8Hy4Ro" title="http://t.co/LC6l8Hy4Ro" target="_blank">http://t.co/LC6l8Hy4Ro</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/305436895553413121" data-datetime="2013-02-23T22:00:05+00:00">February 23, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> Good sleep, good learning, good life <a href="http://t.co/gHC23ozp" title="http://t.co/gHC23ozp" target="_blank">http://t.co/gHC23ozp</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/305102212017831936" data-datetime="2013-02-22T23:50:10+00:00">February 22, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>The third option <a href="http://t.co/aeisRIgYPe" title="http://t.co/aeisRIgYPe" target="_blank">http://t.co/aeisRIgYPe</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/304706827545899008" data-datetime="2013-02-21T21:39:03+00:00">February 21, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@vimcasts:" target="_blank">@vimcasts:</a> No. 41 &#8211; Meet the arglist: <a href="http://t.co/oVUVA4Tf" title="http://t.co/oVUVA4Tf" target="_blank">http://t.co/oVUVA4Tf</a> (part 1 of 3): Think of the arglist as a stable subset of the files in the &#8230;</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/303922290905739264" data-datetime="2013-02-19T17:41:35+00:00">February 19, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Hackers movie <a href="http://t.co/SKfQQX9l" title="http://t.co/SKfQQX9l" target="_blank">http://t.co/SKfQQX9l</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/303627617255448576" data-datetime="2013-02-18T22:10:39+00:00">February 18, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@garybernhardt:" target="_blank">@garybernhardt:</a> Remember this every time you put your content on a box, or especially on a domain, that you don&#8217;t own: <a href="http://t.co/Ae" title="http://t.co/Ae" target="_blank">http://t.co/Ae</a> &#8230;</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/302937522021990401" data-datetime="2013-02-17T00:28:28+00:00">February 17, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#facebook" target="_blank">#facebook</a> api live event + videos <a href="https://t.co/L56y3eIm" title="https://t.co/L56y3eIm" target="_blank">https://t.co/L56y3eIm</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/301040200308621313" data-datetime="2013-02-11T18:49:11+00:00">February 11, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Host webpages on <a href="https://twitter.com/search/#Google" target="_blank">#Google</a> Drive <a href="https://t.co/zCFFmrRB" title="https://t.co/zCFFmrRB" target="_blank">https://t.co/zCFFmrRB</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/300370326922084353" data-datetime="2013-02-09T22:27:21+00:00">February 09, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>a business from <a href="https://twitter.com/search/#twitter" target="_blank">#twitter</a> <a href="http://t.co/ZuHu6UZR" title="http://t.co/ZuHu6UZR" target="_blank">http://t.co/ZuHu6UZR</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/300365754723864576" data-datetime="2013-02-09T22:09:11+00:00">February 09, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>You don’t want to be typical <a href="http://t.co/CLHPEjbe" title="http://t.co/CLHPEjbe" target="_blank">http://t.co/CLHPEjbe</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/297808087069384704" data-datetime="2013-02-02T20:45:55+00:00">February 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>“The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.” – Stephen Hawking <a href="https://t.co/96uGsYK0" title="https://t.co/96uGsYK0" target="_blank">https://t.co/96uGsYK0</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/297708920531738625" data-datetime="2013-02-02T14:11:52+00:00">February 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Failure Is Not The Worst Outcome, Mediocrity Is <a href="https://t.co/quZs4uXA" title="https://t.co/quZs4uXA" target="_blank">https://t.co/quZs4uXA</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/297707337098067969" data-datetime="2013-02-02T14:05:34+00:00">February 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Why You Should Work From a Coffee Shop, Even When You Have an Office <a href="http://t.co/4ow6mEhB" title="http://t.co/4ow6mEhB" target="_blank">http://t.co/4ow6mEhB</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/297684528300949504" data-datetime="2013-02-02T12:34:56+00:00">February 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@safaribooks:" target="_blank">@safaribooks:</a> Learn more about <a href="https://twitter.com/search/#web" target="_blank">#web</a> application frameworks for <a href="https://twitter.com/search/#JavaScript!" target="_blank">#JavaScript!</a> <a href="http://t.co/30bhSz9u" title="http://t.co/30bhSz9u" target="_blank">http://t.co/30bhSz9u</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/297450429250416641" data-datetime="2013-02-01T21:04:43+00:00">February 01, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> script to clone itunes autofill feature for USB device &#8211; <a href="http://t.co/6fL0boNu" title="http://t.co/6fL0boNu" target="_blank">http://t.co/6fL0boNu</a> <a href="https://twitter.com/search/#Programming" target="_blank">#Programming</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/295598636908285952" data-datetime="2013-01-27T18:26:21+00:00">January 27, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>I&#8217;m learning how to push it with Try Git! <a href="http://t.co/MQpjthvT" title="http://t.co/MQpjthvT" target="_blank">http://t.co/MQpjthvT</a> via <a href="https://twitter.com/@codeschool" target="_blank">@codeschool</a> &#8211; nice intro if you&#8217;re new to <a href="https://twitter.com/search/#git" target="_blank">#git</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294975413128683520" data-datetime="2013-01-26T01:09:53+00:00">January 26, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>browser-based <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> interpreter <a href="http://t.co/9Xu9X4Qv" title="http://t.co/9Xu9X4Qv" target="_blank">http://t.co/9Xu9X4Qv</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294960135913234433" data-datetime="2013-01-26T00:09:11+00:00">January 26, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Guido van Rossum vertelt over zijn geesteskind <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> &#8211; filosofie achter de taal <a href="http://t.co/n9GRwYQ8" title="http://t.co/n9GRwYQ8" target="_blank">http://t.co/n9GRwYQ8</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294958611120136193" data-datetime="2013-01-26T00:03:07+00:00">January 26, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Script to email a weekly digest of upcoming and playing movies &#8211; <a href="http://t.co/SERHxIEh" title="http://t.co/SERHxIEh" target="_blank">http://t.co/SERHxIEh</a> <a href="https://twitter.com/search/#Programming" target="_blank">#Programming</a> <a href="https://twitter.com/search/#Python" target="_blank">#Python</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294544723056668672" data-datetime="2013-01-24T20:38:29+00:00">January 24, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>useful <a href="https://twitter.com/search/#wordpress" target="_blank">#wordpress</a> plugin to autopost to your social sites <a href="http://t.co/GPudSKFk" title="http://t.co/GPudSKFk" target="_blank">http://t.co/GPudSKFk</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294533583622774784" data-datetime="2013-01-24T19:54:13+00:00">January 24, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Encoding and Decoding Text in <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> &#8211; explains well some annoying decoding errors you probably gonna hit <a href="http://t.co/t3qbB7Hu" title="http://t.co/t3qbB7Hu" target="_blank">http://t.co/t3qbB7Hu</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/294186941002440704" data-datetime="2013-01-23T20:56:47+00:00">January 23, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Now that <a href="https://twitter.com/search/#linkedin" target="_blank">#linkedin</a> seems to have removed <a href="https://twitter.com/search/#amazon" target="_blank">#amazon</a> <a href="https://twitter.com/search/#reading" target="_blank">#reading</a> list you might want to try this app to update your reading: <a href="http://t.co/ORpDMGOL" title="http://t.co/ORpDMGOL" target="_blank">http://t.co/ORpDMGOL</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/292932633560756224" data-datetime="2013-01-20T09:52:36+00:00">January 20, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>View all your tweets on one page with All My Tweets <a href="http://t.co/7KUwpu3O" title="http://t.co/7KUwpu3O" target="_blank">http://t.co/7KUwpu3O</a> via <a href="https://twitter.com/@felixturner" target="_blank">@felixturner</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/292757201855078402" data-datetime="2013-01-19T22:15:30+00:00">January 19, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Your Twitter archive <a href="http://t.co/InkZECwe" title="http://t.co/InkZECwe" target="_blank">http://t.co/InkZECwe</a> &#8211; nice twitter will support this, so no more hacking around to get your full <a href="https://twitter.com/search/#tweet" target="_blank">#tweet</a> <a href="https://twitter.com/search/#archive" target="_blank">#archive</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/292747417223319552" data-datetime="2013-01-19T21:36:37+00:00">January 19, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@RubyonRailsNews:" target="_blank">@RubyonRailsNews:</a> Dutch govt pulls Ruby on Rails, exploits become semi-automated <a href="http://t.co/EO1HKJvO" title="http://t.co/EO1HKJvO" target="_blank">http://t.co/EO1HKJvO</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/292606773892882433" data-datetime="2013-01-19T12:17:45+00:00">January 19, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Free tech <a href="https://twitter.com/search/#books" target="_blank">#books</a> <a href="https://twitter.com/search/#programming" target="_blank">#programming</a> <a href="http://t.co/T3jfkFXL" title="http://t.co/T3jfkFXL" target="_blank">http://t.co/T3jfkFXL</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/292571928680595457" data-datetime="2013-01-19T09:59:18+00:00">January 19, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>What happened when Facebook disabled my account <a href="http://t.co/cYwdnd3w" title="http://t.co/cYwdnd3w" target="_blank">http://t.co/cYwdnd3w</a> via <a href="https://twitter.com/@TNWfacebook" target="_blank">@TNWfacebook</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291311481717420033" data-datetime="2013-01-15T22:30:44+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@BkVirendra:" target="_blank">@BkVirendra:</a> how to &#8220;Hire a <a href="https://twitter.com/search/#Hacker" "="" target="_blank">#Hacker&#8221;</a> <a href="http://t.co/QSm83SRB" title="http://t.co/QSm83SRB" target="_blank">http://t.co/QSm83SRB</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291308342096302080" data-datetime="2013-01-15T22:18:15+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@chanhope:" target="_blank">@chanhope:</a> hacking is about passionately working towards a goal and not being afraid of failure.</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291308299918397440" data-datetime="2013-01-15T22:18:05+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#vim" target="_blank">#vim</a> command-t on <a href="https://twitter.com/search/#ubuntu" target="_blank">#ubuntu</a> requires vim-ruby, installed vim-nox and all works <a href="http://t.co/vKEiLkip" title="http://t.co/vKEiLkip" target="_blank">http://t.co/vKEiLkip</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291287619780894720" data-datetime="2013-01-15T20:55:55+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Fixing Command-T for <a href="https://twitter.com/search/#Vim" target="_blank">#Vim</a> in <a href="https://twitter.com/search/#Ubuntu" target="_blank">#Ubuntu</a> 12.04 (add. step install ruby-dev) <a href="http://t.co/1wpjeIkE" title="http://t.co/1wpjeIkE" target="_blank">http://t.co/1wpjeIkE</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291287425362305024" data-datetime="2013-01-15T20:55:08+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#Python" target="_blank">#Python</a> development environment for <a href="https://twitter.com/search/#Ubuntu" target="_blank">#Ubuntu</a> 12.04 Precise <a href="http://t.co/8z6Plbcz" title="http://t.co/8z6Plbcz" target="_blank">http://t.co/8z6Plbcz</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291287149658128384" data-datetime="2013-01-15T20:54:02+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>“<a href="https://twitter.com/@mashable:" target="_blank">@mashable:</a> Facebook Graph Search Could Be Its Greatest Innovation <a href="http://t.co/UIbxrVSd”" title="http://t.co/UIbxrVSd”" target="_blank">http://t.co/UIbxrVSd”</a> <a href="https://twitter.com/search/#facebook" target="_blank">#facebook</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/291287018430926849" data-datetime="2013-01-15T20:53:31+00:00">January 15, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@BkVirendra:" target="_blank">@BkVirendra:</a> &#8220;Why am I so upset about Aaron Swartz&#8217;s suicide?&#8221; <a href="http://t.co/RR7LhyK6" title="http://t.co/RR7LhyK6" target="_blank">http://t.co/RR7LhyK6</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290947111766343681" data-datetime="2013-01-14T22:22:51+00:00">January 14, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>nice <a href="https://twitter.com/search/#instagram" target="_blank">#instagram</a> search app by <a href="https://twitter.com/@BkVirendra" target="_blank">@BkVirendra</a> <a href="http://t.co/bsUIqthx" title="http://t.co/bsUIqthx" target="_blank">http://t.co/bsUIqthx</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290891745242275840" data-datetime="2013-01-14T18:42:51+00:00">January 14, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Anonymous hacks MIT web pages in tribute to Aaron Swartz <a href="http://t.co/0EwZNWRs" title="http://t.co/0EwZNWRs" target="_blank">http://t.co/0EwZNWRs</a> via <a href="https://twitter.com/@TNWinsider" target="_blank">@TNWinsider</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290888978301861888" data-datetime="2013-01-14T18:31:51+00:00">January 14, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@DZone:" target="_blank">@DZone:</a> Image Picker &#8211; A jQuery Plugin That Transforms A Select Element Into An Image Pi&#8230; &#8211; <a href="http://t.co/yA0wjBx8" title="http://t.co/yA0wjBx8" target="_blank">http://t.co/yA0wjBx8</a> &#8211; <a href="https://twitter.com/@DZone" target="_blank">@DZone</a> Big Link &#8230;</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290425411698032641" data-datetime="2013-01-13T11:49:48+00:00">January 13, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>I created a new tool: <a href="https://twitter.com/search/#CSS" target="_blank">#CSS</a> Featured Image Creator, ideal for Blog Featured Images, check it out at <a href="http://t.co/qu91Z3Aj" title="http://t.co/qu91Z3Aj" target="_blank">http://t.co/qu91Z3Aj</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290420190766845952" data-datetime="2013-01-13T11:29:03+00:00">January 13, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>always useful to see how <a href="https://twitter.com/search/#facebook" target="_blank">#facebook</a> parses your URLs when being shared <a href="https://twitter.com/search/#api" target="_blank">#api</a> <a href="https://twitter.com/search/#tools" target="_blank">#tools</a> <a href="https://t.co/07AaacVU" title="https://t.co/07AaacVU" target="_blank">https://t.co/07AaacVU</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290419198063177729" data-datetime="2013-01-13T11:25:07+00:00">January 13, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>GCLI &#8211; Graphic Command Line <a href="https://twitter.com/search/#javascript" target="_blank">#javascript</a> <a href="https://t.co/Tr0Kclzo" title="https://t.co/Tr0Kclzo" target="_blank">https://t.co/Tr0Kclzo</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290243430121078784" data-datetime="2013-01-12T23:46:40+00:00">January 12, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>nice, taking a screenshot from <a href="https://twitter.com/search/#firefox" target="_blank">#firefox</a> <a href="https://twitter.com/search/#gcli" target="_blank">#gcli</a> with &gt;&gt; screenshot test.png &#8211;selector <a href="https://twitter.com/search/#div" target="_blank">#div</a> <a href="https://t.co/3V7TYx3a" title="https://t.co/3V7TYx3a" target="_blank">https://t.co/3V7TYx3a</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290242692758241280" data-datetime="2013-01-12T23:43:45+00:00">January 12, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>handy tip: printscreen of app window on <a href="https://twitter.com/search/#mac:" target="_blank">#mac:</a> Shift-Command-4 then press the space bar <a href="http://t.co/ZplQgGjo" title="http://t.co/ZplQgGjo" target="_blank">http://t.co/ZplQgGjo</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290229904379875328" data-datetime="2013-01-12T22:52:56+00:00">January 12, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>very cool <a href="https://twitter.com/search/#jquery" target="_blank">#jquery</a> plugin to handle progress feedback to user between requests (even works with page refreshes) <a href="http://t.co/APtEIS8g" title="http://t.co/APtEIS8g" target="_blank">http://t.co/APtEIS8g</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/290082862781300736" data-datetime="2013-01-12T13:08:38+00:00">January 12, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>8 Things Remarkably Successful People Do <a href="https://twitter.com/search/#productivity" target="_blank">#productivity</a> <a href="http://t.co/oOjRv1T4" title="http://t.co/oOjRv1T4" target="_blank">http://t.co/oOjRv1T4</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/289858196418490368" data-datetime="2013-01-11T22:15:53+00:00">January 11, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>nice … phpsh &#8212; An interactive shell for <a href="https://twitter.com/search/#php" target="_blank">#php</a> <a href="http://t.co/qGsTsJu8" title="http://t.co/qGsTsJu8" target="_blank">http://t.co/qGsTsJu8</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/289836867862556672" data-datetime="2013-01-11T20:51:08+00:00">January 11, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#vim" target="_blank">#vim</a> shortcuts .. another nice one: nmap cp :ConqueTermVSplit python&lt;CR&gt; to open a python shell in vertical split (requires conque plugin)</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/289122928950386688" data-datetime="2013-01-09T21:34:12+00:00">January 09, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#vim" target="_blank">#vim</a> shortcut of the day: :map gf :vertical wincmd f&lt;CR&gt; =&gt; meaning: open the file under the cursor in a vertical split window … nice</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/289122639530844161" data-datetime="2013-01-09T21:33:03+00:00">January 09, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>nice get a list of all <a href="https://twitter.com/search/#google" target="_blank">#google</a> <a href="https://twitter.com/search/#fonts" target="_blank">#fonts</a> with <a href="http://t.co/LoHFsFvH" title="http://t.co/LoHFsFvH" target="_blank">http://t.co/LoHFsFvH</a> <a href="http://t.co/0SUO2hN6" title="http://t.co/0SUO2hN6" target="_blank">http://t.co/0SUO2hN6</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288794918774775808" data-datetime="2013-01-08T23:50:48+00:00">January 08, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@deadbird1980:" target="_blank">@deadbird1980:</a> The Rise and Fall of Languages in 2012 <a href="http://t.co/qXG1DNUf" title="http://t.co/qXG1DNUf" target="_blank">http://t.co/qXG1DNUf</a> via <a href="https://twitter.com/@zite" target="_blank">@zite</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288790077952360448" data-datetime="2013-01-08T23:31:34+00:00">January 08, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Why You Should Never Stop Studying <a href="http://t.co/GaRYnng3" title="http://t.co/GaRYnng3" target="_blank">http://t.co/GaRYnng3</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288372289081323522" data-datetime="2013-01-07T19:51:26+00:00">January 07, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@WritetoDone:" target="_blank">@WritetoDone:</a> How to Become a Writer <a href="http://t.co/aptXoaGt" title="http://t.co/aptXoaGt" target="_blank">http://t.co/aptXoaGt</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288272925759528961" data-datetime="2013-01-07T13:16:36+00:00">January 07, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: How to search and copy Stack Overflow data without leaving Vim! &#8211; <a href="http://t.co/YAXu25J9" title="http://t.co/YAXu25J9" target="_blank">http://t.co/YAXu25J9</a> <a href="https://twitter.com/search/#python" target="_blank">#python</a> <a href="https://twitter.com/search/#vim" target="_blank">#vim</a> <a href="http://t.co/YAXu25J9" title="http://t.co/YAXu25J9" target="_blank">http://t.co/YAXu25J9</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288242260548673536" data-datetime="2013-01-07T11:14:44+00:00">January 07, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>interesting story: A year without caffeine <a href="http://t.co/ffRn1nxR" title="http://t.co/ffRn1nxR" target="_blank">http://t.co/ffRn1nxR</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288054316114268160" data-datetime="2013-01-06T22:47:55+00:00">January 06, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@EmersonSpartz:" target="_blank">@EmersonSpartz:</a> “Success is going from failure to failure without losing enthusiasm.”</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/288021691764973568" data-datetime="2013-01-06T20:38:17+00:00">January 06, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> Python &#8211; language of the decade <a href="http://t.co/hWr1DURm" title="http://t.co/hWr1DURm" target="_blank">http://t.co/hWr1DURm</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287969815367401473" data-datetime="2013-01-06T17:12:08+00:00">January 06, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@kalebdees:" target="_blank">@kalebdees:</a> Apple is buying the rights to McDonalds hamburger name; naming their newest development a &#8220;Big Mac&#8221;</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287968387622125568" data-datetime="2013-01-06T17:06:28+00:00">January 06, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@WritetoDone:" target="_blank">@WritetoDone:</a> The Zen Habits Story: How I Got 100,000 Subscribers in Two Years <a href="http://t.co/RL96wHba" title="http://t.co/RL96wHba" target="_blank">http://t.co/RL96wHba</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287968105890713601" data-datetime="2013-01-06T17:05:21+00:00">January 06, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>nice &#8230; Conque Shell : Run interactive commands inside a <a href="https://twitter.com/search/#Vim" target="_blank">#Vim</a> buffer</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287370008718352384" data-datetime="2013-01-05T01:28:43+00:00">January 05, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Raspberry Pi: The Raspberry Pi Education Manual Teaches You Basic Computer Science Principles &#8211; <a href="https://twitter.com/@Lifehacker" target="_blank">@Lifehacker</a> <a href="http://t.co/RYTWaxGq" title="http://t.co/RYTWaxGq" target="_blank">http://t.co/RYTWaxGq</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287369395091668993" data-datetime="2013-01-05T01:26:17+00:00">January 05, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Python html email &#8211; nice working example <a href="http://t.co/7ChMHRkT" title="http://t.co/7ChMHRkT" target="_blank">http://t.co/7ChMHRkT</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287365596105043968" data-datetime="2013-01-05T01:11:11+00:00">January 05, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Notes on Python variable scope <a href="http://t.co/Haow43gM" title="http://t.co/Haow43gM" target="_blank">http://t.co/Haow43gM</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287362693499854849" data-datetime="2013-01-05T00:59:39+00:00">January 05, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> script to query github code in your terminal <a href="http://t.co/BMiOjPrA" title="http://t.co/BMiOjPrA" target="_blank">http://t.co/BMiOjPrA</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287357538456973312" data-datetime="2013-01-05T00:39:10+00:00">January 05, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>cool trick from DAS screencasts: diff local vs production site: diff -u &lt;(curl <a href="http://t.co/6fQqfMVQ)" title="http://t.co/6fQqfMVQ)" target="_blank">http://t.co/6fQqfMVQ)</a> &lt;(curl <a href="http://127.0.0.1/fbreadinglist/)" title="http://127.0.0.1/fbreadinglist/)" target="_blank">http://127.0.0.1/fbreadinglist/)</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287327328160333824" data-datetime="2013-01-04T22:39:07+00:00">January 04, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>still becoming faster in <a href="https://twitter.com/search/#vim," target="_blank">#vim,</a> I wrote up some tips some time ago &#8211; <a href="http://t.co/0MjDCnj4" title="http://t.co/0MjDCnj4" target="_blank">http://t.co/0MjDCnj4</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287297197324775424" data-datetime="2013-01-04T20:39:24+00:00">January 04, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>when you are pressing ESC, w, b, dw etc. when writing an email in Thunderbird, you know you&#8217;re spending a good time in <a href="https://twitter.com/search/#vim" target="_blank">#vim</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/287296939089854467" data-datetime="2013-01-04T20:38:22+00:00">January 04, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: a <a href="https://twitter.com/search/#python" target="_blank">#python</a> script to import a complete blog to plain text <a href="http://t.co/wBGyRAJo" title="http://t.co/wBGyRAJo" target="_blank">http://t.co/wBGyRAJo</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286945243121725441" data-datetime="2013-01-03T21:20:51+00:00">January 03, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>PragPub, January 2013 is out <a href="https://twitter.com/search/#programming" target="_blank">#programming</a> <a href="http://t.co/sYPjEMA1" title="http://t.co/sYPjEMA1" target="_blank">http://t.co/sYPjEMA1</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286553131108687872" data-datetime="2013-01-02T19:22:45+00:00">January 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>cool <a href="https://twitter.com/search/#ubuntu" target="_blank">#ubuntu</a> coming to the <a href="https://twitter.com/search/#phone" target="_blank">#phone</a> <a href="http://t.co/RuSRw94P" title="http://t.co/RuSRw94P" target="_blank">http://t.co/RuSRw94P</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286552877206487042" data-datetime="2013-01-02T19:21:44+00:00">January 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>the <a href="https://twitter.com/search/#wordpress" target="_blank">#wordpress</a> 3.5 New Media Manager is a pretty neat interface</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286552426859876352" data-datetime="2013-01-02T19:19:57+00:00">January 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Daily movie digest Spanish TV / Part II &#8211; rewrite in Python <a href="http://t.co/kvYCO8a7" title="http://t.co/kvYCO8a7" target="_blank">http://t.co/kvYCO8a7</a> <a href="https://twitter.com/search/#scripting" target="_blank">#scripting</a> <a href="https://twitter.com/search/#python" target="_blank">#python</a> <a href="https://twitter.com/search/#movies" target="_blank">#movies</a> <a href="https://twitter.com/search/#spanishtv" target="_blank">#spanishtv</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286549849183232000" data-datetime="2013-01-02T19:09:42+00:00">January 02, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>“<a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> C# is the language of the year, Python of the decade <a href="http://t.co/j1KNTnVI”" title="http://t.co/j1KNTnVI”" target="_blank">http://t.co/j1KNTnVI”</a> , doing a lot in python these days :)</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286162236618186752" data-datetime="2013-01-01T17:29:28+00:00">January 01, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@pageaffairs:" target="_blank">@pageaffairs:</a> Enjoyed this 24ways post by Andy Clarke: Monkey Business <a href="http://t.co/CoYl8ArZ" title="http://t.co/CoYl8ArZ" target="_blank">http://t.co/CoYl8ArZ</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286153831639826432" data-datetime="2013-01-01T16:56:04+00:00">January 01, 2013</a></p></blockquote>
<blockquote class="twitter-tweet"><p>“<a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> Twitter and Emptiness <a href="http://t.co/rChRaoY6”" title="http://t.co/rChRaoY6”" target="_blank">http://t.co/rChRaoY6”</a> &#8211; interesting, social media changed the way we connect</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/286151280441847809" data-datetime="2013-01-01T16:45:56+00:00">January 01, 2013</a></p></blockquote>
<p></p>
<p>Powered by <a href="http://tweetdigest.net" target="_blank">tweetdigest</a>.</p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/awsDe0uptYo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/03/twitter-digest-january-february-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/03/twitter-digest-january-february-2013/</feedburner:origLink></item>
		<item>
		<title>Website re-design: making it fully responsive</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/BraZd_GqSRE/</link>
		<comments>http://bobbelderbos.com/2013/02/responsive-website-redesign/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 22:07:32 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[lynda]]></category>
		<category><![CDATA[masonry]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2352</guid>
		<description><![CDATA[As you see I adopted a new theme for my website / blog. Reason? Responsive web design. I want my site to be easily accessible on a desktop, tablet and smartphone. Responsive is hot Mashable predicted that 2013 is the Year of Responsive Web Design. And it is true, more websites are converting to this &#8230;]]></description>
				<content:encoded><![CDATA[<p>As you see I adopted a new theme for my website / blog. Reason? <a href="http://en.wikipedia.org/wiki/Responsive_web_design" target="_blank">Responsive web design</a>. I want my site to be easily accessible on a desktop, tablet and smartphone.</p>
<p><span id="more-2352"></span></p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>Responsive is hot</h3>
<p>Mashable predicted that <a href="http://mashable.com/2012/12/11/responsive-web-design/" target="_blank">2013 is the Year of Responsive Web Design</a>. And it is true, more websites are converting to this solution:</p>
<ul>
<li> The default WordPress theme, <a href="http://wordpress.org/extend/themes/twentytwelve" target="_blank">Twenty Twelve</a> is fully responsive; </li>
<li> <a href="http://zenhabits.net/theme/" target="_blank">Zenhabits.net</a> released a simple yet elegant theme which uses media queries; </li>
<li> Popular webdev sites like <a href="http://mashable.com" target="_blank">Mashable</a> and <a href="http://www.smashingmagazine.com" target="_blank">Smashing Magazine</a> are fully responsive;</li>
</ul>
<p> And it makes sense with the increasing amount of mobiles and tablets browsing the web. I do a lot more reading now on the phone/tablet myself, plus visits from these devices increase. Hence it was time for my site to be responsive as well!</p>
<h3>Re-use or build from scratch? </h3>
<p> Both options are interesting, but there are some very good templates: for WordPress the mentioned 2012 theme or the <a href="http://themeid.com/responsive-theme/" target="_blank">Responsive Theme</a>. I decided to use Morten Rand-Hendriksen&#8217;s <a href="http://designisphilosophy.com/wordpress-themes/free-responsive-wordpress-theme-anaximander-now-available-through-lynda-com/" target="_blank">Anaximander theme</a> which he builds from scratch in the Lynda course <a href="http://www.lynda.com/WordPress-tutorials/WordPress-Building-Responsive-Themes/104261-2.html" target="_blank">WordPress: Building Responsive Themes</a>.</p>
<p>Apart from providing an awesome theme you can adapt for your blog, this course is really insightful how to build an advanced responsive WordPress theme from scratch. It has some slick features, for example the dynamic homepage (fall-in-place-when-resize) layout using <a href="http://masonry.desandro.com" target="_blank">masonry</a>.</p>
<p>Soon however I will restyle one of my projects from scratch (I am thinking of <a href="http://fbreadinglist.com" target="_blank">My Reading List</a>) to be responsive.</p>
<p>Where to start? Resources: apart from looking at the CSS of the WP themes and mentioned Lynda course, I recommend starting with <a href="http://alistapart.com/article/responsive-web-design" target="_blank">Ethan Marcotte&#8217;s article on responsive webdesign</a> and his book on the subject which I discussed <a href="http://bobbelderbos.com/2012/01/web-design-shift-read-responsive-web-desig/" target="_blank">here</a>.</p>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>Look and compare &#8230;</h3>
<p>In the old design resizing would overlap the right sidebar. The new design uses media queries and a flexible grid to adapt to any size. It sets max-width: 100% on the images so they scale, see the images in this post, or resize the browser, or enjoy a better view of my blog if you are reading this on a tablet or phone :)</p>
<p><img class="size-full" src="http://bobbelderbos.com/wp-content/uploads/2013/02/before_not_responsive.png" alt="before" style="float:none; margin: 20px;" width="600"><br />
<img class="size-full" src="http://bobbelderbos.com/wp-content/uploads/2013/02/after_responsive_desktop.png" alt="after - desktop" style="float:none; margin: 20px;" width="600"><br />
<img class="size-full" src="http://bobbelderbos.com/wp-content/uploads/2013/02/after_responsive_ipad.png" alt="after - ipad " style="float:none; margin: 20px;" width="600"><br />
<img class="size-full" src="http://bobbelderbos.com/wp-content/uploads/2013/02/after_responsive_iphone.png" alt="before - ipad " style="float:none; margin: 20px;" width="600"></p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/BraZd_GqSRE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/02/responsive-website-redesign/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/02/responsive-website-redesign/</feedburner:origLink></item>
		<item>
		<title>Python script to clone itunes autofill feature for USB device</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/m7g4dDVTn6U/</link>
		<comments>http://bobbelderbos.com/2013/01/python-eyed3-script-to-autofill-usb-with-mp3/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 18:25:43 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2320</guid>
		<description><![CDATA[I never thought I would autofill my iphone with music, but I recently tried it and I actually like it. You start to appreciate more types of music. In this post a python script to do the same thing for USB devices to listen to new music in my car. It is funny how you &#8230;]]></description>
				<content:encoded><![CDATA[<p>I never thought I would autofill my iphone with music, but I recently tried it and I actually like it. You start to appreciate more types of music. In this post a python script to do the same thing for USB devices to listen to new music in my car.</p>
<p><span id="more-2320"></span></p>
<p>It is funny how you limit yourself to a few albums/playlists over time, autofill breaks this habit. Now my daily music digest is much more variated. The autofill script is on <a href="https://github.com/bbelderbos/Codesnippets/blob/master/python/music_autofill.py" target="_blank">github</a>. It has become a bit longer than expected because I added more features.</p>
<p>With the required options (music lib path, destination dir path, max size of autofill), it just takes random songs. With the optional switches you can filter on genre and limit the song length. I use <a href="http://eyed3.nicfit.net" target="_blank">eyed3</a> to read the mp3 metadata. As it is expensive to run it against a lot of mp3 files, I dump its output to a file in json format. When using the -c option you can retrieve the metadata of your songs from this file. This makes it much faster and has the benefit (over a simple copy/paste script) that you can specify genres, etc.</p>
<p>Some useful things in Python:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python" target="_blank">recursively find files</a>,</li>
<li><a href="http://stackoverflow.com/questions/7100125/storing-python-dictionaries" target="_blank">loading and storing json</a> (note you can also use <a href="http://docs.python.org/2/library/pickle.html" target="_blank">pickle</a>),</li>
<li>optparse is a great module to deal with command line parsing (see switches below),</li>
<li>random dict key selection with random.choice,</li>
<li>become trained in catching every exception (here for example the AttributeError when eyed3 couldn&#8217;t find genre.name etc.), otherwise the program will end unexpectedly!</li>
<li>rfe: it generally suits my purpose, but there are many options that could be added like filtering artist, album, and other criteria, delete previously selected songs, etc. Any ideas, feel free to post them in the comments.</li>
<li>code: split functionality over more / smaller methods and classes (length of &#8216;path_exists_check&#8217; and &#8216;select_genres&#8217; is convenient), build automated testing against each method.</li>
</ul>
<p>&nbsp;</p>
<h3>Script use:</h3>
<pre>$ python music_autofill.py
Mandatory option is missing: [path]

Usage: music_autofill.py [options]

Options:
  -h, --help            show this help message and exit
  -p PATH, --path=PATH  path to music lib
  -u USB, --usb=USB     path to usb stick
  -s SIZE, --size=SIZE  max size autofill in MB
  -g, --genres          filter on genres
  -l LENGTH, --length=LENGTH
                        max length of song in minutes
  -v, --verbose         verbose switch
  -c, --caching         dump music lib to json for fast retrieval</pre>
<h3>Example output</h3>
<p>Without genres, using cache file:</p>
<pre>$ python music_autofill.py -p "music_dir" -u ~/Desktop/tmp  -s 1000 -c 
1048576000 bytes reached, we're done!
Successfully copied: 103 / failures upon copying: 0
Cache file music_dir/my_music_library.json was used
- to run without caching, don't use the -c option
- to refresh the cache, delete the mentioned file</pre>
<p>&nbsp;</p>
<p>With -g to specify genres:</p>
<pre>$ python music_autofill.py -p "music_dir" -u /Volumes/USB\ DISK/ -g  -s 200  -c 
provide genres to filter on, seperated by commas: brazilian beats, breaks, da bass, blues
209715200 bytes reached, we're done!
Successfully copied: 36 / failures upon copying: 0
Cache file music_dir/my_music_library.json was used
..</pre>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/m7g4dDVTn6U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/01/python-eyed3-script-to-autofill-usb-with-mp3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/01/python-eyed3-script-to-autofill-usb-with-mp3/</feedburner:origLink></item>
		<item>
		<title>Script to email a weekly digest of upcoming and playing movies</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/mVSoXBKZxC4/</link>
		<comments>http://bobbelderbos.com/2013/01/sharemovies-python-script-cron-latest-movies/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 17:00:38 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2307</guid>
		<description><![CDATA[To keep up2date with new and upcoming movies, I wrote a Python script to send me an weekly movie digest. It queries themoviedb.org and parses the &#8220;now-playing&#8221; and &#8220;upcoming pages&#8221;, it creates the proper html and sends it. Putting it in a cronjob this happens weekly. See the code here (previously I copied the code &#8230;]]></description>
				<content:encoded><![CDATA[<p>To keep up2date with new and upcoming movies, I wrote a Python script to send me an weekly movie digest. It queries <a href="http://www.themoviedb.org" target="_blank">themoviedb.org</a> and parses the &#8220;now-playing&#8221; and &#8220;upcoming pages&#8221;, it creates the proper html and sends it. Putting it in a cronjob this happens weekly.</p>
<p><span id="more-2307"></span></p>
<p>See the code <a href="https://github.com/bbelderbos/Codesnippets/blob/master/python/themoviedb_crawler.py" target="_blank">here</a> (previously I copied the code in the post, but what happens if I update it? I would push to github but would forget to update it in the post, hence a link to github only is best, with the exception of highlighting snippets in the post). This is the initial version and I might create a page to signup and let users select genres (which filter is already in), like <a href="http://anynewbooks.com" target="_blank">any new books</a> does for books. They actually inspired me to build this, their weekly new books mail is a nice service.</p>
<p>Note that the css styles are inside the html elements, which is not recommended for a website, but html email does not support linking to an external stylesheet, so here I didn&#8217;t have a better option. Images count, so I use the bigger version, thanks to themoviedb.org&#8217;s consistent url naming (replacing w92 by w185 in the poster url).</p>
<p>The mail code is a nice snippet I found on <a href="http://stackoverflow.com/questions/882712/sending-html-email-in-python" target="_blank">stackoverflow</a>.</p>
<p>For DOM parsing, I highly recommend you get familiar with <a href="http://www.crummy.com/software/BeautifulSoup/bs4/doc/" target="_blank">Beautiful Soup</a> which makes parsing html easy and powerful.</p>
<p>The weekly digests are saved to sharemovies as well, see <a href="http://sharemovi.es/moviedigest/sharemovi.es_digest_2013_w4.html" target="_blank">this</a> example. See also some images below from two different mail clients.</p>
<p>Also note the encode/decodes that were needed, <a href="http://blog.codekills.net/2008/05/01/encoding-and-decoding-text-in-python-%28or---i-didn%27t-ask-you-to-use-the-%27ascii%27-codec!-%29/" target="_blank">this article</a> explains pretty well what to do when you are confronted with these annoying UnicodeDecodeError exceptions. Basically what worked for me is encoding obtained text from any websource to utf-8 when writing to a file or printing to stdout, and decoding to utf-8 when assigning it to variables.</p>
<p>Not much else, the rest is pretty basic Python. If you want to receive the weekly update, go to <a href="http://sharemovi.es" target="_blank">sharemovi.es</a> and email via the Email button at the top. This homepage actually shows a subset of the upcoming and now-playing results I query with this script, however there it uses themoviedb API.</p>
<p>&nbsp;</p>
<p><img class="size-full" style="float: none; margin: 20px;" alt="widget example" src="http://bobbelderbos.com/wp-content/uploads/2013/01/sharemovies_html_email2.png" width="558" /><br />
<img class="size-full" style="float: none; margin: 20px;" alt="widget example" src="http://bobbelderbos.com/wp-content/uploads/2013/01/sharemovies_html_email3.png" width="558" /><br />
<img class="size-full" style="float: none; margin: 20px;" alt="widget example" src="http://bobbelderbos.com/wp-content/uploads/2013/01/sharemovies_html_email4.png" width="558" /></p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/mVSoXBKZxC4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/01/sharemovies-python-script-cron-latest-movies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/01/sharemovies-python-script-cron-latest-movies/</feedburner:origLink></item>
		<item>
		<title>How to search and copy Stack Overflow data without leaving Vim!</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/IPOShg7EA1g/</link>
		<comments>http://bobbelderbos.com/2013/01/search-copy-stackoverflow-data-in-vim-with-conque/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 11:03:47 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2294</guid>
		<description><![CDATA[To save time and concentrate as a developer, Vim is the best place to be. But I cannot code everything from memory so I made a tool to lookup stackoverflow questions and answers without leaving Vim. Searching Google for programming related questions I found out that about 80% of the times I end up at &#8230;]]></description>
				<content:encoded><![CDATA[<p>To save time and concentrate as a developer, Vim is the best place to be. But I cannot code everything from memory so I made a tool to lookup stackoverflow questions and answers without leaving Vim.</p>
<p><span id="more-2294"></span></p>
<p>Searching Google for programming related questions I found out that about 80% of the times I end up at <a href="http://stackoverflow.com/" target="_blank">Stack Overflow</a> which has tons of useful information!</p>
<p>What if I could search this huge Q&amp;A database from the command line? I built a Python class to do so. But to be able to run it inside a Vim buffer you will need the Vim plugin <a href="http://code.google.com/p/conque/" target="_blank">conque</a> and some settings in .vimrc. With that setup you can search Stack Overflow interactively in a Vim split window and copy and paste useful code snippets back and forth.</p>
<p>In the following sections I will show you how it works&#8230;</p>
<h3>Setup / config</h3>
<ul>
<ul>1. Install</ul>
</ul>
<p><a href="http://www.vim.org/scripts/script.php?script_id=2771" target="_blank">Conque</a></p>
<ul>
<ul>- make sure you use 2.2, 2.1 gave me some issues. Just download the file, open vim and run :so %, then exit. Opening Vim again and you can use the plugin.</ul>
</ul>
<p>&nbsp;</p>
<ul>
<ul>2. Get a copy of the</ul>
</ul>
<p><a href="https://github.com/bbelderbos/Codesnippets/blob/master/python/stackoverflow_cli_search.py" target="_blank">stackoverflow_cli_search script</a></p>
<ul>
<ul>3. Setup a key mapping in .vimrc to open up the script in vertical split (at least that is how I like it):</ul>
</ul>
<p>nmap ,s :ConqueTermVSplit python &#8230;path-to-script&#8230;/stackoverflow_cli_search.py</p>
<p>Note that I use comma (,) as mapleader &#8211; in .vimrc add: let mapleader = &#8220;,&#8221;</p>
<p>I made two similar key mappings as well to:</p>
<ul>
<ul>
<ul>
<li>a. try things in Python while I am coding:</li>
</ul>
</ul>
</ul>
<p>nmap cp :ConqueTermVSplit python</p>
<ul>
<ul>
<ul>
<li>b. search github code (see <a href="http://bobbelderbos.com/2013/01/python-script-to-query-github-code-i-your-terminal/" target="_blank">this blogpost</a>):</li>
</ul>
</ul>
</ul>
<p>nmap ,g :ConqueTermVSplit python &#8230;path-to-script&#8230;/github_search.py</p>
<p>4. When coding you can just type ,s to start searching Stack Overflow &#8211; ,g for github (if you downloaded the script from the previously mentioned post as well) &#8211; or cp to get a interactive python shell. All in a new Vim vertical split window, so no need to leave the terminal, you can switch between the two windows hitting ctrl+w twice.</p>
<p>Here you see a printscreen of the split window:</p>
<p><img class="size-full" style="margin: 20px;" alt="vim split window" src="http://bobbelderbos.com/wp-content/uploads/2013/01/vimsplit.png" width="620" /></p>
<p>&nbsp;</p>
<p>5. When you like to copy a code snippet you&#8217;ll find, hit Esc and conque goes into normal mode so you can select with V (visually select current line) + a motion command + y (yank). Thenk you move to your code window (2x ctrl+w) and p (paste) the yanked buffer. To resume with the script go back to the stakcoverflow window (again 2x ctrl+w) and go into Insert mode with i, I, a, A, etc.</p>
<h3>Example</h3>
<p>The example below I literally pasted into this blog post staying in Vim (in the right window typing : ESC-Vgg-y to copy the whole buffer, then 2x ctrtl+w to go back to this post and there run: p to paste:</p>
<pre>      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice:  

You picked: [s]
Enter search: python re.compile 
Questions found for search &lt;python re.compile&gt;
1) python regex re.compile match
2) python re.compile match percent sign %
3) Case insensitive Python regular expression without re.compile
4) Python and re.compile return inconsistent results
5) Does re.compile() or any given Python library call throw an exception?
6) python re.compile Beautiful soup
7) python re.compile strings with vars and numbers
8) how to do re.compile() with a list in python
9) python regex re.compile() match string
10) Python re.compile between two html tags
11) Python BeautifulSoup find using re.compile for end of string
12) Python: How does regex re.compile(r'^[-\w]+$') search? Or, how does regex
 work in this context?
13) Clean Python Regular Expressions
14) Matching a specific sequence with regex?
15) Regex negated capture group returns answer

      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice: 9 

You picked: [9]
Q&amp;A for 9) python regex re.compile() match string 

http://stackoverflow.com/questions/8012320/python-regex-re-compile-match-string

----------------------------------------
[ Question ]
----------------------------------------

Gents,
  I am trying to grab the version number from a string via python regex...
Given filename: facter-1.6.2.tar.gz

When, inside the loop:
import re
version = re.split('(.*\d\.\d\.\d)',sfile)
print version

How do i get the 1.6.2 bit into version 
Thanks!

----------------------------------------
[ Answer #1 ]
----------------------------------------
Two logical problems:
1) Since you want only the 1.6.2 portion, you don't want to capture the .* part before the first \d, so it goes outside the parentheses.

[truncated]

      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice: n 

You picked: [n]
----------------------------------------
[ Answer #2 ]
----------------------------------------
match = re.search(r'\d\.\d\.\d', sfile)
if match:
    version = match.group()

      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice: n 

You picked: [n]
----------------------------------------
[ Answer #3 ]
----------------------------------------
&gt;&gt;&gt; re.search(r"\d+(\.\d+)+", sfile).group(0)
'1.6.2'

      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice: n 

You picked: [n]
All answers shown, choose a question of previous search (L) or press Enter (o
r S) for a new search

      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice:</pre>
<p>&nbsp;</p>
<h3>The script</h3>
<p>See below (download at <a href="https://ghttps://github.com/bbelderbos/Codesnippets/blob/master/python/stackoverflow_cli_search.py" target="_blank">Github</a>):</p>
<pre>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, urllib, urllib2, pprint
from bs4 import BeautifulSoup as Soup

class StackoverflowCliSearch(object):
  """ Query stackoverflow from cli 
      I think this could be handy in Vim's spit view (with ConqueTerm) """

  def __init__(self):
    """ Definition class variables, initialize menu """
    self.searchTerm = ""
    self.questions = {}
    self.showNumAnswers = 1 # show 1 answer first, then 1 by 1 pressing N
    self.show_menu() # start user interaction

  def show_menu(self):
    """ Menu that allows user to to search, query question's answers, etc. """
    prompt = """
      (S)earch (default when pressing Enter)
      (1-15) Show answers for question number ...
      (N)ext answer
      (L)ist questions again for last search
      (Q)uit
      Enter choice: """
    while True:
      chosen = False 
      while not chosen:
        try:
          choice = raw_input(prompt).strip().lower()
        except (EOFError, KeyboardInterrupt):
          choice = 'q'
        except:
          sys.exit("Not a valid option")
        if choice == '': choice = 's' # hitting Enter = new search
        print '\nYou picked: [%s]' % choice 
        if not choice.isdigit() and choice not in 'snlq':
          print "This is an invalid option, try again"
        else:
          chosen = True
      if choice.isdigit() : self.show_question_answer(int(choice))
      if choice == 's': self.search_questions() 
      if choice == 'n': self.show_more_answers() 
      if choice == 'l': self.list_questions(True) 
      if choice == 'q': sys.exit("Goodbye!")

  def search_questions(self):
    """ Searches stackoverflow for questions containing the search term """
    self.questions = {} 
    self.searchTerm = raw_input("Enter search: ").strip().lower()
    data = {'q': self.searchTerm }
    data = urllib.urlencode(data)
    soup = self.get_url("http://stackoverflow.com/search", data)
    for i,res in enumerate(soup.find_all(attrs={'class': 'result-link'})):
      q = res.find('a')
      self.questions[i+1] = {}
      self.questions[i+1]['url'] = "http://stackoverflow.com" + q.get('href')
      self.questions[i+1]['title'] = q.get('title')
    self.list_questions()

  def get_url(self, url, data=False):
    """ Imports url data into Soup for easy html parsing """
    u = urllib2.urlopen(url, data) if data else urllib2.urlopen(url)
    return Soup(u)

  def list_questions(self, repeat=False):
    """ Lists the questions that were found with the last search action """
    if not self.questions:
      print "No questions found for search &lt;%s&gt;" % self.searchTerm
      return False
    if not self.questions and repeat:
      print "There are no questions in memory yet, please perform a (S)earch first"
      return False
    print "Questions found for search &lt;%s&gt;" % self.searchTerm 
    for q in self.questions:
      print "%d) %s" % (q, self.questions[q]["title"])

  def show_question_answer(self, num):
    """ Shows the question and the first self.showNumAnswers answers """
    entries = []
    if num not in self.questions: 
      print "num &lt;%s&gt; does not appear in questions dict" % str(num) 
      return False
    print "Q&amp;A for %d) %s \n%s\n" % \
      (num, self.questions[num]['title'], self.questions[num]['url'])
    soup = self.get_url(self.questions[num]['url'])
    for i,answer in enumerate(soup.find_all(attrs={'class': 'post-text'})):
      qa = "Question" if i == 0 else "Answer #%d" % i
      out = "%s\n[ %s ]\n%s\n" % ("-"*40, qa, "-"*40)
      out += ''.join(answer.findAll(text=True))
      # print the Q and first Answer, save subsequent answers for iteration with option (N)ext answer
      if i &lt;= self.showNumAnswers:
        print out
      else:
        entries.append(out) 
    self.output = iter(entries)

  def show_more_answers(self):
    """ Result of option (N)ext answer: iterates over the next answer (1 per method call) """ 
    if not self.output:
      print "There is no QA output yet, please select a Question listed or perform a (S)earch first"
      return False
    try:
      print self.output.next()
    except StopIteration as e:
      print "All answers shown, choose a question of previous search (L) or press Enter (or S) for a new search"

# instant
so = StackoverflowCliSearch()</pre>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/IPOShg7EA1g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/01/search-copy-stackoverflow-data-in-vim-with-conque/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/01/search-copy-stackoverflow-data-in-vim-with-conque/</feedburner:origLink></item>
		<item>
		<title>Twitter digest – November/ December 2012</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/NEO-b0vnk74/</link>
		<comments>http://bobbelderbos.com/2013/01/twitter-digest-november-december-2012/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 10:36:52 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tweet digest]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2287</guid>
		<description><![CDATA[#amazon #api #bluehost #fbreadinglist #github #imdb #javascript #movies #omdb #perl #php #python #quotes #ruby #rubygems #selfdevelopment #solaris #success #twitter #ubuntu RT @newsycombinator: Guy Kawasaki &#8211; Four free books http://t.co/24z5FzhN — Bob Belderbos (@bbelderbos) December 31, 2012 RT @zehzinho: The five programming books that meant most to me http://t.co/pCLUBSRd — Bob Belderbos (@bbelderbos) December 30, 2012 &#8230;]]></description>
				<content:encoded><![CDATA[<p>#amazon #api #bluehost #fbreadinglist #github #imdb #javascript #movies #omdb #perl #php #python #quotes #ruby #rubygems #selfdevelopment #solaris #success #twitter #ubuntu<br />
<span id="more-2287"></span></p>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> Guy Kawasaki &#8211; Four free books <a href="http://t.co/24z5FzhN" title="http://t.co/24z5FzhN" target="_blank">http://t.co/24z5FzhN</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/285819936612438016">December 31, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@zehzinho:" target="_blank">@zehzinho:</a> The five programming books that meant most to me <a href="http://t.co/pCLUBSRd" title="http://t.co/pCLUBSRd" target="_blank">http://t.co/pCLUBSRd</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/285492935632515072">December 30, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> It&#8217;s like JSON. but fast and small. <a href="http://t.co/jB2zRXuK" title="http://t.co/jB2zRXuK" target="_blank">http://t.co/jB2zRXuK</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/285057237246943233">December 29, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@lmsanchezgarcia:" target="_blank">@lmsanchezgarcia:</a> RT <a href="https://twitter.com/@SciProgramming" target="_blank">@SciProgramming</a> Computational science and engineering video lectures from MIT  <a href="http://t.co/ag4jIidV" title="http://t.co/ag4jIidV" target="_blank">http://t.co/ag4jIidV</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284821663319719938">December 29, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>cool -.- Stateful programmatic web browsing in <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> &#8211; <a href="http://t.co/lXta4n00" title="http://t.co/lXta4n00" target="_blank">http://t.co/lXta4n00</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284801325416472576">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Check out <a href="https://twitter.com/search/#Python" target="_blank">#Python</a> for Data Analysis <a href="http://t.co/F4hO10Ci" title="http://t.co/F4hO10Ci" target="_blank">http://t.co/F4hO10Ci</a> via <a href="https://twitter.com/@oreillymedia" target="_blank">@oreillymedia</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284787004540071936">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Having redone some scripts from <a href="https://twitter.com/search/#perl" target="_blank">#perl</a> in <a href="https://twitter.com/search/#python," target="_blank">#python,</a> I can say latter is cleaner, easier and more fun programming</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284774822691602433">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Tapping back into <a href="https://twitter.com/search/#twitter," target="_blank">#twitter,</a> a tool so simple yet powerful</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284774180266864640">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@BrianTracy:" target="_blank">@BrianTracy:</a> Success comes when you do what you love to do and commit to being the best in your field. <a href="https://twitter.com/search/#success" target="_blank">#success</a> <a href="https://twitter.com/search/#quotes" target="_blank">#quotes</a> <a href="https://twitter.com/search/#selfdevelopment" target="_blank">#selfdevelopment</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284773973848358913">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Dropbox users save more than 1 billion files every day, <a href="http://t.co/P4txZYnz" title="http://t.co/P4txZYnz" target="_blank">http://t.co/P4txZYnz</a> <a href="http://t.co/k7BfOKsC" title="http://t.co/k7BfOKsC" target="_blank">http://t.co/k7BfOKsC</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284615067750760450">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Fb new poke app, need to try it  <a href="http://t.co/VuS75NZg" title="http://t.co/VuS75NZg" target="_blank">http://t.co/VuS75NZg</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284614459757060096">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>$35 computer can get kids coding <a href="http://t.co/Y46bseS1" title="http://t.co/Y46bseS1" target="_blank">http://t.co/Y46bseS1</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284613595550060545">December 28, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Oreilly interview, interesting views <a href="http://t.co/7vLgi4I9" title="http://t.co/7vLgi4I9" target="_blank">http://t.co/7vLgi4I9</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/284413359527428096">December 27, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@aarron:" target="_blank">@aarron:</a> Python for kids: <a href="http://t.co/wlrGOUnC" title="http://t.co/wlrGOUnC" target="_blank">http://t.co/wlrGOUnC</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/283568786286723073">December 25, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/@newsycombinator:" target="_blank">@newsycombinator:</a> Python alternatives for PHP functions <a href="http://t.co/5nrLeJ2x" title="http://t.co/5nrLeJ2x" target="_blank">http://t.co/5nrLeJ2x</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/283568466982744064">December 25, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p><a href="https://twitter.com/search/#python" target="_blank">#python</a> oop from scratch <a href="http://t.co/ClIquAIn" title="http://t.co/ClIquAIn" target="_blank">http://t.co/ClIquAIn</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/267588202636902400">November 11, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>start unittest in <a href="https://twitter.com/search/#python" target="_blank">#python</a> <a href="http://t.co/e7shzJkG" title="http://t.co/e7shzJkG" target="_blank">http://t.co/e7shzJkG</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/267586532213420032">November 11, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Show <a href="https://twitter.com/search/#amazon" target="_blank">#amazon</a> book reviews on your site with the Product Advertising <a href="https://twitter.com/search/#API" target="_blank">#API</a> <a href="http://t.co/FNTuDTps" title="http://t.co/FNTuDTps" target="_blank">http://t.co/FNTuDTps</a> <a href="https://twitter.com/search/#php" target="_blank">#php</a> <a href="https://twitter.com/search/#fbreadinglist" target="_blank">#fbreadinglist</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/267330655115943937">November 10, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: How to install Ruby(Gems) as regular user on Bluehost and Unix <a href="http://t.co/XcFhyum9" title="http://t.co/XcFhyum9" target="_blank">http://t.co/XcFhyum9</a> <a href="https://twitter.com/search/#ruby" target="_blank">#ruby</a> <a href="https://twitter.com/search/#rubygems" target="_blank">#rubygems</a> <a href="https://twitter.com/search/#ubuntu" target="_blank">#ubuntu</a> <a href="https://twitter.com/search/#solaris" target="_blank">#solaris</a> <a href="https://twitter.com/search/#bluehost" target="_blank">#bluehost</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/265128592860643329">November 04, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Best way to prevent SQL injection in <a href="https://twitter.com/search/#PHP" target="_blank">#PHP</a> <a href="http://t.co/j4MtdkNp" title="http://t.co/j4MtdkNp" target="_blank">http://t.co/j4MtdkNp</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/265000692647866368">November 04, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Sharemovi.es / how to dynamically load IMDB ratings for movies <a href="http://t.co/8Vqra3ZK" title="http://t.co/8Vqra3ZK" target="_blank">http://t.co/8Vqra3ZK</a> <a href="https://twitter.com/search/#php" target="_blank">#php</a> <a href="https://twitter.com/search/#javascript" target="_blank">#javascript</a> <a href="https://twitter.com/search/#movies" target="_blank">#movies</a> <a href="https://twitter.com/search/#imdb" target="_blank">#imdb</a> <a href="https://twitter.com/search/#omdb" target="_blank">#omdb</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/264712528091820032">November 03, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Blogged: Sharemovi.es / make a cool multifunctional autocomplete <a href="http://t.co/UBXSp57M" title="http://t.co/UBXSp57M" target="_blank">http://t.co/UBXSp57M</a> <a href="https://twitter.com/search/#php" target="_blank">#php</a> <a href="https://twitter.com/search/#javascript" target="_blank">#javascript</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/264686964396146688">November 03, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>commit emails <a href="https://twitter.com/search/#github" target="_blank">#github</a> <a href="http://t.co/KCQ69Aqw" title="http://t.co/KCQ69Aqw" target="_blank">http://t.co/KCQ69Aqw</a></p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/263942985660633088">November 01, 2012</a></p></blockquote>
<blockquote class="twitter-tweet"><p>Learning <a href="https://twitter.com/search/#ruby," target="_blank">#ruby,</a> wow compact clean powerful. Seems to take the good parts of other languages</p>
<p>— Bob Belderbos (@bbelderbos) <a href="https://twitter.com/bbelderbos/status/263937894748667904">November 01, 2012</a></p></blockquote>
<p>Powered by <a href="http://tweetdigest.net" target="_blank">tweetdigest</a>.</p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/NEO-b0vnk74" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/01/twitter-digest-november-december-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/01/twitter-digest-november-december-2012/</feedburner:origLink></item>
		<item>
		<title>Python script to query github code in your terminal</title>
		<link>http://feedproxy.google.com/~r/bbelderbos/~3/vn8Fqlo86po/</link>
		<comments>http://bobbelderbos.com/2013/01/python-script-to-query-github-code-i-your-terminal/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 00:25:51 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://bobbelderbos.com/?p=2283</guid>
		<description><![CDATA[I was using the Advanced Search in Github the other day and thought: what if I could use this in a terminal. So I started to try out some things in Python which led to the following script. Some comments about the script It is an interactive script that you run from a terminal, main &#8230;]]></description>
				<content:encoded><![CDATA[<p>I was using the Advanced Search in Github the other day and thought: what if I could use this in a terminal. So I started to try out some things in Python which led to the following script.</p>
<p><span id="more-2283"></span></p>
<h3>Some comments about the script</h3>
<p><img class="size-full" src="http://bobbelderbos.com/wp-content/uploads/2013/01/githubsearch.png" alt="featured image" style="float:right; margin: 20px;" width="200"></p>
<ul>
<li> It is an interactive script that you run from a terminal, main options are (n) for new search and (s) for show script snippet. You first search for a keyword and optionally a programming language and number result pages to parse. See an example at the end of this post &#8230;</li>
<li> It takes these args and builds the right search URL (base url =https://github.com/search?q=) and uses html2text.theinfo.org to strip out the html (I tried the remote versionhere, for local use just download and import the html2text Python module, see <a href="http://bobbelderbos.com/2013/01/python-script-import-blog-sitemap-html2text/" target="_blank">my last post</a> for an example). </li>
<li> It filters the relevant html with re.split(r&#8221;seconds\)|## Breakdown&#8221;, html) &#8211; this is based on what html2text makes of github&#8217;s html markup.</li>
<li> When choosing (s) and then a number of the search result the method &#8220;show_script_context&#8221; imports the raw script and shows the line that matches the search string with 8 lines before and after (like grep -A8 -B8 would do)</li>
<li> You can use <a href="http://www.vim.org/scripts/script.php?script_id=2771" target="_blank">Conque</a> to run this in a split window in Vim which allows you to copy output to the script you are working on. </li>
</ul>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like> </p>
<h3>The code</h3>
<p> See below and on <a href="https://github.com/bbelderbos/Codesnippets/blob/master/python/github_search.py" target="_blank">github</a>:</p>
<pre>
#!/usr/bin/env python                                                                                                                                     
# -*- coding: utf-8 -*-
# Author: Bob Belderbos / written: Dec 2012
# Purpose: have an interactive github cli search app
#
import re, sys, urllib, pprint
# import html2text # -- to use local version

class GithubSearch:
  &quot;&quot;&quot; This is a command line wrapper around Github&#39;s Advanced Search
      https://github.com/search &quot;&quot;&quot;

  def __init__(self):
    &quot;&quot;&quot; Setup variables &quot;&quot;&quot;
    self.searchTerm = &quot;&quot;
    self.scripts = []
    self.show_menu()


  def show_menu(self):
    &quot;&quot;&quot; Show a menu to interactively use this program &quot;&quot;&quot;
    prompt = &quot;&quot;&quot;
      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: &quot;&quot;&quot;
    while True:
      chosen = False 
      while not chosen:
        try:
          choice = raw_input(prompt).strip().lower()
        except (EOFError, KeyboardInterrupt):
          choice = &#39;q&#39;
        except:
          sys.exit(&quot;Not a valid option&quot;)
        print &#39;\nYou picked: [%s]&#39; % choice 
        if choice not in &#39;nsq&#39;:
          print &quot;This is an invalid option, try again&quot;
        else:
          chosen = True
      if choice == &#39;q&#39;: sys.exit(&quot;Goodbye!&quot;)
      if choice == &#39;n&#39;: self.new_search() 
      if choice == &#39;s&#39;: self.show_script_context()

  
  def new_search(self):
    &quot;&quot;&quot; Take the input field info for the advanced git search &quot;&quot;&quot;
    #&Acirc;&nbsp;reset script url tracking list and counter
    self.scripts = [] 
    self.counter = 0
    #&Acirc;&nbsp;take user input to define the search
    try:
      self.searchTerm = raw_input(&quot;Enter search term: &quot;).strip().lower().replace(&quot; &quot;, &quot;+&quot;)
    except:
      sys.exit(&quot;Error handling this search term, exiting ...&quot;)
    lang = raw_input(&quot;Filter on programming language (press Enter to include all): &quot;).strip().lower()
    try:
      prompt = &quot;Number of search pages to process (default = 3): &quot;
      numSearchPages = int(raw_input(prompt).strip()[0])
    except:
      numSearchPages = 3
    # get the search results
    for page in range(1,numSearchPages+1):
      results = self.get_search_results(page, lang)
      for result in results[1].split(&quot;##&quot;): # each search result is divided by ##
        self.parse_search_result(result)


  def get_search_results(self, page, lang):
    &quot;&quot;&quot; Query github&#39;s advanced search and re.split for the relevant piece of info 
        RFE: have a branch to use html2text local copy if present, vs. remote if not &quot;&quot;&quot;
    githubSearchUrl = &quot;https://github.com/search?q=&quot;
    searchUrl = urllib.quote_plus(&quot;%s%s&amp;p=%s&amp;ref=searchbar&amp;type=Code&amp;l=%s&quot; % \
      (githubSearchUrl, self.searchTerm, page, lang))
    html2textUrl = &quot;http://html2text.theinfo.org/?url=&quot;
    queryUrl = html2textUrl+searchUrl
    html = urllib.urlopen(queryUrl).read()
    return re.split(r&quot;seconds\)|## Breakdown&quot;, html)


  def parse_search_result(self, result):
    &quot;&quot;&quot; Process the search results, also store each script URL in a list for reference &quot;&quot;&quot;
    lines = result.split(&quot;\n&quot;)
    source = &quot;&quot;.join(lines[0:2])
    pattern = re.compile(r&quot;.*\((.*?)\)\s+\((.*?)\).*&quot;)
    m = pattern.match(source)
    if m != None:
      self.counter += 1 
      url = &quot;https://raw.github.com%s&quot; % m.group(1).replace(&quot;tree/&quot;, &quot;&quot;)
      lang = m.group(2)
      self.print_banner(lang, url)
      self.scripts.append(url) # keep track of script links 
      for line in lines[2:]:
        # ignore pagination markup
        if &quot;github.com&quot; in line or &quot;https://git&quot; in line or &quot;[Next&quot; in line: continue 
        if line.strip() == &quot;&quot;: continue
        print line


  def print_banner(self, lang, url):
    &quot;&quot;&quot; Print the script, lang, etc. in a clearly formatted way &quot;&quot;&quot;
    print &quot;\n&quot; + &quot;+&quot; * 125
    print &quot;(%i) %s / src: %s&quot; % (self.counter, lang, url)


  def show_script_context(self, script_num=&quot;&quot;):
    &quot;&quot;&quot; Another menu option to show more context from the github script 
        surrounding or leading up to the search term &quot;&quot;&quot;
    if len(self.scripts) == 0:
      print &quot;There are no search results yet, so cannot show any scripts yet.&quot;
      return False
    script_num = int(raw_input(&quot;Enter search result number: &quot;).strip())
    script = self.scripts[script_num-1] # list starts with index 0 = 1 less than counter
    a = urllib.urlopen(script)
    if a.getcode() != 200:
      print &quot;The requested script did not give a 200 return code&quot;
      return False
    lines = a.readlines() 
    a.close()
    if len(lines) == 0:
      print &quot;Did not get content back from script, maybe it is gone?&quot;
      return False
    num_context_lines = 8
    print &quot;\nExtracting more context for search term &lt;%s&gt; ...&quot; % self.searchTerm
    print &quot;Showing %i lines before and after the match in the original script hosted here:\n%s\n&quot; % \
      (num_context_lines, script)
    for i, line in enumerate(lines):
      if self.searchTerm.lower() in line.lower():
        print &quot;\n... %s found at line %i ...&quot; % (self.searchTerm, i)
        j = i - num_context_lines
        for x in lines[i-num_context_lines : i+num_context_lines]:
          if self.searchTerm.lower() in x.lower():
            print &quot;%i ---&gt; %s&quot; % (j, x), # makes the match stand out
          else:
            print &quot;%i      %s&quot; % (j, x),        
          j += 1


###&Acirc;&nbsp;instant
github = GithubSearch()
</pre>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<h3>See it in action</h3>
<pre>
$ vi github_search.py 


      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: N

You picked: [n]
Enter search term: os.system
Filter on programming language (press Enter to include all): python
Number of search pages to process (default = 3): 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(1) Python / src: https://raw.github.com/fhopecc/stxt/1a14c802362047af4c9f6d5ec2312a57cbc9bca6/task/setup_win.py
    import os
    _os.system_(

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(2) Python / src: https://raw.github.com/fhopecc/stxt/325dc6e2cbfecc9d071264f71aee7b156a8a6970/task/shutdown.py
    import os
    _os.system_(&#39;shutdown -s -f&#39;)

..
..
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(9) Python / src: https://raw.github.com/rob0r/snmpnetif/b6228f3ba6c55a7f8119af3a1bd4c014f5533b9b/snmpnetif.py
    (True):
                try:
                    # clear the screen
                    if os.name == &#39;nt&#39;: clearscreen = _os.system_

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(10) Python / src: https://raw.github.com/trey0/geocamShare/98029ffb1d26784346f7a2e5984048e8764df116/djangoWsgi.py
    .mkstemp(&#39;djangoWsgiSourceMe.txt&#39;)
        os.close(fd)
        _os.system_(&#39;bash -c &quot;(source %s/sourceme.sh &amp;&amp; printenv &gt; %s

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(11) Python / src: https://raw.github.com/jphcoi/MLMTC/48029dd647dc17173ed94693deccbb8d7bb42ed6/map_builder/CFpipe.py
    _sys
        try:
          _os.system_(command_sys)
        except:
          &#39;----------------------------------detection de communaut

      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: s

You picked: [s]
Enter search result number: 9

Extracting more context for search term &lt;os.system&gt; ...
Showing 8 lines before and after the match in the original script hosted here:

https://raw.github.com/rob0r/snmpnetif/b6228f3ba6c55a7f8119af3a1bd4c014f5533b9b/snmpnetif.py

... os.system found at line 250 ...
242              ifidx = self.ifactive()
243              
244              # get active interface names
245              ifnames = self.ifnames(ifidx)
246              
247              while(True):
248                  try:
249                      # clear the screen
250 ---&gt;                 if os.name == &#39;nt&#39;: clearscreen = os.system(&#39;cls&#39;)
251 ---&gt;                 if os.name == &#39;posix&#39;: clearscreen = os.system(&#39;clear&#39;)
252                      
253                      # print the device name and uptime
254                      print(devicename)
255                      print(&#39;Device uptime: {0}\n&#39;).format(self.devuptime())
256                      
257                      # print stats if the first loop has run
..

      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: n

You picked: [n]
Enter search term: grep
Filter on programming language (press Enter to include all): perl
Number of search pages to process (default = 3): 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(1) Perl / src: https://raw.github.com/xPapers/xPapers/1fe2bf177e3d37f2024d00601340627a8ded85ad/lib/xPapers/Cat.pm
    -&gt;catCount($me-&gt;catCount-1);
        $me-&gt;save;
        $me-&gt;clear_cache;
        # detach
        $me-&gt;cat_memberships([_grep_

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(2) Perl / src: https://raw.github.com/roethigj/Lx-Office-Anpassungen/e06afb2fc94573bc4a305a41e95a8b7a812e2db0/SL/IS.pm
    -&gt;{TEMPLATE_ARRAYS}-&gt;{$_} }, &quot;&quot;) } _grep_({ $_ ne &quot;description&quot; } @arrays));
        }
        $form

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(3) Perl / src: https://raw.github.com/roethigj/Lx-Office-Anpassungen/e06afb2fc94573bc4a305a41e95a8b7a812e2db0/SL/OE.pm
    -&gt;{sort} &amp;&amp; _grep_($form-&gt;{sort}, keys(%allowed_sort_columns))) {
        $sortorder = $allowed

      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: s

You picked: [s]
Enter search result number: 3

Extracting more context for search term &lt;grep&gt; ...
Showing 8 lines before and after the match in the original script hosted here:

https://raw.github.com/roethigj/Lx-Office-Anpassungen/e06afb2fc94573bc4a305a41e95a8b7a812e2db0/SL/OE.pm

... grep found at line 210 ...
202          &quot;ordnumber&quot;               =&gt; &quot;o.ordnumber&quot;,
203          &quot;quonumber&quot;               =&gt; &quot;o.quonumber&quot;,
204          &quot;name&quot;                    =&gt; &quot;ct.name&quot;,
205          &quot;employee&quot;                =&gt; &quot;e.name&quot;,
206          &quot;salesman&quot;                =&gt; &quot;e.name&quot;,
207          &quot;shipvia&quot;                 =&gt; &quot;o.shipvia&quot;,
208          &quot;transaction_description&quot; =&gt; &quot;o.transaction_description&quot;
209        );
210 ---&gt;   if ($form-&gt;{sort} &amp;&amp; grep($form-&gt;{sort}, keys(%allowed_sort_columns))) {
211          $sortorder = $allowed_sort_columns{$form-&gt;{sort}} . &quot; ${sortdir}&quot;;
212        }
213        $query .= qq| ORDER by | . $sortorder;
214      
215        my $sth = $dbh-&gt;prepare($query);
216        $sth-&gt;execute(@values) ||
217          $form-&gt;dberror($query . &quot; (&quot; . join(&quot;, &quot;, @values) . &quot;)&quot;);

... grep found at line 1135 ...
1127        my $sameitem = &quot;&quot;;
1128        foreach $item (sort { $a-&gt;[1] cmp $b-&gt;[1] } @partsgroup) {
1129          $i = $item-&gt;[0];
1130      
1131          if ($item-&gt;[1] ne $sameitem) {
1132            push(@{ $form-&gt;{TEMPLATE_ARRAYS}-&gt;{description} }, qq|$item-&gt;[1]|);
1133            $sameitem = $item-&gt;[1];
1134      
1135 ---&gt;       map({ push(@{ $form-&gt;{TEMPLATE_ARRAYS}-&gt;{$_} }, &quot;&quot;) } grep({ $_ ne &quot;description&quot; } @arrays));
1136          }
1137      
1138          $form-&gt;{&quot;qty_$i&quot;} = $form-&gt;parse_amount($myconfig, $form-&gt;{&quot;qty_$i&quot;});
1139      
1140          if ($form-&gt;{&quot;id_$i&quot;} != 0) {
1141      
1142            # add number, description and qty to $form-&gt;{number}, ....
..

      (N)ew search
      (S)how more context (github script)
      (Q)uit
      Enter choice: q

You picked: [q]
Goodbye!

shell returned 1
</pre>
<p><fb:like href="" send="true" width="580" show_faces="false" action="like" font=""></fb:like></p>
<img src="http://feeds.feedburner.com/~r/bbelderbos/~4/vn8Fqlo86po" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bobbelderbos.com/2013/01/python-script-to-query-github-code-i-your-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bobbelderbos.com/2013/01/python-script-to-query-github-code-i-your-terminal/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: bobbelderbos.com @ 2013-06-18 22:46:01 by W3 Total Cache -->
