Choose Your Theme
Warren Shea

Archive for the ‘PHP’ Category

Radical Web Ideas

Tuesday, April 19th, 2011 at 9:03 pm

I have begun a revamp of my entire site (warrenshea.com). I started yesterday but I was finding warrenshea.com/megaman too hard to fix while maintaining the other themes.

I can change the stylesheet but I can’t change the name of divs in the HTML without changing global code, which means I would have to change the other styles. Anyways, big pain.

What I decided to do, temporarily, is make worldofwarren.com my warrenshea.com dev site, at least while I do these major updates. You could check it out but it might be down…I figure this will take some time to do. I’m excited though.

So anyways: Radical Web Ideas

  1. Combining Stylesheets
    Turning
    -reset.css
    -stylesheet.css
    -stylesheet_blog.css (the wordpress css)
    -print.css
    -prettyPhoto.css (the image viewer)
    into one css.

    But the thing is, there are actually 4 stylesheet.css and 4 stylesheet_blog.css files, one for each theme. So instead of combining 5 stylesheets together, it’s actually combining 11 stylesheets together. That’s actually quite difficult.

    So what I’m doing go to is load a .PHP with a CSS header (instead of a .CSS). I’ll put all my stylesheets for every theme in there, but only output the necessary CSS needed, keeping to stylesheet small, all in one place, and have it only do one call to the server.

  2. Combining Javascripts
    Same deal as above. Rather than call Google and the jsapi (making numerous calls – jquery, jquery-ui, swfobject), I will house all the scripts locally, in one file as well. Also, I call a bunch of scripts too…custom one. I’ll centralize that as well
  3. Get Twitter feed via PHP and Twitter API and output via PHP, w/o JavaScript
    Rather than need Twitter’s JavaScript to load to make the rest of my site load, it will all be PHP, reducing a JavaScript call.
  4. Re-write HTML for many of the pages. A year ago, when I built the site in Apr, I thought my skills were great. Now, I feel my skills are just as good but I can see how bad I used to be. “You don’t know what you don’t know”.. Anyways, I plan to fix some terribly badly named divs, switch some ids to classes, etc.
  5. Re-evaluate my wordpress changes and code/css for those items
  6. Re-do the RSS feeds…currently they’re outputted with wordpress widgets…I want to change it to standalone code written by myself.

Overall, the point is optimization. Yes, my site loads slow (especially lately… :S) and it’s probably me.

Right now:
1 – HTML Request
5 – CSS Request
9 – JS Request

Ideally I want to make it
1 – HTML Request
1 – CSS Request
3 – JS Request (maybe less if I can…)

Anyways…yeah, working on worldofwarren.com as my dev site.

My Personal (Developer) Resolve

Wednesday, January 12th, 2011 at 1:31 pm

Resolve
To be awesome at (almost) all aspects in the limited stage of the web.

*The following is a list on all the web-related items that I already know, would like to learn, and have no interest in learning (despite being related to the web). Some points may not seem to make sense, that is because my knowledge in the area is so terrible that I don’t know what I’m writing >_<

This Resolve includes:

  • The ability to develop proficiently in various development languages, frameworks, and techniques including:
    • ASP.NET 4.0 C#
    • ASP 3.0 VB (Classic)
    • HTML5
    • PHP 5
    • XHTML 1.0/HTML 4.01
    • JavaScript
    • MS SQL (and mySQL)
    • Ruby (on Rails) (maybe…)

    • CSS2
    • CSS3
    • SASS
    • OOP
    • AJAX
    • JSON
    • XML
    • XSL/XSLT
    • DOM
    • DHTML

    • jQuery
    • Prototype (and script.aculo.us)
    • MooTools

    • Google Chart API
    • Facebook API
    • Twitter API
    • Google Search Appliance API

  • The ability to develop for major browsers including Chrome, Firefox, Internet Explorer, Safari and (maybe) Opera
  • Familiarity with Web Accessibility standards including:
    • WCAG 2.0 standards
    • CNIB (The Canadian National Institute for the Blind) Priority Level 2
  • Understanding of fundamental SEO principles and Analytic tools including:
    • Google Analytics
    • Google Search Appliance
  • Knowledge of various Content Management System and Web Publishing tools including:
    • Drupal 7 and Drupal
    • WordPress and Blogger
    • Vignette 7 and Vignette 6
  • Proficiency in various graphic programs including:
    • Photoshop
    • Fireworks

This Resolve does not include:

  • Mobile development (although this may change in the future)
  • Email development
  • Development of non-web languages including:
    • C
    • C++
    • Java
    • Visual Basic
    • Perl
    • Python
  • Development of non-web languages that are fundamentally from the list above including:
    • JSP (Java) (although this may change in the future)
    • Mason (Perl)
    • Django/Zope (Python)
  • Development of supporting web languages:
    • ActionScript
  • Proficiency in web-related tools including:
    • Flash, Premiere, Illustrator
    • Silverlight (although this may change in the future)

I love solving a good problem.

Sunday, November 28th, 2010 at 3:50 am

Not much to write about. I have been coding all night, from around 6pm-11pm in ASP classic, VB.
I couldn’t get this file upload thing to work.

It’s dumb, I should have written everything in ASP.NET C#…but 90% was already coded in ASP classic VB…so I tried to power through.

5 hours later with no success, and no wanting to recode everything in ASP.NET C# or ASP.NET VB, I decided to go with PHP.

30 minutes later and I had most of what I needed. I was so happy!

And then I ran into another bug. Skip forward 4 hours (to now)…and I have it solved :) And I’m feeling very good…it’s a good feeling, working on something, in this case, 10 hours….and finally solving the problem. Yourself. I mean, there’s the internet, but not asking friends/coworkers…and being able to do what you need.

I dunno…just really happy right now :)

I really wanted to spend this weekend reading. Reading my novel and reading a CSS book. But this was good, I learned a lot about PHP and have more code base to work with, and isn’t that what it’s all about? :)

Developers start counting at 0

Tuesday, October 26th, 2010 at 4:45 pm

So I spent a good hour or so trying to get subcategories to show up on the right panel….
It wasn’t showing up, despite putting in parameter for it (below)…so I thought maybe it was the wordpress code I’d modified. That wasn’t it either.

To show categories, you have to put:
<?php wp_list_categories(‘depth=1‘); ?>

By default, wordpress shows subcategories…so you just have to specify the depth.

So here I’m thinking all categories belong in depth 0
Subcategories belong in depth 1
Subsubcategories belong in depth 2, and so on.

And after of trying to debug this, (and I probably should have done this at the start), I modified depth to 2 and it worked.

So basically,
Categories belong in depth 1
Subcategories belong in depth 2…
and so on.

Man, I feel stupid…but…it’s an honest mistake no? I guess I’m just so used to counting at 0, especially when I see all this code….”who starts counting at 1?” I asked myself…but…the answer is non-developers. But still, this *is* still PHP code…so…man, i dunno.

Anyways. Time wasted….

I need to re-categorize everything. I hate my categories. Can’t find/do anything.

PHP > ASP.NET? + SWFObject + Google Javascript Libraries API

Tuesday, August 10th, 2010 at 9:15 pm

Actually…I’m not entirely convinced of the above statement (PHP > ASP.NET). I just know that within the last week, I was building something in ASP.NET. Today I was building something in PHP. Both were simple CRUDs…actually, more like C(reate) R(etrieve) U(pdate)s…(btw, the D(elete) is the last one). And PHP was so much easier to develop in, a bit harder to debug (my errors consisted of: Parse error on line: #) but….everything is just so much faster and simpler!

Even with drag and drop controls, Visual Studio design view, etc…I found it more fun and easier to develop in PHP.

Anyways, it was good to develop in both and stay away from ASP Classic.

I developed some good PHP today, finished what I needed to do. Back to my .NET project!

Man…I walked home today and thought of 2 other things to blog about but I can’t remember them now that I’m at home >:( I’ve got some defective RAM and the only ROM I came across was the Royal Ontario Museum.

OMG i just spent like, 20 minutes putting that button in…the reason was that this google page:
http://code.google.com/apis/libraries/devguide.html#swfobject has some code,
load request: google.load(“swfobject, 2.2″);
but they forgot 2 quotes, it should be
load request: google.load(“swfobject”, “2.2”); !

DAMN YOU GOOGLE! HELP ME OUT AND FRUSTRATE ME AT THE SAME TIME ! If you weren’t the best (minus Wave and Talk), I’d hate you! But no…I (would) still love (to work for) you.

/malnourished. will develop for food.