Just run:
$ ruby csvtohtml.rb data.csv > table.html
You can customize the table's id, table's classes, header's classes and field's classes. You can also use linux pipes and it's only one small file long with NO dependencies.
" Author: Susan Potter | |
" Using ~/.vim/supo as placeholder initialization VimScripts location. | |
" Didn't want to use ~/.vim/init in case init had or starts to have special meaning for Vim plugins or loading. | |
source $HOME/.vim/supo/global.vim | |
source $HOME/.vim/supo/functions.vim |
if Rails.env.development? | |
around_filter :perform_profile | |
end | |
# In development mode, optionally perform a RubyProf profile of any request. | |
# Simply pass perform_profile=true in your params. | |
def perform_profile | |
return yield unless params[:perform_profile] | |
require 'ruby-prof' | |
RubyProf.start |
require 'rubygems' | |
fetcher = Gem::SpecFetcher.fetcher | |
my_dep = 'activesupport' | |
# 1st arg = all (true to get all versions, false to get latest) | |
# 2nd arg = prerelase (true to get pre-release gems, false to get stable) | |
all_gems = fetcher.list(false, false) |
# In development mode, optionally perform a RubyProf profile of any request. | |
# Simply pass perform_profile=true in your params. | |
def perform_profile | |
return yield unless params[:perform_profile] | |
require 'ruby-prof' | |
RubyProf.start | |
yield | |
result = RubyProf.stop | |
printer = RubyProf::FlatPrinter.new(result) | |
File.open("#{Rails.root}/tmp/profile.txt", 'w+') do |f| |
require 'find' | |
BLACKLIST = %w[ | |
.git | |
.gitignore | |
Rakefile | |
] | |
task :default do | |
Find.find('.') do |path| |
require "redis" | |
local WMAX = 100000 | |
local rc = Redis.connect("unix:///tmp/redis.sock") | |
local rs_mhset = [[ | |
local keys,argv,rcall = KEYS,ARGV,redis.call | |
local n,f = 0,argv[#keys+1] | |
for i,k in ipairs(keys) do n = n + rcall("hset",k,f,argv[i]) end | |
return n |
Surround these with : e.g. :calling: | |
+1 | |
-1 | |
bulb | |
calling | |
clap | |
cop | |
feet |
# coding=UTF-8 | |
from __future__ import division | |
import nltk | |
import re | |
import requests | |
# Add your freebase key here | |
# If you don't have one, register at https://code.google.com/apis/console | |
FREEBASE_KEY = "" |