Skip to content

Instantly share code, notes, and snippets.

View shanemcd's full-sized avatar

Shane McDonald shanemcd

  • (Ansible (Red Hat (IBM)))
  • Jersey City
View GitHub Profile
@shanemcd
shanemcd / gist:2644373
Created May 9, 2012 13:10
Kick Ass CSS "Well" Look
position: relative;
white-space: pre;
padding: 10px;
float: right;
width: 380px;
font-size: 12px;
font-family: 'Courier new';
font-weight: bold;
background: rgba(0, 0, 0, 0.15);
border-radius: 4px;
window.App =
Models: {}
Collections: {}
Views: {}
Routers: {}
init: (options) ->
App.project = options.project
App.question_set = options.question_set
App.router = new App.Routers.QuestionsRouter()
Backbone.history.start();
@shanemcd
shanemcd / gist:2209334
Created March 26, 2012 20:14
Populate staging server with Production DB
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app instruments2` --app instruments2-staging
@shanemcd
shanemcd / gist:1717520
Created February 1, 2012 15:25
HipsterIpsum Install and Usage
gem install hipsteripsum
hipsteripsum 5 latin | mate
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
@shanemcd
shanemcd / gist:1418016
Created December 1, 2011 16:33
fixed iOS footer
if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{$("#footer").css({'position' : 'static', 'height' : '50px'});};
});
#wrap{
display: block;
position: absolute;
height: auto;
bottom:0;
top:0;
left:0;
right:0;
margin-top:50px;
margin-bottom:25px;
irb(main):002:0> Articles.count
=> 5
irb(main):003:0> Articles.find(1)
=> #<Enumerator: Articles:find(1)>
get '/articles/:id' do
@article = Articles.get params[:id]
set :public_folder, File.dirname(__FILE__) + '/css/styles.css'
erb :article
end
@shanemcd
shanemcd / gist:1297488
Created October 19, 2011 04:42
sinatra partial
<% @articles.each do |article| %>
<ul>
<li> <%= article.articleName %> </li>
</ul>
<% end %>