Skip to content

Instantly share code, notes, and snippets.

View jvnill's full-sized avatar

Jim Ruther Nill jvnill

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Include gadget (iframe)" title_url="http://sites.google.com/"
description="Include another web page in your Google Site"
thumbnail="https://www.gstatic.com/sites-gadgets/common/images/sites-icon-gadget-thumb.png"
screenshot="https://www.gstatic.com/sites-gadgets/common/images/sites-icon-gadget-ss.png"
height="800" width="600" author="Google">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="iframeURL" display_name="URL to content" required="true"/>
@jvnill
jvnill / rails http status codes
Created May 18, 2016 03:50 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
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.
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"
>> 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
=> 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">
ActionView::Template::Error (Illegal nesting: nesting within plain text is illegal.):
1: %ol
2: foo
3: foo
4:
@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},
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 / 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.