This file contains hidden or 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
# download and git methods swiped from http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb | |
require 'open-uri' | |
def download(from, to = from.split("/").last) | |
#run "curl -s -L #{from} > #{to}" | |
file to, open(from).read | |
rescue | |
puts "Can't get #{from} - Internet down?" | |
exit! |
This file contains hidden or 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
require 'rexml/document' | |
module ActiveMerchant #:nodoc: | |
module Billing #:nodoc: | |
# Paygate is one of the leading CC gateways in South Africa | |
# see http://www.paygate.co.za | |
# Contributed by Nick Coyne (http://www.codevader.com) | |
class PaygateGateway < Gateway | |
URL = 'https://www.paygate.co.za/payxml/process.trans' |
This file contains hidden or 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
def link_to( *args, &block ) | |
title_object = args.first if args.first.is_a?( ActiveRecord::Base ) | |
if title_object && ( args.size == 1 || ( args.size == 2 and args.last.is_a?(Hash) ) ) | |
args.insert( 1, polymorphic_url( title_object ) ) | |
end | |
options = args.get_or_initialize_options! | |
title_object ||= args.second if Rails.env != 'test' && args.second.is_a?( ActiveRecord::Base ) | |
if !options[:title].blank? | |
options[:title] = options[:title].to_s | |
elsif title_object |
This file contains hidden or 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
Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /usr/www/users/sarahw/blog/wp-includes/media.php on line 1006 | |
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /usr/www/users/sarahw/blog/wp-includes/media.php on line 424 | |
Warning: imagejpeg(): supplied argument is not a valid Image resource in /usr/www/users/sarahw/blog/wp-includes/media.php on line 455 |
This file contains hidden or 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
#Deploy and rollback on Heroku in staging and production | |
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
This file contains hidden or 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
require 'cloudinary' | |
require 'cloudinary/migrator' | |
class DbMigrator < Cloudinary::Migrator | |
def self.init | |
return if @@init | |
@@init = true | |
require 'tempfile' | |
end |
This file contains hidden or 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
$ RAILS_ENV=profiling bundle exec derailed exec perf:mem | |
Your Gemfile lists the gem dotenv-rails (>= 0) more than once. | |
You should probably keep only one of them. | |
While it's not a problem now, it could cause errors if you change the version of just one of them later. | |
Booting: profiling | |
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from mon_synchronize at /Users/nick/.rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211) | |
You did not specify how you would like Rails to report deprecation notices for your profiling environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/profiling.rb | |
Endpoint: "/" | |
/Users/nick/.rbenv/versions/2.1.5/gem |
This file contains hidden or 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
2016-02-29T11:57:37+00:00 {"error":"EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@70475c64]","status":429} | |
2016-02-29T11:57:37+00:00 {"error":"RemoteTransportException[[dwalin-1][inet[/10.0.1.109:9300]][indices:data/write/index]]; nested: EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@3a9b376c]; ","status":429} | |
2016-02-29T11:57:37+00:00 {"error":"EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@765fa2ba]","status":429} | |
2016-02-29T11:57:23+00:00 {"error":"RemoteTransportException[[dwalin-1][inet[/10.0.1.109:9300]][indices:data/write/index]]; nested: EsRejectedExecutionException[rejected execution (queue capacity 200) on org.elasticsearch |
This file contains hidden or 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
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@bfe2356]; | |
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@420985d9] | |
EsRejectedExecutionException[rejected execution (queue capacity 50) on org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1@48c29c4a]; |
This file contains hidden or 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
class @App.Components.TempUserTimer | |
constructor: -> | |
@timeoutWarning = 10000 # Display warning in 1 min. | |
@timeoutNow = 60000 # Warning has been shown, give the user 1 minute to interact | |
@logoutUrl = '/timeout' # URL to logout page. | |
# Button click handlers | |
# close page | |
$(document).on 'click', '.js-temp-user-logout', => | |
@timeout() |
OlderNewer