programming magic

Iterations in Less

Posted on December 11, 2012 by

Part of the beauty of Less and other CSS ‘compilers’ is to enable the author to automate tedious functions that normally must be coded by hand. Suppose you needed several classes that specified padding/margins: .mRight50{margin-right:50px} .mLeft50{margin-left:50px} .pRight50{padding-right:50px} .pLeft50{padding-left:50px} .mRight25{margin-right:25px} .mLeft25{margin-left:25px} .pRight25{padding-right:25px} .pLeft25{padding-left:25px} No big deal, right? It wouldn’t take that long to type in; just […]

Regular Expressions Roundup

Posted on September 27, 2012 by

Writing some Regular Expressions? Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems. —Jamie Zawinski Well, not really. There are some cases where using a Regular Expression—RegEx— instead of a heap of convoluted if statements just makes sense from both a lazy and practical standpoint. When […]

Find Something You Like and Dissect It

Posted on September 20, 2012 by

I’m always on the lookout for a new technique or Better Mousetrap. I admit I don’t know all that much, so I’m happy to learn. I was playing around with Wikify @ (a nifty tool that goes through a block of text and ‘wikifies’ it–that is, links all the words it can find to relavant […]

Wicked Cool FizzBuzz in Perl

Posted on August 22, 2012 by

The FizzBuzz problem is a simple coding demonstration to write an application in any language that counts from 1 to 100: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are […]