This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ************* | |
// Original plugin Gist: https://gist.github.com/268257 | |
// Current repos: https://github.com/desandro/imagesloaded | |
// fix in response to: https://github.com/desandro/imagesloaded/issues/8 | |
// | |
// In case this is useful to anyone. | |
// ************* | |
/*! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hack to change the Rails cookie serializer from Marshal to JSON and therefore allow the session | |
# to be shared between different languages but also avoid that someone knowing the | |
# cookie secret key could execute arbitrary code on the server by unmarshalling | |
# modified Ruby code added to the session/permanent cookie. | |
# | |
# Note that all users will beed to login again since both the remember me cookie and the session cookies | |
# won't be valid. Note also that the remember me cookie is tested multiple times per request even when it fails. | |
# for performance reasons you might want to delete it if these extra cycles are too costly for you. | |
# | |
# Rails 4 (not tested on Rails 3). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import File.expand_path(File.dirname(__FILE__) + '/schema_format.rb') | |
namespace :db do | |
# Define PG environment utility methods | |
task :pg_env => :environment do | |
def pg_get_config | |
ActiveRecord::Base.configurations.fetch(Rails.env).tap do |config| | |
ENV['PGHOST'] = config['host'].to_s if config.key?('host') | |
ENV['PGPORT'] = config['port'].to_s if config.key?('port') | |
ENV['PGPASSWORD'] = config['password'].to_s if config.key?('password') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E.g. | |
$('.js-show-spinner').click(function() { | |
var $saveButton = $(this) | |
$saveButton.html($('<div>').addClass('loader')) | |
setTimeout(function() { $('#' + $saveButton.attr('form')).submit(); }) | |
return false | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ****************** | |
# *** FYI :: This turned out to be the missing link in the process ***** | |
# Install the devel packages for png, jpg, tiff. these are dependencies of ImageMagick | |
# Time taken: ~ 3secs | |
# ****************** | |
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel | |
# ****************** | |
# Download and Install Imagemagick |
OlderNewer