├── .gems ├── .rvmrc ├── Gemfile ├── Gemfile.lock ├── README.mdown ├── app.rb ├── config.ru └── public ├── css ├── base.css └── style.css ├── img └── transparent.gif ├── index.html ├── js ├── libs │ ├── backbone-0.5.3.js │ ├── jquery-1.6.4.js │ ├── logfix.js │ ├── paper-0.21.js │ └── underscore-1.2.1.js └── script.js └── json └── example.json /.gems: -------------------------------------------------------------------------------- 1 | sinatra -------------------------------------------------------------------------------- /.rvmrc: -------------------------------------------------------------------------------- 1 | rvm --create ruby-1.9.2@coach_perf 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | gem 'sinatra' 4 | gem 'thin' 5 | gem 'json' -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | daemons (1.1.4) 5 | eventmachine (0.12.10) 6 | json (1.6.1) 7 | rack (1.3.5) 8 | rack-protection (1.1.4) 9 | rack 10 | sinatra (1.3.1) 11 | rack (~> 1.3, >= 1.3.4) 12 | rack-protection (~> 1.1, >= 1.1.2) 13 | tilt (~> 1.3, >= 1.3.3) 14 | thin (1.2.11) 15 | daemons (>= 1.0.9) 16 | eventmachine (>= 0.12.6) 17 | rack (>= 1.0.0) 18 | tilt (1.3.3) 19 | 20 | PLATFORMS 21 | ruby 22 | 23 | DEPENDENCIES 24 | json 25 | sinatra 26 | thin 27 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # What is this? 2 | 3 | This is a base/starting point for a simple web app. Includes jQuery 1.5, Underscore 1.1.4, and plugins.js from HTML5 Boilerplate. It also uses the stylesheet from HTML5 Boilerplate as a base. As well as setting up some default directories. 4 | 5 | The "Installation" below is only necessary if you want the convenience of using a stand-alone web server for this app (thin), using passenger, or using the server as a proxy for cross-site json requests. 6 | 7 | # Installation 8 | 9 | Dependencies: Ruby, RubyGems, Sinatra, Thin 10 | 11 | On OSX, both Ruby and RubyGems should be installed by default. 12 | 13 | To install Sinatra and Thin: 14 | 15 | $ sudo gem install sinatra 16 | $ sudo gem install thin 17 | 18 | To start the app locally (from this directory): 19 | 20 | $ thin start 21 | 22 | The app should be running on localhost, port 3000. Now just point your browser to [http://localhost:3000/](http://localhost:3000/) 23 | 24 | --- 25 | 26 | If you're on OSX and you'd prefer to use Passenger: 27 | 28 | I recommend [PassengerPane](https://github.com/Fingertips/passengerpane), follow the directions there to get all set-up. 29 | 30 | -------------------------------------------------------------------------------- /app.rb: -------------------------------------------------------------------------------- 1 | get '/' do 2 | open(File.dirname(__FILE__) + '/public/index.html').read 3 | end -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require 'bundler' 2 | 3 | Bundler.require 4 | 5 | require './app.rb' 6 | 7 | run Sinatra::Application -------------------------------------------------------------------------------- /public/css/base.css: -------------------------------------------------------------------------------- 1 | /* HTML5 ✰ Boilerplate */ 2 | 3 | html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, 4 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, 5 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, 6 | fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, 7 | article, aside, canvas, details, figcaption, figure, footer, header, hgroup, 8 | menu, nav, section, summary, time, mark, audio, video { 9 | margin:0; 10 | padding:0; 11 | border:0; 12 | outline:0; 13 | font-size:100%; 14 | vertical-align:baseline; 15 | background:transparent; 16 | } 17 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 18 | display:block; 19 | } 20 | nav ul { list-style:none; } 21 | blockquote, q { quotes:none; } 22 | blockquote:before, blockquote:after, 23 | q:before, q:after { content:''; content:none; } 24 | a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; } 25 | ins { background-color:#ff9; color:#000; text-decoration:none; } 26 | mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; } 27 | del { text-decoration: line-through; } 28 | abbr[title], dfn[title] { border-bottom:1px dotted; cursor:help; } 29 | table { border-collapse:collapse; border-spacing:0; } 30 | hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; } 31 | input, select { vertical-align:middle; } 32 | 33 | 34 | body { font:13px/1.231 sans-serif; *font-size:small; } 35 | select, input, textarea, button { font:99% sans-serif; } 36 | pre, code, kbd, samp { font-family: monospace, sans-serif; } 37 | 38 | body, select, input, textarea { color: #444; } 39 | h1,h2,h3,h4,h5,h6 { font-weight: bold; } 40 | html { overflow-y: scroll; } 41 | 42 | a:hover, a:active { outline: none; } 43 | a, a:active, a:visited { color: #607890; } 44 | a:hover { color: #036; } 45 | 46 | ul, ol { margin-left: 1.8em; } 47 | ol { list-style-type: decimal; } 48 | 49 | nav ul, nav li { margin: 0; } 50 | small { font-size: 85%; } 51 | strong, th { font-weight: bold; } 52 | td, td img { vertical-align: top; } 53 | sub { vertical-align: sub; font-size: smaller; } 54 | sup { vertical-align: super; font-size: smaller; } 55 | pre { padding: 15px; white-space: pre; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; } 56 | textarea { overflow: auto; } 57 | .ie6 legend, .ie7 legend { margin-left: -7px; } 58 | input[type="radio"] { vertical-align: text-bottom; } 59 | input[type="checkbox"] { vertical-align: bottom; } 60 | .ie7 input[type="checkbox"] { vertical-align: baseline; } 61 | .ie6 input { vertical-align: text-bottom; } 62 | label, input[type=button], input[type=submit], button { cursor: pointer; } 63 | button, input, select, textarea { margin: 0; } 64 | input:valid, textarea:valid { } 65 | input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; } 66 | .no-boxshadow input:invalid, 67 | .no-boxshadow textarea:invalid { background-color: #f0dddd; } 68 | 69 | ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; } 70 | ::selection { background:#FF5E99; color:#fff; text-shadow: none; } 71 | a:link { -webkit-tap-highlight-color: #FF5E99; } 72 | 73 | button { width: auto; overflow: visible; } 74 | .ie7 img { -ms-interpolation-mode: bicubic; } 75 | 76 | .ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; } 77 | .hidden { display: none; visibility: hidden; } 78 | .visuallyhidden { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); } 79 | .invisible { visibility: hidden; } 80 | .clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; visibility: hidden; } 81 | .clearfix:after { clear: both; } 82 | .clearfix { zoom: 1; } 83 | 84 | 85 | /* Primary Styles 86 | Author: 87 | */ 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | @media all and (orientation:portrait) { 103 | 104 | } 105 | 106 | @media all and (orientation:landscape) { 107 | 108 | } 109 | 110 | @media screen and (max-device-width: 480px) { 111 | 112 | 113 | /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */ 114 | } 115 | 116 | @media print { 117 | * { background: transparent !important; color: #444 !important; text-shadow: none !important; } 118 | a, a:visited { color: #444 !important; text-decoration: underline; } 119 | a:after { content: " (" attr(href) ")"; } 120 | abbr:after { content: " (" attr(title) ")"; } 121 | .ir a:after { content: ""; } 122 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } 123 | thead { display: table-header-group; } 124 | tr, img { page-break-inside: avoid; } 125 | @page { margin: 0.5cm; } 126 | p, h2, h3 { orphans: 3; widows: 3; } 127 | h2, h3{ page-break-after: avoid; } 128 | } 129 | 130 | -------------------------------------------------------------------------------- /public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | text-align: center; 4 | } -------------------------------------------------------------------------------- /public/img/transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidguttman/BaseJSApp/a247a5e9a81884cbd0657dec15e93951d82b4f55/public/img/transparent.gif -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |