next

Archive: 2007

Secret Santa Script

2

Every year my friends and I typically have a little “Secret Santa” (we call it “Secret Satan”, but that’s neither here nor there) — you know, where you are randomly pick a person’s name out of a hat and it becomes your job to buy a present for said person.

In previous years it was always easier because we were able to meet up to do the hat-selection. The past two years have not been so easy, due to conflicting schedules and what-not. Last year’s solution was to get someone’s mom to send out the emails.

This year I opted for a PHP-based solution. If you’re thinking “THAT’S AMAZING”, you are correct, it is amazing. Because of the rush I was in to make it, it’s not as user-friendly as it should be. There’s two things you need to do to get this working out of the box:

  1. Edit the array containing names and emails. This is the most critical part.
  2. When you first run the script it will be in no-email mode, so you can preview the how the script might work (remember, it’s random …). Change the $noemail variable to false for it to send emails. You will NOT see who is paired up with who after debug mode is turned off.

It randomly pairs people up, making sure not to pair up the same person twice, or pairing the same person. Then it sounds out the emails! It’s just that easy (I hope).

Edit: this has been updated as of December 2009.

Demo | Source (on Github)

Woops

3

Sorry for the lack of updates lately! It’s not that I’ve been without things to post, but more because I accidentally uploaded some files I was editing in my backend and, long story short: I broke it.

Typically I’d be apt to fix such a thing, but I was already in the middle of recoding my backend portfolio management thinger: “Derriere”. And if I’m going to redo the backend the front needs to change, too … you know! So fret not, I’ll be back soon.

OR WILL I?
Now you don’t know! Have you been bought over by my dramatic effect?

Fun Freelance Facts …

5

A few things I’m noticing which I did not know before about working in Ontario/Canada:

  1. Small Supplier (GST): In Canada, if your business (business/sole proprietor) makes under $30,000/year or calendar quarter you do not need to charge customers GST. However, in turn this lets your clients know that you make/expect to make under the “small supplier” threshold of $30,000/year. (Assuming they know about this little rule).
    Making more than $30,000? Then you register for an official GST number to charge people with and pay the GST you collect to the government.
  2. GST is not charged to foreign customers. I don’t know why that is news to me … but it makes sense. Presumably this applies to PST as well, including inter-provincial business. Why does it make sense to charge an Albertan 8% Ontario sales tax?
  3. Ontario PST (or RST … as I am now learning it is called by the gov’t) apparently is not charged for web design + xhtml/css/”presentational” markup; languages such as javascript and php apparently do not qualify for PST, either — as they are delivered as non-compiled code. Neat. With that being said, there are some exceptions on the delivery of the final product, which summed up basically says “You charge tax if the site or any of its assets are provided to the client in hard-form”:
    • “the design is transferred to clients electronically, or placed on the Internet, and”
    • “it is not provided in a hard copy version (i.e., disk, CD or paper copy), and”
    • “the webpage does not qualify as a taxable computer program.”
    • ^ link (http://www.rev.gov.on.ca/english/interp/rst/agd0006.html)
  4. Ontario PST: If you create a “TPP” (Tangible Personal Property) you have to charge PST on it. This means anything made to be printed. For example: brochures, direct mail flyers, logos, coupons, gift certificates, posters, catalogues, business cards, letterheads, envelopes. So if what you’re making COULD be turned into “taxable matter”, then you must charge PST.
    *My interpretation of this one feels flawed, since it mentions that if you were to give it to the client electronically, taxes do not apply. See here, 3rd paragraph under “Artwork and/or Graphic Design Services”.
  5. Sole Propriety: It’s kind of scary, but if you don’t incorporate and somehow rack up a lot of debt, creditors can go after your personal property. However, if you incorporate your personal assets are separate from the company’s. Neat.

I guess a disclaimer is in order since I am by no means a tax expert. If you use my advice I am in no way liable for any wrongdoing it may cause. Taxes suck, and while I might be completely wrong — I think it’s better to be at least somewhat informed about what’s going on than remaining in the dark until the government wants to audit me or something.

You know what still makes little sense to me? Income tax + freelance work. Ah.

Sweet Freedom

2

Things have been pretty crazy lately. I’ve finished my first year of class at Algonquin, and have started working for a local multimedia company — Wavertree. It’s very exciting and should be an awesome experience.

As for the rest of the summer, who knows … I’ve got a few projects up my sleeves. In particular — I’m just thinking out loud here — I want to make a list-managing app (todo/hierarchical/goals/other?). Yeah, it’s been done before, I’m sure. However, I think it might be simple enough for me to grasp Ajax and learn some neat PHP trickery. In particular, I’d really like to learn more about object-oriented PHP for some reason or other; it would be good to know, I think, and it might be more practical in some situations? Who knows …

I’m also going to try posting on the blog more (uhoh, this has now become a meta-post) with the stuff I’ve been up to and what-not.

Woohoo!

next