Skip to content

Instantly share code, notes, and snippets.

View jvnill's full-sized avatar

Jim Ruther Nill jvnill

View GitHub Profile
Received: from mail139.wdc04.mandrillapp.com (unknown [205.201.131.139])
by ip-10-220-3-120 (Postfix) with ESMTP id A14602017D
for <bounce-md_30000046.535f3e6a.v1-5c1d2f6abda64895b422486e954e245a@mandrillapp.com>; Tue, 29 Apr 2014 05:53:47 +0000 (UTC)
Date: Tue, 29 Apr 2014 05:53:47 +0000
From: postmaster@mail139.wdc04.mandrillapp.com
Subject: Delivery report
To: bounce-md_30000046.535f3e6a.v1-5c1d2f6abda64895b422486e954e245a@mandrillapp.com
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="report535F3E6B@mail139.wdc04.mandrillapp.com"
I want to use `/blog` as the url but I created a `PostsController` so I have to set the `path` option in the routes.
resources :posts, path: '/blog'
This is working fine in development but when I deploy it to heroku, I get a 500. The logs doesn't seem helpful at all, you'll get the normal log like the one below but the status is 500 so I'm a bit lost on the cause of the issue
at=info method=GET path=/path_name host=www.example.com request_id=some-random-numbers-here fwd="xxx.xxx.xxx.xxx" dyno=web.1 connect=2ms service=95ms status=500 bytes=37419
And yep, I'm using a custom url so that may also be part of the issue. What I did to fix it was to change the posts controller to a blog controller.
def attempt_login
if authorized_user = User.authenticate(params[:username], params[:hashed_password])
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
case authorized_user.account_type
when "admin"
redirect_to :action => "index"
when "it"
redirect_to :action => "it"
@jvnill
jvnill / client.rb
Created November 21, 2012 15:06
Core associations between contract, client, code and codeline
class Client < ActiveRecord::Base
attr_accessible :etc, :firstname, :lastname, :mi
has_many :contracts
validates :firstname, :lastname, :mi, presence: true
def full_name
"#{firstname} #{mi} #{lastname}"
end
@jvnill
jvnill / 0-readme.md
Created November 23, 2012 02:33 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

require 'rspec'
require 'json'
require 'active_support/all'
require 'pry'
def input
[{:lastmodificationdate=>"2012-12-20T23:26:34Z",
:totalcost=>30.827698,
:userproject=>"FCBIZ"},
{:lastmodificationdate=>"2012-12-20T23:26:34Z",
@jvnill
jvnill / netengine_golf.rb
Last active December 10, 2015 00:19 — forked from jp/netengine_golf.rb
require 'rspec'
require 'json'
require 'active_support/all'
require 'pry'
def input
[
{lastmodificationdate:"2012-11-16",userproject:'FCBIZ',totalcost:10},
{lastmodificationdate:"2012-11-16",userproject:'LMS',totalcost:20},
{lastmodificationdate:"2012-11-16",userproject:'NetEngine',totalcost:52},
ActionView::Template::Error (Illegal nesting: nesting within plain text is illegal.):
1: %ol
2: foo
3: foo
4:
=> item_list = Project.limit(2).select('projects.name')
=> [#<Project name: "SEO">, #<Project name: "Site Analysis">]
>> item_list.each { |il| il.name = 'foo' }
=> [#<Project name: "foo">, #<Project name: "foo">]
>> item_list.first
=> #<Project name: "foo">
>> str="D:\\projects\\curator\\java\\hpc"
=> "D:\\projects\\curator\\java\\hpc"
>> no=str.count("\\")
=> 4
>> splitstr=str.split(pattern="\\",no+1)
=> ["D:", "projects", "curator", "java", "hpc"]
>> splitstr.length
=> 5