This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PHP Pear | |
# Command line | |
# See pear configuration | |
# >pear config-show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer