Wednesday, July 20, 2011

Google+ Blurb: After I Logged Into Facebook

So I had to log in to facebook for some fun app debugging today (code rolled out today btw, yay!) and decided to poke around and see what's going on there and...not missing much at all! I've heard some chatter about Google+ being too noisy, but I seriously think facebook is noisier. Yes, the "main" stream on Google+ is definitely noisy, but you gotta remember that's all of your circles! To be honest, I pretty much only check my circle streams to filter out cruft. "What are my friends up to?": friends circle; simple. Doing the equivalent in facebook... I technically can do that, but that's only in those fb groups; otherwise, I need to go to each of my friends' pages and stalk see their recent activity, etc. but even in doing that, I'm already seeing too much. I could really care less if my friend likes "Nose-picking" or "I leveled up in Farmville". I can probably go on, but i won't. Just my $0.02. 8-)


P.S. I do, however, miss one thing: band/musician updates. I started following bands on facebook to get updates on new shows, albums, etc. here, it's all technology (for now).

Tuesday, July 5, 2011

There's a Bikeshed In The Forest

Into The Forest We Go

So lately I've been inundated with a (IMHO) very aggressive project schedule; and when I say "project", I mean projects plural since the ending of the first one overlapped with some of the discovery & design portion of the second one. Which is fine, since I've done that many of times. Though, somewhere along the schedule of the second project I started having more and more bikeshed'ing talks. Be it that I was busy or if I wasn't completely focused due to personal reasons, I fed into these bikeshed'ing talks and they kept coming and I sunk like quicksand.


Painting the Bikeshed

For those of you who come from a BSD background, you all have probably heard the "painting the bikeshed" phrase. If not, go and give it a read; even if you aren't part of the *nix scene or even if you're not an engineer; the thread will shed some light on managing projects whether personal or work-related.

Anyhow, in a brief summation: somewhere, somehow, I got sidetracked with tasks of changing certain language of front-end and etc. design-related issues as opposed to working on core-code functionality. In turn, the project needed to delay a bit.

Lesson learned: Be more vocal. Yes, let the PM know that there are bigger issues at hand and you'll get back to the miniscule issues at a later time.


Forest? Huh?

So what's the bikeshed have to do with the forest? Well, another phrase has been echoing in my brain a lot lately, and that's "can't see the forrest for the trees". It has a similar premise behind it and I thought it was very fitting, being that I've caught myself (twice now), wasting time debugging code to only later see that there was a simple error that was causing issues; the more recent issue was actually a human error and not code-related at all.

Lesson learned here: it's okay to step away for a bit to rest your brain (and your eyes!) from code.


Cheers! Code. Debug. Repeat.


Post Script

* My one delayed project was only delayed three days. We are now just maintaining code and debugging small bugs.

Monday, May 2, 2011

Nginx's Rewrite Rules for WordPress MS In a Subdirectory

Nginx's rewrite rules have been giving me a headache lately. Okay, cool so it doesn't support .htaccess files; that's fine. WordPress' Codex Nginx Page gives me some great information on how to do the rewrites.


Ah but I'm running WordPress in a subdirectory! My site URI for WordPress is something like, http://mydomain.com/subdir/. Okay? Yea should be fine as long as you rewrite the rewrite rules a little bit like so:

if (!-e $request_filename) {
rewrite ^/subdir/[_0-9a-zA-Z-]+(/wp-.*) /subdir$1 last;
rewrite ^/subdir/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ /subdir$1 last;
rewrite ^/subdir/[_0-9a-zA-Z-]+(/.*\.php)$ /subdir$1 last;
}


That wasn't so bad right? Yea, it confused the heck out of me though at first! So hopefully the next person won't have the same headaches! Cheers!

Thursday, April 28, 2011

Nginx: Running FastCGI Under an Alias

So yay, Nginx has been a new playground for me here. It's awesome thus far and I love the process management! I've still got a bunch of exploring to do and I'm super busy, so excuse the brevity!


FastCGI Issues With Aliases

I've scoured the web for help on this one and it seems like a common issue that people have had. Check out the comment section on this post for a good starting point on this issue. But the usual trial and error was what ultimately got everything working for me.


Here's what I got working for me below:

location /dir/ {
alias /usr/local/www/foo/;
index index.php;
}

location ~ /dir/.*\.php$ {
if ($fastcgi_script_name ~ /dir(/.*\.php)$) {
set $valid_fastcgi_script_name $1;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/foo$valid_fastcgi_script_name;
include fastcgi_params;
}


The problem I was running into was here:
location ~ /dir/.*\.php$ {
if ($fastcgi_script_name ~ /dir(/.*\.php)$) {
set $valid_fastcgi_script_name $1;
}

I assumed $fastcgi_script_name was going to be from /foo but it was already being passed the alias (/dir).


I suppose I'm just writing this to remind me in the future, but in case this helps anyone else, hope it makes sense!


Cheers!

Tuesday, April 12, 2011

PHP: Encode Text Into Numeric HTML Entities While Keeping HTML

If for whatever reason you need to have some text with special characters encoded into numeric HTML entities, but you also have HTML that you do not want to encode, well here you have it!


Why Numeric HTML Entities?

If you've worked with RSS before I'm sure you understand the dilemma. For those of you that don't know, RSS has a problem with validating if there are non-numeric HTML entities (the normal output you get from htmlentities()). More headaches, more XML fun!


Why Keep HTML?

Well, to be honest, it's just because we have a special scenario right now. But, I'm sure some people may find this helpful.



*Note* The numeric HTML entities foreach loop is based off of Michael Krenz's xml_character_encode function. Thank you sir!


function htmlentities_keephtml($text) {
$entities = get_html_translation_table(HTML_ENTITIES);
unset($entities['"']);
unset($entities['<']); unset($entities['>']);
unset($entities['&']);
foreach ($entities as $k=>$v)
$entities[$k] = "&#" . ord($k) . ";";
$s = array_keys($entities);
$r = array_values($entities);

$text = html_entity_decode($text, ENT_NOQUOTES); // decode the named entities
$text = str_replace($s, $r, $text); // now encode to numeric entities

return $text;
}

Saturday, April 9, 2011

Amazon Cloud Drive Now Doesn't Support Multiple Downloads?!


Wait, what?!

This change must be recent because I downloaded the only two albums I purchased from Amazon already and I definitely did NOT download them one at a time. I just so happen to have downloaded those files on my laptop and now I'm on my desktop. Yes, I can simply power on my laptop, but what's the point of having my files in the Amazon Cloud Drive anyway then?!


So now, 99 files for me to download one at a time?! (Yes, that's right classical music!) Not cool Amazon. Fail on you...


Update: Okay, between sometime after this post and now (April 19, 2011), Amazon has made multiple downloads possible again. Thank you Amazon!

Thursday, April 7, 2011

Google Chrome Update and Now No Status Panel Icon?

No more Google Chrome in my status panel?

So, I guess this was only a month test. Okay, so what's the statistics on this test guys? ;)