Skip to content

Instantly share code, notes, and snippets.

View chadoh's full-sized avatar
🌲

Chad Ostrowski chadoh

🌲
View GitHub Profile
@chadoh
chadoh / gist:9591825ce729bd911464
Created November 19, 2014 23:23
install libv8 & therubyracer on yosemite
brew uninstall v8
gem install therubyracer -v '$YOUR_VERSION_HERE'
brew install v8
gem install libv8 -v '$YOUR_VERSION_HERE' -- --with-system-v8
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright Zuora, Inc. 2007 - 2010 All Rights Reserved. -->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:zns="http://api.zuora.com/"
xmlns:ons="http://object.api.zuora.com/"
---
- name: Ensure we can add apt repos
apt: pkg=python-software-properties state=latest update_cache=yes
sudo: yes
- name: configure apt for first run
sudo: yes
shell: apt-get install -f
- name: Update apt
apt: update_cache=yes
sudo: yes
- name: install nginx and needed packages
apt: pkg=$item state=latest force=yes
sudo: yes
with_items:
- libpcre3
- libpcre3-dev
---
- name: Update apt
apt: update_cache=yes
sudo: yes
- name: install dev packages
apt: pkg=$item state=latest
sudo: yes
with_items:
- git-core
---
- name: Update apt
apt: update_cache=yes
sudo: yes
- name: install db packages (need to be forced; cannot be verified)
apt: pkg=$item state=latest force=yes
sudo: yes
with_items:
- python-mysqldb
---
- name: add apt repo for redis
# from http://ph.ly/dotdeb
apt_repository: repo="deb http://packages.dotdeb.org squeeze all"
sudo: yes
- name: Update apt
apt: update_cache=yes
sudo: yes
class Entry
attr_accessor :author_name, :author_email, :title, :body, :semester
def initialize(author_name, author_email, title, body, semester, date_of_submission)
@author_name = author_name
@author_email = author_email
@title = title
@body = body
@semester = semester # "200(8|9) (Spring|Fall)"
end
def self.all
require 'sinatra'
get '/' do
haml :index
end
get '/result' do
missed_fields = params.keys.select {|key| params[key].blank? }
haml :index and return if missed_fields
require 'sinatra'
get '/' do
haml :index
end
get '/result' do
loan_eligibility = params[:loan_length]/params[:loan_amount] + params[:income] - params[:expenses]
haml :result
end