Hardscrabble 🍫

By Max Jacobson

jfk

17 Aug 2016

Note: this is a sort of personal story about a stressful experience. I’m writing it because I want to remember it.

Last week I was on vacation in Berlin, and this week I’m jumping back into my work life. Both things are great! In-between something wasn’t great.

My airbnb in Berlin
My airbnb in Berlin. 9:53

I had a few hours laid over in Copenhagen before my flight into JFK. I spent them doing laps around the terminal looking for something vegetarian to eat. While walking I listened to a few episodes of the Bike Shed podcast, which I’m a few months behind on. Eventually I found and ate some nachos, which I happily ate while reading Squirrel Girl. All that, fine.

The flight was uneventful. Norwegian Air. I got around to watching Carol. I probably need to rewatch it on a bigger screen. Solid. Slept a bit. So far so good.

A husky American in a striped polo shirt sat on my right. A young Swedish woman slept on my left. None of us really talked much, except mild small talk about whether you need to declare spices at customs. (She asked me. I had no idea, but I said eh, you can probably get away with not mentioning it. I think she declared anyway.) She told me she’s a student on her way to Arkansas to study abroad, and she’s just transfering in New York.

When we landed, around 8pm, we couldn’t disembark right away. The pilot cited weather. They played music. People kept watching movies and TV. I think I didn’t disembark until around 9:40pm. I remember joking to the Swedish woman that if it wasn’t for the music, I might be kinda impatient, but with it I’m pretty content. The playlist ran out of songs and looped back on itself. I only noticed because it was mostly upbeat pop songs, but then also Blue Bucket of Gold by Sufjan Stevens, a very slow and beautiful song about feeling lonely and alienated. And I didn’t realize it was Sufjan Stevens (who I really like) until it came on a second time and I laughed at how random that is. Then I fell asleep for a bit.

When we did start to disembark, I put on my big black backpack, but then we were asked to sit down again, and I took it off. A few minutes later, people started moving again and we flowed off the plane. I said “thanks” to the flight attendants, thinking they were probably getting a lot of shit from impatient passengers and strolled down the jet bridge (a term I only learned this week) toward customs. I was kind of tired; I’d just been napping with my forehead against a television. All I was thinking about was how to get home, weighing the choice of springing for a cab or just taking the train.

But first, customs. I got on the end of a long line, putting in my earbuds and selecting Hotline Operator, a song which bristles with an impatient energy. Because people were impatient, they pressed forward, as though becoming dense would make the line move faster. Some others got on the stationary moving sidewalk to move farther ahead in the line. I remember thinking it was like people driving on the shoulder of a highway to pass you. Without putting a lot of effort into hanging back, I was pretty much at the way back of the line. I couldn’t see all the way to the front. I started thinking about taking off my heavy backpack with the expectation that I would be standing for a while. When I expect to be bored for a while I kind of let my body go into autopilot and let my mind wander for a while, and that’s what I was starting to do.

I’m not sure what exactly snapped me back to reality, but the next thing I knew I was running, and so was everyone else. In only a few seconds, hundreds of mostly stationary people facing one way turned and ran the other way, toward me. You don’t really question that, you just go. You don’t really have another option. Not that you’re thinking at all.

The gush of humanity I was swept up in elected to run down a jet bridge. There were several abandoned rolling suitcases blocking the path. I knew people were charging behind me and were probably going to stumble on them, and I grab one by the handle and run with it in my hands. At the entrance to the plane, I set it to the side. This is the one good deed I did all night, I think, and I still left a bunch behind.

The Air Korea flight attendants were confused and kind of angry that these people were rushing onto their plane.

“What is happening??” one asked the streaming crowd.

I told her the crowd has panicked and I didn’t know why, but it seemed like maybe there’s a shooter, but I didn’t know.

That seemed like the only explanation. People in the front must have seen something and bolted, understandably. What else could it be? No one needed to say it – we all knew, right away. And people did start saying it.

I felt incredibly alert. I would notice later my mouth was dry as a bone.

I paused in first class and moved into a seat to get my bearings. Some came panting, others crying onto the plane, everyone flowing into the back as though for a takeoff. I saw a woman calling for her son; they were separated in the chaos. “What does he look like?”, someone asked. “He’s ten years old”, she said. I saw another mother holding her young, sobbing son to her stomach and telling him, “It’s okay. It’s okay.” I wrote a text to my family:

I’m safe. There was a a panic at the airport. Crowd ran. I’m sitting on an airplane right now. Different one than I disembarked from. Followed running crowd. No signal. Not sure if this will send. Writing at 22:07 ET Will update. I am safe

I see now that it went through ten minutes later.

I wasn’t sure how safe I was. Even on the plane, I felt exposed and at risk. I was tempted to move to the right side of the plane to be just a little farther from the terminal. But I needed to send that.

I saw the Swedish woman, shocked, move into the back of the plane, and I joined her in a seat.

“What the fuck is going on?” I asked, and she didn’t reply.

Somehow, for some reason, the flight attendants communicated to us that it was time for us to get off the plane. I don’t recall if we were instructed to go back down the jet bridge. I don’t recall if the plane was becoming full of people. What happened next is that people started opening the emergency exits. Maybe that’s why. They couldn’t manage to open the emergency exit in the rear of the plane. I recall seeing some kind of component hanging by a wire, and a flight attendant poking at it like, “well, this one isn’t opening”. “Stay calm”, an elderly woman urged everyone.

The mid-plane emergency exits were both open, and the one on the left (facing the terminal) had a slide going down to the tarmac. The one on the right had no slide, it was just open twenty something feet above the hard ground. One flight attendaant stood spread-eagle in front of it to make sure people knew not to go that way. Another stood by the slide, metering us out, telling us when to go. The two women shouted to each other in Korean over the din.

Ahead of me, people were sliding down to the tarmac and jogging around a corner of the terminal. I jumped, slid, and hit the ground running after them. I passed a man taking shelter in a corner behind what might have been gas tanks, and I was tempted to join him, but I ran on with the bigger group.

Around the corner, we reached a barbed-wire fence. I assume the idea is to make it harder to access the tarmac, but in the moment many people felt trapped. I saw some people pushing a bright yellow dumpster toward the fence, with the idea that they could use it to jump the fence.

I took several photos from this point on, nearly all of which came out blurry beyond interpretation.

The crowd and dumpster in the corner
The crowd and dumpster in the corner. 22:19

My sister texted me:

Max?

The rest of my family was in London, and sleeping, but Gaby was awake. I told her I was safe and to tell me if there’s anything in the news about JFK. Then I fired off a tweet:

I sent tweets intermittently for the rest of the night, most of which have typos because I wrote them quickly while afraid.

People weren’t sure what to do. Personally, my plan was to stay put and wait for a hero. I think some others probably felt the same way. Opinions varied on where was safest to physically stand. There was a large, open garage (I think that’s what you’d call it, although I don’t recall seeing any vehicles), which some stood within. This seemed like a good idea in the event that attackers came around the corner. Others seemed suspicious that attackers might come from inside the garage, and stood vigilant, eyes darting between the garage and the tarmac.

Around this point a policeman came and told us to follow him around the corner back toward the customs area, where there are more police. When he saw the people pushing the dumpster he shouted after them, something like, “You are NOT going to do that.” A woman asked him what the plan was, said she wouldn’t go unless there was a plan. He made the point that he was going to walk us there, and what, is he going to willfully put himself in danger? This argument, an appeal to a relatable self-preservation, seemed to make sense to the crowd.

We started cautiously walking.

The crowd under an overpass
The crowd inching under an overpass toward customs. 22:28

We were all hugely reluctant to move back in the direction of airplane and customs. As we inched forward I saw silhouettes of figures in the windows of the terminal, some walking, some standing and watching us. I didn’t know what to make of that. A child let out a screaming cry, and everyone immediately turned to run back toward the corner, which had somehow started to feel safe, and not worth leaving.

I saw a woman was running barefoot.

“I’m faster this way”, she said.

Gaby:

Something at terminal 1 and 8

They are bringing in bomb squad

What is your battery %

If you feel safe please save battery

They haven’t found shooter or anyone injured as of now

Me:

100%. I feel safe right now

Battery pack baby

Slowly the policeman and some other airport staffers coaxed us back toward customs, and two doors which went directly from the tarmac into the big open room. People were very reluctant to enter. I had the sense that the room must be safe if I’m being told to enter it, and I went in.

Inside, I was shocked to find that there were already dozens of people queueing in an orderly fashion to go through customs. I couldn’t see if anyone was actually at the desks to process them. Beyond the desks, the airport seemed well-lit and deserted.

I didn’t feel safe getting on the line; I’d seen this crowd turn into a stampede in seconds. I stood near the doors and tweeted this:

And a few minutes later, it happened. Something spooked the crowd and they bolted for the doors, feeling safer on the tarmac. I think they believed an active shooter must have still been in the terminal, even though some semblance of order was beginning to form… Outside I tweeted this (compare the timestamp to the previous one):

I meant “pile”, not pipe. Here’s what I saw:

People struggling to leave customs
People struggling to leave customs, and one tarmac staffer helping a fallen person get up. 22:41

At this point I saw people were starting to move way in the opposite direction of customs, to the far edge of the tarmac. I saw why: there were 2 shuttle buses there, and people were getting on them. I walked under an airplane toward the buses.

View of airplane from below
I made my way under an airplane. 22:46
Buses in the distance
I made my way toward these buses. 22:47

A crowd formed here, hopeful. We’re getting outta here. The two buses became full and left. I have no idea where they went. We waited, hopeful that more would come.

I took the opportunity to update Gaby, tweet a few updates, and search for any news. My twitter feed was full of people talking about the Olympics and or the election. I remember feeling slightly stunned that the whole world wasn’t talking about me. Every minute or two I got notifications of people sharing or replying to my tweet updates. Some folks mentioned or direct messaged me asking questions and providing updates from police scanners and news reports. No one knew anything. One BBC reporter mentioned me asking if I wanted to do an interview when I feel safe; a reporter from a talk radio show asked me if I could confirm that shots were fired.

I felt the need to offer this update:

I didn’t know if there was a shooting or not. I wanted to believe there hadn’t been. I knew there was a lot of confusion both among the passengers on the tarmac and among the people replying to my tweets. I couldn’t clear away the confusion but I wanted to emphasize to anyone who was following the story not to assume the worst.

After more than 20 minutes of standing restlessly and comparing confused notes with each other, three more buses arrived. I got on the last bus. The last person to board the bus before the door closed was a young guy who reminded me of my 20 year old cousin Eric from Georgia. He asked if I knew anything. Said his phone died. Said he got separated from his sister.

“How old is she?” I asked

“Nineteen”, he said.

Nearby a guy in a Panini Express shirt told us he was working when his boss suddenly turned and ran without saying anything. The next thing he saw was a traveler crawling behind the counter for shelter.

We waited on the bus for about ten minutes when an airport staffer boarded in the front and cheerfully, loudly gave us directions.

“Alright, here’s what we’re gonna do”, he projected. “We’re going to exit the front of the bus and follow [muffled muffled]. OK? Do you understand? Who understands?”

He spoke with the cadence of a DJ trying to get the party started. I had missed some of what he said, but I still felt kind of compelled to echo back, “I understand!” This was the clearest instructions I heard all night. Give that guy a medal.

The bus was packed, and there was a second exit in the back. A woman shouted out to the bus driver, “Back door!” The kind of thing you might shout on a city bus on a normal day, when the door hasn’t opened. I couldn’t help but wonder if the front door was somehow safer than the back door, and that was why we were being told explicitly to exit through the front door.

Upon exiting I followed a stream of people back toward customs. The crowd was much bigger now than before, and much calmer. There were more police. At some point a fire truck showed up. People started to relax, breath, sit.

Gathering crowd on tarmac
Gathering crowd on tarmac. 23:28
Crowd including man with torn shirt
Man with torn shirt in crowd. 23:31
Woman in crowd prays
Woman in crowd was praying to herself. 23:39

I noticed my dad has replied to me:

Dad (23:19, 5:19 in London):

Just got up to pee. Any new updates? News at 15 minutes ago says unconfirmed reports of gun shots at terminal 8 & 1 (yours)

I told him where I was and that it was much calmer now.

Dad:

Be patient & be a calming influence. See if anyone is alone & nervous

Me:

Yep

I pictured my mom sleeping and my dad glued to his phone.

The Swedish woman approached me.

“Hey”, she said.

I was shocked and very relieved to see a familar face. I had been traveling alone on my vacation and kind of reveling in the freedom to do whatever I wanted at any time. But during this incident I wasn’t myself, wasn’t independent, I was just alone, an unindividuated animal in a suspicious herd. We shared a water bottle she got from a fireman. I started to feel like a human again.

She missed her transfer to Arkansas and was on the phone with her friend in New York to see if she could stay there.

Many people sat down. I realized I felt safe enough to sit down.

Soon we started queueing toward customs and I felt safe getting in line. A young woman stood with us for a while, seemingly wanting not to be alone.

We parted ways inside, and I went through customs. I think it was quiet. The kiosk was working, and I punched in that I wasn’t planning to declare any food, spices, or anything. I was glad I held onto my backpack as I dug my passport out.

The young southern man from the bus was ahead of me in line.

“I found her”, he said, indicating his nineteen year old sister.

It took me a moment to register who he was and figure out what to say.

“I’m really glad to see that”, I finally said.

The police officer checked my passport and barely glanced at my customs slip.

“You’re okay”, he said, and stamped my passport.

As I exited baggage claim, I was met by a huge group of people waiting for the long-overdue terminal 1 arrivals, and felt momentarily like they were all there just for me, just to tell me I had been brave and I could rest now.

Crowd at arrivals
Crowd at arrivals. 00:27

I felt destabilized by how normal operations were on this side of the terminal, when it had been such fright and chaos on the tarmac.

There was no question I was taking a taxi. I waited for a while and ended up sharing one with three other people. The dispatcher was long gone, so the drivers were free to negotiate whatever prices they wanted. No problem.

On the drive home, we compared notes. A guy my age sat in the front seat, and a mother and teenaged daughter sat with me in the back. The news was saying it was all a false alarm and that there was no evidence of a shooter or a bomb or anything. The daughter said something about how scary the night had been for her, and her mother made the point, “We were never actually in danger at any point.”

When I eventually found my way to my bed (around 2:30) and closed my eyes, I felt waves of cold energy coursing through my limbs.


If you’re curious for another experience of this night, read this article: Scenes From the Terrifying, Already Forgotten JFK Airport Shooting That Wasn’t which captured a lot of what I felt and am feeling and also filled in some details for me.

This passage jumped out like a lightning bolt:

The fact that there had been, actually, nothing to panic about was an enormous relief, of course. But it made things all the more eerie the next morning, when we woke up feeling like survivors of a ghost trauma, a minor local-news story. For several hours, we were in the flood of panic and chaos of an ongoing act of terror. There’s no other way to describe it. That it was an overreaction almost doesn’t matter; in fact, that is how terrorism works.

Reading it made me feel some amount of relieved and want to write something myself.

integrating vim with the mac clipboard

30 Jul 2016

Using terminal text editors has a lot of advantages, but for a while the biggest disadvantage I’ve felt as a vim user is that it’s kind of hard to interact with the system clipboard. I’m aware that there’s a concept called “registers” which are something like multiple clipboards that you can copy and paste from, and one of them is the system clipboard, and the others are all virtual, or something like this, but I haven’t taken the time to really learn how those work yet.

If I want to copy a helpful code snippet from Stack Overflow into vim and I copy it to the mac clipboard, and then press “command + v” to paste it into vim, the indentation gets totally screwed up. This is becuse vim is trying to help. It doesn’t know that I just pasted, it thinks that I was suddenly just typing super super fast and each newline character I “typed” caused it to helpfully auto-indent the appropriate amount. When I actually am typing, this is helpful. But when I’m pasting, it’s kind of annoying.

Pasting into vim doesn't work well

(You can see in this example that not only is the indentation screwed up, but also there is an extra end which vim-endwise helpfully tried to auto-insert)

The workaround I’ve used for a while is to always run :set paste before I paste, and then :set nopaste afterward. This mode doesn’t auto-indent. It also breaks a number of my other vim configurations, such as jk being an alias for the escape key.

Pretty annoying.

Copying text out of vim is even more difficult. I can use my mouse to highlight the text I want to copy and then press “command + c” to copy it, but this is pretty awful, too, because it’s very easy to accidentally copy things like line numbers (which are just text in the terminal, and your mouse doesn’t know to avoid it) or to even copy text from multiple files which you happen to have open side by side in split buffers, such that the code is totally broken when you paste it out again.

Copying from vim split buffer doesn't work well

My workaround for this is even worse! I generally close my splits, turn off line numbers (:set nonumber) and sometimes make my font smaller so I can fit the whole lines on my screen and select the text and copy it. When I do this, I generally pick up a bunch of trailing whitespace that wasn’t there in the source code. It totally stinks.

Sometimes I will just open the file in Atom so I can copy text in a sane way.

Other times I will run :! cat % | pbcopy to “shell out” to a bash command and copy the entire contents of the file to the clipboard.1

OK. So obviously that sucks, right? That’s just some context for how I’ve been doing things. I meant to look into a better technique and never got to it.

The other day at work I saw my coworker Will very seamlessly copy some text out of vim and paste it into Slack.

Scandalized, I asked him how he had done that. He told me he’s using neovim and it’s probably something neovim does.

I made a note to look into it. I’m open to the idea of using neovim instead of regular vim – I think it’s cool that you can run a terminal inside vim, which makes me wonder if I even need tmux…

One of the first things I found in my research was a neovim issue from April 2014 about how some vim configuration was working in vim but not neovim

… the follwing works perfectly fine with mainline vim, “y” and “p” work with X clipboard:

set clipboard=unnamedplus

but not for neovim.

I’ve tried setting it to:

set clipboard=unnamed

still works in vim, but not neovim.

Hm. Wait. Does this mean vim already supports clipboard integration this whole time and no one told me!?

Indeed, yes, and this is why I’m writing this blog post to tell you. I feel like there’s a good chance you already knew.

So yep, I added that second config option to my .vimrc and now it works great:

  • I can yank text from vim and then “command + v” it into other apps.
  • I can copy text from Stack Overflow and then “p” it into vim – no weird indentation behavior or anything

I may yet switch to neovim2 or learn about registers, but for now I don’t yet need to, and for that I celebrate.

  1. The ! means to run a bash command; the % will expand to refer to the file name; pbcopy is a mac thing for piping data to your clipboard. 

  2. Note that neovim did fix that issue and it does work now

the first useful thing I wrote in Rust

09 Jun 2016

I’ve been interested in the Rust programming language for a while, but it wasn’t until this week that I wrote something in it which I found useful.

Let’s rewind. I like to have a random, nice emoji in my shell prompt. It’s just to add a little flair to the proceedings, some color. The emoji don’t mean anything, they’re just for fun.

My shell prompt is set like this:

PROMPT="%F{grey}%C%f \$(random_nice_emoji) \$(git_prompt) "

random_nice_emoji is a command line program on my PATH. git_prompt is a shell function. The \$(...) syntax means that the program or function should be called each time the prompt is drawn, not just once when you first open your terminal.

I could have written random_nice_emoji as a shell function if I could figure out how to use shell arays, but I could not.

Instead I wrote it as a simple ruby script:

#!/usr/bin/env ruby

print %w(
  🐖
  😅
  🌸
  🐙
  🎑
  🖌
  ☕
  📊
  🐋
  🌈
  ✨
).sample

And my prompt looks like this:

my prompt, where each line includes a random fun emoji

But over time I noticed that it was kind of….. slow. And I started to wonder if maybe my fun affectation was worth it. Some benchmarking suggests that this program takes about a tenth of a second to run. That’s not a lot, really. But we can do better.

Maybe the shell function would be much faster, but yea, still don’t know how to use shell arrays.

So let’s try writing this little script as a Rust program – Rust is supposed to be fast!

To make a new command line program in Rust, you can use Cargo to scaffold the project:

cargo new random_nice_emoji --bin

The --bin part means that it will be a command line program. Without it, I think the idea is that you’re making a package which will be used in an application.

That command crates a directory called random_nice_emoji, and within that there is a file src/main.rs which is where you put your code which should run when the command line program is invoked.

Here’s what I came up with (I’m really new to Rust so this isn’t necessarily good code):

extern crate rand;
use rand::distributions::{IndependentSample, Range};

fn main() {
    // cool, friendly emoji that look fine against a black terminal background
    let list = vec!["🐖", "😅", "🌸", "🐙", "🎑", "🖌", "☕", "📊", "🐋", "🌈",
                    "✨"];
    let between = Range::new(0, list.len());
    let mut rng = rand::thread_rng();
    let index = between.ind_sample(&mut rng);
    let emoji = list[index];
    print!("{}", emoji);
}

I couldn’t find a super-simple sample method, so I did my best to adapt the example from the docs for the rand crate to achieve that behavior.

You can install it yourself with cargo install random_nice_emoji. Maybe I shouldn’t have released it because it’s not generally useful – but it’s very convenient for me so I can install it on multiple computers, for example.

And this one usually finishes in 0.006 seconds – 16 times faster. And it was maybe 5 times harder to write? I’m hopeful that if I get better at Rust, that will go down.

If you’re into Ruby and intrigured by Rust, I recommend checking out this Helix project which makes it easy to embed Rust code in Ruby projects to ease performance hot spots. I haven’t used Helix yet, but that talk does a really great job of explaining the idea and was really inspiring to me.