Model View Controller Route
/config/routes.rb
WITH accepted_applications AS | |
( | |
SELECT | |
contact.firstname, | |
contact.surname, | |
gender.gender, | |
exp_form_run, | |
external_school.external_school | |
FROM table(edumate.getallstudentstatus(current_date)) accepted |
require 'rubygems' | |
require 'httparty' | |
require 'ap' | |
class GiantBomb | |
include HTTParty | |
base_uri 'api.giantbomb.com' | |
default_params :api_key => 'SECRET', :format => 'json' | |
def self.thing(resource, id) |
<!-- | |
Accessing this: | |
http://api.giantbomb.com/videos/?api_key=SECRET&field_list=name&limit=5&sort=publish_date&format=xml | |
generates the XML below. | |
How can I get the API to give me the 5 latest videos instead of (I assume) the 5 oldest? |
require 'sinatra' | |
require 'nokogiri' | |
require 'open-uri' | |
get '/' do | |
url = "http://dota2.com/hero/Earthshaker/" | |
data = Nokogiri::HTML(open(url)) | |
name = data.css('h1').text | |
abilities = data.css('#abilitiesInner h2').text |
<h1><%= name %></h1> | |
<% abilities.each do |ability| %> | |
<h2><%= ability %></h2> | |
<% end %> |
> gem install middleman | |
Successfully installed middleman-3.0.11 | |
1 gem installed | |
Installing ri documentation for middleman-3.0.11... | |
Installing RDoc documentation for middleman-3.0.11... | |
> middleman init test | |
zsh: command not found: middleman |
CASE STUDENT_STATUS_ID | |
WHEN 1 THEN 'Application Cancelled' | |
WHEN 2 THEN 'Alumni' | |
WHEN 3 THEN 'Past Enrolment' | |
WHEN 4 THEN 'Returning Enrolment' | |
WHEN 5 THEN 'Current Enrolment' | |
WHEN 6 THEN 'Place Accepted' | |
WHEN 7 THEN 'Offered Place' | |
WHEN 8 THEN 'Interview Pending' | |
WHEN 9 THEN 'Wait Listed' |
SELECT YEAR(current timestamp) + 1 AS "NEXT_TWENTY_YEARS" FROM SYSIBM.SYSDUMMY1 | |
UNION | |
SELECT YEAR(current timestamp) + 2 AS "YEAR_PLUS_TWO" FROM SYSIBM.SYSDUMMY1 | |
UNION | |
SELECT YEAR(current timestamp) + 3 AS "YEAR_PLUS_THREE" FROM SYSIBM.SYSDUMMY1 | |
UNION | |
SELECT YEAR(current timestamp) + 4 AS "YEAR_PLUS_FOUR" FROM SYSIBM.SYSDUMMY1 | |
UNION | |
SELECT YEAR(current timestamp) + 5 AS "YEAR_PLUS_FIVE" FROM SYSIBM.SYSDUMMY1 | |
UNION |
if Time.now < Time.gm(2013,"jun",12,00,00,01) | |
"late twenties" | |
else | |
"early thirties" | |
end |