Matt vs. Rat

65 days ago

How did you spend last night? It wasn’t by chance chasing a 5-6 inch rat around your home or apartment was it? If not then I envy you. Now I know what you might be thinking, “Wow, this dude lives in a fucking dump, or maybe NYC, if he has rats running around..,” Well, neither is true… or so I thought. Perhaps there is a east coast wormhole under my fridge, or maybe this place isn’t all that great after all. I’ll stop the NYC jokes though, LA has plenty of rats as anyone from Downtown to the Palisades knows. The Palisades rat story is especially crazy if you haven’t heard it. Anyway, as many friends know, I’ve had a lot of issues with this place, but I think its had more positives than negatives. However, chasing a small rodent around your apartment with hot murder in your soul is a pretty big fucking negative.

So this all started when I was doing some work on my laptop last night and I thought I saw something out of the corner of my eye. Must have been something caught in my eyelash. Whatever, back to the code. After a while though, it was time for tea. So, I walked into my kitchen. When quick as a flash I saw a grey blur (with a tail?) blink before my eyes on the floor between the cabinets and my fridge. I stopped. Now, when you envision this happening to you in your daydreams, in the supermarket aisle as you pass the rat poison, you think you’re going to respond with the cool detachment of a man who knows he can take care of shit. I’m not the sort of guy who likes John Wayne, but in this instance he’s the macho archetype that jumps into my brain. “Bah! It’s just a god damn mouse! What’s the big deal! Are you yella or sumthin partner!” Then you walk up and confidently crush it beneath the heel of your cowboy boot. (Maybe its that I just finished Red Dead Redemption?) My actual response was a little different: “HOLY FUCK!” I exclaimed to no one in particular, and then took a step back. My body flooded with adrenaline and I froze. While I didn’t scream like a little girl on the outside, I’m ashamed to admit I did on the inside. Part of me thought “Simple. Go grab your laptop. Open your stove turn up the gas all the way. Then, light a candle in your living room. Walk out of here and never come back.” Realizing the “Flight” part of my adrenaline wasn’t exactly coming up with the best course of action my brain switched fairly quickly to “Fight”. I could hear John Wayne in my head laughing. “Guess that little mouse just got himself a house of his own, since this yella bellied, computer nerd, city boy ain’t got the guts to be the man of his own house. Huh huh huh…” More adrenaline surged. Fuck you John Wayne.

I’d love to say that my “Fight” self was a picture of detached cool that I wished myself to be. Sadly it turned out to be more a deranged lunatic bent on rodent death. I grabbed a broom from my utility cupboard. “Sorry my little gray friend but you picked the wrong fucking house, and you’re GONNA DIE!!!” I thought as maniacal laughter filled my imagination drowning out the contemptuous John Wayne. I walked into my kitchen. Unsurprisingly the mouse had fled. I started moving things to see if I could find him. My dining table, my fridge, my stove. He was nowhere. I started looking down on the floor for holes he might have run into. I opened my back door from the kitchen and stared moving some excess stuff out back to clear the kitchen. Still, there was nothing. WTF?!? Did I imagine the gray blur? It had been so very fast, maybe it was something else? I started looking through the cabinets where I kept my food and all over all the floors in my kitchen. There were no signs of mice past or present. Odd… Maybe I just imagined it. I walked into the hallway, a sort of three-way crossroads between my kitchen and the other rooms in my apartment. Yeah, maybe I had imagined it. I started to calm down I texted my cousin, the only person I thought who might be up at the same time as me to relate the funny madness of my current situation.

As I finished my text, something came from my bedroom into the hallway. It was no longer a blur. It was not a mouse but a 5-6 inch gray rat, fast, but plain as day. “FUCK!” I shouted reflexively, the rat jumped startled as me and ran past me back towards the kitchen. My adrenaline kicked in again and this time I started swinging the broom honed in on my now visible quarry. It was at this time that I learned something: rats are fast. If I might say, my reflexes aren’t half-bad for a man of my years. Video games give me reasonable eye/hand co-ordination, and I now work out just enough now to give it a more than a little physical backing as well. However, it seems evolution has honed the rat to be surprisingly fast. I went after the rat with a flurry of blows and it avoided them all even jumping through the air a few times as I swept across the floor trying to jam it against the wall. It was impressive, in a filthy, darting sort of way. After several seconds of intense attack, the rat escaped deeper into my kitchen. Shit, that thing is fast, I thought. If you didn’t know: rats are fucking fast. Take note. Coming to this knowledge I realized the rat had probably left the kitchen and got into my bedroom (shudder) while I had gone to the other side of kitchen. Keeping an eye on the kitchen entrance I quickly closed my bedroom door and the bathroom door. I wanted to avoid it getting into any other parts of the house again, especially my bedroom (shudder again) Standing at the kitchen entrance I came to a grim realization. This thing is so fast I could chase it around all night and still might not be able to kill it, even with my crazy rage going. Maybe I could chase it outside. The back door was on the other side from where I was, and was unlocked, but this was still a problem. I knew how quick it was now, and that it had gotten away in the brief time I was on the other side of the kitchen before. Also my back door is kinda loud, there was a good chance it would scare it out and I couldn’t stop it from going into my living room. This sucked. If only I had someone to help me open the door, and switch places to help me keep it from escaping, while I could shew it outside or kill it. There was someone who could help… I felt bad and stupid at the same time, but I called my cousin. My cousin lives about 4 miles away, and it’s late. “…Dude, I just need someone to open my kitchen door. I know how fucking stupid this sounds, but this thing is fast and big…”

