Suppose you're opening an issue and there's a lot noisey logs that may be useful.
Rather than wrecking readability, wrap it in a <details>
tag!
<details>
<summary>Summary Goes Here</summary>
# run using ```rvm jruby-1.6.7 do jruby "-J-Xmx2000m" "--1.9" tej.rb``` | |
require 'rubygems' | |
require 'nokogiri' | |
require 'csv' | |
f = File.open("/tmp/preview.html") | |
doc = Nokogiri::HTML(f) | |
csv = CSV.open("/tmp/output.csv", 'w',{:col_sep => ",", :quote_char => '\'', :force_quotes => true}) |
# Read and write spreadsheets with ruby using the spreadsheet gem | |
# Full Docs: http://spreadsheet.rubyforge.org/GUIDE_txt.html | |
require 'spreadsheet' | |
# Open source spreadsheet | |
workbook = Spreadsheet.open 'source.xls' | |
# READ |
First, Create a folder inside of lib
called seeds
Put your CSV file example.csv
into the lib/seeds
folder. In the example below, the file is called real_estate_transactions.csv
Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.
# I use this in conjunction with Contentful CMS to render blocks of markdown into my static middleman templates. | |
# In your gemfile, add Redcarpet: | |
gem 'redcarpet' | |
# ...and do a bundle install | |
# In your config.rb, add this line: | |
set :markdown_engine, :redcarpet |
# Local Dates: | |
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt | |
# ISO Dates: | |
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt |
# ... | |
activate :external_pipeline, | |
name: :webpack, | |
command: build? ? "npm run build:assets" : "npm run start:assets", | |
source: ".tmp/webpack_output", | |
latency: 1 | |
# ... |
#!/bin/bash | |
# Stop all containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |