Skip to content

Instantly share code, notes, and snippets.

View RobertLowe's full-sized avatar

Robert Lowe RobertLowe

View GitHub Profile
namespace :solargraph do
task generate: :environment do
# Add the folder you choose in your config/application.rb
# example:
# config.autoload_paths << Rails.root.join('app/solargraph')
gen_directory = Rails.root.join("config", "yard")
# run the script as a rails runner:
# jundle exec rails r ./bin/generate_solar_models.rb
@moro
moro / gist:1024620
Created June 14, 2011 10:05
Kaminari and pushState
(function($){
$('.pagination a[data-remote=true]').live('ajax:success', function(e){ window.history.pushState('', '', $(e.target).attr('href')) })
$(window).bind('popstate', function(){ $.ajax({url:window.location, dataType:'script'}) ; return true });
})(jQuery);