Skip to content

Instantly share code, notes, and snippets.

Corrupt Congressman

  • Application gives voters a way to view a congressperson’s legislative action and donor information side-by-side
  • Python / Django, JavaScript, Nginx, Gunicorn, Fabric, Digital Ocean
  • interested in using the existing data from APIs to create a visualization of some sort or do some data analysis to create a corruption index for a congressperson (this could also be integrated into a visualization)

Robot with an attitude

  • Watson API to do sentiment analysis on a user input
  • Ruby, JavaScript, Rails, jQuery, RSpec, Watson API.
  • Theres a lot that could be done with this project. Allowing the user to compare data from multiple inputs.

Feedback!

Pros

  • All the tests still pass
  • I like your use of reduce in the chance method, good use of a proc as well.
  • The determine_score_for_number method is a very nice abstraction. The method reads well and really DRYs up the codebase.

Constructive Criticism

  • I see why you have a self.set_dice_array method. I like the idea of giving this method the responsbility of creating an array for us. In ruby there is a better way of taking

User

Registration

  • Example URL POST host_name/v1/registrations/?api_key=9014e51c-f5b0-4cd9-8725-f1e729665905

  • Example body required

{
	"user": {
public class Order {
State unpaidState;
State paidState;
State shippedState;
State deliveredState;
State state = unpaidState;
public Order() {
unpaidState = new UnpaidState(this);
public class UnpaidState implements State {
private Order order;
public UnpaidState(Order order) {
this.order = order;
}
public void verifyCreditCard(String info) {
if (verifyCreditCard(info)) {
order.setState(order.getPaidState());
public interface State {
public void verifyCreditCard(String info);
public void ship();
public void orderDelivered();
}
public class OnlineMenu {
private Menu klinesMenu;
private Menu peddlersMenu;
public OnlineMenu(Menu klinesMenu, Menu peddlersMenu) {
this.klinesMenu = klinesMenu;
this.peddlersMenu= peddlersMenu;
}
public void printMenu() {
public class KlinesIceCreamMenu implements Menu {
static final int MAX_ITEMS = 3;
int numberOfItems = 0;
private MenuItem[] menuItems;
public KlinesIceCreamMenu() {
menuItems = new MenuItem[MAX_ITEMS];
addItem("Chocolate", "The gold standard, creamy and chocolatey", 3.99);
addItem("Vanilla", "Anything but boring", 3.99);
public class KlinesIceCreamMenuIterator implements Iterator {
MenuItem[] items;
int position = 0;
public KlinesIceCreamMenuIterator(MenuItem[] items) {
this.items = items;
}
public MenuItem next() {
MenuItem menuItem = items[position];
public class OnlineMenu {
private KlinesIceCreamMenu klinesMenu;
private PeddlersIceCreamMenu peddlersMenu;
public OnlineMenu(KlinesIceCreamMenu klinesMenu, PeddlersIceCreamMenu peddlersMenu) {
this.klinesMenu = klinesMenu;
this.peddlersMenu= peddlersMenu;
}
public void printMenu() {