Skip to content

Instantly share code, notes, and snippets.

View danblaker's full-sized avatar

Dan Blaker danblaker

View GitHub Profile
@danblaker
danblaker / s3_folder_upload.rb
Last active August 9, 2019 17:39 — forked from fleveque/s3_folder_upload.rb
Upload folder to S3 recursively with ruby, multi threads and aws-sdk v2 gem, based on http://avi.io/blog/2013/12/03/upload-folder-to-s3-recursively/
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk-s3'
# Forked from https://gist.github.com/fleveque/816dba802527eada56ab
class S3FolderUpload
attr_reader :folder_path, :total_files, :s3_bucket, :include_folder, :base_path
attr_accessor :files
@danblaker
danblaker / heroku_database_copy.md
Last active April 4, 2018 19:14 — forked from kosyfrances/heroku_database_copy.md
To copy heroku database from one app to another and from local to heroku

To copy database from one heroku app to another -

heroku pg:backups capture [database_name] --app source_app
heroku pg:backups restore $(heroku pg:backups public-url --app source_app) DATABASE_URL --app target_app

You can refer to https://devcenter.heroku.com/articles/heroku-postgres-backups for more information.

To copy database from local to heroku - Dump your local database in compressed format using the open source pg_dump tool: PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump where myuser is your database username and mydb is the database name.

@danblaker
danblaker / wpmenus.html
Created June 14, 2011 06:51
Wordpress default menu markup
<div id="access" role="navigation">
<div class="skip-link screen-reader-text">
<a href="#content" title="Skip to content">Skip to content</a>
</div>
<div class="menu">
<ul>
<li class="current_page_item">
<a href="http://dgb.moderndomestic.dev/" title="Home">Home</a>
</li>
<li class="page_item page-item-5">