Archive

Author Archive

Help Me Out?

August 6th, 2010 lococobra No comments

This will take you about 3 minutes or so, and it would be really awesome if you’d do it for me.

  1. Go to http://10minutemail.com and copy the email address that it gives you (you’ll need this a couple times).
  2. Go here: https://www.dropbox.com/referrals/NTc5OTc1OQ
  3. Sign up using some random name, the email you just copied, and a password you can remember for 2 minutes.
  4. Download their client thingy (should start automatically)
  5. Install it and log in using the email and password from before.
  6. Click skip
  7. Uninstall Dropbox (instructions here)

If you did that, thank you very much! Please don’t do it multiple times, it only helps me the first time.

As a side note, you might just check out this “Dropbox” thing and sign up for real. It’s kind of cool.

Categories: Random Tags: ,

Automagically Load Class Files in PHP

August 5th, 2010 lococobra 2 comments

If you have very much experience with writing medium/large PHP based projects, you’ve probably run into the following annoyance:

You have a bunch of classes that you use ubiquitously, some which you wrote and some which others have written. Each file has a single class in it, but since the classes are from difference sources, some of their files have non-consistent naming conventions. You have to include classes into the files which use them, so you might include all of the classes in a header file, but that will cause unnecessary overhead because even unneeded classes get included in ever file which uses the header at all. The other option is to individually include only the necessary classes into the files that use them, but what a pain in the ass!

Fortunately there is a third option, available in PHP 5.0+; it’s called Autoloading Classes. Basically, as soon as an object of a class is created for which the source file has not yet been included a function called __autoload is called. Using that function, we can then include the appropriate class file just before the object is created. Thus avoiding including any additional classes via a header or having to type out extra includes. So how does this magical function work?
Read more…

Categories: PHP Magic Tags: , ,

Stop Hating on Longboarders

July 21st, 2010 lococobra No comments

NoLongboarding Stop Hating on LongboardersMy room mate (Steven) and I went out to longboard. First we went down to this construction area that said “Road closed to through traffic”, but had a very well built hill and turn well before there was any construction. We parked and went to slide on the turn. We took one run down and then went back to evaluate how to better take the turn. That’s when a “Police” car drove up.

“You aren’t allowed to be here. In a couple of weeks this road will open up and be public property but until then it’s private.”

We apologized and explained that we didn’t know and turned to leave. The cop seemed plenty friendly. We left, and won’t go back there until it’s open. No problem! If everyone was as polite as this, we’d have no problems.

Then we headed over to the Ross Complex. We parked at a C-Tran parking lot, and about a minute after parking we were approached by a security car. The driver told my room-mate that we could only stay parked there until 7:30. We agreed and went to walk up the hill. After about twenty minutes of riding a different security car stopped us and an older man said “Pick em up and head out” (talking about the longboards we were already carrying. We said, “well we can still skate in the street right? It’s public property.” He replied, “yes I suppose.”

A while later the second security car drove up to me and said “That doesn’t look very safe with the cars, you better go do that somewhere else.” I shrugged and said “It’s fine, we’re being careful.”

Then after taking just one more he stopped both my room mate and I yet again and said “You guys can’t be here, you better leave before I call the cops.”

We had been very careful not to ride only on public property after his initial warning so we asked, “Why? We have every right to be here, but we were just about to leave anyways.” I started towards the car. He assumed we were walking to go ride some more, and he repeated “you have to leave.” This is where the conversation took a turn for the worse. Here’s everything he said as best I remember it..

Me: Yeah, our car is over here.. we’re leaving.
Steven: We have every right to be here.
Security: No you don’t, if you don’t leave I’m calling the cops.
Steven: We have the same rights as bikers.
Security: No you don’t. Stick around and find out because I’m going to call the police.
Steven: Go ahead and call them, we’re on public property. We have every right to be here.
Security: Do you pay taxes?
Steven: What?? Yeah I own a business, I pay both state business and income tax.
Security: Well you’re not allowed to ride here, you’re being a nuisance.
Steven: How are we being a nuisance?
Security: What if a car hit you?
Steven: It didn’t.
Security: Well what if one did?
Steven: Then it would be our fault but we were being very careful. Besides, since when is being a nuisance against the law?

At this point I was just done. I started to walk back to the car and told Steven to do the same.

It’s the comment about the taxes that made me decide to write this. He assumed that just because we were on longboards we were of no use to society. This is so far from the truth. I own my own business, which means I have to pay small business taxes and pay for the full 15% income tax. Anyone who is employed has half of their income tax paid by their employer, so I actually pay way more than most people! What gives him the right to stereotype me based on how I spend my free time?

And this wasn’t by any means an isolated incident. This kind of thing happens all the time. We’ve gotten chased out of public parks by cops, and constantly get nasty looks by people we pass. I know I’m not by any means the stereotypical skater, but that doesn’t give anyone the right to treat me as less than any other person.

UPDATE:
I just got some information about what that security officer was and wasn’t allowed to do. Here will be my response next time this happens:

  1. Take the security person’s name
  2. If I’m able to, begin either recording or taking video of the confrontation, and let them know they are being recorded. This is 100% legal as long as you’re on public property
  3. Let them know that their liability insurance doesn’t cover them on public property. I know this because I did some work for an insurance broker who specifically insures security guards.
  4. If they continue harassment, let them know that they can be convicted of a misdemeanor because they are not within their jurisdiction and trying to act as a public officer.
  5. If they still don’t quit, call the cops.

Of course, all of this only applies if it’s a private security guard and he’s on public property, so it doesn’t help if it’s the actual police. It’s still useful information though.

Categories: Random Tags: ,

AT&T – Slower Than Dial-Up and More Disapointing Than Ever

July 11th, 2010 lococobra No comments

 AT&T   Slower Than Dial Up and More Disapointing Than EverSo much fail in one screenshot. No shenanigans here, no death grip. Notice the five bars? For those who don’t know why this is bad: do you remember dial-up? Dial up was 56kbps. AT&T is currently charging me $30 a month for an upload speed that is slower than what I was using 10 years ago.

Apparently I fall into the “less than 2%” of AT&T’s customers who are affected by this glitch.

Should I still be paying $30 even though AT&T is not providing me an adequate service?

It seems to me like any person affected by this should not be charged for data every day that this persists, at least.

Categories: iPhone and You Can Too Tags: ,

Apple, AT&T … I am disappointed in you.

June 24th, 2010 lococobra No comments

June 7th – iPhone 4 is announced

June 15th – Pre-orders start, I try unsuccessfully to pre-order my new iPhone that morning, and then try again that night. Success! A page showing that I did in fact reserve my new phone, and some instructions on what information to bring, when, etc…

June 24th – 5:00 AM – Wake up after only several hours of sleep.

June 24th – 6:15 AM – Arrive at the Apple store at Pioneer Place, get into line.

June 24th – 6:20 AM – I’m very sick to my stomach, probably due to an overdose of allergy medication.

June 24th – 10:00 AM – My friend and I are told that our pre-orders didn’t go through, and that we should go home. Apparently our reservations were only valid if we received an email about them. When asked, an employee at the Apple store tells me that my best bet is to order the phone online, and that it will probably arrive in the later half of July.

There are so many things wrong with this.

  1. How was I supposed to know that I should have gotten an email? This seemingly crucial piece of information was never at any point given to me.
  2. Why did I see that my pre-order went through successfully when it didn’t? This one is probably AT&T’s fault and this time it’s inexcusable.  This is the FOURTH iPhone launch. Every time it gets bigger, and every time both AT&T and Apple are woefully under-prepared.
  3. Why didn’t the Apple store employees check the pre-orders as people showed up? It really goes to show you the way that Apple operates that they would wait for four hours before getting around to tell you that you’re screwed.

The hidden subtext is:

Apple knows that they don’t even have to try to get people to buy their products. They have already sufficiently hyped the new iPhone, and at this point any delays will just cause customers to want the phone even more. What they’re not thinking about is: while this is true, most people (including myself) who had similar experiences will still buy the new phone if they were originally intending to.. all it’s doing is pissing people off! Apple doesn’t care! A year to prepare for this launch and they can’t even keep up with the (predictably obviously insane) demand. I feel like this is just bullshit marketing. I don’t like being pushed around!

Categories: iPhone and You Can Too Tags: , ,

Generate Javascript Bookmarklets Using A Simple PHP Function

June 9th, 2010 lococobra No comments

I wrote a pretty simple PHP function for converting Javascript into a bookmarklet. As you’ll see, it’s nothing too crazy. I did come up with a kind of interesting way of shortening the source using base 64. I don’t know if I’m the first person to do this, but I came up with the idea on my own (no plagiarism!). Unfortunately, it’s not IE compatible.. so there’s a switch to turn that feature off (if you want). Read more…

Categories: PHP Magic Tags: , , ,

Form Request Hijacker Javascript Bookmarklet

June 4th, 2010 lococobra No comments

The idea: Lets say you want to use some service hosted at another site, but there isn’t an API or anything.. just a user-accessible form. Well, in order to use that form, you’re going to have to use something like cURL to submit some POST variables or something to the form handler.

Here’s the problem: What information is actually getting submitted with the form?

The only way to form your curl request is if you know every single bit of data that’s getting sent to the form. You could do this with a tool like the “Web Developer” add-on for Firefox, but then if there’s some onsubmit javascript that affects the form in any way, you don’t get those changes.

My solution: Using javascript, hijack the form and have it submit to a custom URL which will then tell you any variables sent through the headers. Read more…

Categories: PHP Magic Tags: , , , ,

Manually Mask Rounded iPhone Icons for Stacks/Categories

February 12th, 2010 lococobra 2 comments

I’m writing this post because I was not able to find anything remotely close to solving this problem elsewhere.

The goal (for me, but there are other uses): custom theme stacks icons so that dock reflections work properly. There are more reasons to do this though, such as making icons display correctly in categories. You could also use this to fix jailbroken apps which don’t have nice iPhone style icons.

Read more…

Enter to Win One of Three Google Wave Invite Packs

November 12th, 2009 lococobra No comments

Howdy folks. Time for some shameless self promotion!

<- Click Here to Enter!

googlewave1 Enter to Win One of Three Google Wave Invite Packs

I just got a bunch more Google Wave invites and I’ve decided to give some away! Here’s how it works…

  1. Retweet this article (make sure you’re retweeting @jeff_way) before December 4th.

Congratulations, you’ve been entered to win one of three Google Wave invite packs! Winners will be chosen on Nov 20, Nov 27, and Dec 4. Each winner will receive the following.

  • One direct instant activation link to join Google Wave
  • Four Google Wave nominations for your friends (they take a bit longer)

Enter now! I’ll be tweeting the three winners names as I draw them.

PHP Variable Variables and Reference Arrays in Use

September 23rd, 2009 lococobra No comments
PHP Variable Variables and Reference Arrays in Use

Something I haven’t talked about a whole lot on here is that I’m actually a professional PHP developer. It’s my job, so usually I don’t mix work and online stuff. This is pretty cool though, so I want people to be able to find it if they’re trying to figure out how to do it. Be warned, if you’re not a PHP coder the following post will make ZERO sense to you :P

Before I get into what a “reference array” is (I made that term up) let me guide you through the discovery and some practical uses of the theory around references. A while ago I was looking for a way to do something in code that didn’t seem very possible. I wanted to do this:

$var1 = 'Hello World';
echo $"var1";

Problem is, that doesn’t work.. instead I found that you can use variable variables (also known as dynamic variables)
Read more…

Categories: PHP Magic Tags: , ,