View hero.js
data = {
name: "paul rudd",
movies: ["I Love You Man", "Role Models"]
}
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if (xhr.readyState === 4 && xhr.status === 201) {
console.log(xhr.response);
}
View gist:3379987
@@styles
@import url(http://fonts.googleapis.com/css?family=Pacifico);
$purple:#639;
$green:#396;
body{ font: 13px/1.4 arial, sans-serif; }
header{ overflow: hidden; }
.logo{float:left;overflow: hidden;}
.logo a{ color: $purple; font: 64px/1 pacifico; text-decoration: none; &:hover{color:$green;}}
.title{ color: $green; font: 32px/1 pacifico; }
.button {text-decoration: none; font-weight: bold; padding: 4px 8px; border-radius: 10px; background: $green; color: white; border:none; &:hover{background:$purple;}}
View gist:3379983
style
- if @riddle.css_engine =="css"
== @riddle.css
- else
== send(@riddle.css_engine, @riddle.css)
View gist:3379980
@@riddle
doctype html
html lang="en"
head
title== @riddle.title
meta charset="utf-8"
style
- if @riddle.css_engine =="css"
== @riddle.css
- else
View gist:3379976
@@new
form action="/riddle" method="POST"
label for="title" Title
input#title name="riddle[title]" value="#{@riddle.title}"
select name="riddle[html_engine]"
option value="markdown" HTML
option value="markdown" MARKDOWN
option value="textile" TEXTILE
option value="haml" HAML
option value="slim" SLIM
View gist:3379955
class Riddle
include DataMapper::Resource
property :id, Serial
property :created_at, DateTime
property :updated_at, DateTime
property :title, String
property :html, Text
View gist:3379948
require 'haml'
require 'RedCloth'
require "coffee-script"
require "v8"
require "liquid"
require "markaby"
require "less"
View gist:3379944
@@new
form action="/riddle" method="POST"
label for="title" Title
input#title name="riddle[title]" value="#{@riddle.title}"
label for="html" HTML
textarea#html cols=60 rows=10 name="riddle[html]"=@riddle.html
label for="css" CSS
textarea#css cols=60 rows=10 name="riddle[css]"=@riddle.css
label for="js" JS
textarea#js cols=60 rows=10 name="riddle[js]"=@riddle.js
View gist:3379943
get '/edit/riddle/:id' do
riddle = Riddle.get(params[:id])
@riddle = Riddle.new(riddle.attributes.merge(id: nil))
slim :new
end
View gist:3379939
Riddle.new(riddle.attributes.merge(id: nil))