Yes to Mercurial

Dec, 29 -- Categories: Linux, Mac

Mercurial is a very nice alternative to svn. I have several projects in it now and I’m pretty happy with it. Here are some starter commands. These should be executed from the command line in the directory that you want to control.

$ hg init # creates .hg

$ hg add # add those ‘unknown’ files
$ hg commit # commit all changes into a new changeset, edit changelog entry
hg commit -m ‘updated bad links to style sheet and changed directory name’

$ hg parents # see the currently checked out revision (or changeset)

$ hg status # show all non-ignored files

$ hg help

# export your current repo via HTTP with browsable interface on port 8000
$ hg serve -n “My repo”

hg revert –all -r 268033ec7859
Backing out changes

Reverting the whole tree to a known-good revision
It’s easy, like using a sledgehammer is easy. But this is usually overkill.

$ hg pull -u
$ hg revert –all -r a0193d83c208 # use your known-good revision id here
$ hg commit # be kind, include the revision id in your commit message
$ hg push

There’s a more precise alternative:
Backing out a single changeset
Suppose changeset f8f4360bf155 broke something.
$ hg pull -u
$ hg backout f8f4360bf155 # use the revision id of the bad change here
This creates and commits a new changeset that reverts all the changes in that revision.

AS3 Manipulating volume

Dec, 14 -- Categories: Actionscript

Tween out the volume of a netStream object:

Tweens the volume down to 0 over 1 second
var sndTransform = new SoundTransform();
nsStream.soundTransform = sndTransform;
TweenMax.to( nsStream, 1, { volume:0 });

needs TweenMax classes imported:

import com.greensock.*;
import com.greensock.easing.*;

php – The execution operator

Dec, 3 -- Categories: PHP

**** note the back ticks not single quote ******

executes the contents of the ticks as if you are at the terminal but as apache or whoever your web server is. this code basically

echo `whoami`; // well who is this script running as

echo `pwd`; // think whereami
echo `mkdir test`; // make a directory
echo `mkdir test/anothertest`; // make a directory in the directory created
echo nl2br(`ls`); // list what is in this directory

`touch log.txt`; // make a text file named log.txt

$date = date("F j, Y, g:i a");
`echo $date > log.txt`; // writes the $date to log.txt
`echo foo >> log.txt`; // writes foo to log.txt
echo nl2br(`cat log.txt`); // echoes what is in log.txt

echo nl2br(`tail /opt/local/apache2/logs/error_log`); // echoes what is in the error_log