To wrap up, my cousin did come and my plan failed, although it did ultimately leave. :) I thought he’ll open the door flush it towards me and I can either kill it(fat chance) or flush it back towards the door and hopefully outside. Alas it seemed to vanish again then i discovered it was under my fridge. It made a break for my living room, while me and my cousin mad attempts to clobber it with the mop and broom we had at hand. Fortunately/Unfortunately it got past us and ran into the wall furnace in my living room. Initially I thought I was fucked, but I opened it up and discovered a nice un-screened hole that I’m pretty sure drops to the crawlspace below my apt. My cousin observed that this was probably how it got in in the first place since my place seemingly lacks any other entry point. Since it’s summer and the heater isn’t in use right now I made a makeshift plug for the hole and resolved to call my landlord the next day.

In the grand scheme this is a stupid problem, but nonetheless THIS FUCKING SUCKED. I don’t recommend it.

I know many.., ok perhaps all of you reading this, will be *ahem* laughing at my expense. Which I can’t really discourage, because in the abstract anyone chasing rats around their house at midnight like a crazy person (i.e. making strategies, calling and waiting for backup), is of course undeniably funny, as long as it isn’t you. The sad thing for me is I bet many of you will never have to have this experience and even if you do you probably will be smart enough not to blog about it on your personal site or facebook. So I don’t get to laugh in return. You’re smarter than me in this respect. A man once said “Life is hard; it’s harder if you’re stupid.” Fuck you John Wayne.

Matt Irwin

,

---

JSConf Videos

78 days ago

Maybe these have been up for a while but I just found them today: videos from jsconf posted on blip.tv. Yay! I was happy to find these since I didn’t get to go to jsconf.

I watched Douglas Crockford’s “Really, Javascript?” presentation, among others, which was very interesting. I think he might have given this same talk at TXJS as well. In any case, one point of particular interest is Crockford believes that HTML5 should be scrapped because it’s not fixing XSS security issues. Not sure about my own opinion on this as I would have to confess great ignorance about anything beyond basic XSS stuff. To me it seems like the web is evolving at a stupidly slow pace however (if we’re supposed to be depending on the W3C anyway), and the idea of scrapping what took too fucking long to begin with IMHO seems… dumb. On the other hand it would be pretty lame if web security became way less stable than it is already, and I’m ignorant of the full spectrum here. Anyway, food for thought and more reading/research I need to do obviously.

Matt Irwin

,

---

Photoshop Text Export Layer to Clipboard

103 days ago

I recently wrote a follow up script to the last set of Export/Import text scripts for Photoshop I did a while back. I found in my actual day to day usage of the script it was rare that I wanted to dump all the text layers in a file, what I really wanted was to be able to copy the text to the clipboard so I could take it wherever I wanted. So that’s what I did. This script takes the active layer, if a text layer, and exports it to the clipboard.

Unfortunately this script is OS X(Mac) only, though it should be easy for me, or others, to port to XP. Not sure about Windows 7, and I don’t have access to a copy of Photoshop on Win7 anyway. As for OS X, the script requires running another shell script to actually copy the text to the clipboard. To make this work you have to create a shell script with executable permissions BEFORE you run your jsx, which I’ve outlined in the instructions. I’ve even written a handy applescript to do it for you if you are so inclined.

Instructions (MAC only):

First Setup Shell Script

1. Run setupClipScript (linked above)
— OR —
1. Open Terminal
2. Type “echo ‘’ > $HOME/Documents/clipScript.command” and hit enter
3. Type “chmod 755 $HOME/Documents/clipScript.command” and hit enter

Next Copy Script

Copy it to your system and choose “File > Scripts > Browse…” and select the script you want to run
— OR —
1. Place script in ‘/Applications/Adobe\ Photoshop\ CS#/Presets/Scripts/’
2. Restart Photoshop
3. Choose File > Scripts > psdExportTextL_Clipboard

