Git and GitHub

Fateen Alam has compiled a terrific Notion page that provides overviews of version control, setting up and using git, and then using GitHub: Git and GitHub. (Notion is one of many new entrants into the note-taking app/system/omnibus category.)

What Is Code?

Paul Ford’s [“What Is Code?”][bb] at/on _Bloomberg Business_ is a magnum opus of a treatment. My little word count app that I created as a service on my Mac logs the things at 30,000 words.


Learn to Write (Code)

This year is the year I teach myself to write code, and there have never been more resources available to humanists interested in doing so. At this moment, I would like to point out two interactive approaches as well as two more thoughtful approaches designed especially for historians (who, as always, seem better at producing these kinds of texts than other humanists):

If you are interested in a very simple, one step at a time approach to learning how to code — and those first few steps really do feel, to me, like what the first few steps must feel like to the soon-to-be toddler, transformative — then there is both [Hackety Hack][hh], which was first brought to my attention by [ProfHacker][ph] and [CodeAcademy][ca]. Hackety-Hack will teach you the basics of [Ruby][], a very powerful programming language that has also been refined for web work — e.g., Rails, which is the power behind Twitter — and CodeAcademy will teach you [JavaScript][js], another scripting language which powers some significant features of the modern web.

In the same ProfHacker article linked above, Ryan Cordell points to another resources for learning Ruby (for humanists): [The Rubyist Historian][rh] by Jason Heppler. (Unfortunately, at this moment, that portion of his site appears to be down.) There is also the terrific book [The Programming Historian][ph], which offers instruction in various ways to work in [Python][].


Visualization Toolkits

As I begin to assemble materials for my spring seminar surveying the digital humanities, I find myself trying to come up with categories, especially for describing arenas of activity. The digital humanities can be quite overwhelming when you are first introduced to them, and because everyone comes to them from so many backgrounds and with so many agendas, it’s hard to separate personal visions from something more synthetic.

Towards the latter, I am trying to think about how to describe some of the things that people regularly do, and I’ll be posting some of my initial thoughts in a series of posts that I will myself later synthesize into something like a syllabus and/or guide. Readers who want to follow along are welcome to do so. I am going to tag the posts with the number for the course, 531, and I will try to update earlier posts so that they turn up under that tag as well.

One of the first things to break out for me is the area of visualization, which is so important that it’s built into most network analysis applications. Visualization, especially dynamic visualization which allows you to adjust your view of the data in various ways, is an essential part of analysis and understanding.

Many of us are used to working with built-in visualizations toolkits like those found in Network Workbench or ORA or even Excel/Powerpoint — Numbers/Pages for those Mac users who eschew Microsoft’s productivity apps and OpenOffice users forgive me for not knowing the equivalents, but R also possesses some remarkable graphical abilities.

None of them can compare to the graphical and/or visualization abilities of two languages build for doing this kind of work: Processing and Protoviz.

Up next: a comparison of the two.

Website Infrastructure

For those who have asked, this site runs on a total of 7 PHP pages. `Index`, `search`, and `single` serve the blog portion. `Page`, `archives`, and `notes` are special purpose pages. (Yes, that’s six pages and I said seven at the outset. One page is purely for my own in-house use, and I don’t want to give it away.)


To reduce server load and to increase load times into browsers, I have opted not to use separate `footer` and `header` php files. The design of the site doesn’t change enough to warrant keeping them as separate files.

My goal in this site is always to keep the infrastructure, and the data structures, as simple as possible.

{less} extends CSS

While CSS3 continues to evolve in interesting and powerful ways, it still clings to some conventions that make it more like a set of markup conventions and less like a programming language. That is, while you can describe a lot of things in CSS, you typically have to do so verbosely and somewhat redundantly. You cannot, like most modern programming languages, compress your efforts, pass variables, create something like objects.

