Skip to content

Instantly share code, notes, and snippets.

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
@hafizio
hafizio / movies_controller.rb
Created May 25, 2014 21:16
MoviesController
class MoviesController < ApplicationController
def show
@movie = Movie.find(params[:id])
end
def index
@all_ratings = Movie.all_ratings
if params[:ratings] != nil

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev

ActiveRecord cheat sheet / EXAMPLES
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@hafizio
hafizio / gist:26270e250c572acec0be
Last active August 29, 2015 14:02
User Stories PPScheduler

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)

Add Assignment teacher

  • As a teacher,
  • I'd like to add an assignment to the system (assignment name, max # participants, etc) so that the students (pair programmers) can pair on that assignment.
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