A Django template filter for goo.gl URL shortener

Sunday, April 24, 2011 by jeremydw

Enables example: {{"http://www.google.com/"|goodotgl}}

#!/usr/bin/python2.5

"""Simple URL shortener template filter that works with the goo.gl service.

Makes a request to the goo.gl URL shortener API and caches then returns the result.

goo.gl API docs:
  http://code.google.com/apis/urlshortener/v1/getting_started.html

Usage:
  {{"http://en.wikipedia.org/wiki/Never_Gonna_Give_You_Up"|goodotgl}}
  => http://goo.gl/K5ac
"""

__author__ = 'jeremydw@gmail.com'

import urllib2
from django import template
from django.core.cache import cache
from django.template.defaultfilters import stringfilter
from django.utils import simplejson

GOOGL_API_URL = 'https://www.googleapis.com/urlshortener/v1/url'

register = template.Library()


class GooDotGlConnectionError(Exception):
  pass


@register.filter
def goodotgl(long_url):
  """Returns a shortened URL via the goo.gl URL shortener service.

  Args:
    long_url: URL to shorten.
  Returns:
    Short URL as string.
  """
  cache_key ='GooDotGl%s' % long_url
  short_url = cache.get(cache_key)
  if not short_url:
    request_dict = {'longUrl': long_url}
    body = simplejson.dumps(request_dict)
    headers = {'Content-Type': 'application/json'}
    request = urllib2.Request(GOOGL_API_URL, body, headers)

    try:
      response = urllib2.urlopen(request).read()
      response_dict = simplejson.loads(response)
    except Exception, e:
      raise GooDotGlConnectionError('Problem using goo.gl service: %s' % e)

    short_url = response_dict['id']
    cache.set(short_url, cache_key)
  return short_url

Idiot's Guide to Generating Google AuthSub Tokens with curl

Thursday, April 7, 2011 by jeremydw
I've had to generate Google AuthSub tokens a bunch of times, and every time I have to re-read documentation on how to create these tokens. So here it is, step by step. How to generate a Google AuthSub Session token.

1. Log in to your Google account.

2. Visit this URL (you'll have to customize it a bit):

https://www.google.com/accounts/AuthSubRequest?next=http://nothing/&scope=[INSERT SCOPE HERE]&session=1   &secure=0

3. Authorize the request, then copy the token from the destination page. Note that it might have URL-encoded characters that you will have to decode. You now have your request token.

Your request token will look something like this: 1/hABD5BM2Ryoh9DEFbq14QvhBKYTIaYFmmR27Db4A

4. Upgrade your request token to a session token:

curl -i -H 'Authorization: AuthSub token="1/hABD5BM2Ryoh9DEFbq14QvhBKYTIaYFmmR27Db4A"' https://www.google.com/accounts/AuthSubSessionToken

And the response will contain your AuthSub session token, ready for use in your web application.

P4/G4 Trick Log

Friday, May 28, 2010 by jeremydw
Add all files from one changelist to another:
g4 list -s [fromCL#] | xargs g4 addto -c [toCL#]
Add all files not in depot to a changelist:
g4 nothave | xargs g4 add -c [toCL#]

Chicken Curry

Sunday, May 9, 2010 by jeremydw
1 tablespoon butter 2 tablespoons canola oil 4 boneless, skinless chicken breast halves 1 onion, chopped 3 garlic cloves, minced 2 tablespoons curry powder for mild taste, 3 for hot 1/2 cup diced apple 1/2 cup chopped dried apricots 1/2 cup golden raisins 1 14 1/2-ounce can chicken broth Salt Freshly cooked rice Melt butter with oil in heavy large skillet over medium heat. Add chicken and brown on both sides, about 5 minutes. Transfer to plate. Add onion and garlic to skillet and sauté until translucent, about 6 minutes. Stir in curry powder. Return chicken to skillet. Add apple, apricots and raisins. Add enough broth to just cover mixture. Season with salt. Cover and simmer until chicken is just cooked through, about 10 minutes. Transfer chicken to platter. Keep warm. Continue simmering fruit mixture until fruit is tender and sauce thickens, about 5 minutes. Spoon sauce over chicken and serve with rice. Serves 4

Personal Life Remember List

Sunday, January 10, 2010 by jeremydw
In college, Karen and I kept a "remember list" for Econ exams. It was composed of stuff we had to review later in order to prepare for the tests. Here's my 2010 "remember list" for stuff I have to review later for real life (because my Gmail inbox is getting too full of empty "todo" stub messages):
Knoedel recipe from Mom:
You are referring to German potato dumplings or Knodel (o with an Umlaut). I make them with a mix called Pfanni and just follow the directions - even the Germans use a mix because to make them at home you have to grate raw potato which everyone says is too hard and these taste the same. These are very bland and only taste good with a gravy - so I make them with a pork roast. I can make this for you when you come home if you'd like and then you could watch me. Or I could send you the recipe. It is not hard to make. I also make this with sauerkraut that I cook with bacon to make it tasty.
Let me know if you'd like the recipes. And the Pfanni mix is sold at German deli's or some specialty food stores. I get it here at a deli on Main St in Santa Monica.
Minh> i watched new moon
Minh> only a horrible movie like this can beat box office of THE DARK KNIGHT
Minh> gg human race

Girl advice from friends

Monday, November 16, 2009 by jeremydw

Minh: tell her you like her

Minh: ask ccowart if im right first lol

Lilly: don't tell girls yer interested in about other girls yer interested in..lol

Ian: so, status check. got any good dates?

Jeremy: like girls or the fruit or calendar days?

Ian: girls

Jeremy: nope, HTML is my only lover.

Also, you should listen to this song. Just click the onebox result (shameless Google plug). Pretty good. :)

Part 2 of this post is a Romesco sauce recipe. Thanks, Cowart.

  • roasted tomatoes, red bell papers, and sweet peppers
  • peeled almonds and hazelnuts
  • garlic
  • olive oil
  • salt and pepper
  • a little bit of red wine
  • vinegar
Part 3 of this post is a text message from Minh:
Jeremy it hurts my xhewja.. sdidn I drop my phone. Hard. I hoe nor buy me a new honbabu local y u bye

40,000 miles

Sunday, November 1, 2009 by jeremydw
Today, my beloved car, a 2005 Acura RSX Type-S (color "vivid blue pearl") will hit 40,000 miles when I drive to the Golden Gate Bridge for a run. Unlike a handful of my friends (you know who you are), I haven't given my car a name. In fact, over the course of the past year, I've downright mistreated my car, but nonetheless I still appreciate this piece of machinery more than just about anything right now. Forget my laziness and mis-luck with public transportation -- I could live without a car in San Francisco, after all -- but the real reason I appreciate my car is because it's been there for me during significant moments during the last five years.
IMG_2654
Driving with Abe back to LA, 3000 miles
My 2002 Prius broke down. I destroyed my 2005 Scion tC in the rain. So I was in college at 2005, living in Christian Hall in Unit 1. My dad had business to take care of in Oakland, so he drove my RSX from Los Angeles to Berkeley, in order to give me my car.
I didn't know how to drive stick. So we drove on the 24 towards Walnut Creek and found a random church on a Saturday afternoon. This random church had a fantastic parking lot, where I learned. I learned for two hours. My dad wasn't the best stick driver, but his instruction got the job done. I was able to drive. A little. I drove us back to Berkeley, and stalled in the middle of College Ave. Some workmen laughed hysterically at me as I frantically tried to get my car out of the middle of the street.
I promised my dad I wouldn't drive until the next day, but the second he left I went out driving once again. I loved stick. It was, and still is, like driving a giant toy. Harish and Mandeep were very fascinated with my car, so I took us out driving. We got lost in Oakland.
A week later, I bought a navigation system (Pioneer AVIC D1) and installed it myself. I found a guy in Fremont with the necessary equipment (his name, "Mistah SparklezZZ" and found him through an RSX forum) whose tools I borrowed to do the installation. It took me a really long time, my hands got bloodied up from the hacking and sharp pieces in the dashboard, but there I had it: a self-installed nav system. Nice.
Some notable events in my car's life:
IMG_2497
March 2006: Road trip to LA with Alex, Abe, Luis, Mike
IMG_0600 IMG_0602 IMG_0594
July 2006: Moving the huge-ass sign in the morning
img_0114
July 2006: Driving through a fire
IMG_1222
November 2006: Camping out for the Wii with Minh
IMG_0679
February 2007: Driving with Sara to line dancing in Davis
Other notable moments not in photos:
  • Teaching Cyn, Victor, Jen, Monica how to drive stick.
  • Saving me from driving myself crazy after dealing with girl trouble at 2 in the morning.
  • Saving several girls from dealing with boy trouble at 2 in the morning.
  • Moving year after year, every year. I can fit more in that car than you would ever imagine.
Needless to say, my car is also now incredibly hurt.
  • The navigation system doesn't work anymore.
  • I scratched up the wheel well while parking in my city apartment's garage (a fire hydrant blocked the entrance).
  • While shopping at Safeway, four times I've returned to huge scratches in my car from careless people.
  • A Prius lost its bumper on the freeway. The Prius was right in front of me. I drove over the bumper and it tore off my sideskirt, which is now hanging loose.
  • My car got shot at.
A lot has changed in my life over the past five years. But my car is constant. That thing stays, and even if I have nowhere to go, my car will be there. Sappy, huh? Yeah. Good car.

Recipe: Okonomiyaki

Wednesday, October 21, 2009 by jeremydw
Okonomiyaki literally means "as you like grill." It's an easy-and-fun-to-make Japanese-style pancake/omelette. There are two types: Kansai-style and Hiroshima-style. The Kansai style is listed below. Hiroshima-style adds yakisoba as an additional ingredient.
Makes two okonomiyakis.
  • 2 cups of flour
  • 2 eggs
  • 4/3rds cup dashi water
  • as you like: soft tofu
  • as you like: cabbage
  • as you like: shrimp pieces
  • as you like: sliced scallops
  • as you like: green onions
  • as you like: dried nori
  • Drench it in Okonomiyaki sauce
  • Cover it in dried seaweed
  • Unload many, many bonito flakes on top
Miso soup
  • 2 cups dashi soup stock
  • 1 block tofu
  • 2 tbsps miso paste
  • 1/4 cup chopped green onion
Boil some soup stock. After boiling, take a little bit out, mix the miso paste in, then slowly return miso to the soup. Let sit but don't boil the soup after the miso paste has been mixed in.
Side salad
Don't forget, with the heavy food it would be nice to have a side salad.
  • tomato wedges
  • carrot shavings
  • lettuce
  • salt and pepper, balsamic vinegar and oil
Dessert
  • 3x mini-scoops of sorbet
  • mint leaves
  • mango pieces
homemade okonomiyaki
A tofu okonomiyaki I made after coming back from Japan. A bit lighter than the recipe I described above, as it had almost no flour but substituted egg and tofu for the batter.

The most fantastic cab in San Francisco

Sunday, October 11, 2009 by jeremydw
It was a pretty usual night, actually. I went to Graham's birthday party (Mexican-themed) and then, on my way home, I would meet Julie and Jori at Homestead. I hung out for about an hour there, after which we went to get tacos from El Farolito (next to the 24th St. BART stop) in the Mission.
215am about. So, time to go home, right? No one's driving our direction, but we were keen on hitching a ride anyway. All of a sudden, this cab pulls up. Neon lights in the back. Pumping music. Jori looks at me and says something to the effect of, "I think we have to take that cab."
So we get in. "Fulton and Divisadero." The cab driver takes off and drives all crazy. Freakin' crazy. Reminded me of an NYC cab driver. But, get this. He turns the music up. Rolls the windows down. Party-raver lights inside the cab turn on. And it's all this crazy-mixed-up-and-awesome Iraqi music. People give us looks. We're, like, dancing in the cab. Cab driver's got these Iraqi flags all up inside.
And we get to our stop. Get out, pay the guy, and he takes off. Pretty much without a word.
Jori and I just stand there on the corner at 230am. "Dude, I don't know what to do now," he says. "I'm all pumped up. I'm all ready to go to the club now. Where are the clubs?!"
In conclusion, if you ever see a crazy cab with neon lights playing music, take it. Just take it.

Restless, Restless, Restless; and the Prisoner's Dilemma of Flirting

Sunday, September 20, 2009 by jeremydw
Every so often my life gets more frivolous than usual. This summer was another one of those times. This post will exist mostly as a log of this summer, but that's no good reason for you not to read it. What follows is the log of my "summer of love and adventure, mostly adventure, but a little love couldn't hurt too."
I used to call my Flickr photos as a lazy man's blog (no writing, just camera-shooting and uploading), but now I realize that writing can capture things that photos can't. Not to say I'm a good writer, but I would like to remind myself of my last two months with keyboard-and-screen (as opposed to pen-and-paper).
* Flew to Munich for the Landshuter Hochzeit. Met my German cousins. Biggest medieval faire in the entire world. A serious faire, not like those lame Ren-Faire things you get in rented-out Holiday Inns here in California. No, I haven't gone myself, but I did drop Lilly off at one once.
Addendum: 3.5 liters of beer and 2 bars later, I was OK. Thank you German genes. Thank you German beer halls.
* Traveled with family to Interlaken to stay with family friends on a lake. Paragliding, relaxing, doing urgent work-for-work during my vacation from the middle of a beautiful old country. Nice. The internet rocks.
* Split off with family and went to Zurich. Thank you, Kat, Asim, KeeKim, Rupert, Jens, for showing me a good time. What do you do in Zurich? Two things. Frequently after work we would grab a beer and hang out at Seebad Enge (a pleasant bar-type-lounge place on the lake, where people just go to relax) or -- drumrolll -- go to Ikea. They asked me twice if I wanted to go to Ikea that week. "What are you going to Ikea for?" "Oh, I need some cushions and things." "Oh really? Me too... let's go!"
Also took a day trip to Basel, where the world's "saddest piece of rock" exists -- a really sad-looking crying lion.
Time to kick my adventure into high gear. Flew to London for the first time, rode the Tube. Met Monica in the middle of the city with my luggage. Saw Harry Potter in London. Went to a Farmer's Market to buy "pork faggots" which are liver sausages. (This will be important to the story later.)
* Ran around London, which was freakin' great for running. Worked hard. Drinks with Simon and Lucy. Drinks with my British coworkers. Made Pfankuchen for Monica. She liked it enough to add to her "things to do in the best day ever" post.
* Went to Brighton, the combination-Monterey-and-Santa-Cruz beach town. Cooked dinner with Monica, but when my back was turned Monica put those liver sausages in the tomato sauce. Epic fail. We were hungry, so we made a mad dash for a nearby Italian restaurant.
* Went to Adam's place for awesome homemade tonkatsu. An unassuming Brit cooking delicious Japanese food, excellent.
London was good. But time to go from "high gear" to "overdrive." On my last day in London, Monica and I flew to Slovenia -- a small country on the eastern border of Italy. We rented a car. The entire country became our playground.
We went caving (for anyone who doesn't know, "cave" can also be a verb and mean "to explore a cave"). We did something called hydrospeed (not a drug, but rather a river rapid extreme sport). They put you in a wetsuit, give you a helmet and flippers, and give you a hard boogie board. They put you in river rapids and the object of the game is: avoid the rocks. Avoid the freakin' rocks! We got there late, but Monica sweet-talked the dude into giving us a private tour. Sweet-talking, she's really good at that.
We traveled to a town that did not allow cars. So we had to park our car outside the town and take a bus inside. Very confused. The parking attendant said to us: "THIS TOWN IS NOT FOR YOU." to indicate we weren't allowed inside.
We continued traveling around, our last night was spent on a farm where they had a pool and dinner service came from the farm's restaurant. They had wine on tap. Good wine on tap. Wow wow. The next morning we had to catch our flight back to London, so we left the farm at 4:45am. I drove 180 kmh with contacts in backwards to make it to the airport on time.
I parted ways with Monica and made my way back to San Francisco. Immediately I felt awkward to be back in the states after a month abroad. Alex was gone to Chicago, Stephanie had settled down in the city. Mike's back in Davis, and Sara remains in Berkeley.
I continued my "bum around, get Bi-Rite and hang out in the park on weekends" life. I coded and rock-climbed at night. I still suck at rock climbing, by the way, but it's very fun.
We went rafting. By we, I mean Cowart, James, and Minh. Yeah. Minh went rafting. He let everyone know that he can't swim. Constantly. Probably the most hilarious 6-hour period of Minh I've ever seen. And that says a lot.
After that, Green Day concert with Mike. Dinner with the marketing team I bossed around in Berkeley. Udupi Palace one day, then Wargames on the lawn another with Julie. It's been good.
I'm writing now from Los Angeles where the weather is officially "off the hook." Thank you Victor, for taking me out for dinner yesterday. And today we will have the pool party that I planned two months ago, even though Monica flaked out. It will be great to meet my old friends again. That means you, Eric. This guy might as well be dead (due to inability to reach him unless he's right in front of you).
That being said, I'm itching to get back to northern California. I have some unfinished business to take care of, and new uncompleted quests have just suddenly appeared in my quest log. And like any good wanna-be gamer, I've gotta complete those quests.
Related, below, is a snippet from another post I found online. Game theory in the context of flirting:
* The girl is flirting with you and you know it, and reply accordingly. (win-win)
* You think the girl is flirting with you and she is not. You say something sticky, and get into a situation. (win-lose)
* You don't think the girl is flrting with you, but she is. (lose-win)
* The girl is not flirting with you, and you don't care. (win-win)
Will Econ 155 with Christine pay off? Time to get moving. I've got the Master Sword already, just gotta slice off Ganon's head.

Vim Trick Log

Thursday, September 10, 2009 by jeremydw

I'll use this Scratchpad entry as a way of logging the handy Vim tricks that I just can't leave at the door. Vim is mission-critical to my efficiency as a web developer and each trick I learn saves many me reps of finger pushups.

There are tons and tons and tons of (seemingly endless) Vim tricks and plugins. This entry will just log a handful that I need to remember.

Search and replace within a selection

Search and replace only in a visual selection, not an entire line:

 
:%s/\%VSEARCH/REPLACE/g

Find non-ascii characters

 
/[^[:print:]]

Delete lines matching (or not matching) keyword

Matching:

 
:g/.*foo.*/d

Not matching:

 
:g!/foo/d

A note about buffers, yanking, and pasting

"adw saves word INTO register a

"ap pastes FROM register a

Two Tips: Rsync and SSH Keys

Friday, August 21, 2009 by jeremydw

These two bits I've been using for longer than I can remember, but every time I reconfigure a machine I need to Google the command syntax. Here they are, in an accessible format.

First, because I recently lost a whole ton of (good) work, here's a simple way to do Rsync for backups.

 
rsync -avz -e ssh REMOTE_HOST:REMOTE_DIR LOCAL_BACKUP_DIR

SSH keys, enabling password-interactive-less sign on, are a brainlessly easy two-step process. If you type your password more than once a day for SSHing into machines, you'll want to use SSH keys.

 
local$ ssh-keygen -t rsa -b 2048
local$ ssh REMOTE_HOST "cat >> .ssh/authorized_keys" < .ssh/id_rsa.pub

Sha-bam, you're done. Two commands and no more typing in that password on every SSH connection.

Pasta Sauce Recipes

Saturday, July 25, 2009 by jeremydw
Hi Jeremy,
Here are the 2 recipes. I just eyeball it so the quantities are not too important.
Pasta Primavera (Spring Pasta):
1 lb pasta
4 cups diced fresh, ripe tomatoes or more
1-3 minced garlic cloves
1/2 - 1/3 cup chopped basil or more
salt to taste
ground pepper if desired
extra virgin olive oil, about 3/4 cup or enough to make a sauce when mixed with the tomatoes etc
In a large serving bowl mix diced, fresh, ripe tomatoes, finely minced garlic, chopped fresh basil, salt and olive oil (enough to make a sauce). Let sit while you boil water and cook pasta. Drain the pasta and pour the drained pasta over the tomato sauce. Mix and serve. Usually eaten without cheese but you can serve it with grated parmesan or even add cubed mozzarella to make it heartier.
Tomato Sauce:
1 large can tomatoes (Pomi chopped or strained in the box is good. If the canned tomatoes do not have some puree added don't use all the liquid and break up any whole tomatoes)
1 large onion, cut into large pieces the size of a quarter or half dollar
salt, pepper
basil fresh or dried
1 -2 Tablespoons extra virgin olive oil
In a medium sauce pan, heat olive oil and add onion. Cook the onion until it is soft. Add rest of ingredients and simmer for about 1/2 an hour or until thick and tasty.
Let me know how it turns out!
Love,
Mom

Enough with the life-threatening posts already

Friday, July 10, 2009 by jeremydw
Luckily it wasn't my life this time. After I got back to my hotel from work to drop my stuff off, I realized I left my power adaptor in the office. So I decided I would swing back on by there after spending the evening wandering around Zurich.
After three hours of wandering, I decide to take the tram back -- yellow line 13 to Albisgütli. I'm finally getting around to reading the book that Linda lent me to read on my trip to Barcelona -- Hard-Boiled Wonderland and the End of the World, by Murakami -- and I'm pretty into it. I walk off the tram with my book in hand and turn right towards the office.
I hear this thud behind me. It occurs to me that the thud is either a broken tram door, or someone had fallen getting off the train. Casually I turn around and see that someone had actually fallen down while getting off the train. Crap. And somehow they had managed to fall right between the train cars.
I was well off of the train (at least 30 meters) and it still hadn't moved, so I assumed that the train driver had noticed the victim and had stopped the train. Someone hurriedly walked to the front of the train to check in with the driver, and another person approached the fallen person intending to pull them up.
Then to my horror, the train doors closed and it began to move forward. People let out screams. The person walking to the front of the train sprinted, and the person walking to help the fallen victim up leaped towards the train to *attempt* to drag the victim to safety.
But it wasn't enough. I jerked forward but was much too far away to reach the person in time. The train continued to move at least 20 meters, crushing the victim beneath it, dragging the victim along, and I watched in horror. (I told you this was morbid.) People tried to pull the person out from under. The train came to a stop, due to the cries of the crowd outside.
The train stopped and the person lay on the ground, a shoe remaining on the street 20 meters back. Three seconds ago I considered running to the ticket-buying station looking for an emergency number to call. But I wouldn't be able to figure it out. I turned to a blonde girl who looked at me, on the brink of tears.
"Police? ...Polizei? Wie kann man die Polizei... uh, call... rufen?!"
She said nothing and shook her head. I turned to some dudes standing next to me and said, "Shit. Someone call the police." People put their hands up to their faces in order to block the view of the victim lying on the floor.
"Shit. Someone just died. Shit. Crushed against the pavement to death, shit." I thought.
People, who had been waiting, got off the train. After talking to the blonde girl, I didn't get closer. I watched from my distance. A man crouched near the victim and pulled at his arm. I couldn't tell what was going on. Another man walked the 20 meters back to retrieve the shoe. It appeared to be a slip-on. "A woman, crushed to death by a train, fuck," is what I thought. People put cell phones to their ears. I stood clutching mine.
Some onlookers cried and quickly left the scene. I stood next to the blonde girl, who was now seated, and another dude who looked a lot like me -- shorter hair, better posture -- who also was standing silent in horror.
Three teenaged-kids came up to us and were talking about the movies they had presumably just saw. Something about returning from the Kino, they said. What the hell. Couldn't they be more concerned? One was, but the other two weren't. Ugh, what kind of town is Zurich -- where people get crushed by trains so often to make teenaged kids un-phased?
I stared those kids in their eyes as I attempted to understand their conversation. And then, I saw the victim's feet move. The person freakin' moved! Argh!
"She's OK! Shit. She's OK!" I said outloud. I corrected my English, thinking "Sie ist gesund!" (which is wrong) but I didn't say it. Relief suddenly replaced the death-horror I felt, but the adrenaline was still kickin'.
The victim continued to wiggle their feet as the helper comforted the victim. The ambulances arrived and started to question the onlookers. The person was OK and to me that ended the terror. Don't get me wrong, I was still shocked. Thankful that the person was OK, but the excitement waned in favor of "Argh, someone did something stupid and is now paying for it." I approached closer to see if any of the immediate onlookers spoke English.
The person on the floor turned out to be a man. There was no blood. The person could wiggle his fingers. His voice was gruff. Seemed like he may have been drunk. He was OK. Wedged against the sidewalk, I had no idea how they would remove him from underneath the train. Fantasies of a chainsaw ran through my head.
At this point, I turned around and ran to the office so I could get my charger. There was a security dude in the blue polo manning the front desk. Little did he know of the occurrence I just witnessed. "Guten Abend," he said. I responded with a wave.
I grabbed my power adaptor and ran back to the scene. The person was removed from the sidewalk and was being loaded onto the stretcher. I never made out the face. Still, there was no blood. Thank goodness. The person's arms were clutched to his chest. I figured they were able to get the person out by crushing the arms all the way and then yanking, but I'll never know the truth. He could still move his fingers.
I left before the ambulance would have -- assumedly -- zoomed away.
Thoughts of precious life entertained me on my walk back to my hotel. I wished I could have done something more. I wished I had those force field super powers that we joke about during lunch. I wished I could have saved the person and that she were a beautiful girl and that we would fall for each other.
Hah. But I was still shocked. I entered the hotel, still clutching the Murakami book. Power adaptor in the other hand. I silently walked into the fancy lounge to the right of the entrance and considered settling down with a glass of rum and something or other. A cool shot of whatever shot I had four nights prior. But instead I returned to my hotel room.
Cross your fingers for a less exciting entry next time.

How do you fix a bullet hole in a car? I GOT FREAKIN' SHOT AT.

Tuesday, June 2, 2009 by jeremydw
Let me just preface this post with saying: I JUST GOT SHOT AT. Right now, there is a bullet hole two feet away from the driver's seat, which is WHERE I SIT WHEN I DRIVE MY CAR. Had the bullet flown two feet to the right, I'd have been hit. What the hell, man. WHAT THE HELL. This happened under two hours ago. WHAT THE HELL.
Rewind. Here's the story. I'm driving home after getting some food with Daniel, Minh, and Jerry. It starts pouring large drops of rain, somewhat ominously, and I approach my intersection. I hear what I think is a gunshot, and I think, "Shit. That was probably a gunshot. Probably not someone driving over crap in the road. Probably a gunshot. I better get home." A sketchy old red tinted out van drives away in a rushed manner and I get a little tense.
So the light turns green and I floor it. As I cross the intersection, I hear another gunshot and my car's front jerks as if I drove over some crap in the road. Hot air starts coming in through the vents (weird, because I have recirculate off) and in milliseconds think, "Shit, that WAS a gunshot. I'm pretty sure my car got hit. Shit, it was that red van. SHIT. SHIT!"
So I floor it and burn rubber up the hill. The first thing that occurs to me is that "they" know that I saw "them" and wanted to get me so that I wouldn't be able to identify "them." So I drive like mad around my block and up and around. Make sure I wasn't able to be tracked, then pull up to my garage (which was just a block away from the shooting). I timidly get out and, bam, there it is. Bullet hole. Right beneath my driver's side mirror. And to the left a little.
SHIT. I get in my car, pull into my garage. Jump out, mess with my keys and get inside. I call Cowart before I even get into my apartment. I tell him I need to talk to the cops but don't want to go down to the crime scene because there were only two cop cars and in my book, unless there are six cop cars, it's not safe. I call 911 and they send two policemen to talk to me.
They come in, we talk. They interview me, I get my driver's license number for them from Gmail (again, because I lost it), and they assure me that I was just in the wrong place at the wrong time. The gunmen weren't actually out to get me, I just got caught in crossfire between a silly gang war that's been happening a couple blocks down for several weeks now. (Note: I don't really live in a bad area. In fact, I'm right on the corner of a really awesome park and next door to the Painted Ladies. In cities, every two blocks change drastically. The nicest places are right alongside the worst.)
I did see police tape and a whole bunch of cop cars down there three nights ago. In fact, I picked something up from the freakin' convenience store the night that a shooting happened. While the cops were on the scene, too. I'm not going down the street that way again for a while. On foot or in my car.
Just caught in crossfire. That's what the policemen said to me. It's believable, especially if they wanted to use my car as cover for the getaway. But the shot was so close to my physical body that adrenaline tells me to think otherwise.
We walk downstairs to my car. One policeman is very impressed with my large personal garage (I wrote about that here). He wanted me to rent it out to my neighbors.
I show them the bullet hole. He says that the bullet could have ricocheted out, but upon closer inspection we determine that it's still inside. I pop the hood but it's useless. There's a bullet somewhere inside my car's engine bay. A freakin' piece of ammunition. The policemen use some sort of digicam to take pictures of my car and they leave.
I thank them, but before they can leave I ask "What about my car?" One says, "Oh, will you be home tonight? Can we reach you on the cell phone?" "Yes, I'm not freakin' going anywhere." "Okay, CSI might call you to tow your car to recover the evidence." CSI hasn't called yet. I hope I'm safe for now.
I knew my car would get destroyed with incremental driving damage while living in the city, but this is something else. Really something else. A real battle scar, none of that "someone opened their door into me while I was parked shopping at Safeway" crap.
I'm not thankful for the bullet hole in my car. But I'm thankful I'm OK.

New York: Just for the record

Sunday, May 24, 2009 by jeremydw
I did this once for my trip to Japan, but looking back on it, it seems to be a little too brief for all the great things I did. I've gotta get a head start now for New York before I forget! places to go:
  • kgb -- a very tasty cinnamon vodka
  • swift bar -- i think we went here, it is the really cool "hey! this is an old castle's forgotten library" place.
  • yum yum bangkok III -- yum yum bangkok I and II are just posers, as are all the other yum yums.
  • bleecker street -- for shopping and walking
  • union square -- for hanging out, why haven't i been here before?
  • kyotofu -- the dessert and sake place. now I know they also have japanese tapas here.
  • sobaya -- delicious japanese food
  • google office -- of course, the office that's also the attraction (76 Ninth Avenue 4th Floor)
  • milo's -- fish-to-impress ($$)
  • centennial -- ten shots for ten bucks
  • brooklyn ice cream factory -- i hadn't had ice cream in a really long time
will i try this time? i hope so...
  • PDT -- please don't tell (we were told!) [addendum: argh! we got our name on the list, but were never called. foiled! there's one easy solution: a return to new york city.]
must still do:
  • pommes frittes -- the new york version of 2am mission food
  • bike-rental in central park
  • belgian beer (burp castle in east village? valhalla? i found these online while trying to remember the name of a place above)
  • village yokocho (while waiting for PDT, we looked for this yakitori place + bar, but never found it...)
  • grimaldi's pizza -- go over the brooklyn bridge, then stand in a very long line for pizza
I owe many of the good items on this list to a certain someone... thank you. Thank you!

Misappropriations of everything

Monday, May 18, 2009 by jeremydw
Persimmons and peaches are coming back to markets. And what does that mean? Summer is here. I apologize in advance for the randomness of this post, because it's going to be fairly disjointed, but also somewhat innocent. I'll begin with some concealed venting. Finding important things out via Twitter just sucks. The internet is great for information-sharing, but it shouldn't be replacing social interaction. Racism can suck it. Okay, let me now continue. Summer is here and it's my first summer living in San Francisco. I've got a wicked apartment that I'm slowly turning into home (half a year later, I've finally got a dresser and put some art up in my bedroom). My car is sorely, sorely in need of a wash, and I'm learning more than ever at work. Four years ago I said Python was a horrible programming language. Now I dream in it. I live and die by Vim, a text editor, and I'm considered an engineer. Of course, my CS-major-friends from school would never agree to that. I ran in Bay to Breakers yesterday. All 7.5 miles and then some. The bus to the starting point never came, so I ran 2.5 miles from my house to the beginning of the race. I shoved dry oatmeal down when I got there and slowly zig-zagged my way through the crowd, ending up with about an hour and a half time, which comes out to 11.5 minutes a mile total. I wish I could've zig-zagged faster at the beginning. I totally would've been able to cut off 10 minutes had the crowd not been so crazy. At mile six, I was so winded. I slept like four hours the night before, like usual, but at least I ate well for this run. At one point, I thought I might have to slow down to a slower jog. But then, I saw a free-water-giver-outter giving out liter-sized bottles of Crystal Geyser. I freakin' darted over to this guy, grabbed a bottle, slowed down my pace, chugged a quarter of the thing, capped it, and immediately got my second wind. I finished the rest of the race without issue. I ran running back-style to the end with that water bottle. I made it to the huge party-thing at the end, which was actually pretty damn lame -- especially compared to the one at the end of the Bridge to Bridge run last year, which had a live band (the Uptones, who I'm now a fan of). I screwed around at the big party thing, lent my phone to a visiting Scottish girl who lost her group, waited, decided to stop letting things screw with my head regarding the waiting, and left. Of course, I was too cool to wait in line for the Muni at the park, and decided to walk down to the normal N Judah stop. Bad idea. That bus took forever to came and in the meantime I grabbed a frozen yogurt. I got on the bus, with yogurt, at the same time this girl did. We suffered a 40-minute horribly hot bus ride together, and got off at the same stop. She stuck a cigarette in her mouth with a swift, determined, programmed motion and I decided to let it go. It was 90 degrees out, so I went home (which just so happened to be at the highest point of the race) and napped. Dinner was at Pyramid with whom I'll refer to as "kr3w2". They didn't accept my passport as a form of ID when ordering drinks, but they did accept a scanned version of my ID on my freakin' cell phone. Go figure. Alex and Sara and Stephanie ordered wrong. Shoulda got the meatloaf sandwich, mac and cheese, and salmon burger. I stick my tongue out at them for not listening to me. We watched one of the worst movies of all time after spending twenty minutes in Blockbuster. This movie could not have been made good by any amount of drinking or shenanigans. It was just bad. TV was better. TV was far better... Rock climbing 2-3 times a week. The Killers concert weeks ago was awesome. 90 degree heat in a packed auditorium. I came out freakin' dripping. I'm ready for the half-marathon in July. I'm going to New York, camping two miles out of Sacramento, and LA the next coming weekends. I have more work than I can shake a stick at, but it's great work. I sleep four to five hours a night. Ethiopian food rocks. Japanese too. I miss cooking. Daniel and I went to a cafe-becomes-night-club south of Nob Hill. Their coffee was bad. The nearby Japanese place was good. Their wifi kicked butt. Music is the most wonderful thing ever. So I guess I'm moving on with life and I'll still walk around with a huge frown. Old friends are moving away. I'll miss them... and new friends are moving closer. Trying to hold on to 'em. This year will be one to remember. Why the frown? Because it's fun to ease my frustration with one. Damn you, damn you indeed. >:) Not frowning here, but still pissed and, as Jarrett Randazzo (to whom I still owe a website) says, tired of waiting.

Being always connected sucks.

Saturday, April 4, 2009 by jeremydw
Sometimes, it'd be nice to enjoy a sunny day outside. Don't get me wrong, I enjoy sunny days outside. But that damn Blackberry, the amazing but infernal Android phone, the MacBook Pro, the high-speed wireless card. They mean I'm never unreachable and always plugged in. For me, there's become no concept of not being at work, and it sucks. As such, any time I'm not creating something, any time I'm not learning a new technology, I feel like I'm wastin' time. But, I'm totally not. Enjoying not-technology is far more important than being productive, and it's something that's tough to realize. I think I need to ditch the technology, except for the camera, and take "vacation" those nights and weekends. Or maybe I just need to go back to last summer's Japan, when I didn't care. That was pretty cool. p.s. I'm writing this from a cafe, while working on things. At least I'm sitting in the sun though.

Summer Days in March

Sunday, March 8, 2009 by jeremydw
A Sunday of rock climbing, hamburgers, arcade games, and a movie. It's like childhood without homework -- so pleasant. Let's keep it up.

Whatever you do, you better wash that fruit.

Monday, February 23, 2009 by jeremydw
Last night, I went to bed at 930pm after a day of traveling from Spain to California -- the end of a business trip to Barcelona for Mobile World Congress. OK, even I'll admit, it was a little ridiculous for me to go to the event itself (my job function has everything to do with mobile marketing, but I have little input on the direction of things), but it was totally 100% necessary for me to go. Why? Well, obviously, I've never been to Spain. But, practically, I got to meet some of the people I've been working with over the last four to six months -- videoconferencing just don't cut it. Plus, 80% of the people I actually work with happened to be in Spain at that time anyway. It only made sense for me to be in their time zone. Mmm hmm. Take Monica, for example. This one is psycho insane. So very well-kept and articulate in email and in meetings, but just like any good Berkeley grad, totally awesome once you remove that layer of accountability. Sara was equally as cool, as were Robert, Anthony, Yasmina, Leslie, and others. I roomed with Monica the night before she left, and she left some of her clothing in our room. Jerk. She better come back to Mountain View to pick it up. Don't let me forget to mention how awesome Jeff, Kai, and Linda are. Yeah, it's crazy-ass trips like these that just improve your relationships with people. As Monica and I have determined, "work hard, play harder" is the theme of just about everything. OK, let me rewind. It's 530am here and I'm killing time working on a page before the bus leaves for Mountain View at 630. I went to bed at 930 last night because my stomach was repeatedly punching me in the face. I got food poisoning on the last night of the trip to Barcelona. Damn. What a killer way to end it. It's not like I get food poisoning often (ever -- this would be the second time in my life -- the first from Bear Sushi House in Berkeley which closed shortly after I got destroyed). Yeah, I ate all kinds of crazy, delicious foods, and drank all kinds of awesome drinks over the course of that week and a half in Spain, but Linda can attribute the food poisoning to my lack of washing the grapes I got at the outdoor market. If you've seen me eat fruit, you know I can down that stuff. Yeah, that was my lesson learned. From now on, I'm taking it easy with the fruit. Don't let me focus on the food poisoning, though. That'd be pretty boring. The flight back was pretty interesting, for lack of a better way to put it. The morning started with us grabbing breakfast at the hotel, then cabbing it to the airport. I still felt crummy, but powered through the airport just long enough to get on the plane. I chilled with Linda at the gate while Kai and Jeff (those uppity, frequent travelers!) stayed in that high-class executive lounge. If there were a phrase that enabled me to stick my tongue out at them, I would write it here. After a while, they came over. Jeff started asking me a technical question about JavaScript, and, like any good-natured programmer-wanna-be, I forgot everything else on my mind (including my sickness), and just spent the next 30 minutes answering the guy. The question was about implementing JSON and callback functions. We got on the plane, and we were ready to leave. But the plane itself just sat there. For nearly an hour. Why? Conditions in Frankfurt, is what I suspected. On our descent, I noticed the captain mention that he slowed our airspeed because there was no room for us in Frankfurt airport. Damn. We had a connecting flight. People started going crazy on the plane. All standing up, yelling, crazy crap. My debilitated stomach prevented me from doing anything, but I knew we'd make the next flight anyway. All those losers were stressin' out over nothing. Just have confidence, people! If the airport really is that congested, that flight ain't goin' nowhere either! Needless to say, we made the flight. I removed my sandals and sprinted like I meant it to the next gate. Running around barefoot on slippery airport floors is actually pretty fun. You can slide around all Sonic-the-Hedgehog-like. Try it sometime. On the plane to SFO, I sat inbetween two ladies who purposefully split themselves, because neither wanted a middle seat. Thanks a lot, ladies. I'm really very interested in your discussions. I offered to switch with one of them so that they could sit next to each other, but they both immediately responded, "oh no! we wanted it this way." Normally this is when I'd say "Jerks." and move on in my discussions, but they weren't exactly mal-intentioned or anything like that. Semi-jerks. There we go. The trip itself reminded me of my travels to Japan mixed with my travels to Italy. Outside drinking by bodies of water, loud partying, having fun with friends, traditional sight-seeing, new and old museums, endless walking around cities, finding landmarks with little-to-no directions, picture after picture after picture. It would've been nice not to worry about work (had one major launch, one launch that quickly escalated into the biggest failure of a marketing campaign ever, and many normal bug fixes and work-related items). Yeah, I didn't take this week off. Work hard, play hard, indeed. Items of interest on this trip? Losing my phone on the plane in Madrid. All of the incredible food that Jeff and Kai selflessly allowed Linda and me to tag with them on, Fast Good (the fast and good fast food place), the outdoor markets, the two Spanish dudes who will forever be known to us as "The Wallies," using Latitude on the G1 like it's meant to be used, running in to a chef of the French Laundry at a tapas bar in Barcelona, the Tokyo-style subways in Barcelona, launching Android.com the way it was meant to be launched, work-all-nighters in hotel rooms, and several items involving someone that would be far too embarrassing for me to write here. You can guess about that last one. If you've heard me whine recently, it shouldn't be too hard to figure out. Pictures here. Don't forget 'em. So, I received more invites to the London office from people on the Mobile engineering team than I can easily count. Now then, when am I going?