Skip to content

Instantly share code, notes, and snippets.

View swaathi's full-sized avatar
🐈

Swaathi Kakarla swaathi

🐈
View GitHub Profile
@swaathi
swaathi / dijkstras.py
Last active October 27, 2019 00:39
Dijkstra's Algorithm with Python
from collections import defaultdict
class Graph:
def __init__(self, start, end):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
self.start = start
self.end = end
def add_node(self, value):
@swaathi
swaathi / show
Last active May 29, 2019 14:11
Add quick functions to your shell
#! /bin/bash
if [[ $1 == 'me' ]]; then
cat "$(which show)"
elif [[ $1 == 'loc' ]]; then
echo `which show`
elif [[ $1 == 'install' ]]; then
echo "Ensure to place this file in `usr/local/bin` and read instructions on https://gist.github.com/swaathi/8c18be3a437e498034a5a3ede54d0ce9/."
brew install fortune
brew install cowsay
brew install lolcat
@swaathi
swaathi / .gitconfig
Created November 25, 2017 12:49
.gitconfig
[user]
name = <username>
email = <email>
[credential]
helper = osxkeychain
[alias]
ci = commit
fu = fetch upstream
mum = merge upstream/master
pom = push origin master
@swaathi
swaathi / markdown-template-engine.rb
Last active December 16, 2017 06:50
Markdown Template Engine
PWD = File.expand_path(File.dirname(__FILE__))
VARIABLE_REGEX = %r{\<[A-Z\-]*\>}
class MTEngineError
class << self
def not_a_file(filepath)
raise "#{filepath} is not a file or does not exist"
end
end
end
@swaathi
swaathi / postmortem.md
Created June 20, 2019 10:39 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym