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 / xml2db.rb
Created August 27, 2011 18:30 — forked from rkumar/xml2db.rb
convert itunes music library to database sqlite3 using ruby
#!/usr/bin/env ruby
=begin
* Name: xml.rb
* Description parses xml iTunes Music Library and inserts into database
so other apps can use, rather than each time parsing xml file
* Author: Original - Aaron Patterson (xml parsing portion)
http://groups.google.com/group/nokogiri-talk/browse_thread/thread/97973521c6f5f0dc
* Additions by rkumar
* Date: 2010-08-04
* License:
@shanemcd
shanemcd / itunes.sql
Created August 27, 2011 18:50 — forked from rkumar/itunes.sql
itunes music library database
/* create tables to store itunes music library data for quick access
- rkumar 2010 July
*/
drop table tracks;
create table tracks (
album_artist VARCHAR(50),
album_rating_computed INTEGER,
album_rating VARCHAR(50),
album VARCHAR(50),
all_items VARCHAR(50),
@shanemcd
shanemcd / gist:1297488
Created October 19, 2011 04:42
sinatra partial
<% @articles.each do |article| %>
<ul>
<li> <%= article.articleName %> </li>
</ul>
<% end %>
get '/articles/:id' do
@article = Articles.get params[:id]
set :public_folder, File.dirname(__FILE__) + '/css/styles.css'
erb :article
end
irb(main):002:0> Articles.count
=> 5
irb(main):003:0> Articles.find(1)
=> #<Enumerator: Articles:find(1)>
#wrap{
display: block;
position: absolute;
height: auto;
bottom:0;
top:0;
left:0;
right:0;
margin-top:50px;
margin-bottom:25px;
@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'});};
});
# 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:1717520
Created February 1, 2012 15:25
HipsterIpsum Install and Usage
gem install hipsteripsum
hipsteripsum 5 latin | mate
@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