Skip to content

Instantly share code, notes, and snippets.

View mwilc0x's full-sized avatar
:shipit:

Mike Wilcox mwilc0x

:shipit:
View GitHub Profile
@mwilc0x
mwilc0x / gist:3366672
Created August 16, 2012 04:03
peer connection class
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;
import java.util.logging.Logger;
/**
* The Class PeerUploader.
@mwilc0x
mwilc0x / gist:2474154
Created April 23, 2012 21:52
Merging two SQL queries into one
I want to divide the correct count by total count (where the domain names match)
/* Get the total count */
SELECT DISTINCT(domain_name), COUNT(*) AS count
FROM recommendations
WHERE rec_date LIKE '2007%'
GROUP BY domain_name
ORDER BY count DESC;
root@bt:/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1# heroku logs
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load
-- gollum (LoadError)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from config.ru:1
from /home/heroku_rack/heroku.ru:23
from /home/slugs/e2d27f54-f930-4f24-9e41-1a0c6c95a1e7/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/bu
ilder.rb:46:in `instance_eval'
from /home/slugs/e2d27f54-f930-4f24-9e41-1a0c6c95a1e7/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/bu
ilder.rb:46:in `initialize'
root@bt:/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1# heroku logs
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- gollum (LoadError)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from config.ru:1
from /home/heroku_rack/heroku.ru:23
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `instance_eval'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:29:in `initialize'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in `new'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/builder.rb:46:in `map'
from /home/heroku_rack/heroku.ru:18
root@bt:/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1# gollum
== Sinatra/1.1.2 has taken the stage on 4567 for development with backup from Mongrel
Grit::InvalidGitRepositoryError - /usr/lib/ruby/gems/1.8/gems/gollum-1.1.1:
/usr/lib/ruby/gems/1.8/gems/grit-2.4.1/lib/grit/repo.rb:51:in `initialize'
/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1/bin/../lib/gollum/wiki.rb:62:in `new'
/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1/bin/../lib/gollum/wiki.rb:62:in `initialize'
/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1/bin/../lib/gollum/frontend/app.rb:145:in `new'
/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1/bin/../lib/gollum/frontend/app.rb:145:in `show_page_or_file'
/usr/lib/ruby/gems/1.8/gems/gollum-1.1.1/bin/../lib/gollum/frontend/app.rb:40:in `GET /'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.1.2/lib/sinatra/base.rb:1057:in `call'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\gollum-1.1.1>gollum
== Sinatra/1.1.2 has taken the stage on 4567 for development with backup from WEBrick
[2011-01-15 20:36:04] INFO WEBrick 1.3.1
[2011-01-15 20:36:04] INFO ruby 1.9.2 (2010-12-25) [i386-mingw32]
[2011-01-15 20:36:04] INFO WEBrick::HTTPServer#start: pid=5092 port=4567
Grit::InvalidGitRepositoryError - C:/Ruby192/lib/ruby/gems/1.9.1/gems/gollum-1.1.1:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/repo.rb:51:in `initialize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/gollum-1.1.1/lib/gollum/wiki.rb:62:in `new'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/gollum-1.1.1/lib/gollum/wiki.rb:62:in `initialize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/gollum-1.1.1/lib/gollum/frontend/app.rb:145:in `new'
@mwilc0x
mwilc0x / gist:781395
Created January 16, 2011 00:05
trying to install gollum wiki app
####command line errors#####
C:\Ruby187\lib\ruby\gems\1.8\gems\gollum-1.1.1>gollum
== Sinatra/1.1.2 has taken the stage on 4567 for development with backup from WEBrick
[2011-01-15 19:02:58] INFO WEBrick 1.3.1
[2011-01-15 19:02:58] INFO ruby 1.8.7 (2010-12-23) [i386-mingw32]
[2011-01-15 19:02:58] INFO WEBrick::HTTPServer#start: pid=4396 port=4567
Grit::InvalidGitRepositoryError - C:/Ruby187/lib/ruby/gems/1.8/gems/gollum-1.1.1:
C:/Ruby187/lib/ruby/gems/1.8/gems/grit-2.4.1/lib/grit/repo.rb:51:in `initialize'
class WikiController < ApplicationController
def index
@page = Page.find_by_title( params[:title] || 'HomePage' )
if @page.nil?
redirect_to :action => 'new', :title => params[:title]
else
@page.body.gsub!(
Regexp.new( '\b((?:[A-Z]\w+){2,})' ), '<a href="/wiki/index?title=\1">\1</a>' )
render :action => 'show'
end
NoMethodError in WikiController#list
undefined method `paginate' for #<WikiController:0x58857a8>
RAILS_ROOT: C:/Users/Mike/railsApps/wiki
Application Trace | Framework Trace | Full Trace
app/controllers/wiki_controller.rb:16:in `list'
C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/base.rb:1166:in `send'
NoMethodError in Wiki#edit
Showing wiki/edit.rhtml where line #3 raised:
undefined method `start_form_tag' for #<ActionView::Base:0x59149f8>
Extracted source (around line #3):
1: <h1>Editing page</h1>
2: