Skip to content

Instantly share code, notes, and snippets.

View aamax's full-sized avatar

Allen Maxwell aamax

  • aaMaxWorks Engineering, LLC
  • Draper, Utah USA
View GitHub Profile
@aamax
aamax / curls
Last active August 29, 2015 14:25
curl -i -H "Accept: application/json" -X POST -H "Content-Type: application/json" -H "X-API-EMAIL:[email protected]" -H "X-API-TOKEN:tokengoeshere" http://127.0.0.1:3000/api/v1/send_vendor_list
I've also tried changing the json to html
curl -i -H "Accept: application/html" -X POST -H "Content-Type: application/json" -H "X-API-EMAIL:[email protected]" -H "X-API-TOKEN:tokengoeshere" http://127.0.0.1:3000/api/v1/send_vendor_list
curl -i -H "Accept: application/html" -X POST -H "Content-Type: application/html" -H "X-API-EMAIL:[email protected]" -H "X-API-TOKEN:tokengoeshere" http://127.0.0.1:3000/api/v1/send_vendor_list
curl -i -H "Accept: application/json" -X POST -H "Content-Type: application/html" -H "X-API-EMAIL:[email protected]" -H "X-API-TOKEN:tokengoeshere" http://127.0.0.1:3000/api/v1/send_vendor_list
@aamax
aamax / application.rb
Last active November 10, 2015 15:13
weird datetime issues in rails
config.time_zone = "Pacific Time (US & Canada)"
config.active_record.default_timezone = "Pacific Time (US & Canada)"
$ gem list
*** LOCAL GEMS ***
actionmailer (4.2.4)
actionpack (4.2.4)
actionview (4.2.4)
activejob (4.2.4)
activemodel (4.2.4)
activerecord (4.2.4)
@aamax
aamax / models, associations and tests
Created May 14, 2016 07:30
AR association tests not passing
class User < ActiveRecord::Base
has_many :lead_offers
has_many :leads, through: :lead_offers
end
class Lead < ActiveRecord::Base
has_many :lead_offers, dependent: :destroy
has_many :users, :through => :lead_offer
end
@aamax
aamax / html content
Created April 16, 2017 22:16
raffle selection spinner for RubyHACK....
<div class="well">
<h1 id="selected_winner">Spin To Select A Winner!</h1>
<br/>
<div id="planeMachine" style="overflow: hidden; height: 70px;" class="" >
<div class="slotMachineContainer" style="transition: 0.9s ease-out; transform: matrix(1, 0, 0, 1, 0, -240);">
<% @raffle_entries.each do |re| %>
<div class="text-center">
<h1 id="panel1"><%= "#{re[:fname]} #{re[:lname]}" %></h1>
</div>