Skip to content

Instantly share code, notes, and snippets.

View rajathagasthya's full-sized avatar

Rajath Agasthya rajathagasthya

View GitHub Profile
@rajathagasthya
rajathagasthya / main.go
Last active November 17, 2020 22:02
Global Entry SFO Appointments Notifier
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"net/url"
"os"
@rajathagasthya
rajathagasthya / tmux-cheatsheet.markdown
Created September 10, 2018 00:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rajathagasthya
rajathagasthya / recover_source_code.md
Created March 11, 2017 23:57 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@rajathagasthya
rajathagasthya / keybase.md
Created August 25, 2016 23:50
Keybase Proof

Keybase proof

I hereby claim:

  • I am rajathagasthya on github.
  • I am rajathagasthya (https://keybase.io/rajathagasthya) on keybase.
  • I have a public key whose fingerprint is 99C5 6092 696B AFA5 1C74 165F 1934 C213 A0E3 1E61

To claim this, I am signing this object:

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: