Books I Read in 2020

Adios 2020! You won't soon be forgotten, that's for sure.

Aloha 2021! In the spirit of getting things off on the right foot, I'm posting the books I read right on time!

Only 17 books this year. Gonna blame too much binge watching of TV shows and a lot of time riding my bike. I seem to be rapidly falling away from my goal of reading 50 books a year.

Particular highlights were The Water Dancer by Ta-Nehisi Coates, Nothing to See Here by Kevin Wilson and The Plot Against America by Philip Roth. The Roth book was pretty frightening given current cirumstances.

But let's not end on a bad note. Here's to a new year!

You can see the other years here in case you missed them.

Add a comment
Category: reading Tags:

Books I Read in 2019

OK, only 11 months late on getting this up. Going to blame 2020 for this. All I'll say is I took a big John Scalzi trip this past year.

34 books.

  • A Perfect Spy by John le Carré (4 stars)
  • Random Family: Love, Drugs, Trouble, and Coming of Age in the Bronx by Adrian Nicole LeBlanc (4 stars)
  • Little Bee by Chris Cleave (4 stars)
  • The Last Colony (Old Man's War, #3) by John Scalzi (3 stars)
  • The Ghost Brigades (Old Man's War, #2) by John Scalzi (4 stars)
  • Old Man's War (Old Man's War, #1) by John Scalzi (4 stars)
  • To Shake the Sleeping Self: A Journey from Oregon to Patagonia, and a Quest for a Life with No Regret by Jedidiah Jenkins (3 stars)
  • The Consuming Fire (The Interdependency, #2) by John Scalzi (4 stars)
  • The Collapsing Empire (The Interdependency, #1) by John Scalzi (5 stars)
  • Bad Blood: Secrets and Lies in a Silicon Valley Startup by John Carreyrou (4 stars)
  • Homegoing by Yaa Gyasi (5 stars)
  • Everything Under by Daisy Johnson (4 stars)
  • Stories of Your Life and Others by Ted Chiang (5 stars)
  • The Dinner by Herman Koch (4 stars)
  • The Day the Sun Died by Yan Lianke (3 stars)
  • Down City: A Daughter's Story of Love, Memory, and Murder by Leah Carroll (4 stars)
  • Howards End by E.M. Forster (5 stars)
  • Delta-v by Daniel Suarez (4 stars)
  • A Philosophy of Walking by Frédéric Gros (0 stars)
  • Murder on the Orient Express (Hercule Poirot, #10) by Agatha Christie (4 stars)
  • There There by Tommy Orange (4 stars)
  • City of Miracles (The Divine Cities, #3) by Robert Jackson Bennett (5 stars)
  • Manhood for Amateurs by Michael Chabon (4 Stars)
  • City of Blades (The Divine Cities, #2) by Robert Jackson Bennett (4 stars)
  • Eileen by Ottessa Moshfegh (4 stars)
  • Friday Black by Nana Kwame Adjei-Brenyah (4 stars)
  • Frederick Douglass: Prophet of Freedom by David W. Blight (4 stars)
  • Washington Black by Esi Edugyan (4 stars)
  • Things Fall Apart (The African Trilogy, #1) by Chinua Achebe (0 stars)
  • The City of Mirrors (The Passage, #3) by Justin Cronin (4 stars)
  • Calypso by David Sedaris (4 stars)
  • City of Stairs (The Divine Cities, #1) by Robert Jackson Bennett (4 stars)
  • Americanah by Chimamanda Ngozi Adichie (5 stars)
  • Wild: From Lost to Found on the Pacific Crest Trail by Cheryl Strayed (5 stars)
  • American Pastoral (The American Trilogy, #1) by Philip Roth (4 stars)
  • You can see the other years here in case you missed them.

    Add a comment
    Category: reading Tags:

    Books I Read in 2018

    Going on nine years, here's my annual list of books I read. Like all the other years, I didn't meet my goal of 53 books. I only managed 33 in 2018. So, it's basically a repeat of 2017.

    In my defense, I did ride my bike quite a few miles. Even more than 2017 so it's not déjà vu all over again.

    Anyways, here is the list. Once again, I read a whole bunch of Harry Bosch. And also a whole bunch of Stephen King.

    You can see the other years here in case you missed them.

    Add a comment
    Category: reading Tags:

    Books I Read in 2017

    So I got tired of waiting around for Donald Trump to post his reading list of 2017 and decided to preempt him and post mine. I have a feeling his was just the outside of Happy Meals and gum wrappers anyways. Plus, this is the only post I make these days so I want to make sure and get it out of the way early in the year.

    My goal was to read 52 books this year but probably spent too much time riding my bike. Maybe I'll do better next year.

    Anyhow, highlights from this year were American War. Not sure if it was a documentary or a sci-fi novel.

    And The Nix was a really funny surreal satire on modern life. I enjoyed it a whole bunch.

    If you want to be absolutely terrified, feel free to dive into The Sixth Extinction.

    • The Ultimate Bicycle Owner's Manual: The Universal Guide to Bikes, Riding, and Everything for Beginner and Seasoned Cyclists by Eben Weiss (4 stars)
    • Home (Binti, #2) by Nnedi Okorafor (4 stars)
    • The Secret Race: Inside the Hidden World of the Tour de France by Tyler Hamilton (3 stars)
    • Pro Cycling on $10 a Day: From Fat Kid to Euro Pro by Phil Gaimon (4 stars)
    • Wizard and Glass (The Dark Tower, #4) by Stephen King (4 stars)
    • Draft Animals: Living the Pro Cycling Dream by Phil Gaimon (5 stars)
    • American War by Omar El Akkad (5 stars)
    • Dark Tower: Wastelands by Stephen King (0 stars)
    • The Sixth Extinction: An Unnatural History by Elizabeth Kolbert (5 stars)
    • The Drawing of the Three (The Dark Tower, #2) by Stephen King (4 stars)
    • The Nix by Nathan Hill (5 stars)
    • Loving Day by Mat Johnson (4 stars)
    • Angels Flight (Harry Bosch, #6) by Michael Connelly (4 stars)
    • The Gunslinger (The Dark Tower, #1) by Stephen King (4 stars)
    • A Darkness More Than Night (Harry Bosch, #7; Terry McCaleb, #2; Harry Bosch Universe, #9) by Michael Connelly (3 stars)
    • Trunk Music (Harry Bosch, #5; Harry Bosch Universe, #6) by Michael Connelly (3 stars)
    • In the Heart of the Sea: The Tragedy of the Whaleship Essex by Nathaniel Philbrick (4 stars)
    • Cities of the Plain by Cormac McCarthy (5 stars)
    • Benediction by Kent Haruf (4 stars)
    • Eventide by Kent Haruf (4 stars)
    • The Handmaid's Tale by Margaret Atwood (5 stars)
    • Hollywood by Charles Bukowski (4 stars)
    • Plainsong (Plainsong, #1) by Kent Haruf (4 stars)
    • Seveneves by Neal Stephenson (4 stars)
    • Last Man in Tower by Aravind Adiga (4 stars)
    • Crosstalk by Connie Willis (4 stars)
    • The Last Coyote (Harry Bosch, #4; Harry Bosch Universe, #4) by Michael Connelly (4 stars)
    • Carry the One by Carol Anshaw (4 stars)
    • The Concrete Blonde (Harry Bosch, #3; Harry Bosch Universe, #3) by Michael Connelly (4 stars)
    • The Black Ice (Harry Bosch, #2; Harry Bosch Universe, #2) by Michael Connelly (4 stars)
    • A Place of My Own: The Education of an Amateur Builder by Michael Pollan (3 stars)
    • The Last Good Heist: The Inside Story of The Biggest Single Payday in the Criminal History of the Northeast by Tim White (3 stars)
    • The Black Echo (Harry Bosch, #1; Harry Bosch Universe, #1) by Michael Connelly (4 stars)
    • Ancillary Sword (Imperial Radch, #2) by Ann Leckie (3 stars)
    • The Art Forger by B.A. Shapiro (3 stars)
    • Apex (Nexus, #3) by Ramez Naam (3 stars)
    • Crux (Nexus, #2) by Ramez Naam (4 stars)
    • Nexus (Nexus, #1) by Ramez Naam (4 stars)
    • Barbarian Days: A Surfing Life by William Finnegan (2 stars)
    • Deep Work: Rules for Focused Success in a Distracted World by Cal Newport (4 stars)
    • Getting Started with Raspberry Pi by Matt Richardson (4 stars)
    • The North Water by Ian McGuire (4 stars)
    • The Family Fang by Kevin Wilson (4 stars)

    If you are curious, I use a python script to generate the list of books. (You'll need your Goodreads key in order to use it.) Then I just paste it into GNU Emacs.

    You can see the other years here. I've managed to do this for 8 years running. Hooray for narcissistic me!

    Add a comment
    Category: reading Tags:

    Books I Read in 2016

    Ah nuts. It's been a whole year without a single post here. Anyways, at least you get one post a year from me. That's more than some blogs I suppose.

    Only 21 books this year! That's a grave offense. I must do better this year. Go 2017!

    By far, the most terrifying (and timely) was "In the Garden of Beasts." Imagine watching the rise of Hitler, screaming about it and no one does anything. Imagine. It was much scarier than the Sarah Pinborough books.

    Colson Whitehead's book was amazing. Heartbreaking and powerful all in one tiny book. Go read it now. I'll wait here until you get back.

    And I cannot recommend reading "Weapons of Math Destruction" after watching "Black Mirror." That will drive you towards a life of digital minimalism where you'll be handing pieces of paper to people to securely deliver messages.

    Without further ado, the books I read in 2016. See you next year (unless "Black Mirror" sets you off):

    If you are curious, I use a python script to generate the list of books. (You'll need your Goodreads key in order to use it.) Then I just paste it into GNU Emacs.

    You can see the other years here. I've managed to do this for 7 years running. Hooray for narcissistic me!

    Add a comment
    Category: reading Tags:

    Books I Read in 2015

    Here it is! The annual post you have all been clamoring for.

    In review, Kindred was a great book. Hot damn! Go read it now! And the book that's a huge interview with DFW was amazing. That reminds me, I need to see that movie.

    Looking over it, I can see I spent a lot time reading books about productivity and work. There are a few books on here from the same topic that I didn't even finish. I guess 2015 was all about business time.

    Also, no idea why I read Drop City followed immediately by Open City. City time? Drop City was good by the way.

    So, here's the complete list:

    If you are curious, I use a python script to generate the list of books. (You'll need your Goodreads key in order to use it.) Then I just paste it into GNU Emacs.

    You can see the other years here. I've managed to do this for 5 years running. Hooray for narcissistic me!

    Add a comment
    Category: reading Tags:

    Org Exporting and Emailing

    I use org-mode. I use Emacs. I send email using Emacs.

    Thus, I really liked John Kitchin's post about sending email with org. It was almost perfect (to me). The only thing it didn't do was format the content before exporting. It just sent it out as plain org.

    Thanks to his hard work, I just had to add a few bits to come up with this. Now I can get the cool line blocks around my code and execute the org-babel blocks in my headings before they get sent out. This is very helpful when sending out snippets of code and random command line effluvia.

    (defun email-heading-after-export (backend &optional plist)
      "Send the current org-mode heading as the body of an email, after converting
    it to the given backend.
    "
      (interactive)
      (setq *email-heading-point* (set-marker (make-marker) (point)))
      (save-excursion
        (org-mark-subtree)
        (let ((TO (org-entry-get (point) "TO" t))
              (SUBJECT (nth 4 (org-heading-components)))
              (continue nil)
          (switch-function nil)
          (yank-action nil)
          (send-actions '((email-send-action . nil)))
          (return-action '(email-heading-return))
              (plist `(:with-toc nil ,@plist)))
          ;; we do not  want the mark to interfere with export
          (deactivate-mark)
          (message (format "%s" plist))
          (org-export-to-buffer backend "*org-to-email*" nil t nil t plist
                                nil)
          (switch-to-buffer "*org-to-email*")
          (let ((content (buffer-substring (point-min) (point-max))))
            (compose-mail TO SUBJECT nil continue switch-function yank-action
                          send-actions return-action)
            (message-goto-body)
            (insert content)
            (if TO
                (message-goto-body)
              (message-goto-to))))))
    

    Now, I can email a heading as ASCII

    (defun email-heading-as-ascii ()
      (interactive)
      (email-heading-after-export 'ascii))
    

    Or UTF-8:

    (defun email-heading-as-utf8 ()
      (interactive)
      (message "wtf")
      (email-heading-after-export 'ascii '(:ascii-charset utf-8)))
    

    Even Markdown:

    (defun email-heading-as-markdown ()
      (interactive)
      (email-heading-after-export 'md))
    

    You could even send email as HTML but there's no way I'm giving out the tips on how to do that.

    Let me know if you have any questions or comments about the above. And thanks to John Kitchin! This code uses the same License.

    Add a comment
    Category: editor Tags:

    I made a toolbox

    A Carpenter's toolbox

    So, I finally got around to making the toolbox from the 1940's from St. Roy Underhill. Aside from making it a bit shorter (so it would fit in our storage), not making the base of the tray out tomato cans and using metal corner bumpers, I followed his directions to the letter. It was a fun project that I made entirely out of hand tools. No electrons were harmed in making this toolbox.

    I opted to use poplar that I picked up at the local big box store because all the pine was knotty and crappy looking . All the hardware used on it, I got from Lee Valley. Overall, I'm pretty happy with the way it came out. And I got some nice compliements at Off the Saw last week.

    Full toolbox

    Learned a ton from this so that's good. For example, using a Stanley #78 Rabbet plane is not as easy as it looks. I kept going cockeyed with it. Also, resawing a 3/4" piece of poplar that is 30" long is not something you can do unless you have an afternoon free. Note to self: make a new friend who owns a bandsaw.

    A corollary to this is that sharp tools are very important. The resawing probably would have gone quicker if my rip saw was sharp. And I gouged the side with my dull block plane.

    Finally, I learned I really need to make a shooting board. All the cuts where I didn't use my Langdon mitre box, turned out all squirrelly.

    But when all is said and done, now I have a nice little toolbox to carry my tools around the house.

    Add a comment
    Category: woodworking Tags:

    Books I Read in 2014

    OK, here is the only blog post I seem to do these days: the books I read in the past year. I still haven't 100% automated this. Maybe next year.

    The count was a tad lower this year, than years past. I spent a lot more time drawing in my sketchbooks this year than I did reading. I managed to do a sketch a day all the way up until October but then lost steam.

    It's also late because I tried to finish Europe Central by William T. Vollman before the year ended. But my Kindle says I still had about 10 hours left last night so that didn't happen. Maybe it'll the first post in my next books I read post.

    So, here's the list:

    I ended up reading parts of the Harry Potter series to my kid (the wife and I alternate reading to him), so I just decided to re-read the whole damned series again this year to get the full package. Good thing too, because it turns out I forgot lots of things when I speed read it the first time through all those yeaers ago. I'm betting that the page count for this year is close to previous years because of those damned door stops masquerading as books.

    Highlights of this year were And the Mountains Echoed and MaddAddam. I enjoyed The Circle while I was reading it but a week or so after I had finished, I realized it just left too many things unanswered. Not too sure about recommending that one. But you can't really go wrong with anything by Hosseini or Atwood methinks.

    Add a comment
    Category: reading Tags:

    Yet another blogging engine

    Since David Lynch can revive Twin Peaks, I figure I can relaunch this dormant blog. I've redone this site and ditched the old Jekyll static site generator and decided to try out a different generator named Pelican that's written in Python.

    I never bothered to learn Ruby so when I ran into trouble with Jekyll, getting it fixed was painful (to me). To Ruby programmers, probably not so much. Since I'm a Python programmer, hopefully I wont' have as much trouble when things go off the rails. Har har...rails...ruby...get it?

    Frankly, porting it over was kind of a pain in the arse. I had to jump through a whole bunch of hoops with custom scripts and Pandoc (which is a pretty incredible piece of software) but that's all for a different post.

    Welcome to the new site. Sorry if I spammed your feed reader with all my new article ids. Hope you still love me!

    And I want some of that damn good pie.

    Add a comment
    Category: personal Tags:

    Books I Read in 2013

    It's that time of the year again where I finally stop blowing off blogging and write something. I should really whip up a script to do this since it's using the Goodreads API. Then I'd never touch my blogging software again!

    So, withtout futher ado, in reverse chronological order, the 29 books I read in 2013:

    Books I enjoyed this year were Oryx and Crake by Margaret Atwood, To Say Nothing of the Dog by Connie Willis (you could say that 2013 was the Year of Connie Willis for me...she's great!), Telegraph Avenue by Michael Chabon and The Gone-Away World by Nick Harkaway.

    Oh, and Beloved. Jeez that book was crazy good. I might read it again in 2014.

    If you really want to stay abreast of what I'm reading, follow me on Goodreads. Otherwise, see you next year!

    Add a comment
    Category: reading Tags:

    Books I Read in 2012

    Oy vey. So, it seems like I only post here once a year and it's only to list books that I read. Well, at least I'm consistent right?

    I kind of went undead crazy this year what with reading the two Justin Cronin books as well as Colson Whitehead's foray into post-apocalyptic zombie prose.

    Favorites from this year include (in no particular order) Et Tu, Babe, Empire Falls, The Tiger's Wife and Perdido Street Station. The Art of Fielding was really entertaining too though the ending was very strange.

    Full disclosure: Most of the book links on this page are Amazon affiliate links so I get to pay off my bookie that much quicker if you buy something.

    Add a comment
    Category: reading Tags:

    Using Pandas to stalk your neighbors

    I picked up the book Python for Data Analysis as I've been seeing it mentioned in quite a few places. And so far, it's great. A very good high level overview of using Pandas. No, not the cute kind of pandas. I'm talking about the Python library for data analysis. Derp.

    Anyhow, I decided to dive in and see what I could find out about my neighbors. Chapter 9 of the book goes into analyzing the 2012 Federal Election Commission Database so I loaded it up:

    >>> import pandas as pd
    >>> fec = pd.read_csv('P00000001-ALL.csv')
    

    Looking into the data, there is some garbage rows. I grabbed all the Culver City zip codes (well, the zip codes I care about) at least:

    >>> zips = fec.contbr_zip.unique()
    >>> mask = np.array([str(x).startswith('90232') for x in zips])
    >>> fec[fec.contbr_zip.isin(zips[mask])].contbr_city.value_counts()
    CULVER CITY     241
    CUILVER CITY      2
    SANTA MONICA      1
    

    I don't know if these come from bad data from the contributor or from the FEC so I'm just going to include everything based on zip code.

    >>> culver = fec[fec.contbr_zip.isin(zips[mask])]
    >>> culver.contb_receipt_amt.sum()
    58341.0
    

    Fifty-eight grand! Nice going Culver City!

    Now let's see who got the money:

    >>> culver.pivot_table('contb_receipt_amt', rows='cand_nm', aggfunc=sum)
    cand_nm
    Huntsman, Jon                      4500
    Obama, Barack                     50381
    Paul, Ron                           500
    Roemer, Charles E. 'Buddy' III      110
    Romney, Mitt                       2850
    

    That's kind of interesting...Huntsman got more money from the 90232 than Romney.

    Now, let's check out the occupations that contributed the most:

    >>> culver.pivot_table('contb_receipt_amt', rows='contbr_occupation',
    ... aggfunc=sum).order(ascending=False).head(10)
    contbr_occupation
    RETIRED                               7272.0
    ACCOUNT MANAGER                       5000.0
    VICE PRESIDENT, INTERNET MARKETING    4000.0
    PROFESSOR                             2800.5
    PRESIDENT & C.E.O.                    2500.0
    GALLERY OWNER                         2500.0
    BOOKKEEPER                            2500.0
    HOMEMAKER                             1971.0
    INTERIOR DESIGNER                     1500.0
    WRITER                                1410.0
    

    Retirees going large. That's kind of interesting. Let's look at that.

    >>> culver[culver.contbr_occupation == 'RETIRED'].pivot_table(
    ... 'contb_receipt_amt', rows='cand_nm', aggfunc=sum)
    cand_nm
    Obama, Barack                     7162
    Roemer, Charles E. 'Buddy' III      10
    Romney, Mitt                       100
    

    Maybe I misunderstand our local retirees (at least the ones I've met) but this was surprising to me. I really expected Romney to come out on top.

    I think that's enough peeking into my neighbors contributions habits for one night. I have to say Pandas makes this sort of thing really easy. I've only scratched the surface here. There's lots more that one can do (mathematically speaking) with Panads. Python for Data Analysis gives you a really good introduction to Pandas and then the webiste fills in the gaps.

    Python for Data Analysis and Panads get two thumbs up from me. Thanks to O'Reilly and Wes McKinney.

    Add a comment
    Category: programming Tags:

    Python and Spotify Together At Last

    Here's a simple script to show the currently playing song in Spotify. All you have to do is put it on your $PATH and run:

    > nowplaying
    The Unsinkable Fats Domino by Guided By Voices
    

    While this is handy in and of itself (to some people), if you are running GNU Screen, you can have it output the currently playing song in your statusline. Just add the following to your .screenrc:

    backtick 101 5 5 /home/YOURNAME/bin/nowplaying
    hardstatus string  '%101`'
    

    If you already have a hardstatus (or caption) line, you'll just need to add %101 in there somewhere. Then, you'll have the currently playing song easily available.

    For info about what the above does, see the GNU Screen manual about backtick.

    Here's the entire script:

    #!/usr/bin/env python
    """Spit out the currently playing song."""
    import dbus
    import sys
    
    try:
        bus = dbus.Bus(dbus.Bus.TYPE_SESSION)
        spotify = bus.get_object('com.spotify.qt','/')
        info = spotify.GetMetadata()
    except dbus.exceptions.DBusException:
        print('Spotify is not running')
        sys.exit(1)
    
    track = {}
    trackMap = { 'artist'    : 'xesam:artist',
                 'album'     : 'xesam:album',
                 'title'     : 'xesam:title'
                 }
    
    for key, value in trackMap.items():
        if not value in info:
            continue
        piece = info[value]
        if isinstance(piece, list):
            piece = ', '.join(piece)
    
        track[key] = piece.encode('utf-8')
    
    if track.has_key('title') and track.has_key('artist'):
        print('%s by %s' % (track['title'], track['artist']))
    else:
        print('No song playing')
    

    If you want Spotify to use the built-in notifier in Ubuntu, then by all means check out Spotify-notify. It also adds support for media keys.

    Add a comment
    Category: music Tags:

    Books I Read in 2011

    So, it's been over a year since my last "Books I Read" post so it's time I suppose. Only 28 books this year but this includes the behemoths that make up the first five books of the A Song Ice and Fire series so my page count is probably a bit higher this year. Hrm, that might be the job for a different script.

    Looking over the list, books that stand out for me this year include The Woman in White, State of Wonder and A Visit from the Goon Squad.

    If you want up to the minute updates, I suggest you follow me on Goodreads.

    Full disclosure: Most of the book links on this page are Amazon affiliate links so I get some coin when you buy something.

    Add a comment
    Category: reading Tags:

    The Big Easy 2011

    TL;DR: I use quite a bit of software.

    For no particular reason other than I need to post something to make up for all the times I didn't post (and because I love making lists), here's a list of the software that I use day to day.

    • Ubuntu: My main machine is running Ubuntu 11.04. I've got other boxes running older versions of Ubuntu (as well as OS X) but this is where my hat hangs for the time being. Speaking of hanging, Unity almost made me want to hang myself but I think I have it dialed into where I like it. Hidden inside the Compiz settings are some sweet keyboard shortcuts for windows management, which is the only reason I tried out xmonad for as long as I did.
    • GNU Emacs: Emacs is probably where I spend about 90% of my day. I've got it to the point where I hardly touch the configuration files anymore. People complain that emacs users spend tons of time fiddling with settings but you have to average that over the lifespan of you using the software. So the time setting it up isn't that much really. Emacs probably demands its own post about all the packages that I use come to think of it.
    • Google Chrome: Yep, I ditched Firefox. Chrome just seems a lot faster and the developer tools are built in and rock solid. Seeing as how Firebug was staring to cause me to stab my eyes out, I'm quite happy now.
    • Dropbox: This is a service that I actually pay for. At my last job, dropbox was blocked and it made my life kind hellish. Without it, all my ebooks, projects and personal wiki are inaccessible.
    • KeePassX: The older the get, the more I forget. And when it comes to the bazillions of passwords I need to remember for various sites, I rely on KeePassX. Open source and available on multiple platforms, it's a keeper. Har har! Get it? Keeper. KeePassX. I should move over to marketing.
    • Spotify: Another service that I pay for. The huge selection of songs and the integration with Facebook make it kind of hard to pass up. I mention Facebook because it's good fun to queue up weird songs so they end up on your wall and your Mom gets to see it.
    • Git: Yeah, I spend way too much time in git but I use it and it suits my software development needs. So much so, that I use git to interact with our Subversion repository at work.
    • Remeber the Milk: Another piece of software that I pay for. I know this is technically a web service but I have software installed for it on my phone and tablet so I'm lumping this into the software post.
    • urxvt: I'm using this less and less now that I've been using Emacs to run my shell but when I need to run complex commands, this is the termianal I turn to. My shell of choice is Zsh.
    • Oh My Zsh!: Speaking of Zsh, this is a great collection of very useful Zsh configurations and aliases which make working with Zsh very very nice.
    • homedir: I don't know how I exactly found homedir but it's very sweet. It's basically a small package manager for your home directory. I use to keep all configurations the same across machines. And where I need a machine specific configuration, homedir comes to the rescue. I don't really use this day to day but thought it was worth mentioning because it's saved my bacon a few times.

    That about wraps up what I'm using day to day. I use other things on-and-off (like LibreOffice -- shudder) but didn't think they were worth putting in the post.

    Add a comment
    Category: personal Tags:

    Moustaches For Good!

    Sooo...hey! How ya' doing? Long time no see. Hope you've been well. Aside from being broken up over the breakdown of Google Reader, I've also been busy growing a moustache for Movember.

    You can donate to my cause at http://mobro.co/sethmason. Feel free to pass it around!

    Add a comment
    Category: personal Tags:

    JSLint and git blame for fun and profit

    For some unknown reason, we have a problem with superfluous trailing commas at work in our JavaScript. It's probably because we have a bunch of Perl developers writing JavaScript. Unfortunately, this doesn't play well in a world with Internet Explorer.

    JSLint makes this easy enough to track down. But I wanted something more. I wanted to know who the culprits were. Thus, I whipped up this little script that'll take a list of files and tell you who committed a file with a trailing comma in it. Besides, JSLint, You'll need Rhino and a script to execute commands (named runtime.js). I'll try and post that later.

    // blame_comma.js -- loop through the files passed in and see who has
    // commas in them
    
    // find ../htdocs/js/ECM -type f -name "*.js" -print | \
    // xargs java -classpath \
    //   /usr/share/yuicompressor-2.4.2/lib/rhino-1.6R7.jar \
    //   org.mozilla.javascript.tools.shell.Main blame_comma.js
    
    load('fulljslint.js');
    load('runtime.js');
    
    (function(args) {
        var bad_files = {};
        for (var i = 0; i < args.length; i++) {
            var file = args[i],
                js = readFile(file);
            var success = JSLINT(js, {
                browser : true,
                undef   : true,
                newcap  : false,
                indent  : 4,
                predef: ["Ext","ECM","ActiveXObject","window",
                         "TestCase","document","assertTrue","sinon","gt"]
            });
            if (!success) {
                var errors = JSLINT.errors;
                for (var j=0;j<errors.length;j++) {
                    var e = errors[j];
                    if (e && e.reason && e.reason.match(/Extra comma/)) {
                        var cmd = 'git blame -L' + e.line + ', ' +
                                  e.line + ' -- ' + file;
                        var output = runtime.exec( cmd );
                        if (!bad_files[file]) {
                            bad_files[file] = [];
                        }
                        bad_files[file].push(output);
                    }
                }
            }
        }
        for (var key in bad_files) {
            if (bad_files.hasOwnProperty(key)) {
                print("\n" + key);
                var errors = bad_files[key];
                for (var i = 0; i<errors.length;i++) {
                    print(errors[i]);
                }
            }
        }
    })(arguments)
    

    Like most of the stuff I seem to do lately, this is available as a gist on GitHub. Let me know if you see anything you like.

    Add a comment
    Category: programming Tags:

    Beautify your JavaScript in Emacs

    I know you'll find this hard to believe dear reader but I'm a big fan of using Emacs to write JavaScript. One thing that irked me in the past is that none of the libraries got the indentation and other formatting how I wanted. Luckily, I recently stumbled onto js-beautify (via the most excellent jsFiddle.

    Lo and behold, there is a command line interface to beautifying JavaScript! Good thing Emacs can call shell commands on text so easily. Thus, we have:

    ;;; js-beautify.el -- beautify some js code
    
    (defgroup js-beautify nil
      "Use jsbeautify to beautify some js"
      :group 'editing)
    
    (defcustom js-beautify-args "--jslint-happy --brace-style=end-expand
    --keep-array-indentation"
      "Arguments to pass to jsbeautify script"
      :type '(string)
      :group 'js-beautify)
    
    (defcustom js-beautify-path "~/projects/js-beautify/python/jsbeautifier.py"
      "Path to jsbeautifier python file"
      :type '(string)
      :group 'js-beautify)
    
    (defun js-beautify ()
      "Beautify a region of javascript using the code from jsbeautify.org"
      (interactive)
      (let ((orig-point (point)))
        (unless (mark)
          (mark-defun))
        (shell-command-on-region (point)
                                 (mark)
                                 (concat "python "
                                         js-beautify-path
                                         " --stdin "
                                         js-beautify-args)
                                 nil t)
        (goto-char orig-point)))
    
    (provide 'js-beautify)
    ;;; js-beautify.el ends here
    

    I like it so much I have bound to M-t (for tidy) in a mode hook:

    (local-set-key "\M-t" 'js-beautify)
    

    If you want to follow any updates, I've put this snippet up as a Gist on GitHub so feel free to clone and send me any pull requests.

    Add a comment
    Category: editor Tags:

    Toggler in Ext JS

    Since it has been awhile since I last posted and we started using Ext JS at work, I thought I'd post a little snippet JavaScript for setting up a link that toggles something.

    // create a toggler link...is there a better way?
    var toggler = new Ext.BoxComponent({
        autoEl: {
            tag: 'a',
            href: '#',
            html: 'All'
        },
        listeners: {
            'render': function(comp) {
                var el = comp.getEl();
                el.on({
                    'click': {
                        scope: comp,
                        fn: function(event, element) {
                            event.stopEvent();
                            var text = this.getEl().dom.innerHTML;
                            text = text.toggle('All', 'None');
                            this.update(text);
                            // do your toggling here
                        }
                    }
                });
            }
        }
    });
    

    Because it's an instance of Ext.Component it can easily be added to a Ext.Container so it's a tad more reusable than a straight up select. At least I think so.

    Questions and comments welcome.

    Add a comment
    Category: programming Tags:

    © Seth Mason

    Themed using aboutwilson

    Powered by Pelican