Freelance Web & Software from a Hobbyist Developer

DubéDev Blog

This is my blog for posts regarding software development. You can check out my more regularly updated personal blog at ericdube.com.

Recommended [Link]
Mon, 20 Jul 2015 02:10:10 -0400

Right now I’m doing some development on my Windows computer and needed to find a LESS compiler. I tried SimpLESS, and it’s perfect for the job; it runs in the background and compiles the LESS files on save, so you can use whichever editor you want. The only drawback is that you need to be sure it’s running when you save your LESS files, otherwise you may end up very confused when changes don’t show up on your page.

JavaScript Animation Fun [Link]
Tue, 30 Dec 2014 11:51:00 -0500

Hello; Eric here!,

I’ve been spending a bit of time lately working on animations using JS and jQuery. Here I’m going to share a quick technique that has helped me create really cool animations!

The setTimeout method is useful for running a JavaScript function after a specified delay. This is essential in creating complicated animations. However, after a while, a long animation using nested setTimtout()s will get pretty messy.

Suppose instead we create our own runSequence() function, which can take a list of functions and times. This will be our structure:

sequence item: [function(), INT delay]
funcList: [sequence item, sequence item, …]

Our runSequence function can then look like this:

function runSequence(funcList) {
	funcData = funcList.shift();
	func = funcData[0]
	time = funcData[1]
	func();
	if (funcList.length > 0) {
		setTimeout(function () {
			runSequence(funcList);
		}, time);
	}
}

In order to use this, all you need to do is create an empty array, and push each part of your animation onto it:

seq = [];

seq.push([function () {
    // Part one of animation
},200])
seq.push([function () {
    // Part two of animation
},200])

That’s all for now!

Progress! [Link]
Sat, 20 Dec 2014 16:00:22 -0500

Thanks to free time during the holiday break, blog entries posted to my Tumblr account will soon post to the DubéDev website as well!

Hello! [Link]
Sun, 07 Dec 2014 12:53:37 -0500

I’ve decided that I’m going to start maintaining a Tumblr blog. Time will tell whether this actually happens.