Skip to content

Instantly share code, notes, and snippets.

View JakeAustwick's full-sized avatar

Jake Austwick JakeAustwick

  • Software Development
  • United Kingdom
View GitHub Profile
@JakeAustwick
JakeAustwick / gist:10689478
Last active August 29, 2015 13:59
Go 1.1.1 http bug
➜ domaincrawler go run bug.go
2014/04/15 00:17:00 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:04 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:07 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:09 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:11 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:14 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
2014/04/15 00:17:16 Unsolicited response received on idle HTTP channel starting with "\x1f"; err=<nil>
➜ domaincrawler cat bug.go
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.string :name
t.string :url
t.string :comment
t.integer :picture_id, :null => false
t.timestamps
end
class CommentsController < ApplicationController
def create
picture = Picture.find(params[:picture_id])
@comment = picture.comments.new(params[:comment]))
if @comment.save
flash[:success] = "Your comment has been added."
redirect_to picture_path(picture)
else
class CommentsController < ApplicationController
def create
picture = Picture.find(params[:picture_id])
@comment = picture.comments.new(params[:comment])
if @comment.save
flash[:success] = "Your comment has been added."
redirect_to picture_path(picture)
else
resources :pictures do
resources :comments, :only => ['create', 'new']
end
class CommentsController < ApplicationController
def create
picture = Picture.find(params[:picture_id])
@comment = picture.comments.new(params[:comment])
if @comment.save
flash[:success] = "Your comment has been added."
redirect_to picture_path(picture)
return
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Comments</title>
<description>Comments feed for the picture Fireworks Logo</description>
<item>
<title>Tom Aisthorpe</title>
<description>I suck donkey dick.</description>
<pubDate>2011-10-24 21:48:45 UTC</pubDate>
</item>
class Comment < ActiveRecord::Base
include Sanitize
belongs_to :picture
validates :name, :presence => true
validates :comment, :presence => true, :length => { :in => 5..300 }
before_save :strip_html
private
w = Whois::Client.new
uninitialized constant WhoisController::Whois
Registrant: #<struct Whois::Record::Contact id=nil, type=1, name="Mumbo Design", organization="139 town street", address="earlsheaton", city="dewsbury", zip="8ja", state="wf12", country="United Kingdom", country_code=nil, phone=nil, fax=nil, email=nil, created_on=nil, updated_on=nil>