Skip to content

Instantly share code, notes, and snippets.

View dustineichler's full-sized avatar

Dustin dustineichler

View GitHub Profile
Loading seed file: stock_locations
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Street Address can't be blank, City can't be blank, Zip can't be blank, Country can't be blank, State name can't be blank
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/usr/local/bundle/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transac
Couldn't find Clubs::Organization with ID=5485 for Clubs::Application with ID=
Deface::Override.new(:virtual_path => "spree/admin/shared/_header",
:insert_bottom => "#login-nav",
:partial => "spree/admin/shared/admin-link-foo",
:name => "bar")
@dustineichler
dustineichler / gist:8872177
Last active August 29, 2015 13:56
undefined method `shipping_costs_admin_reports_url' for #<#<Class:0x007fe0d7c795b0>:0x007fe0d7bc67d0>
<tbody>
<% @reports.each do |key, value| %>
<tr data-hook="reports_row">
<td class="align-center"><%= link_to value[:name], send("#{key}_admin_reports_url".to_sym) %></td>
<td style="padding-left:1em"><%= value[:description] %></td>
</tr>
<% end %>
bash$ (psql -U postgres|sudo -u postgres psql)
postgres=# CREATE DATABASE foo_production;
postgres=# DROP DATABASE foo_production;
bash$ RAILS_ENV=production bundle exec rake db:migrate
diff --git a/a.txt b/b.txt
index e38eacc..f0d06da 100644
--- a/a.txt
+++ b/b.txt
@@ -1,54 +1,33 @@
Return-path: [email protected]>
Envelope-to: nyctrains@redacted.com
-Delivery-date: Tue, 16 Apr 2013 12:12:56 -0600
-Received: from squashgl by host360.hostmonster.com with local-bsmtp (Exim 4.80)
- (envelope-from [email protected]>)
@import "variables";
/** Text Styles */
body, p {
@include font("Interstate Light", 16px, 21px);
text-rendering: optimizedLegibility;
-webkit-font-smoothing: antialiased;
}
.img-fallback {
cc1: warnings being treated as errors
src/http/ngx_http_request.c: In function ‘ngx_http_ssl_handshake_handler’:
src/http/ngx_http_request.c:635: error: implicit declaration of function ‘SSL_get0_next_proto_negotiated’
make[1]: *** [objs/src/http/ngx_http_request.o] Error 1
make[1]: Leaving directory `/home/ubuntu/nginx-1.3.1'
make: *** [build] Error 2
#!/Users/dustyeike/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
require "test/unit"
require "benchmark"
require "pp"
def find_similarity(str)
t,l,c=[],str.length,0
t=(0..l-1).map{|x|str.slice(x,l)}.compact
total=t.map{|x|i=0;while((x[i]==str[i])&&i<l);i+=1 end;c+=i}
@dustineichler
dustineichler / gist:730824
Created December 6, 2010 19:55
image cropper for local storage
module Paperclip
class Cropper < Thumbnail
def transformation_command
if crop_command
crop_command + super.join(' ').sub(/ -crop \S+/, '').split(' ') # super returns an array like this: ["-resize", "100x", "-crop", "100x100+0+0", "+repage"]
else
super
end
end