ARTLUNG
this is the website of joe crawford. code. occasional comics. toy robots. san diego.

ArtLung posts tagged with “web-programming” ·

  • New Theory of Technology Work
    Quoting myself from an email to a colleague: Why I stayed so long at *****, where the primary thing I was working on was traditional ASP, I have no idea. I’m coming to think if a job isn’t making you smarter, it’s making you dumber. And *** man, every line of VBScript I code makes…
  • Browser Wars II
    I so wanted to go to this – folks from Internet Explorer, Mozilla, and Opera PLUS my JavaScript hero Douglas Crockford getting together to talk browsers: YUI Theater — “Browser Wars Episode II: Attack of the DOMs” [Yahoo! User Interface Blog] I will be watching this. Hi, I’m Joe, and I’m a browser nerd.  Hi…
  • Destructured Assignment in Ruby, PHP, and JavaScript
    Stupid code tricks in Ruby, PHP, and JavaScript
  • Loading TinyMCE on the fly
    Let’s say you have a textarea that is called into a page dynamically, say with an AJAX loaded chunk of HTML with a textarea in it. If you want that textarea to have TinyMCE applied to it, you need to call a script. This was a fun one to think through and debug, and it…
  • Trailing commas in an array OK in PHP
    I was editing some code today and saw what looked like an error to me, but nothing was broken on the code I was looking at it, so I was prompted to look it up. And indeed, in PHP: “Having a trailing comma after the last defined array entry, while unusual, is a valid syntax.”…
  • Display a Brace in Smarty Code
    The “literal” tag should do it: {literal} {works} {/literal} Smarty info. (By the way, yes, the blog is still screwed up. I’m busy. Gimme a break. I was up till one last night working on it and no joy. Yuck. This is what I get for a rushed upgrade.)
  • Bitmasks
    I’m doing work with bitmasks these days, working on system maintenance on a web application I had nothing to do with building. One of the things it does is use Bitmasks to keep track of some customer data states. I’m not sure I like it, but I can’t deny that it’s a way to preserve…
  • “Click to activate and use this control”
    Yuck. This is the latest in a series of failures in the last 24 hours. Eolas and Microsoft are cheesing me off this afternoon.
  • JavaScript trim() function
    it’s hokey, but it’s a nice basis for some other things. why didn’t i go looking for this last night when i was slamming my head against stupid code? ugh. function trim(str) { while(”+str.charAt(0)==’ ‘) { str=str.substring(1,str.length); } while(”+str.charAt(str.length-1)==’ ‘) { str=str.substring(0,str.length-1); } return str; }
  • Best Web Code Comment Ever
    This applies to HTML, JavaScript, and CSS equally well. Concerned about someone being able to see your code? Get over it. Minification v Obfuscation » Yahoo! User Interface Blog Then finally, there is that question of code privacy. This is a lost cause. There is no transformation that will keep a determined hacker from understanding…