A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
"""Download stories of a Pivotal Tracker project. | |
You need the project ID (an int) and your API token. The latter can be | |
obtained in ``https://www.pivotaltracker.com/profile``, or using curl:: | |
$ curl -u username:password -X GET https://www.pivotaltracker.com/services/v3/tokens/active | |
""" | |
import getpass | |
import pickle |
/* Merge sort in C */ | |
#include<stdio.h> | |
#include<stdlib.h> | |
// Function to Merge Arrays L and R into A. | |
// lefCount = number of elements in L | |
// rightCount = number of elements in R. | |
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) { | |
int i,j,k; |
import numpy as np | |
class DirectTransformer: | |
"""Utility for building class-like features from a single-point function, but that may need | |
some general configuration first (you usually override __init__ for that) | |
""" | |
def fit(self, X, y=None): | |
return self |
import numpy as np | |
class OneHotTransformer: | |
def __init__(self, func): | |
self.f = func | |
def fit(self, X, y=None): | |
unseen = object() | |
seen = set() | |
for x in X: |
from sklearn.feature_extraction.text import CountVectorizer | |
class ProjectionCountVectorizer(CountVectorizer): | |
def __init__(self, projection_path, *args, **kwargs): | |
self.projection_path = projection_path.split('/') | |
super().__init__(*args, **kwargs) | |
def build_preprocessor(self): | |
built = super().build_preprocessor() |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This is how I used it: | |
# $ cat ~/.bash_history | bash-history-to-zsh-history >> ~/.zsh_history | |
import sys | |
def main(): |
In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.
Following this tutorial, you will have an application that has: