Skip to content

Instantly share code, notes, and snippets.

View scottswezey's full-sized avatar
👋
Looking for work

Scott Swezey scottswezey

👋
Looking for work
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Starting StaticAssetTest App</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// Do ajax call to '/status' if we get 'Online' redirect
$.ajax({
url: '/status',
match 'status' => proc {|env| [200, {}, 'Online']}
match 'home' => proc {|env| [200, {}, 'It works!']}
<!DOCTYPE html>
<html>
<head>
<title>Starting StaticAssetTest App</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url: '/status',
success: function(data) {
# **Updates**
%w{body_labor refinish_labor frame_labor}.each do |rate|
%w{mean mathematical_mode lowest highest}.each do |method|
@result.send(rate).send(method)
end
end
# **Original**
%table
module ResultsHelper
def make_table_row_for(result, rate)
ret << []
ret << content_tag(:tr) do
content_tag(:th, rate.to_s.humanize)
content_tag(:td) do
pretty_number_to_currency method(rate, [:mean, :mathematical_mode, :lowest, :highest])
end
end
return ret.join("\n")
[scott@server2 ~]$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 373 100 373 0 0 2442 0 --:--:-- --:--:-- --:--:-- 0
mkdir: cannot create directory `/usr/local/rvm': Permission denied
bash: line 10: cd: /usr/local/rvm/src: No such file or directory
Cloning into rvm...
remote: Counting objects: 2635, done.
remote: Compressing objects: 100% (1364/1364), done.
remote: Total 2635 (delta 1566), reused 1685 (delta 797)
class TodoItem
# provide reader and setter for name and state
attr_accessor :name, :state
def initialize(name)
# store name
self.name = name
# set state to undone
self.state = false
end
Name of some item to do
Another items to do
IMPORTANT item
etc
class TodoList
attr_accessor :file
def load(file = 'todo.txt')
@file = file
@list = []
# Check that file exists
if using_valid_file?
# read the file, create a list, create items, add them
require 'TodoList'
class App
def self.file_choser
puts "Enter a filename to use:"
gets.chomp
end
def self.main
file = file_choser