A literal haskell gist file
someHaskellCode :: a -> [a]
def test_gist_from_cli | |
puts "hello world" | |
end |
# Initialize Mechanize Agent | |
agent = Mechanize.new | |
# Visit a web page | |
agent.get 'http://localhost:3000/' | |
# get the url of the current page | |
agent.page.uri #=> http://localhost:3000 | |
# agent remembers the scheme + host, so no need to supply it when navigating somewhere else |
# So your PicsController probably looks something like this: | |
class PicsController < ApplicationController | |
def update | |
@pic = Pic.find(params[:id]) | |
@pic.update_attributes(params[:pic]) | |
end | |
end | |
# You want to change that to this: | |
class PicsController < ApplicationController |
A literal haskell gist file
someHaskellCode :: a -> [a]
A literal haskell gist file | |
> someHaskellCode :: a -> [a] |
<html> | |
<head></head> | |
<body> | |
<h1>My Web Page</h1> | |
<?php include 'sidebar.html' ?> | |
<h2>A title</h2> | |
<p>Some content</p> | |
</body> | |
</html> |
<?php | |
//calling this with the above files (layout.php + page.php) in the working directory | |
render_page('page', array( | |
'title' => "About The Shakes", | |
'content' => "<p>Bringing the boys to the yard since 1976</p>" | |
)); | |
//would then render this => |
<?php | |
function render_page($page, $params = array(), $layout = 'layout') { | |
extract($params); | |
$__page = "{$page}.php"; | |
include "{$layout}.php"; | |
} |
<h3><?= $title ?></h3> | |
<div id='content'> | |
<?= $content ?> | |
</div> |