Skip to content

Instantly share code, notes, and snippets.

View maclover7's full-sized avatar

Jon Moss maclover7

View GitHub Profile
@maclover7
maclover7 / gist:8742788
Created January 31, 2014 20:46
twilio probs
<?php
include('Services/Twilio.php');
function guide(){
$response = new Services_Twilio_Twiml();
$response->sms("Blah.");
echo $response;
}
@maclover7
maclover7 / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am maclover7 on github.
  • I am moss (https://keybase.io/moss) on keybase.
  • I have a public key whose fingerprint is 4B63 126A F84F AF85 3D96 3ADA 2CEB 46D0 4F80 1DF2

To claim this, I am signing this object:

-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org
hQIMA04Va+WS3WgHARAAzSSTjGy377lokucEI2OYN7uHad5czpmIWW0z4fK9Ns0i
WuxYTUE9MwpXJ1/GlrdM5N+WTD4OQNyh3u7PX7qkCgisQkq/khRHZfIaSkkq6+Yu
HY0HrZ9FYkS8xehg9/ZMw94yxhMVoLES+NY8vWJ/1sBM0KaoG93WKNZ92opT+0sX
0yZdkCKDIqQxLZWjxrdAu3mDuMiVoCc43d/z7baZTUBtpKMEQ/i0d3WHzowdOtee
cuzKEBht2O2p0/zJ96RwrwxfR1voySWoo81asHuQn9A0jTnAmZ+dtv1k3KPwUndw
GfZUNNGbxv4136tP5Qxvj0O+hO2ZvI3skqmd9TBxDoq/wjxnNRozWfcBuYTyMmRT
@maclover7
maclover7 / README.md
Created March 29, 2014 01:39
MTA NYC Subway Widget for Dashing

You know what to do.

@maclover7
maclover7 / _form.html.erb (Jokes)
Created October 25, 2014 02:17
Rails Sub-resources Routing error
<%= form_for [@person, @joke] do |f| %>
<% if @joke.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@joke.errors.count, "error") %> prohibited this joke from being saved:</h2>
<ul>
<% @joke.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
@maclover7
maclover7 / README.md
Last active August 29, 2015 14:08
Rails Sub-resources Routing

person has_many :jokes joke belongs_to :person

require 'faker'
require 'factory_girl_rails'
FactoryGirl.define do
factory :profile do |f|
f.name { Faker::Name.name }
f.user_id "1"
end
end
Failures:
1) ProfilesController PUT #update valid attributes located the requested @profile
Failure/Error: put :update, id: @profile, profile: FactoryGirl.attributes_for(:profile)
NameError:
undefined local variable or method `profile' for #<ProfilesController:0x007fae343cfe08>
# PATCH/PUT /profiles/1
# PATCH/PUT /profiles/1.json
def update
respond_to do |format|
if @profile.update(profile)
format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }
else
format.html { render :edit }
end
end
@maclover7
maclover7 / error
Created January 19, 2015 17:38
Stack Overflow
Failure/Error: put :update, hackathon_id: create(:hackathon), submission_id: @submission, submission: FactoryGirl.attributes_for(:submission), :format => :json, :access_token => @token.token
ActiveRecord::RecordNotFound:
Couldn't find Submission with 'id'=Dolorum ipsa officiis velit et id quo ea.
# ./app/controllers/api/v1/submissions_controller.rb:60:in `set_submission'
# ./spec/controllers/api/v1/submissions_controller_spec.rb:88:in `block (5 levels) in <top (required)>'