Skip to content

Instantly share code, notes, and snippets.

@econchick
econchick / base.html
Last active December 28, 2015 18:29
PyLadies BYOBlog - Templates and static files
<!doctype html>
<html lang="{{ HTML_LANG }}">
<head>
<meta charset="utf-8"/>
<title>{% block title %}PyLadies BYOBlog{%endblock%}</title>
<meta name="author" content="A PyLady">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0">
@econchick
econchick / pyladiessthlm_django.md
Last active December 28, 2015 15:59
Installation & Setup instructions for PyLadies Stockholm's Django workshop on Nov 19th, 2013 @ Spotify.

PyLadies Stockholm: Build your own Blog with Django

Installation

  1. Download & install VirtualBox for your machine here.
  2. Download & install Vagrant for your machine here.
  3. Download the PyLadiesDjango virtual machine here. Do not open this file NOTE: Remember where you downloaded this PyLadiesDjango virtual machine.
  4. If you don't have a text editor (like Notepad++, TextEdit, TextWrangler), I highly recommend Sublime Text 2, which can be downloaded here.
  5. Continue to Setup below when you're all set with downloading & installing.

Call for Proposals

[…]

What Kind of Sessions can I give?

[…]

Lightning Talks

@econchick
econchick / interview_tips.md
Last active August 7, 2019 08:28
Women Who Code: Interviewing Tips
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@econchick
econchick / gist:4666389
Last active June 29, 2022 17:11
Convert decimal/base 10 numbers to hexidecimal/base 16
def hex2dec(dec_number):
mapping = {
10 : "A",
11 : "B",
12 : "C",
13 : "D",
14 : "E",
15 : "F"
}
@econchick
econchick / gist:4666378
Created January 29, 2013 18:24
Implement a Binary Tree in Python
class Node:
def __init__(self, key):
self.key = key
self.parent = None
self.left = None
self.right = None
def insert(root, t):
new = Node(t)
@econchick
econchick / gist:4666365
Created January 29, 2013 18:22
Python questions asked at Women Who Code's Interview workshop
unsorted_list = [1, 4, 12, 3, 0, 4, 1, 16, 20, 20, 19, 7, 4, 0]
# Terrible solution that only works small integers, but it is O(n) in both
# space and time
max_int = max(unsorted_list)
entries = [0] * (max_int + 1)
for x in unsorted_list:
entries[x] += 1
@econchick
econchick / How to Build OpenShift Server on F17
Created November 27, 2012 08:18
How to Build OpenShift Server on F17
Start with Fedora 17
yum install -y git vim rubygem-thor rubygem-parseconfig tito make rubygem-aws-sdk tig mlocate bash-completion rubygem-yard rubygem-redcarpet ruby-devel redhat-lsb
yum install -y http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-devel-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-doc-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-minimum-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-mls-3.10.0-160.fc17.noarch.rpm http://kojipkgs.fedoraproject.org//packages/selinux-policy/3.10.0/160.fc17/noarch/selinux-policy-targeted-3.10.0-160.fc17.noarch.rpm
gem install rspec -v '1.1.12'
for i in origin-
@econchick
econchick / settings.py
Created November 25, 2012 16:39
ZagrebWorkshop/ZagrebWorkshop/settings.py
# Django settings for ZagrebWorkshop project.
import os
import dj_database_url
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (