# change mirror to ubuntu.osuosl.org first
sudo apt-get update
sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev
echo "Building libplist..." | |
git clone http://cgit.sukimashita.com/libplist.git/ > /dev/null | |
cd libplist | |
mkdir build | |
cd build | |
cmake --prefix=/usr .. | |
make | |
sudo make install | |
cd ../../ |
#!/usr/bin/env ruby | |
require 'gosu' # gem install gosu --no-document | |
include Gosu | |
$dimension, $splits = 200, 20 | |
$size = $dimension.to_f / $splits.to_f | |
class Worm | |
attr_writer :dir | |
def initialize() reset end |
class MoviesController < ApplicationController | |
def show | |
@movie = Movie.find(params[:id]) | |
end | |
def index | |
@all_ratings = Movie.all_ratings | |
if params[:ratings] != nil |
ActiveRecord cheat sheet / EXAMPLES | |
INSTALL | |
======= | |
$ gem install activerecord | |
in GEMFILE: gem ‘activerecord’ | |
REQUIRE | |
======= | |
require ‘active_record’ |
Story Summary (in this case replace "Untitled Post" with this) As a (TYPE_OF_STAKEHOLDER) So that (THE_GOAL_OR_BUSINESS_VALUE) I would like to (SPECIFIC_SITE_INTERACTION)
require 'rubygems' | |
require 'nokogiri' | |
require 'eeepub' | |
DOC_TITLE = 'Ruby on Rails Guides' | |
def get_pages(src_dir) | |
index_file = File.join(src_dir, 'index.html') | |
section = nil | |
pages = [{ :section => section, :title => DOC_TITLE, :path => index_file }] |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
#!/usr/bin/env bash | |
# Download HTML converted from provided Markdown, using GitHub API v3 | |
## | |
md2html(){ | |
if [[ $# -ne 2 ]]; then | |
echo "ERROR.\nSYNTAX: Markdown_To_HTML <markdown-filepath> <dest-html-filepath>" | |
return | |
fi | |
unset _markdown_filepath |