(Perl, js, vim, bash, machine learning and more...)
I often have multiple terminals open and screen running in each one. I then try to group all my work for a particular project in that terminal. While I am trying to limit the amount of multitasking and concentrate on one thing at a time, I might leave a terminal/screen session up for days and when I come back I can jump right back where I started.
I am thinking about giving a presentation at one of my local Perl Monger meetings. So as usual, I have spent a bunch of time toying with new tools rather than getting work done! Which tools: open source presentation creation software. I wanted something that would take a simple text file and easily create an attractive and easy to use presentation.
Here is a quick summary of the options that I tried or looked into:
Here is another AppleScript version of a
prior vba script. This one creates a back of the current
workbook. It copies the last saved version of the current workbook to
a Backup
subdirectory below the directory in which that file was saved.
It adds a counter (ie, .001
) before the .xls(x)
extension.
Rather than merging cells to center headers, I prefer to have text centered
across selection
. This avoids problems with deleting and filling columns that
are cosed by merged cells. The following sets up a command to toggle centering
across columns.
Open up the AppleScript Editor, paste the following code and save it as
/Users/<your-username>/Documents/Microsoft User Data/Excel Script Menu
Items/AlignCentered\sca.scpt
. The \sca
in the filename creates a
keyboard shortcut control-shift-a
.
-- Align selected cells across selection
-- Copyright under GPL by Mark Grimes
-- Saving with '\sca' in the filename creates Shortcut: Crtl+Shift+a
tell application "Microsoft Excel"
--activate
tell range (get address selection) of active sheet
if (get count columns) > 1 or (get count rows) > 1 then
if (get horizontal alignment) is horizontal align center across selection then
set horizontal alignment to horizontal align general
else
set horizontal alignment to horizontal align center across selection
end if
else
if (get horizontal alignment) is horizontal align center then
set horizontal alignment to horizontal align general
else
set horizontal alignment to horizontal align center
end if
end if
end tell
end tell
I recently switched to a Mac and really miss my auto color cells VBA script for Excel. After quite a bit of digging (and trial-and-error) I managed to recreate the functionality using AppleScript. It is pretty slow, but it works!
Just like the VBA version, this automatically color codes cells to help
identify inputs, formulas, etc. For example, cells that contain only numbers
are colored blue, all formulas black, references to other workbooks are green
and cells that include the =OFFSET()
function (what I use for setting up
different scenarios) are rust.
Open up the AppleScript Editor, paste the following code and save it as
/Users/<your-username>/Documents/Microsoft User Data/Excel Script Menu
Items/AutoColorCells\scc.scpt
. The \scc
in the filename creates a
keyboard shortcut control-shift-c
.
I have recently been adding and updating tests to my biggest Catalyst
project and have been a bit perplexed by the debugging output…in particular
that I was seeing any of it! Generally, I like to see all that output scroll
by, but when running Test::WWW::Mechanize::Catalyst
tests over and
over again, it just clutters things and obfuscates any failures.
I had removed -Debug
from the plugin list and tried
CATALYST_DEBUG=0
env variable, but I continued to see a lot of the
debug messages. After a bit of Googling, I finally learned that this was a
feature.
We’ll after neglecting this blog for quite some time, I’m now back. I had to swap my laptop during the summer, and I decided to give one of the MacBook Pros a try. So I’ll be adding Perl on the Mac and the Mac in general to the topics covered here. My first dilemma with the new Mac was which perl to use.
As promised in my last post
I have released a new version of
App::EditorTools
and have a number of screenshots of the new functionality. This version
includes App::EditorTools::Vim
, which provides an easy way to add
the vim scripts to integrate the package into Vim.
perl -MApp::EditorTools::Vim -e run > ~/.vim/ftplugin/perl/editortools.vim
And now you should have the following mappings:
App::EditorTools
Here are a few screenshots of these actions:
I was pleasantly surprise at the positive response to my last post on Stealing from Padre for Vim–particularly from the Padre developers! Seems they had hoped/planned on separating some of the tools out of the Padre core from the beginning (and many seem to be vimmers).
With their blessing and encouragement, I have pulled the editor independent parts of their PPI::Task tools into its own distribution–PPIx::EditorTools–available now on CPAN. I also adapted the current version of Padre to work wit the external package and released App::EditorTools to provide a command line interface for those editors that need it (i.e., vim). I’ll post another screencast and the Vim scripts needed to integrate it shortly.
I’m sure the Padre developers weren’t hoping to have their code absconded for those of us addicted to vim, but tsee’s recent blog post on refactoring with Padre’s lexical variable replace made me jealous–I want that for vim! So hack, hack, hack and _voila_: