Skip to content

Instantly share code, notes, and snippets.

View gregelin's full-sized avatar

Greg Elin gregelin

  • RegScale, Inc.
  • Knoxville, TN
  • 16:43 (UTC -04:00)
View GitHub Profile
#!/usr/bin/env python
import httplib
import urllib, urllib2
import os
import re
HTTP_HOST = 'disclosures.house.gov'
HTTP_PATH = '/ld/LDDownload.aspx'
def get_context():
PROBLEM>
getting this error when I try to run dispatch.fcgi:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- application (MissingSourceFile)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
I am using rails 2.1.0 and went through freezing rails http://www.hostingrails.com/wiki/2/Install-and-freeze-your-own-RubyGems to use it. My environment.rb matches this.
ANSWER:
PROBLEM:
getting this error when I try to run dispatch.fcgi:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- application (MissingSourceFile)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
I am using rails 2.1.0 and went through freezing rails http://www.hostingrails.com/wiki/2/Install-and-freeze-your-own-RubyGems to use it. My environment.rb matches this.
ANSWER:
Please try renaming app/controllers/application_controller.rb file to app/controllers/application.rb .
Creating a rails app "Vurl"
http://www.vimeo.com/3761040
(replace vurl with your appname, then Vurl is first model, too)
rails -d mysql vurl
cd vurl
git init
git add .
git commit -m "Initial commit."
@gregelin
gregelin / parse_csv.rb
Created September 13, 2009 11:39
Ruby parse csv file
# Command line parse csv file
require 'CSV'
gf = "ucp_top_500_pages.txt"
af = "ucp_top_500_091209_categorized.txt"
src = File.open(gf,"r").read
views = {}
views = build_views(src)
# parse a file of urls and use hpricot
require 'hpricot'
require 'open-uri'
fn='top_500_urls.txt'
urls=[]
f.each_line {|line| urls.push line }
f.close
url.each {|u| puts u}
site="http://ucp.org"
Find all cap words, as in an acroynym
[A-Z][A-Z-]*\b
Python find Acronynms
import re
re.findall("[A-Z][A-Z-][A-Z-]*\\b",text)
# http://www.daniweb.com/forums/thread126955.html
def processDirectory ( args, dirname, filenames ):
print 'Directory',dirname
for filename in filenames:
print ' File',filename
top_level_dir = "/usr/local"
os.path.walk(top_level_dir, processDirectory, None )
# PHP Pear
# Command line
# See pear configuration
# >pear config-show
import re
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone
from metaphone import dm as double_metaphone
# get the Redis connection
from jellybean.core import redis
import models
# Words which should not be indexed