Normal safety warning here: PLEASE SAVE YOUR FILES BEFORE YOU RUN SCRIPTS. I did suspend/save history state for the script, but things can still go bad and often do.

Scripts are only written with CS3 and above in mind, but I only verified them in CS3 on os x.

You can download the script here (right click and choose “Save As” to download).

Next I’ll probably add XP support, just didn’t have as much need as I primarily work on os x. The script has the annoying side effect of leaving open terminal windows open every time it’s executed. Maybe there is some way I can get rid of these, but they are a minor price to pay, for me anyway. Still haven’t figured out why my Photoshop executes scripts differently when I shortcut them. I bypassed this issue by “shortcutting” them via actions instead. Anyway, enjoy the js magic.

Matt Irwin

,

---

Photoshop Text Export/Import Scripts

130 days ago

About a month ago I wrote some more scripts for Photoshop, which the people I work with seemed to enjoy. These scripts export all the text in a PSD to a text file, or import each line in a text file into a text layer (duplicated from the psd or new). I made use of a few algorithms at ps-scripts.com a great resource if you are writing scripts or looking for them.

To use these scripts:

Copy them to your system and choose “File > Scripts > Browse…” and select the script you want to run

- OR –

1. Place script in ‘/Applications/Adobe\ Photoshop\ CS#/Presets/Scripts/’ for mac or ‘C:\Program Files\Adobe\Adobe Photoshop CS#\Presets\Scripts\’ for win

2. Restart Photoshop

3. Choose File > Scripts > psdImportText or psdExportText

Normal safety warning here: PLEASE SAVE YOUR FILES BEFORE YOU RUN SCRIPTS. I did suspend/save history state for the script, but things can still go bad and often do.

Scripts are only written with CS3 and above in mind, but I only verified them in CS3 on osx and xp.

You can download the export script here and the import script here (right click and choose “Save As” to download).

I’m thinking about streamlining a version of the export which only exports the current layer (if text), since in my own use this seems to be more useful and easier to shortcut. Although for some reason my photoshop executes scripts differently when they are “shortcutted” and they often fail. I’ll have to look into this. Anyway, hope you like em’.

Matt Irwin

,

---

The iPad, and more HTML5 vs Flash Ranting

208 days ago

So Apple announced the iPad Wednesday before last, and like every little good geek I followed along with the live-bloggers, attentive to every tedious twist. I’ve been thinking about buying a book reader of some sort recently and this is an interesting addition to the mix. Will I shell out $700 for this thing in a few months? I’m leaning towards no, however I will defer my decision for 3-4 months, which says a lot I guess. I’m really interested to see how this thing fares regardless. I think the reason all us tech dorks love speculating about the iPad is that it’s a total unknown, it could be a huge success or fail spectacularly. As an observer on the sidelines I’d find either of those outcomes fun to watch. For my own worthless speculation however, I’d guess the boring middle ground: sells ok, nowhere near as big as the iPod/iPhone. We’ll see.

Once again listening to MacBreak as I do, they sprang off the iPad to discuss more about Flash vs HTML5/Canvas again, which in turn got me a bit worked up… again. Sometime later I found this link to an article on John Nack’s blog via Gina Trapani’s site. This article is really great and sums up my own points and many others in a much better way than I would have. John is a developer for Adobe, but I think his article is very even handed. You should read it, its good. John’s Main points which I will briefly echo here:

  • Flash is flawed, but it has moved the world forward.
  • Open standards are great, but they can be achingly slow to arrive.
  • Talk of “what’s good for standards is bad for Adobe” is misinformed nonsense.
  • Flash will innovate or die. I’m betting on innovation.

Hear, hear people. You can blame developers or designers or even Adobe for shitty flash sites if you like, but they are not to blame. If you see a guy with a mullet dyed red, white and blue and a neck tattoo of a fat naked clown, do you blame the barber, the tattoo artist? I hope not, because there’s a 99% chance they weren’t recommending that crazy nonsense. In fact, they probably tried to talk the guy out of it. I would argue the same is true of Flash widgets and sites. Flash makes more things possible, often at the cost of higher resources. Clients often only see the additional possibility and go off the fucking rails with it. Sometimes, try as you might, you just can’t talk people out of dumb fucking ideas.

On to HTML5 though, since my last post on the subject, I stumbled across this great demo site for html5 by Remy Sharp. These demos look really promising for the future possibilities of the web. I’m hoping to get an opportunity to build off some these examples myself. Remy also did a talk about the demos at JSConf.eu. Good stuff

Matt Irwin

,

---

« Older