For those who either run Ruby or, like me, are confined to admiring it and continue to try to learn it, [`less`]( is available for installation and use and what it does to, or for, CSS is nothing short of amazing.

For one thing, you can set up variables for things used site-wide that allow you to establish, as in the example below, all your colors in one place:

@brand_color: #4D926F;

#header {
color: @brand_color;

h2 {
color: @brand_color;

Or you can use something they call *mixins* which operate like some sort of powerful hybrid of variables and functions — note how you can pass an argument to what looks like a variable:

.rounded_corners (@radius: 5px) {
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
border-radius: @radius;

#header {

#footer {

Finally, for me at least, there is the opportunity to nest selector names in a way to make inheritance more obvious:

#header {
color: red;
a {
font-weight: bold;
text-decoration: none;

(Nothing kills me more than trying to figure out inheritance of an item that just won’t style for me because I’ve missed some piece of the CSS flow in my analysis.)

Check out [`less`]( for more.

Share Delicious Library

(with simple HTML)

For anyone interested in sharing the library with friends, here are some tips. For the purpose of this explanation I am going to assume that you have a web server on your machine and that you server root directory is at `/Library/WebServer/Documents`.

1 – Copy your library file, `Library Media Data.xml`, from `~/Library/Application Support/Delicious Library/` to the root directory of you web server. I recommend renaming it to something without spaces, such as `mylibrary.xml`.
2 – Copy the directory `~/Library/Application Support/Delicious Library/Images/Small Covers` to the root of your web server.
3 – Edit the file `mylibrary.xml` (if that is the name you gave it) and add the line:

after then line that reads:

4 – Create a new file called `delicious-library.xsl` in the root folder of your web server and add the following text:



oddRow evenRow
Small Covers/   


oddRow evenRow


Small Covers/   
oddRow evenRow
Small Covers/   

5 – Now from you web server, if it is running on the same machine:


If your web server is not your local computer, then you will simply have to modify the steps with uploading instead of copying. Always be sure to modify a *copy* of your files, and not the originals. You don’t want to get burnt if you make a mistake

Run MultiMarkdown in Terminal

I found this script. I think I could substitute the PHP version of MultiMarkdown here.


# This script runs the multimarkdown       #
# script on specified file, redirects      #
# output to html file, and opens resulting #
# file in web browser.                     #

# gets complete filename of file 
srcfile="`eval echo $1`"	

# gets the filename without .txt
FILENOEXTENSION="`echo $srcfile | sed -e 's/\..*$//'`"	

# Runs perl script and creates .html file
~/MultiMarkdown/bin/ $srcfile > $FILENOEXTENSION.html	

# opens it up

Convert HTML to text

I forgot from where I copied this script:

# Usage: convert-html-to-md […]
# Convert the specified HTML files into Markdown text-format equivalents
# in the current working directory. The file extension will be .md.txt.
# Requires the Python script by Aaron Swartz to convert
# from HTML to Markdown text [].
# html2text=”${1}”shift

[while [ -n “${1}” ] ; do
# Use the contents of the title element for the filename. In case
# the title element spans multiple lines, the entire file is first
# converted to a single line before the sed pattern is applied. Any
# “unsafe” characters are then replaced with hyphens to produce a
# valid filename.
title=$(cat “${1}” | \
tr -d ‘\n\r’ | \
sed -nre ‘s/^.*(.*?)<\/title>.*$/\1\n/ip’ | \<br /> tr “\`~\!@#$%^&*()+={}|[]\\:;\”\’<>?,/ \t” ‘[-*]’)</p> <p> # If there’s no title, then just use the original filename.<br /> if [ -z “${title}” ] ; then<br /> title=$(basename “${1}” .html)<br /> fi</p> <p> # Convert the HTML to Markdown.<br /> cat “${1}” | python “${html2text}” > “${title}.md.txt”<br /> shift<br /> done]</p> </div><!-- .entry-content --> <footer class="entry-meta"> Posted on <a href="" title="12:16" rel="bookmark"><time class="entry-date" datetime="2008-05-08T12:16:18-06:00" pubdate>2008 May 8</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="" title="View all posts by johnlaudun" rel="author">johnlaudun</a></span></span>. <span class="sep"> | </span> <span class="tags-links"> Tagged: <a href="" rel="tag">code</a>, <a href="" rel="tag">html</a>, <a href="" rel="tag">python</a>.</span> </footer><!-- .entry-meta --> </article><!-- #post-1997 --> <article id="post-2014" class="post-2014 post type-post status-publish format-standard hentry category-work tag-code tag-svn"> <header class="entry-header"> <h1 class="entry-title"><a href="" title="Permalink to Subversion Notes" rel="bookmark">Subversion Notes</a></h1> </header><!-- .entry-header --> <div class="entry-content"> <p>Here’s what a checkout request on the command line looks like:</p> <p> $ svn checkout<br /> A calc/Makefile<br /> A calc/integer.c<br /> A calc/button.c<br /> Checked out revision 56.</p> <p>### SSH Problems</p> <p>> ## Planet Argon, ssh, authorized_keys, and TextMate happiness</p> <p>> Been trying to get ssh-based password-free login going at Planet Argon (more on the transfer from DreamNightmareHost to Planet Argon in a future post). A couple of back-and-forths with the admins over there. Both they and this thread insist that ~/.ssh/authorized_keys needs to be chmoded to 600. This isn’t right. It only needs 644.</p> <p>But what the above thread pointed me to is that ~/ needs to be chmoded to 750. Voila! Now I can use Subversion, directly inside the best text editor on the Mac.</p> <p>Let’s just hope there aren’t any groups that need to write to my home directory.</p> <p>## Problems</p> <p> Toulouse:~ jjl$ ssh -v<br /> OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006<br /> usage: ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]<br /> [-D [bind_address:]port] [-e escape_char] [-F configfile]<br /> [-i identity_file] [-L [bind_address:]port:host:hostport]<br /> [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]<br /> [-R [bind_address:]port:host:hostport] [-S ctl_path]<br /> [-w local_tun[:remote_tun]] [user@]hostname [command]</p> <p>## Following Allan’s Advice</p> <p>Your identification has been saved in /Users/jjl/.ssh/id_dsa.<br /> Your public key has been saved in /Users/jjl/.ssh/<br /> The key fingerprint is:</p> <p>Shakespeare was the pass-phrase used.</p> <p>## MacFusion</p> <p>Set up on 2007-04-28. Used SSH (which has the wild woman password by the way). Mounted like a charm. Now, let’s see what’s in there and how well this works.</p> <p>## SVN Checkout</p> <p>If you are using bash you should put this in your ~/.bash_profile (or a similar file which gets sourced when you open a terminal):</p> <p> export LC_CTYPE=en_US.UTF-8</p> </div><!-- .entry-content --> <footer class="entry-meta"> Posted on <a href="" title="20:39" rel="bookmark"><time class="entry-date" datetime="2008-04-28T20:39:28-06:00" pubdate>2008 April 28</time></a><span class="byline"> by <span class="author vcard"><a class="url fn n" href="" title="View all posts by johnlaudun" rel="author">johnlaudun</a></span></span>. <span class="sep"> | </span> <span class="tags-links"> Tagged: <a href="" rel="tag">code</a>, <a href="" rel="tag">svn</a>.</span> </footer><!-- .entry-meta --> </article><!-- #post-2014 --> </div><!-- #content .site-content --> </section><!-- #primary .content-area --> <div id="secondary" class="widget-area" role="complementary"> <aside id="text-3" class="widget widget_text"> <div class="textwidget"><h2>Recent Publications</h2> <p><a href="">Folklore as a Networked Economy: How a Recently-Invented-but-Traditional Artifact Reveals the Way Folkloric Production Has Always Worked.</a></p> <p><a href="">TED Talks as Data</a></p> <p><a href="">Trucks under Water: A Legend from the 2016 Flood</a></p> <p>And, of course <em><a href="">the book.</a></em></p> </div> </aside><aside id="search-5" class="widget widget_search"> <form method="get" id="searchform" action="" role="search"> <label for="s" class="assistive-text">Search</label> <input type="text" class="field" name="s" value="" id="s" placeholder="Search …" /> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" /> </form> </aside><aside id="top-posts-2" class="widget widget_top-posts"><h1 class="widget-title">Top Posts & Pages</h1><ul> <li> <a href="" class="bump-view" data-bump-view="tp">Append a Python List Using a List Comprehension</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">Installing, and Setting, PIP with MacPorts</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">From CSV to Bipartite Network to One-Mode Projection</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">Making a Wordpress Category Private</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">IRkernel Difficulties</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">Language Family Tree</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">RGB/Hex Color "Wheel"</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">24-liter Daypack Comparison</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">Fruit Trees for South Louisiana</a> </li> <li> <a href="" class="bump-view" data-bump-view="tp">Word-wrap (filling) in Emacs</a> </li> </ul></aside> </div><!-- #secondary .widget-area --> </div><!-- #main .site-main --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="site-info"> <a href="" rel="generator">Proudly powered by WordPress</a> Theme: Publish by <a href="" rel="designer">Konstantin Kovshenin</a>. </div><!-- .site-info --> </footer><!-- #colophon .site-footer --> </div><!-- #page .hfeed .site --> <script type='text/javascript' id='jetpack-carousel-js-extra'> /* <![CDATA[ */ var jetpackCarouselStrings = {"widths":[370,700,1000,1200,1400,2000],"is_logged_in":"","lang":"en","ajaxurl":"https:\/\/\/wordpress\/wp-admin\/admin-ajax.php","nonce":"4bcf1cb03d","display_exif":"1","display_comments":"1","display_geo":"1","single_image_gallery":"1","single_image_gallery_media_file":"","background_color":"black","comment":"Comment","post_comment":"Post Comment","write_comment":"Write a Comment...","loading_comments":"Loading Comments...","download_original":"View full size <span class=\"photo-size\">{0}<span class=\"photo-size-times\">\u00d7<\/span>{1}<\/span>","no_comment_text":"Please be sure to submit some text with your comment.","no_comment_email":"Please provide an email address to comment.","no_comment_author":"Please provide your name to comment.","comment_post_error":"Sorry, but there was an error posting your comment. Please try again later.","comment_approved":"Your comment was approved.","comment_unapproved":"Your comment is in moderation.","camera":"Camera","aperture":"Aperture","shutter_speed":"Shutter Speed","focal_length":"Focal Length","copyright":"Copyright","comment_registration":"1","require_name_email":"1","login_url":"https:\/\/\/wordpress\/wp-login.php?","blog_id":"1","meta_data":["camera","aperture","shutter_speed","focal_length","copyright"],"local_comments_commenting_as":"<p id=\"jp-carousel-commenting-as\">You must be <a href=\"#\" class=\"jp-carousel-comment-login\">logged in<\/a> to post a comment.<\/p>"}; /* ]]> */ </script> <script type='text/javascript' src='' id='jetpack-carousel-js'></script> <script type='text/javascript' src='' id='small-menu-js'></script> <script type='text/javascript' src='' id='jetpack-lazy-images-polyfill-intersectionobserver-js'></script> <script type='text/javascript' id='jetpack-lazy-images-js-extra'> /* <![CDATA[ */ var jetpackLazyImagesL10n = {"loading_warning":"Images are still loading. Please cancel your print and try again."}; /* ]]> */ </script> <script type='text/javascript' src='' id='jetpack-lazy-images-js'></script> <script type='text/javascript' src='' id='wp-embed-js'></script> <script src='' defer></script> <script> _stq = window._stq || []; _stq.push([ 'view', {v:'ext',j:'1:9.5',blog:'33779968',post:'0',tz:'-6',srv:''} ]); _stq.push([ 'clickTrackerInit', '33779968', '0' ]); </script> </body> </html>