This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Hello!</h1> | |
<p>Hey <?php echo $name ?>, how's it going?</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'haml' | |
# 静的コンテンツ参照のためのパス設定 | |
set :public, File.dirname(__FILE__) + '/public' | |
# アップロード | |
get '/' do | |
haml :index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Struct(hash) | |
# ハッシュのキーを構造体のメンバーとして設定 | |
st = Struct.new(*hash.keys) | |
# 構造体に新しい要素を突っ込む | |
st.new( | |
*hash.values.map do |s| | |
# ハッシュの場合は再帰 | |
Hash === s ? Struct(s) : s | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
Options +FollowSymlinks | |
Options +Indexes | |
RewriteEngine on | |
# if your app is in a subfolder | |
# RewriteBase /my_app/ | |
# test string is a valid files | |
RewriteCond %{SCRIPT_FILENAME} !-f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
#content | |
%strong= @var | |
%p | |
これはPタグ | |
%div{:id => "aaa", :class => "bbb"} | |
IDとかクラスも指定できるよ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%title Amazon aaws | |
:css | |
div{ | |
border: 1px dashed; | |
color: #444444; | |
width: 450px; | |
margin: 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'amazon/aws/search' | |
require 'haml' | |
require 'sass' | |
include Amazon::AWS | |
include Amazon::AWS::Search | |
get '/' do |
NewerOlder