Skip to content

Instantly share code, notes, and snippets.

View gregblake's full-sized avatar
👨‍💻

Greg Blake gregblake

👨‍💻
View GitHub Profile
@gregblake
gregblake / gist:8939c2ae1aabd3dd2b6e515b067e9ce4
Created July 28, 2017 15:17
Vagrant was unable to mount VirtualBox shared folders
11:07 $ vagrant status
Current machine states:
nitro poweroff (virtualbox)
The VM is powered off. To restart the VM, simply run `vagrant up`
✔ ~/code/nitro-web [fix/prevent_connect_users_from_seeing_corporate_events_#149559425|⚑ 33]
11:07 $ vagrant up
Bringing machine 'nitro' up with 'virtualbox' provider...
==> nitro: Checking if box 'tbfisher/ubuntu1404puppet4' is up to date...
@gregblake
gregblake / index_query.sql
Created August 11, 2017 04:20
Media Library v2: sql query on index action
[read] SQL (1.1ms) SELECT `documents`.`id` AS t0_r0, `documents`.`name` AS t0_r1, `documents`.`active` AS t0_r2, `documents`.`created_by` AS t0_r3, `documents`.`roles_count` AS t0_r4, `documents`.`created_at` AS t0_r5, `documents`.`updated_at` AS t0_r6, `documents`.`territories_count` AS t0_r7, `documents`.`published_date_start` AS t0_r8, `documents`.`published_date_end` AS t0_r9, `documents`.`thumbnail_file_name` AS t0_r10, `documents`.`thumbnail_file_size` AS t0_r11, `documents`.`thumbnail_content_type` AS t0_r12, `documents`.`viewing_mode` AS t0_r13, `document_versions`.`id` AS t1_r0, `document_versions`.`document_id` AS t1_r1, `document_versions`.`attachment_file_size` AS t1_r2, `document_versions`.`thumbnail_file_size` AS t1_r3, `document_versions`.`version` AS t1_r4, `document_versions`.`created_by` AS t1_r5, `document_versions`.`updated_by` AS t1_r6, `document_versions`.`attachment_file_name` AS t1_r7, `document_versions`.`attachment_content_type` AS t1_r8, `document_versions`.`thumbnail_file_name` AS
[read] SQL (1.1ms) SELECT `documents`.`id` AS t0_r0, `documents`.`name` AS t0_r1, `documents`.`active` AS t0_r2, `documents`.`created_by` AS t0_r3, `documents`.`roles_count` AS t0_r4, `documents`.`created_at` AS t0_r5, `documents`.`updated_at` AS t0_r6, `documents`.`territories_count` AS t0_r7, `documents`.`published_date_start` AS t0_r8, `documents`.`published_date_end` AS t0_r9, `documents`.`thumbnail_file_name` AS t0_r10, `documents`.`thumbnail_file_size` AS t0_r11, `documents`.`thumbnail_content_type` AS t0_r12, `documents`.`viewing_mode` AS t0_r13, `document_versions`.`id` AS t1_r0, `document_versions`.`document_id` AS t1_r1, `document_versions`.`attachment_file_size` AS t1_r2, `document_versions`.`thumbnail_file_size` AS t1_r3, `document_versions`.`version` AS t1_r4, `document_versions`.`created_by` AS t1_r5, `document_versions`.`updated_by` AS t1_r6, `document_versions`.`attachment_file_name` AS t1_r7, `document_versions`.`attachment_content_type` AS t1_r8, `document_versions`.`thumbnail_file_name` AS
[read] SQL (1.1ms) SELECT `documents`.`id` AS t0_r0, `documents`.`name` AS t0_r1, `documents`.`active` AS t0_r2, `documents`.`created_by` AS t0_r3, `documents`.`roles_count` AS t0_r4, `documents`.`created_at` AS t0_r5, `documents`.`updated_at` AS t0_r6, `documents`.`territories_count` AS t0_r7, `documents`.`published_date_start` AS t0_r8, `documents`.`published_date_end` AS t0_r9, `documents`.`thumbnail_file_name` AS t0_r10, `documents`.`thumbnail_file_size` AS t0_r11, `documents`.`thumbnail_content_type` AS t0_r12, `documents`.`viewing_mode` AS t0_r13, `document_versions`.`id` AS t1_r0, `document_versions`.`document_id` AS t1_r1, `document_versions`.`attachment_file_size` AS t1_r2, `document_versions`.`thumbnail_file_size` AS t1_r3, `document_versions`.`version` AS t1_r4, `document_versions`.`created_by` AS t1_r5, `document_versions`.`updated_by` AS t1_r6, `document_versions`.`attachment_file_name` AS t1_r7, `document_versions`.`attachment_content_type` AS t1_r8, `document_versions`.`thumbnail_file_name` AS
@gregblake
gregblake / error.rb
Created August 15, 2017 12:54
ActionView::Template::Error (undefined method `eligible_to_sign_up?' for #<Class:0x000000089a8118>):
ActionView::Template::Error (undefined method `eligible_to_sign_up?' for #<Class:0x000000089a8118>):
88: </a>
89: <div class="dropdown-menu pull-right settings-box">
90: <div class="triangle"></div>
91: <ul class="profile-navigation"><%= @theme_presenter.power_actions %></ul>
92: <div class="clearfix"></div>
93: </div>
@gregblake
gregblake / new.html
Created August 24, 2017 17:43
documents/new
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- meta name="viewport" content="width=device-width, initial-scale=1.0" -->
<meta name="viewport" content="initial-scale=1.0001, minimum-scale=1.0001, maximum-scale=1.0001, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
$(document).on('page:update', function(){
$('#s3-uploader').fileupload({
type: 'PUT'
});
});
<form id="s3-uploader" data-callback-url="null" data-callback-method="POST" data-callback-param="file" enctype="multipart/form-data" action="https://s3-direct.powerhrg.com/nitro-devbox/" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" />
<input type="hidden" name="key" id="key" value="greg_local_test{timestamp}-{unique_id}-b7fe100b273872a03c6869c961b4082d/${filename}" />
<input type="hidden" name="acl" id="acl" value="public-read" />
<input type="hidden" name="AWSAccessKeyId" id="AWSAccessKeyId" value="GWNQSVNDSVYEMTU6EFPD" />
<input type="hidden" name="policy" id="policy" value="eyJleHBpcmF0aW9uIjoiMjAxNy0wOC0yNlQwMToyMTo1OFoiLCJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiR1dGY4IiwiIl0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJncmVnX2xvY2FsX3Rlc3QiXSxbInN0YXJ0cy13aXRoIiwiJHgtcmVxdWVzdGVkLXdpdGgiLCIiXSxbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwwLDUyNDI4ODAwMF0sWyJzdGFydHMtd2l0aCIsIiRjb250ZW50LXR5cGUiLCIiXSx7ImJ1Y2tldCI6Im5pdHJvLWRldmJveCJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7InN1Y2Nlc3NfYWN0aW
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "X-HTTP-Method-Override: PUT" -H "X-Amz-Date: 20170825T214005Z" -H "Authorization: AWS4-HMAC-SHA256 Credential=GWNQSVNDSVYEMTU6EFPD/20170825/us-east-1/execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-http-method-override, Signature=ead546251a4d6f7890b78069a9f9964989dbc0c55b65adcd7469459af3f3c3b2" -H "Cache-Control: no-cache" -H "Postman-Token: 5fba84e8-e50f-35de-3d5a-9aaf6c3b3172" -F "file=@/Users/greg/Documents/presentations/solar_page_1.pdf" "https://s3-direct.powerhrg.com/nitro-devbox"
<form id="s3-uploader" data-callback-url="null" data-callback-method="POST" data-callback-param="file" enctype="multipart/form-data" action="https://s3-direct.powerhrg.com/nitro-devbox/" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" />
<input type="hidden" name="key" id="key" value="greg_local_test{timestamp}-{unique_id}-b3f955bab1c9bec7d1aadeee5e802635/${filename}" />
<input type="hidden" name="acl" id="acl" value="public-read" /><input type="hidden" name="AWSAccessKeyId" id="AWSAccessKeyId" value="GWNQSVNDSVYEMTU6EFPD" />
<input type="hidden" name="policy" id="policy" value="eyJleHBpcmF0aW9uIjoiMjAxNy0wOC0yOFQyMjo0MzowNloiLCJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiR1dGY4IiwiIl0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJncmVnX2xvY2FsX3Rlc3QiXSxbInN0YXJ0cy13aXRoIiwiJHgtcmVxdWVzdGVkLXdpdGgiLCIiXSxbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwwLDUyNDI4ODAwMF0sWyJzdGFydHMtd2l0aCIsIiRjb250ZW50LXR5cGUiLCIiXSx7ImJ1Y2tldCI6Im5pdHJvLWRldmJveCJ9LHsiYWNsIjoicHVibGljLXJlYWQifSx7InN1Y2Nlc3NfYWN0aW9uX