COOL STUFF |
---|
Written in Ruby |
Uses Markdown for content generation |
Integrates with GitHub Pages |
###What is Jekyll?
class DroughtshapesController < ApplicationController | |
include ApplicationHelper | |
def index | |
if params[:s] | |
state_name = params[:s].split.map {|i| i.capitalize}.join(" ") | |
state = State.find_by(name: state_name) | |
if state | |
shapes = state.drought_shapes | |
geojson_shapes = to_geojson(shapes) |
module GeojsonHelper | |
# this method takes in a RGeo geometry object and returns a GeoJSON object | |
def to_geojson(geometry_collection) | |
geojson_object = {} | |
geojson_object["type"] = "FeatureCollection" | |
geojson_object["features"] = [] | |
geometry_collection.each_with_index do |record, index| |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<script src="script.js"></script> | |
<meta charset="utf-8"> | |
<title>HangMan</title> | |
</head> | |
<body ng-app> |
# Prints a multiplication table | |
puts "Please specify the number of rows and colums:" | |
size = gets.chomp.to_i | |
if size > 0 | |
puts "A multiplication table:" | |
puts |
#Simple ASCII Art | |
puts "What character do you want to make the pyramid out of?" | |
character = gets.chomp | |
puts "How many rows of #{character}'s do you want?" | |
row_count = gets.chomp.to_i | |
character_count = 1 | |
width = 100 |