Monday, May 2, 2016

make URLs clickable in javascript

Autolinker.js seems to a decent solution to making URLs clickable with in a js variable. (Though I couldn't get the min.js version in the zip file to work.)

Monday, April 25, 2016

uniq shell quickie quirks

I had a bunch of small text files in a directory, on some CENTos system, and I was pleased to realize
more *txt | cat
would print each file name as well as the contents.  But it didn't work in my default MacOS shell. This stackoverflow gave me a better idea:
grep "." *txt
which is nice because it was leaving out the empty files - it also did the format "filename:contents" which worked ok for my needs.

Ok, not rocketscience, but a reminder that different Unix-y shells have different implementations of some basic text manipulation commands.

Friday, April 22, 2016

tom chi on rapid prototyping and product managment

It's interesting comparing his "Culture of Yes + No" / "Culture of Learning" to the human development ideas of Fixed Mindset vs Growth Mindset.

Man, sometimes I do wish I was on a fast prototype team like that.... it's really the sweetspot of what I'm good at.

Thursday, April 21, 2016

old school unix text processing

Sometimes it's nice to know about old school unix command line tools - though I'd welcome other solutions to this problem:

At work, we wanted to move some "human readable error messages" processing to the front end. One aspect of this was to get a list of the error codes a certain service could produce (since we didn't necessarily want to come up with human readable version of VERY error the whole backend system could produce.)

The error constants where all of the form ErrorMessages.SOME_VALUE. so my first step was top copy and paste the contents of the file (a little easier than locating it on the file system in terminal) into
grep ErrorMessage > tmp.txt
Then I copy and pasted that (again, pipes is the cooler way, but whatever) into my editor, hand tweaked some of the content to make it consistent (push all the entries to the left side and getting rid of any other code that snuck in on those lines) and then copy and pasted THAT into
sort | uniq > tmp2.txt
(Uniq says show me only one copy of a line for a block of repeated lines, but if you sort it first, it will make sure you only see one per actually unique line.)

And now I have a list of potential error codes to ask my product manager about!

Monday, April 18, 2016

grumble grumble

Apologies for not much in terms of updates lately (combined with reassurances to anyone who might be looking in on this that this blog is indeed an active concern)

Today's random gripe: Safari's address bar autocompletion is slow enough, relative to habits trained into my physics on chrome, that I see more about Good Morning America (gma as in gmailand European Soccer (FA as in facebook) than I otherwise would.  Between that, clutzier download management, and inferior delete tab recall, it's a shame that Apple puts forth such a lagging browser.

Thursday, April 14, 2016

sweet bureaucracy

Sometimes I wonder if over-eager code testing policies are a bit like excessive password complexity requirements and expiry; both sound great on paper and give certain types of administrative types warm fuzzies, but unless used properly just make things worse.

Wednesday, March 30, 2016

img tags and baselines

I just wrapped up DesignLab's Design 101 online course - great interactions with real-live mentors.

For my final project I put together a draft to sell my comic So You're Going to Die... my first draft started something like this:

For my second and more or less final draft I started with this rough idea my mentor Charlene Foote sketched out:

The thing is, when I look at it on my computer it was kind of a "cheat", since the boundary of the image was a logical place for the skull to end, but on a webpage, I'd have to figure out what went underneath. At first i thought a pinstripe, but then I finally ended up making the whole bottom a different color:
There was a problem though: the skull there is riding a bit above the div. I could hack it back into place with a position:relative; but that's hardly elegant, but when I was careful to set all relevant padding and margin to, it was still hanging up there?

I think the issue is that imgs are by default "inline", and that's geared to put them on corresponding text baselines. Which is usually a decent default, but the text baseline leaves room for a descender; no good if you're looking to have the image snug with whatever is beneath.

After a little experimenting the simplest solution was making the image display:block; ... inline-block had the same descender issue.

Seems like there's always more to learn in CSS... but especially in js. It's counterintuitive to me how much people can get done with incomplete knowledge... kind of a life lesson, actually.