Skip to content

Instantly share code, notes, and snippets.

View shobhit's full-sized avatar

Shobhit shobhit

View GitHub Profile
@jbochi
jbochi / skyline.py
Created August 7, 2012 17:12
Solution for dailykata.net - Skyline problem in Python
buildings = [
[1, 11, 5],
[2, 6, 7],
[3, 13, 9],
[12, 7, 16],
[14, 3, 25],
[19, 18, 22],
[23, 13, 29],
[24, 4, 28],
]
@yosemitebandit
yosemitebandit / send_pdf_with_boto_ses.py
Created June 6, 2012 17:56
send PDF attachment with boto and SES
''' quick example showing how to attach a pdf to multipart messages
and then send them from SES via boto
'''
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import boto
@hrldcpr
hrldcpr / tree.md
Last active June 19, 2025 08:17
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@danlamanna
danlamanna / SVN.py
Created November 19, 2011 22:45
Sublime Text 2 - SVN Plugin
import sublime, sublime_plugin
import os, commands
import json, re
import pprint
""" TODO:
- have settings file with username/password/additional flags?
- options menu, per file/folder commands
from __future__ import with_statement
import random
def create_chain(file_paths):
markov_chain = {}
word1 = "\n"
word2 = "\n"
for path in file_paths:
with open(path) as file:
for line in file: