Skip to content

Instantly share code, notes, and snippets.

@cllns
cllns / README.md
Created February 26, 2018 04:17
Resume builder scripts

Super simple 'server' for rendering HTML from an index.html.erb file, and a data.yml file.

The instance variable to use in the ERB file is just @data. Then you can do things like @data.contact.email.

I just update the file, it's re-generated every second, and I refresh the browser when there's changes I want to see.

Caveats:

  1. If there's a problem with the command, it's just a blank screen, but the terminal will show you what's going on (usually malformed YAML).
  2. Sometimes when refreshing it's blank, I think because it's writing the file the same time you're trying to read it. Refreshing again fixes it.
@cllns
cllns / deploy.rb
Last active August 29, 2015 14:14
Capistrano task for pulling attachments from production (namely images with paperclip)
namespace :images do
desc "Pull images from production to dev"
task :pull do
on roles(:app) do
within shared_path do
with rails_env: fetch(:rails_env) do
info "Downloading images"
download! "#{shared_path}/public/assets/**/*.{png,jpg,jpeg,gif}", "public/", recursive: true
end
@cllns
cllns / deploy.rb
Last active August 29, 2015 14:13 — forked from technicalpickles/deploy.rb
Capistrano (VERSION 3) recipe for using yaml_db to pull data into local database
# Add this to your config/deploy.rb
# Then run it with:
#
# cap production db:pull
#
# (or with `bundle exec` in front, if necessary)
#
# For Capistrano version 2, use the original script, that this was forked from.
#
# Note, you need to add: