How to send 500 lines of Python code up in flames

Jupyter Lab was open. The notebooks and data I was working on were sitting on the left.

It was close to home time.

After digging through docs all day to figure out how to get some old code running, my brain was looking like this: FQRUQ#$%(#$QJTQITHqRjlrjkaw

Every time I push to GitHub I have to look up a guide.

3-minutes later, I sent off a push command and noticed all the files were being pushed. Not what we wanted. Only the new stuff was to go up.




It stopped.

> git reset
> git add [notebooks]
> git commit -m "adding latest datascience notebooks"
> git push origin master

"You're already one commit ahead of master."


Google time.

*clicks on first stackoverflow link*

No good.

*clicks back*

*next link*


"To rollback a commit you can use git revert..."

Back to the shell.

> git log

*copies previous commit hash key*

> git revert [insert above hash key]

All of a sudden two files disappeared from the Jupyter Lab directory. The exact two files I wanted to commit.

And the data folder was now empty. "Huh?"

30-minutes of trying to revert a revert later, 1 of the 2 notebooks were nowhere to be seen. We saved one because I still had it open. The other wasn’t as lucky. ~500 lines of Python code gone.

Moral of the story?

When it comes to Git. Move slow and save things.


PS. I found a really cool (and colourful) guide on how to use git. I’ve bookmarked for future reference. If you want to step up your git/GitHub game, you might be interested.


Same direction, new ground

We started a website. Airbnb for gyms.

We wanted to workout together but none of us were members of the same place.

'Surely technology could solve this,' we thought.

It was exciting. We were going to build a solution for ourselves.

Walking around visiting gyms was fun.

'How does your current sign up system work?'

'They fill out this form and then we enter it into the database.'

'How do you enter it?'

'I type it up and my manager checks it later.'


The site was up. It had gyms on there. But only as listings.

We hit a roadblock. Gyms like having control of their memberships. Most of the revenue comes from people not showing up. You know that weekly payment coming out of your account you've forgotten about? That.

The excitement fizzled out. I even stopped using the gym, all I needed was the ground and a pull-up bar. Movement and being around friends were the underlying passions, not a poor sign up process.

The idea is still there but the execution came to a halt.

Then I found a new path. I'm still on it. Still health, still technology. But with a different ground underfoot.

Let's see where it goes.