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> |
A literal haskell gist file | |
> someHaskellCode :: a -> [a] |
A literal haskell gist file
someHaskellCode :: a -> [a]
# 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 |
# 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 |
def test_gist_from_cli | |
puts "hello world" | |
end |
puts 'hello world' |
namespace :admin do | |
task :list_users do | |
User.all.each { |u| puts [u.name, u.email, u.created_at].join(' | ') } | |
end | |
task :show_stats do | |
puts Stats.todays_traffic | |
end | |
end |
require 'fileutils' | |
# constants for site generation | |
PUBLIC_DIR = 'public/' | |
CONTENT_DIR = 'content/' | |
LAYOUT = 'views/layout.erb' | |
namespace :site do | |
task :clear do | |
FileUtils.rm_rf "#{PUBLIC_DIR}/*" |
#! /usr/bin/env ruby | |
require "twitter" | |
require 'csv' | |
require 'regexp' | |
# Twitter setup was here... | |
#Gets the last 10 tweets from a given user from the twitter API | |
screen_name = String.new ARGV[0] |